CN115391290A - Object file cleaning method, device, computer equipment, medium and program product - Google Patents

Object file cleaning method, device, computer equipment, medium and program product Download PDF

Info

Publication number
CN115391290A
CN115391290A CN202211010199.7A CN202211010199A CN115391290A CN 115391290 A CN115391290 A CN 115391290A CN 202211010199 A CN202211010199 A CN 202211010199A CN 115391290 A CN115391290 A CN 115391290A
Authority
CN
China
Prior art keywords
file
target
information
cleaning
folder
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211010199.7A
Other languages
Chinese (zh)
Inventor
陶传英
李松松
项小雷
丁浩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
FAW Jiefang Automotive Co Ltd
Original Assignee
FAW Jiefang Automotive Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by FAW Jiefang Automotive Co Ltd filed Critical FAW Jiefang Automotive Co Ltd
Priority to CN202211010199.7A priority Critical patent/CN115391290A/en
Publication of CN115391290A publication Critical patent/CN115391290A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/162Delete operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/174Redundancy elimination performed by the file system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/1873Versioning file systems, temporal file systems, e.g. file system supporting different historic versions of files

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application relates to a target file cleaning device, a computer device, a storage medium and a computer program product, which can be used for judging whether a file in a folder needing to be cleaned is a target file or not according to the file name by acquiring the folder needing to be cleaned and the file information of each file in the folder and acquiring the file name according to the file information, and can be used for cleaning all target files in the folder needing to be cleaned and all subfolders of the folder at one time, so that the file cleaning efficiency is improved.

Description

Object file cleaning method, device, computer equipment, medium and program product
Technical Field
The present application relates to the field of information processing technologies, and in particular, to a method and an apparatus for cleaning a target file, a computer device, a storage medium, and a computer program product.
Background
In engineering research and development by using engineering software, a three-dimensional model and a two-dimensional drawing are often modified for multiple times, and in order to ensure data safety, a system for storing each pair of models or drawings once automatically creates a new file and adds a version suffix so as to keep the newly designed models or drawings. However, the number of the target three-dimensional model and the number of the two-dimensional drawings are increased sharply along with the increase of the workload, so that the hard disk space is occupied seriously to influence the working speed of engineering software, and meanwhile, the model or the drawing of the latest version is not convenient to find to carry out work.
The target file is cleaned mainly through a deleting instruction carried by software.
However, in the above method, when cleaning the target file, each model still needs to be opened in sequence for cleaning, and all the target files cannot be cleaned at one time, which is complicated in operation.
Disclosure of Invention
In view of the foregoing, it is desirable to provide an object file cleaning method, an object file cleaning apparatus, a computer device, a computer readable storage medium, and a computer program product, which can delete an object file concisely and efficiently.
In a first aspect, the present application provides a method for cleaning a target file, including:
acquiring a folder needing to be cleaned and file information of each file in the folder;
acquiring a file name according to the file information;
judging whether the files in the folder needing to be cleaned are target files or not according to the file names;
and cleaning the target file.
In one embodiment, after the acquiring the folder needing to be cleaned and the file information of each file in the folder, the method includes:
and traversing the folder to be cleaned and all the subfolders of the folder, and saving the obtained files to a standby list.
In one embodiment, the determining whether the file in the folder needing to be cleaned is the target file according to the file name includes:
judging whether the files in the standby list are target type files or not;
storing the target type file into a file list;
acquiring file suffix information of the target type file, wherein the file suffix information comprises version information of the target type file;
and judging whether the target type file is the target file or not according to the file suffix information.
In one embodiment, the determining whether the target type file is the target file according to the file suffix information includes:
acquiring the version times of the target type file according to the file suffix information;
acquiring update information of the target type file, wherein the update information comprises update time;
and judging whether the target type file is the target file or not according to the version times and the updating information.
In one embodiment, after the cleaning the target file, the method includes:
acquiring the file size and the file size unit of a cleaned target file;
adjusting the size unit of the file to be a target unit according to the size of the file and the size unit of the file;
and summarizing the file cleaning information of the target file into a document, wherein the file cleaning information comprises the file name and the file size of the target file, and the file size takes a target unit as a file size unit.
In one embodiment, the method for cleaning the target file further includes:
and acquiring the cleaning progress of the target file, and displaying the cleaning progress.
In a second aspect, the present application further provides a target file cleaning apparatus, including:
the file information acquisition module is used for acquiring the folders to be cleaned and the file information of each file in the folders;
the file name acquisition module is used for acquiring a file name according to the file information;
the target file judging module is used for judging whether the files in the folder needing to be cleaned are target files or not according to the file names;
and the target file cleaning module is used for cleaning the target file.
In a third aspect, the present application further provides a computer device, which includes a memory and a processor, where the memory stores a computer program, and the processor implements the steps of the method in any one of the above embodiments when executing the computer program.
In a fourth aspect, the present application also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method in any of the above embodiments.
In a fifth aspect, the present application also provides a computer program product comprising a computer program which, when executed by a processor, performs the steps of the method in any of the above embodiments.
According to the target file cleaning method, the target file cleaning device, the computer equipment, the storage medium and the computer program product, the file information of the files in the folder and the folder needing to be cleaned is obtained, and the file names are obtained according to the file information, so that whether the files in the folder needing to be cleaned are the target files or not is judged according to the file names, all the target files in the folder needing to be cleaned and all the sub-folders of the folder can be cleaned at one time, and the file cleaning efficiency is improved.
Drawings
FIG. 1 is a schematic view of an operation interface of a software with an old-version file removal instruction;
FIG. 2 is a flowchart illustrating a method for cleaning a target document according to an embodiment;
FIG. 3 is a schematic flow chart of step S203 in the embodiment shown in FIG. 2;
FIG. 4 is a flowchart illustrating the step S304 in the embodiment shown in FIG. 3;
FIG. 5 is a flowchart illustrating a method for cleaning a target document according to one embodiment;
FIG. 6 is a flowchart illustrating a method for cleaning a target document according to one embodiment;
FIG. 7 is a flowchart illustrating a method for cleaning a target document according to another embodiment;
FIG. 8 is a flowchart of Creo old file clean-up software cleaning up old files, under an embodiment;
FIG. 9 is a diagram illustrating the size of a cleaning file after cleaning is completed in one embodiment;
FIG. 10 is a block diagram showing a configuration of a file cleaning apparatus according to an embodiment;
FIG. 11 is a diagram of the internal structure of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein in the description of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. It will be further understood that the terms "comprises/comprising," "includes" or "including," or "having," and the like, specify the presence of stated features, integers, steps, operations, or combinations thereof, but do not preclude the presence or addition of one or more other features, integers, steps, operations, or combinations thereof. Also, as used in this specification, the term "and/or" includes any and all combinations of the associated listed items.
As described in the background, the number of older versions of files has increased dramatically with increased effort in engineering development using software. For the cleaning of old version files, there are two main ways: firstly, manual clearance one by one, a large amount of time and energy can not only be wasted to this kind of mode, can't ensure in addition can be accurate and thorough clearance. The other is a clearing command carried by the software itself, as shown in fig. 1, the old file can be effectively deleted by selecting the function of deleting the old file under the management file menu in the software interface, but when deleting, each file to be deleted needs to be opened in sequence for clearing, and the operation is complex. Based on the above problems, the application provides a target file cleaning method, which can clean all target files in a folder and all subfolders of the folder which need to be cleaned at one time, and improve the file cleaning efficiency.
In one embodiment, as shown in fig. 2, there is provided a target file cleaning method, including the steps of:
s201: acquiring a folder needing to be cleaned and file information of each file in the folder.
When a file is selected, all the subfolders in the folder are selected, each file in the folder comprises the files in all the folders including the subfolders, and the file information comprises the file name, the file size and the like.
S202: and acquiring the file name according to the file information.
The file name includes a file suffix name, which is also called a file extension name, and is used to indicate a mechanism adopted by a certain file format. The file extension is appended to the main file name, separated by ". Times.. Different software requires different file formats, and a suffix name can help a user to know which software the file should be opened using.
S203: and judging whether the files in the folder needing to be cleaned are target files or not according to the file names.
The file suffix name in the file name can be used for judging which type of file the file belongs to, taking Creo software as an example, creo is a CAD design software package, and the Creo file suffix name comprises: drw, prt, asm, etc., wherein the file suffixed to asm is the system assembly file, the file taking prt as suffix is a single part file, and the file taking drw as suffix is a two-dimensional drawing file.
S204: and cleaning the target file.
And clearing the target file refers to clearing the file which is judged as the target file by one key.
According to the target file cleaning method, the file to be cleaned and the file information of each file in the file are obtained, and the file name is obtained according to the file information, so that whether the file in the file to be cleaned is the target file or not is judged according to the file name, all the target files in the file to be cleaned and all the subfolders of the file can be cleaned at one time, and the file cleaning efficiency is improved.
In an embodiment, after acquiring the folder needing to be cleaned and the file information of each file in the folder, the method includes: and traversing the folder to be cleaned and all the subfolders of the folder, and saving the obtained files to a standby list.
The folder needing to be cleaned comprises a plurality of subfolders, each subfolder possibly comprises files, all the folders needing to be cleaned and the subfolders in the folders need to be traversed, and the files obtained after traversal need to be stored in a standby list, so that the files with different storage positions are stored in the same position, and the target files can be conveniently judged subsequently.
In the embodiment, the file to be cleaned and all the subfolders of the file are traversed, so that no file is omitted, all the target files can be cleaned at one time, and the file cleaning efficiency is improved.
In an embodiment, as shown in fig. 3, the determining whether the file in the folder needing to be cleaned is the target file according to the file name includes the following steps:
s301: and judging whether the files in the standby list are target type files or not.
The standby list comprises the folders needing to be cleaned and the files in all the subfolders of the folders, and whether the files in the standby list are the target type files or not can be judged according to the file suffix names in the file names.
S302: and storing the target type file into a file list.
The target type file comprises a plurality of versions of files, and the target type file is stored in a file list, so that the target file can be conveniently judged from the target type file in the follow-up process.
S303: and acquiring file suffix information of the target type file.
The file suffix information can be obtained from a file suffix name, and the file suffix information includes version information of the target type file, such as: drw.n,. Prt.n,. Asm.n, etc., where n is a number, i.e., the version number corresponding to the file, a larger number indicating a newer version.
S304: and judging whether the target type file is the target file or not according to the file suffix information.
When the old version of the file is to be deleted, all the old version of the file and the latest version of the file are reserved according to the version information in the intervertebral of the suffix information of the file, and when the latest version of the file is to be deleted, all the new version of the file and the old version of the file are reserved.
In the above embodiment, the file suffix information of the target type file is obtained by judging whether the file in the standby list is the target type file and storing the target type file in the file list, so that whether the target type file is the target file is judged according to the file suffix information, and the files of different versions can be deleted according to actual needs.
In an embodiment, as shown in fig. 4, the determining whether the target type file is the target file according to the file suffix information includes the following steps:
s401: and acquiring the version times of the target type file according to the file suffix information.
Wherein, the number in the file suffix represents the number of times of the file version, for example, if the latest version number of drw0001 file is 4, drw0001.Drw.4 is the latest file of the file. The acquired version times can be stored in a dictionary, and the update times of the file can be inquired at any time. A dictionary is a variable container model that can store any type of object.
S402: and acquiring the update information of the target type file.
The update information comprises update time, and the update time is used for indicating whether the target type file is the latest file.
S403: and judging whether the target type file is the target file or not according to the version times and the updating information.
When the version times are the same or similar, so that whether the target type file is the target file cannot be judged, judgment can be carried out through the updating information of the file, and updating time is more recent and represents updating of the file version.
In the above embodiment, the number of times of the version of the target type file is obtained according to the file suffix information, the update information of the target type file is obtained, and whether the target type file is the target file is determined according to the number of times of the version and the update information, so that the accuracy of determining the target file can be improved.
In one embodiment, as shown in fig. 5, after the target file is cleaned, the following steps are included:
s501: and acquiring the file size and the file size unit of the cleaned target file.
The file size refers to the size of a computer file, usually expressed in terms of bytes with prefixes, and the disk space actually occupied by the file depends on the file system. The maximum file size of the file system depends on the number of bits that hold the storage size information, and the total size of the file system. For example, in a FAT32 (File Allocation table, FAT32 refers to a disk File management system in which a File Allocation table is managed by 32-bit binary number recording), the size of a single File cannot exceed 4GiB. Some common units of file size are: 1bytes =8bits, 1kib =1,024bytes, 1mib =1,048,576bytes, 1gib =1,073,741,824bytes, 1tib =1,099,511,627,776bytes. Wherein, KB: a kilobyte (Kbyte); MB: a full megabyte (MByte); GB: the full gigabyte (GByte). The storage capacity of a computer is generally expressed in bytes (Byte), kilobytes (KB), megabytes (MB), and the like.
S502: and adjusting the file size unit to be a target unit according to the file size and the file size unit.
The target unit is one of the file size units, and may be KB, MB, GB, or the like.
S503: and summarizing the file cleaning information of the target file into a document.
The file cleaning information comprises the file name and the file size of the target file, and the file size takes a target unit as a file size unit.
In the above embodiment, by obtaining the file size and the file size unit of the cleaned target file, and adjusting the file size unit as the target unit according to the file size and the file size unit, the file cleaning information of the target file can be collected in one document, so that all cleaned files can be conveniently queried, and when the file cleaning information is collected, the total size of all cleaned files can be counted.
In an embodiment, the file cleaning method further includes: and acquiring the cleaning progress of the target file, and displaying the cleaning progress.
The target file cleaning progress can be displayed through a progress bar or other modes and is used for displaying the target file cleaning condition.
In the above embodiment, the cleaning condition of the target file can be obtained in real time by obtaining the cleaning progress of the target file and displaying the cleaning progress.
In another embodiment, as shown in fig. 6, there is provided a target file cleaning method, including the steps of:
s1: acquiring a folder needing to be cleaned and file information of each file in the folder.
S2: and traversing the folder needing to be cleaned and all the subfolders of the folder, and storing the obtained files into a standby list.
S3: and acquiring the file name according to the file information.
S4: and judging whether the files in the standby list are target type files or not.
S5: and storing the target type file into a file list.
S6: and acquiring file suffix information of the target type file, wherein the file suffix information comprises version information of the target type file.
S7: and acquiring the version times of the target type file according to the file suffix information.
S8: and acquiring the update information of the target type file, wherein the update information comprises update time.
S9: and judging whether the target type file is the target file or not according to the version times and the updating information.
S10: and cleaning the target file.
S11: and acquiring the file size and the file size unit of the cleaned target file.
S12: and adjusting the file size unit to be a target unit according to the file size and the file size unit.
S13: and summarizing the file cleaning information of the target file into a document, wherein the file cleaning information comprises the file name and the file size of the target file, and the file size takes a target unit as a file size unit.
S14: and acquiring the cleaning progress of the target file, and displaying the cleaning progress.
In the embodiment, the file name is obtained according to the file information of the file in the folder and the folder needing to be cleaned, so that whether the file in the folder needing to be cleaned is the target file is judged according to the file name, all the target files in the folder needing to be cleaned and all the subfolders of the folder can be cleaned at one time, and the file cleaning efficiency is improved.
In one embodiment, there is provided Creo old file clearing software, as shown in fig. 7, when cleaning a Creo old file using the Creo old file clearing software, the method includes the following steps:
(1) Selecting a folder to be cleaned, as shown in fig. 8, selecting a folder selection interface, selecting different hard disks and folder directories for folder search, cleaning the folder by clicking a "cleaning" button, canceling the deletion operation by clicking a "canceling" button, and selecting all types of files.
(2) After the folder to be cleaned is selected, a cleaning button is clicked to start cleaning the folder, the folder selected by a user and all the subfolders in the folder are traversed by adopting a recursive algorithm, and the folders are stored in a list for standby.
(3) Traversing all files in one folder, judging each file to judge whether the file is a Creo file or not, and storing all Creo files in the folder into a new list for later use. For example: files with file suffixes of drw.n,. Prt.n and asm.n (n is a number, i.e., the version number corresponding to the file, a larger number indicates a newer version) are Creo files.
(4) And (4) judging based on the Creo file list in the step (3), and finding out the latest version file of each file, wherein if the latest version number of the drw0001 file is 4, the drw0001.Drw.4 is the latest file of the file.
(5) And keeping the non-Creo file and the Creo file of the latest version, and deleting the rest files.
(6) And (5) traversing all the folders selected in the step (2), and sequentially carrying out the operations from the step (3) to the step (5) on each folder until all the Creo old version files in the folder selected by the user are cleaned. The progress of cleaning is displayed by a progress bar in the cleaning process, the size of the total cleaning files is displayed after cleaning is finished, as shown in fig. 9, a user can click a 'finish' button to exit the program after cleaning is finished, and the 'finish' button cannot be pressed in the cleaning process.
(7) The cleaned files are added to a document, and the storage position of the deleted files, the file size and the total number of the cleaned files are stored in the document.
In the embodiment, whether a file is a Creo file is judged by combining character string segmentation and a regular expression, so that the interference of the file with a format similar to that of the Creo file can be successfully eliminated, the latest version of each Creo file is searched by adopting a version number increasing method, the method is simple and convenient, the query speed is high, one-time removal of old Creo files can be realized, and the file cleaning efficiency is improved.
It should be understood that, although the steps in the flowcharts related to the embodiments are shown in sequence as indicated by the arrows, the steps are not necessarily executed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the flowcharts related to the above embodiments may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least a part of the steps or stages in other steps.
Based on the same inventive concept, the embodiment of the application also provides an object file cleaning device for realizing the object file cleaning method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so specific limitations in one or more embodiments of the target file cleaning device provided below can be referred to the limitations of the target file cleaning method in the above, and details are not described herein again.
In one embodiment, as shown in fig. 10, there is provided a target file cleaning apparatus including: the file information acquiring module 10, the file name acquiring module 20, the target file judging module 30 and the target file cleaning module 40, wherein:
the file information acquiring module 10 is used for acquiring a folder to be cleaned and file information of each file in the folder;
a file name obtaining module 20, configured to obtain a file name according to the file information;
the target file judging module 30 is configured to judge whether a file in a folder needing to be cleaned is a target file according to a file name;
and the target file cleaning module 40 is used for cleaning the target file.
In an embodiment, the file information obtaining module is further configured to traverse the folder that needs to be cleaned and all the subfolders of the folder, and store the obtained file in the standby list.
In one embodiment, the target file determining module includes: the device comprises a target type judging unit, a file list storing unit, a suffix information acquiring unit and a target file judging unit, wherein:
the target type judging unit is used for judging whether the files in the standby list are target type files or not;
the file list storage unit is used for storing the target type file into a file list;
a suffix information acquisition unit for acquiring file suffix information of the target type file, the file suffix information including version information of the target type file;
and the target file judging unit is used for judging whether the target type file is the target file or not according to the file suffix information.
In one embodiment, the target file determining unit includes: a version number obtaining subunit, an update information obtaining subunit and a target file judging subunit, wherein:
the version number acquiring subunit is used for acquiring the version number of the target type file according to the file suffix information;
the updating information acquiring subunit is used for acquiring the updating information of the target type file, wherein the updating information comprises updating time;
and the target file judging subunit is used for judging whether the target type file is the target file or not according to the version times and the updating information.
In one embodiment, the target file cleaning module is further configured to obtain a file size and a file size unit of a cleaned target file; adjusting the size unit of the file to be a target unit according to the size of the file and the size unit of the file; and summarizing the file cleaning information of the target file into a document, wherein the file cleaning information comprises the file name and the file size of the target file, and the file size takes a target unit as a file size unit.
In an embodiment, the target file cleaning module is further configured to obtain a cleaning progress of the target file, and display the cleaning progress.
All or part of each module in the target file cleaning device can be realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent of a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 11. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a target file cleaning method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on a shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 11 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program: acquiring a folder needing to be cleaned and file information of each file in the folder; acquiring a file name according to the file information; judging whether the files in the folder needing to be cleaned are target files or not according to the file names; and cleaning the target file.
In one embodiment, the obtaining of the folder to be cleaned and the file information of each file in the folder, which is involved in the execution of the computer program by the processor, includes: and traversing the folder to be cleaned and all the subfolders of the folder, and saving the obtained files to a standby list.
In one embodiment, the determination of whether a file in a folder needing to be cleaned is a target file according to a file name, which is involved in the execution of the computer program by the processor, includes the following steps: judging whether the files in the standby list are target type files or not; storing the target type file into a file list; acquiring file suffix information of the target type file, wherein the file suffix information comprises version information of the target type file; and judging whether the target type file is the target file or not according to the file suffix information.
In one embodiment, the determining whether the target type file is the target file based on the file suffix information involved in the execution of the computer program by the processor comprises the steps of: acquiring the version times of the target type file according to the file suffix information; acquiring update information of the target type file, wherein the update information comprises update time; and judging whether the target type file is the target file or not according to the version times and the updating information.
In one embodiment, the processor, after executing the computer program, is involved in cleaning the target file, comprising: acquiring the file size and the file size unit of a cleaned target file; adjusting the size unit of the file to be a target unit according to the size of the file and the size unit of the file; and summarizing file cleaning information of the target file into a document, wherein the file cleaning information comprises the file name and the file size of the target file, and the file size takes a target unit as a file size unit.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and acquiring the cleaning progress of the target file, and displaying the cleaning progress.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of: acquiring a folder needing to be cleaned and file information of each file in the folder; acquiring a file name according to the file information; judging whether the files in the folder needing to be cleaned are target files or not according to the file names; and cleaning the target file.
In one embodiment, the computer program, when executed by a processor, after acquiring a folder needing to be cleaned and file information of each file in the folder, comprises: and traversing the folder to be cleaned and all the subfolders of the folder, and saving the obtained files to a standby list.
In one embodiment, the computer program, when executed by a processor, is directed to determining whether a file in a folder needing to be cleaned is a target file according to a file name, comprising the steps of: judging whether the files in the standby list are target type files or not; storing the target type file into a file list; acquiring file suffix information of the target type file, wherein the file suffix information comprises version information of the target type file; and judging whether the target type file is the target file or not according to the file suffix information.
In one embodiment, the computer program, when executed by the processor, is directed to determining whether a target type file is a target file based on file suffix information, comprising the steps of: acquiring the version times of the target type file according to the file suffix information; acquiring update information of the target type file, wherein the update information comprises update time; and judging whether the target type file is the target file or not according to the version times and the updating information.
In one embodiment, the computer program, after being executed by a processor, involves cleaning a target file, comprising: acquiring the file size and the file size unit of a cleaned target file; adjusting the size unit of the file to be a target unit according to the size of the file and the size unit of the file; and summarizing the file cleaning information of the target file into a document, wherein the file cleaning information comprises the file name and the file size of the target file, and the file size takes a target unit as a file size unit.
In one embodiment, the computer program when executed by the processor further performs the steps of: and acquiring the cleaning progress of the target file, and displaying the cleaning progress.
In one embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, performs the steps of: acquiring a folder needing to be cleaned and file information of each file in the folder; acquiring a file name according to the file information; judging whether the files in the folder needing to be cleaned are target files or not according to the file names; and cleaning the target file.
In one embodiment, the computer program, when executed by a processor, after acquiring a folder needing to be cleaned and file information of each file in the folder, comprises: and traversing the folder to be cleaned and all the subfolders of the folder, and saving the obtained files to a standby list.
In one embodiment, the computer program, when executed by a processor, is directed to determining whether a file in a folder needing to be cleaned is a target file according to a file name, comprising the steps of: judging whether the files in the standby list are target type files or not; storing the target type file into a file list; acquiring file suffix information of the target type file, wherein the file suffix information comprises version information of the target type file; and judging whether the target type file is the target file or not according to the file suffix information.
In one embodiment, the computer program, when executed by a processor, is directed to determining whether a target type file is a target file based on file suffix information, comprising the steps of: acquiring the version times of the target type file according to the file suffix information; acquiring update information of the target type file, wherein the update information comprises update time; and judging whether the target type file is the target file or not according to the version times and the updating information.
In one embodiment, the computer program, after being executed by a processor, involves cleaning a target file, comprising: acquiring the file size and the file size unit of a cleaned target file; adjusting the size unit of the file to be a target unit according to the size of the file and the size unit of the file; and summarizing the file cleaning information of the target file into a document, wherein the file cleaning information comprises the file name and the file size of the target file, and the file size takes a target unit as a file size unit.
In one embodiment, the computer program when executed by the processor further performs the steps of: and acquiring the cleaning progress of the target file, and displaying the cleaning progress.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware related to instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high-density embedded nonvolatile Memory, resistive Random Access Memory (ReRAM), magnetic Random Access Memory (MRAM), ferroelectric Random Access Memory (FRAM), phase Change Memory (PCM), graphene Memory, and the like. Volatile Memory can include Random Access Memory (RAM), external cache Memory, and the like. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), for example. The databases referred to in various embodiments provided herein may include at least one of relational and non-relational databases. The non-relational database may include, but is not limited to, a block chain based distributed database, and the like. The processors referred to in the various embodiments provided herein may be, without limitation, general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, or the like.
All possible combinations of the technical features in the above embodiments may not be described for the sake of brevity, but should be considered as being within the scope of the present disclosure as long as there is no contradiction between the combinations of the technical features.
The above examples only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, and these are all within the scope of protection of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

Claims (10)

1. A method for cleaning a target file, the method comprising:
acquiring a folder needing to be cleaned and file information of each file in the folder;
acquiring a file name according to the file information;
judging whether the files in the folder needing to be cleaned are target files or not according to the file names;
and cleaning the target file.
2. The method according to claim 1, wherein after acquiring the folder needing to be cleaned and the file information of each file in the folder, the method comprises:
and traversing the folder needing to be cleaned and all the subfolders of the folder, and storing the obtained files to a standby list.
3. The method according to claim 2, wherein the determining whether the file in the folder needing to be cleaned is a target file according to the file name comprises:
judging whether the files in the standby list are target type files or not;
storing the target type file into a file list;
acquiring file suffix information of the target type file, wherein the file suffix information comprises version information of the target type file;
and judging whether the target type file is a target file or not according to the file suffix information.
4. The method according to claim 3, wherein said determining whether the target type file is a target file according to the file suffix information comprises:
acquiring the version times of the target type file according to the file suffix information;
acquiring update information of a target type file, wherein the update information comprises update time;
and judging whether the target type file is a target file or not according to the version times and the updating information.
5. The method according to any one of claims 1 to 4, wherein after the cleaning of the object file, the method comprises:
acquiring the file size and the file size unit of a cleaned target file;
adjusting the file size unit to be a target unit according to the file size and the file size unit;
and summarizing the file cleaning information of the target file into a document, wherein the file cleaning information comprises the file name and the file size of the target file, and the file size takes a target unit as a file size unit.
6. The method of claim 1, further comprising:
and acquiring the cleaning progress of the target file, and displaying the cleaning progress.
7. An object document cleaning apparatus, characterized in that the apparatus comprises:
the file information acquisition module is used for acquiring a folder needing to be cleaned and file information of each file in the folder;
the file name acquisition module is used for acquiring a file name according to the file information;
the target file judging module is used for judging whether the files in the folder needing to be cleaned are target files or not according to the file names;
and the target file cleaning module is used for cleaning the target file.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 6.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that the computer program realizes the steps of the method of any one of claims 1 to 6 when executed by a processor.
CN202211010199.7A 2022-08-23 2022-08-23 Object file cleaning method, device, computer equipment, medium and program product Pending CN115391290A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211010199.7A CN115391290A (en) 2022-08-23 2022-08-23 Object file cleaning method, device, computer equipment, medium and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211010199.7A CN115391290A (en) 2022-08-23 2022-08-23 Object file cleaning method, device, computer equipment, medium and program product

Publications (1)

Publication Number Publication Date
CN115391290A true CN115391290A (en) 2022-11-25

Family

ID=84120734

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211010199.7A Pending CN115391290A (en) 2022-08-23 2022-08-23 Object file cleaning method, device, computer equipment, medium and program product

Country Status (1)

Country Link
CN (1) CN115391290A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116595602A (en) * 2023-07-17 2023-08-15 中国核工业二三建设有限公司 CAD block cleaning method and device, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116595602A (en) * 2023-07-17 2023-08-15 中国核工业二三建设有限公司 CAD block cleaning method and device, electronic equipment and storage medium
CN116595602B (en) * 2023-07-17 2023-09-22 中国核工业二三建设有限公司 CAD block cleaning method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
US11947489B2 (en) Creating snapshots of a storage volume in a distributed storage system
US20120005307A1 (en) Storage virtualization
US8751763B1 (en) Low-overhead deduplication within a block-based data storage
CN107180092B (en) File system control method and device and terminal
US20160283501A1 (en) Posix-compatible file system, method of creating a file list and storage device
CN108139902A (en) The method and apparatus of SSD drive are accessed for providing mixed mode
CN108804510A (en) Key assignments file system
US10437521B2 (en) Consistent method of indexing file system information
US10891074B2 (en) Key-value storage device supporting snapshot function and operating method thereof
WO2014144449A1 (en) Apparatus and method for translation from multi-dimensional to linear address space in storage
JP2007035030A (en) Methods, apparatuses, and programs for graphical display of hierarchical hardlinks to files in file system
US9430492B1 (en) Efficient scavenging of data and metadata file system blocks
KR20200122994A (en) Key Value Append
CN115391290A (en) Object file cleaning method, device, computer equipment, medium and program product
CN115840731A (en) File processing method, computing device and computer storage medium
JP2015076064A (en) Information processing device, information processing method, program, and storage medium
JPWO2007099636A1 (en) File system migration method, file system migration program, and file system migration apparatus
CN113688139A (en) Object storage method, gateway, device and medium
CN114090637A (en) Data access method, device, equipment and storage medium
US10585802B1 (en) Method and system for caching directories in a storage system
CN107220248A (en) A kind of method and apparatus for data storage
US20190073270A1 (en) Creating Snapshots Of A Storage Volume In A Distributed Storage System
US11249851B2 (en) Creating snapshots of a storage volume in a distributed storage system
CN108804571B (en) Data storage method, device and equipment
US20100228787A1 (en) Online data volume deletion

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination