CN110941597B - Method and device for cleaning decompressed file, computing equipment and computer storage medium - Google Patents

Method and device for cleaning decompressed file, computing equipment and computer storage medium Download PDF

Info

Publication number
CN110941597B
CN110941597B CN201811108150.9A CN201811108150A CN110941597B CN 110941597 B CN110941597 B CN 110941597B CN 201811108150 A CN201811108150 A CN 201811108150A CN 110941597 B CN110941597 B CN 110941597B
Authority
CN
China
Prior art keywords
file
decompressed
compressed package
cleaning
edited
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.)
Active
Application number
CN201811108150.9A
Other languages
Chinese (zh)
Other versions
CN110941597A (en
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.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology 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 Beijing Qihoo Technology Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201811108150.9A priority Critical patent/CN110941597B/en
Publication of CN110941597A publication Critical patent/CN110941597A/en
Application granted granted Critical
Publication of CN110941597B publication Critical patent/CN110941597B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Telephone Function (AREA)

Abstract

The invention discloses a method, a device, a computing device and a computer storage medium for cleaning a decompressed file, wherein the method comprises the following steps: under the condition of meeting the release requirement of the storage space, acquiring at least one compressed package in the storage space and file information of the at least one compressed package; searching a decompressed file corresponding to the at least one compressed and decompressed file packet, and obtaining file information of the decompressed file; comparing the file information of the at least one compressed package with the file information of the corresponding decompressed file, and judging whether the decompressed file meets the cleaning condition according to the comparison result; and if so, cleaning the decompressed file to release the storage space occupied by the decompressed file. Therefore, by utilizing the scheme of the invention, the decompressed files corresponding to the compressed packets meeting the cleaning conditions in the storage space can be cleaned, so that the use of the storage space is saved.

Description

Method and device for cleaning decompressed file, computing equipment and computer storage medium
Technical Field
The present invention relates to the field of storage management technologies, and in particular, to a method and apparatus for cleaning a decompressed file, a computing device, and a computer storage medium.
Background
With the advent of the information age, more and more information is acquired by people, and a large amount of data is stored in various storage spaces such as a memory of a computing device and a network storage space, and the data occupies a very large storage space, which causes a lot of adverse effects, such as that the storage space cannot store new data, the operation speed of the computing device is slow, the data acquisition speed of the network storage space is slow, and the like.
Therefore, the present storage space cleaning tool software can start cleaning operation periodically or according to the operation of a user, and clean some unused data in the storage space, such as system garbage data, cache data of various software, similar photos, blurred photos, long-time unused software or long-time unaccessed data, and the like. However, the inventor finds that the compressed package and the decompressed file corresponding to the compressed package are stored in the storage space at the same time through long-time research, but no cleaning method and device are available at present for effectively cleaning the compressed package and the decompressed file corresponding to the compressed package so as to save the use of the storage space.
Disclosure of Invention
The present invention has been made in view of the above problems, and it is an object of the present invention to provide a cleaning method, apparatus, computing device and computer storage medium for decompressed files, which overcomes or at least partially solves the above problems.
According to one aspect of the present invention, there is provided a method for cleaning up a decompressed file, including: under the condition of meeting the release requirement of the storage space, acquiring at least one compressed package in the storage space and file information of the at least one compressed package; searching a decompressed file corresponding to the at least one compressed and decompressed file packet, and obtaining file information of the decompressed file; comparing the file information of the at least one compressed package with the file information of the corresponding decompressed file, and judging whether the decompressed file meets the cleaning condition according to the comparison result; and if so, cleaning the decompressed file to release the storage space occupied by the decompressed file.
According to still another aspect of the present invention, there is provided a cleaning apparatus for decompressed files, comprising: the compressed package acquisition module is suitable for acquiring at least one compressed package in the storage space and file information of the at least one compressed package under the condition of meeting the release requirement of the storage space. The decompressed file acquisition module is suitable for searching decompressed files corresponding to the at least one compressed decompressed file packet to acquire file information of the decompressed files; the comparison module is suitable for comparing the file information of the at least one compressed package with the file information of the corresponding decompressed file, and judging whether the decompressed file meets the cleaning condition according to a comparison result; and the file cleaning module is suitable for cleaning the decompressed file when the decompressed file meets the cleaning conditions so as to release the storage space occupied by the decompressed file.
According to yet another aspect of the present invention, there is provided a computing device comprising: the device comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface are communicated with each other through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction enables the processor to execute the operation corresponding to the cleaning method of the decompressed file.
According to still another aspect of the present invention, there is provided a computer storage medium having at least one executable instruction stored therein, the executable instruction causing a processor to perform operations corresponding to the above-described method for cleaning a decompressed file.
According to the method, the device, the computing equipment and the computer storage medium for cleaning the decompressed file, file information of at least one compressed package in the storage space and the at least one compressed package is obtained under the condition that the storage space release requirement is met; searching a decompressed file corresponding to the at least one compressed and decompressed file packet, and obtaining file information of the decompressed file; comparing the file information of the at least one compressed package with the file information of the corresponding decompressed file, and judging whether the decompressed file meets the cleaning condition according to the comparison result; and if so, cleaning the decompressed file to release the storage space occupied by the decompressed file. By using the scheme of the embodiment, the decompressed files corresponding to the compressed packets meeting the cleaning conditions in the storage space can be cleaned, so that the use of the storage space is saved.
The foregoing description is only an overview of the present invention, and is intended to be implemented in accordance with the teachings of the present invention in order that the same may be more clearly understood and to make the same and other objects, features and advantages of the present invention more readily apparent.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to designate like parts throughout the figures. In the drawings:
FIG. 1 illustrates a flow chart of a method of cleaning up decompressed files according to one embodiment of the invention;
FIG. 2 shows a sub-flowchart of an alternative S130 of an embodiment of the invention;
FIG. 3 is a detailed sub-flowchart of an alternative method for determining whether the decompressed file has been edited according to an embodiment of the invention;
FIG. 4 shows a further alternative embodiment of a specific sub-flowchart of the step of determining whether the decompressed file has been edited in accordance with an embodiment of the invention;
FIG. 5 shows a specific sub-flowchart of yet another alternative method of determining whether the decompressed file has been edited in accordance with an embodiment of the invention;
FIG. 6 illustrates a functional block diagram of a cleaning device for decompressed files according to one embodiment of the invention;
FIG. 7 shows a functional block diagram of a cleaning device for decompressed files according to yet another embodiment of the invention;
FIG. 8 illustrates a functional block diagram of a cleaning device for decompressed files according to yet another embodiment of the present invention;
FIG. 9 illustrates a schematic diagram of a computing device, according to an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
FIG. 1 illustrates a flow chart of a method of cleaning up decompressed files according to one embodiment of the invention.
As shown in fig. 1, the method comprises the steps of:
Step S110, under the condition of meeting the release requirement of the storage space, acquiring at least one compression packet in the storage space and file information of the at least one compression packet.
In an embodiment of the present invention, files stored in a storage space of a computing device include a compression package, where the compression package is a file obtained by compressing one or more files in various compression formats. For convenience of the following description, the files included in the compression package are referred to as original files, that is, the original files corresponding to the compression package before being compressed are the original files. For example, a compressed package a is obtained by compressing a file B, a file C and a file D, that is, the compressed package a includes the file B, the file C and the file D, and then the file B, the file C and the file D are the original files of the compressed package a.
In an optional manner of this embodiment of the present invention, the condition for meeting the storage space release requirement further includes:
detecting that the occupancy rate of the storage space is higher than a preset occupancy rate threshold value;
or the set file cleaning time is reached;
or receiving a file cleaning instruction sent by a remote server;
or, a user-triggered storage space release command is detected.
The time for achieving the set file cleaning may be, for example, a period for setting the file cleaning to be one week, and when the current time is one week of the previous file cleaning time, the set file cleaning time is considered to be achieved.
The storage space may be various types of memory in the computing device, such as a Nor Flash memory, a NAND Flash memory, a Solid State Disk (SSD), a mechanical hard disk (HDD), a Hybrid Hard Disk (HHD), or a network storage space, such as a cloud disk, etc.
It is appreciated that files stored in the storage space of the computing device or in the network storage space have file information including, but not limited to, one or more of file name, storage path, file size, creation time, modification time, etc.
Step S120, searching a decompressed file corresponding to the at least one compressed package, and obtaining file information of the decompressed file;
in the embodiment of the present invention, the decompressed files corresponding to the compression package may be the decompressed files of the compression package, and the decompressed files of the compression package may be the decompressed files of the compression package, or may be the decompressed files corresponding to the compression package, which may be the edited files, or may not be the edited files, for example, the original files included in the compression package a include the file B, the file C and the file D, and the decompressed files B1, the file C1 and the file D1 generated by decompressing the compression package a are the decompressed files corresponding to the compression package a, and the file B1, the file C1 and the file D1 may be edited or not edited after the decompression is generated.
Step S130, comparing the file information of the at least one compressed package with the file information of the corresponding decompressed file, and judging whether the decompressed file meets the cleaning condition according to the comparison result;
and step S140, if yes, cleaning the decompressed file to release the storage space occupied by the decompressed file.
In the embodiment of the invention, if the file is not satisfied, the decompressed file is not cleaned.
In the embodiment of the present invention, for example, the decompressed files corresponding to the compressed package a have the file B1, the file C1 and the file D1, and according to the method of the present embodiment, it is determined that the file B1 and the file D1 satisfy the cleaning condition, and then the file B1 and the file D1 will be cleaned to release the storage space occupied by the file B1 and the file D1, and the file C1 is not cleaned. Similarly, for example, the decompressed files corresponding to the compressed package B include the file B2, the file C2, the file E2 and the file D2, and if the method according to the embodiment determines that the file E2 satisfies the cleaning condition, the file E2 will be cleaned, while the other compressed files corresponding to the compressed package B include the file B2, the file C2 and the file D2 which are not cleaned.
It will be appreciated that cleaning a file may be deleting the file, or removing the tag of the storage address to which the file points in the file management list.
It can be seen that the method for cleaning up the decompressed file according to the embodiment of the invention: under the condition of meeting the release requirement of the storage space, acquiring at least one compressed package in the storage space and file information of the at least one compressed package; searching a decompressed file corresponding to the at least one compressed package, and obtaining file information of the decompressed file; comparing the file information of the at least one compressed package with the file information of the corresponding decompressed file, and judging whether the decompressed file meets the cleaning condition according to the comparison result; if the conditions are met, the decompressed files are cleaned, so that the storage space occupied by the decompressed files is released, the decompressed files corresponding to the compressed packets meeting the cleaning conditions in the storage space can be cleaned, and the use of the storage space is saved.
Referring to fig. 2, in a sub-flowchart of an alternative manner of S130 in the embodiment of the present invention, comparing the file information of the at least one compressed package with the file information of the corresponding decompressed file, and determining whether the decompressed file meets the cleaning condition according to the comparison result further includes:
step S210, comparing the file information of the at least one compressed package with the file information of the corresponding decompressed file, and judging whether the decompressed file is edited or not according to the comparison result;
Step S220, if the decompressed file is not edited, determining that a cleaning condition is met;
step S230, if the decompressed file has been edited, determining that the cleaning condition is not satisfied.
According to the above-mentioned alternative, in the embodiment of the present invention, for example, the decompressed files corresponding to the compressed package a have the files B1, C1 and D1, and it is determined that the files B1 and D1 are not edited, then the files B1 and D1 will be cleaned to release the storage space occupied by the files B1 and D1, and the files C1 are not cleaned after being edited.
In the storage space, the decompressed files corresponding to a compressed package a include a file B1, a file C1 and a file D1, and if the file B1 and the file C1 are not edited, it means that a compressed package a also includes the file B1 and the file C1, and the files included in the compressed package a are repeated, and if the unedited decompressed files (the file B1 and the file C1) are not edited, the storage space is wasted. Therefore, according to the above-mentioned alternative mode of the method for cleaning the decompressed file according to the embodiment of the present invention, the unedited decompressed file corresponding to the compressed package is cleaned, so that the waste of the storage space can be saved.
As shown in fig. 3, which is a specific sub-flowchart of an alternative way of determining whether the decompressed file has been edited according to an embodiment of the present invention, in an alternative way of an embodiment of the present invention, comparing the file information of the at least one compressed package with the file information of the corresponding decompressed file, and determining whether the decompressed file has been edited according to the comparison result further includes:
step S310, comparing the first MD5 value of the original file of the at least one compressed packet with the second MD5 value of the corresponding decompressed file, and judging whether the first MD5 value is the same as the second MD5 value;
step S320, if the decompressed files are the same, determining that the decompressed files are not edited;
step S330, if not, determining that the decompressed files have been edited.
For example, the original files of the compressed package a include a file B, a file C and a file D, the corresponding decompressed files are a file B1, a file C1 and a file D1, the MD5 value of the file B is the same as the MD5 value of the file B1, the decompressed file B1 is not edited, the MD5 value of the file D is different from the MD5 value of the file D1, and the decompressed file D1 is already edited.
As shown in fig. 4, in a further alternative embodiment of the present invention, which is a specific sub-flowchart of the step of determining whether the decompressed file has been edited, in an alternative embodiment of the present invention, the comparing the file information of the at least one compressed package with the file information of the corresponding decompressed file, and determining whether the decompressed file has been edited according to the comparison result further includes:
Step S410, comparing the first file size of the original file of the at least one compressed package with the second file size of the corresponding decompressed file, and judging whether the first file size and the second file size are the same;
step S420, if the decompressed files are the same, determining that the decompressed files are not edited;
step S430, if not, determining that the decompressed files have been edited.
For example, the original files of the compressed package a include a file B, a file C, and a file D, the corresponding decompressed files are a file B1, a file C1, and a file D1, the file size of the file B is the same as the file size of the file B1, the decompressed file B1 is considered not edited, and the file size of the file D is different from the file size of the file D1, and the decompressed file D1 is already edited.
As shown in fig. 5, in a further alternative embodiment of the present invention, which is a specific sub-flowchart of the step of determining whether the decompressed file has been edited, the step of comparing the file information of the at least one compressed package with the file information of the corresponding decompressed file, and determining whether the decompressed file has been edited according to the comparison result further includes:
Step S510, comparing the first modification time of the original file of the at least one compressed package with the second modification time of the corresponding decompressed file, and judging whether the first modification time is the same as the second modification time;
step S520, if the decompressed files are the same, determining that the decompressed files are not edited;
step S530, if not, determining that the decompressed file has been edited.
For example, the original files of the compressed package a include a file B, a file C, and a file D, the corresponding decompressed files are a file B1, a file C1, and a file D1, the modification time of the file B is the same as the modification time of the file B1, the decompressed file B1 is considered not edited, the modification time of the file D is different from the modification time of the file D1, and the decompressed file D1 is already edited.
In an optional manner of the embodiment of the present invention, before comparing the file information of the at least one compressed package with the file information of the corresponding decompressed file, that is, between step S120 and step S130 in fig. 1, the method for cleaning the decompressed file further includes:
acquiring a current time and a creation time of the decompressed file, and calculating a time interval between the current time and the creation time;
Judging whether the time interval is larger than or equal to a preset interval or not;
if yes, executing the step of comparing the file information of the at least one compressed package with the file information of the corresponding decompressed file;
otherwise, the decompressed file is not processed. That is, the flow may return to step S110, or if there is no unprocessed compressed packet in the storage space, the processing flow is ended.
In this alternative, an example is exemplified in which it is assumed that the current time is 2018.07.25 days, the compressed package is one month, the creation time of the compressed package a is 2018.07.05 days, and the creation time of the compressed package B is 2018.06.24 days. If the time interval between the creation time and the current time of the compressed package a is smaller than the preset interval (one month), the decompressed file corresponding to the compressed package a is not processed, that is, the following step of comparing the file information of the at least one compressed package with the file information of the decompressed file corresponding to the at least one compressed package is not executed; and the time interval between the creation time of the compressed package B and the current time is larger than the preset interval (one month), the step of comparing the file information of the compressed package B with the file information of the corresponding decompressed file is executed.
Therefore, by the above-mentioned optional manner, the cleaning method of the embodiment of the present invention can be executed on the decompressed files whose creation time exceeds the preset time, and the decompressed files whose creation time does not exceed the preset time are not processed, so as to avoid affecting the normal use of the decompressed files, and at the same time, the cleaning speed of the decompressed files can be increased due to the reduced processing range.
In an optional manner of the embodiment of the present invention, before comparing the file information of the at least one compressed package with the file information of the corresponding decompressed file, that is, between step S120 and step S130 in fig. 1, the method for cleaning the decompressed file further includes:
acquiring a third file size of the at least one compressed package and a second file size of the corresponding decompressed file, and calculating a file size difference between the second file size and the third file size;
judging whether the file size difference is larger than or equal to a preset difference;
if yes, executing the step of comparing the file information of the at least one compressed package with the file information of the corresponding decompressed file;
otherwise, the decompressed file is not processed.
Therefore, by the above-mentioned alternative manner, the cleaning method according to the above-mentioned embodiment of the present invention may be performed on the decompressed file whose decompressed file size differs greatly from the compressed package file size, and the decompressed file whose decompressed file size differs less from the compressed package file size is not processed, so that on one hand, the cleaning speed of the decompressed file may be increased due to the reduced processing range, and on the other hand, the cleaning efficiency is improved by selecting an appropriate processing object.
The two alternatives described above may be used in combination, i.e. the cleaning method according to the above embodiment of the present invention is performed for decompressed files whose creation time exceeds a preset time period and which differ significantly from the size of the compressed package file.
In an optional manner of the embodiment of the present invention, the searching for the decompressed file corresponding to the at least one compressed packet further includes:
acquiring the catalog of the at least one compression package and the file name of the original file of the at least one compression package;
and searching for a decompressed file with the same file name as the original file under the catalog or a sub-catalog with the same name as the compressed package.
By the alternative mode, the searching range of the decompressed file can be reduced, and the execution efficiency of the method is improved.
FIG. 6 illustrates a functional block diagram of a cleaning device for decompressed files according to one embodiment of the invention. As shown in fig. 6, the apparatus includes: the system comprises a compressed package acquisition module 610, a decompressed file acquisition module 620, a comparison module 630 and a file cleaning module 640.
The compressed package obtaining module 610 is adapted to obtain at least one compressed package in the storage space and file information of the at least one compressed package under the condition that the storage space release requirement is satisfied.
The decompressed file obtaining module 620 is adapted to find a decompressed file corresponding to the at least one compressed decompressed file packet, and obtain file information of the decompressed file;
the comparison module 630 is adapted to compare the file information of the at least one compressed package with the file information of the corresponding decompressed file, and determine whether the decompressed file meets the cleaning condition according to the comparison result;
the file cleaning module 640 is adapted to clean the decompressed file when the decompressed file meets the cleaning condition, so as to release the storage space occupied by the decompressed file.
In an alternative manner, the condition for meeting the storage space release requirement further includes: detecting that the occupancy rate of the storage space is higher than a preset occupancy rate threshold value; or the set file cleaning time is reached; or receiving a file cleaning instruction sent by a remote server; or, a user-triggered storage space release command is detected.
In an alternative manner, the comparing module 630 is adapted to compare the file information of the at least one compressed package with the file information of the corresponding decompressed file, and determine whether the decompressed file meets the cleaning condition according to the comparison result, and further includes: comparing the file information of the at least one compressed package with the file information of the corresponding decompressed file, and judging whether the decompressed file is edited or not according to a comparison result; if the decompressed file is not edited, determining that a cleaning condition is met; and if the decompressed file is edited, determining that the cleaning condition is not met.
In an optional manner, the comparing the file information of the at least one compressed package with the file information of the corresponding decompressed file, and determining whether the decompressed file has been edited according to the comparison result further includes: comparing the first MD5 value of the original file of the at least one compressed packet with the second MD5 value of the corresponding decompressed file, and judging whether the first MD5 value is the same as the second MD5 value; if the decompressed files are the same, determining that the decompressed files are not edited; if not, determining that the decompressed files have been edited.
In an optional manner, comparing the file information of the at least one compressed package with the file information of the corresponding decompressed file, and determining whether the decompressed file has been edited according to the comparison result further includes: comparing the first file size of the original file of the at least one compressed package with the second file size of the corresponding decompressed file, and judging whether the first file size and the second file size are the same or not; if the decompressed files are the same, determining that the decompressed files are not edited; if not, determining that the decompressed files have been edited.
In an optional manner, comparing the file information of the at least one compressed package with the file information of the corresponding decompressed file, and determining whether the decompressed file has been edited according to the comparison result further includes: comparing the first modification time of the original file of the at least one compressed package with the second modification time of the corresponding decompressed file, and judging whether the first modification time is identical with the second modification time; if the decompressed files are the same, determining that the decompressed files are not edited; if not, determining that the decompressed files have been edited.
In an alternative manner, the searching the decompressed file corresponding to the at least one compressed packet further includes: acquiring the catalog of the at least one compression package and the file name of the original file of the at least one compression package; and searching for a decompressed file with the same file name as the original file under the catalog or a sub-catalog with the same name as the compressed package.
Fig. 7 shows a functional block diagram of a cleaning device for decompressed files according to a further embodiment of the invention. As shown in fig. 7, on the basis of fig. 6, the apparatus further includes: a first judging module 650, adapted to obtain a current time and a creation time of the decompressed file, and calculate a time interval between the current time and the creation time; judging whether the time interval is larger than or equal to a preset interval or not; if yes, the comparison module 630 is triggered to start the operation, and if not, the comparison module 630 is not triggered to start the operation.
FIG. 8 illustrates a functional block diagram of a cleaning device for decompressed files according to an embodiment of the invention. As shown in fig. 8, on the basis of fig. 6, the apparatus further includes: a second judging module 660, adapted to obtain a third file size of the at least one compressed packet and a second file size of the corresponding decompressed file, and calculate a file size difference between the second file size and the third file size; judging whether the file size difference is larger than or equal to a preset difference; if yes, the comparison module 630 is triggered to start the operation, and if not, the comparison module 630 is not triggered to start the operation.
The specific structure and working principle of each module described above may refer to descriptions of corresponding steps in the method embodiment, and are not repeated herein.
The embodiment of the invention provides a nonvolatile computer storage medium, which stores at least one executable instruction, and the computer executable instruction can execute the method for cleaning the decompressed file in any of the method embodiments.
FIG. 9 illustrates a schematic diagram of a computing device, according to an embodiment of the invention, the particular embodiment of the invention not being limited to a particular implementation of the computing device.
As shown in fig. 9, the computing device may include: a processor 902, a communication interface (Communications Interface), a memory 906, and a communication bus 908.
Wherein:
processor 902, communication interface 904, and memory 906 communicate with each other via a communication bus 908.
A communication interface 904 for communicating with network elements of other devices, such as clients or other servers.
The processor 902 is configured to execute the program 910, and may specifically perform relevant steps in the above-described embodiments of the method for cleaning a decompressed file.
In particular, the program 910 may include program code including computer-operating instructions.
The processor 902 may be a central processing unit, CPU, or a specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement embodiments of the present invention. The one or more processors included by the computing device may be the same type of processor, such as one or more CPUs; but may also be different types of processors such as one or more CPUs and one or more ASICs.
A memory 906 for storing a program 910. Memory 906 may comprise high-speed RAM memory or may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 910 may be used to cause the processor 902 to perform operations comprising:
under the condition of meeting the release requirement of the storage space, acquiring at least one compressed package in the storage space and file information of the at least one compressed package;
searching a decompressed file corresponding to the at least one compressed and decompressed file packet, and obtaining file information of the decompressed file;
comparing the file information of the at least one compressed package with the file information of the corresponding decompressed file, and judging whether the decompressed file meets the cleaning condition according to the comparison result;
And if so, cleaning the decompressed file to release the storage space occupied by the decompressed file.
In an alternative manner, the condition for meeting the storage space release requirement further includes:
detecting that the occupancy rate of the storage space is higher than a preset occupancy rate threshold value;
or the set file cleaning time is reached;
or receiving a file cleaning instruction sent by a remote server;
alternatively, a user-triggered storage space release command is detected
In an alternative manner, the program 910 may be specifically further configured to cause the processor 902 to perform the further operation of comparing the file information of the at least one compressed package with the file information of the corresponding decompressed file, and determining whether the decompressed file meets the cleaning condition according to the comparison result: comparing the file information of the at least one compressed package with the file information of the corresponding decompressed file, and judging whether the decompressed file is edited or not according to a comparison result; if the decompressed file is not edited, determining that a cleaning condition is met; and if the decompressed file is edited, determining that the cleaning condition is not met.
In an alternative manner, the program 910 may be specifically further configured to cause the processor 902 to perform the further operation of comparing the file information of the at least one compressed package with the file information of the corresponding decompressed file, and determining whether the decompressed file has been edited according to the comparison result: comparing the first MD5 value of the original file of the at least one compressed packet with the second MD5 value of the corresponding decompressed file, and judging whether the first MD5 value is the same as the second MD5 value; if the decompressed files are the same, determining that the decompressed files are not edited; if not, determining that the decompressed files have been edited.
In an alternative manner, the program 910 may be specifically further configured to cause the processor 902 to perform the further operation of comparing the file information of the at least one compressed package with the file information of the corresponding decompressed file, and determining whether the decompressed file has been edited according to the comparison result: comparing the first file size of the original file of the at least one compressed package with the second file size of the corresponding decompressed file, and judging whether the first file size and the second file size are the same or not; if the decompressed files are the same, determining that the decompressed files are not edited; if not, determining that the decompressed files have been edited.
In an alternative manner, the program 910 may be specifically further configured to cause the processor 902 to perform the further operation of comparing the file information of the at least one compressed package with the file information of the corresponding decompressed file, and determining whether the decompressed file has been edited according to the comparison result: comparing the first modification time of the original file of the at least one compressed package with the second modification time of the corresponding decompressed file, and judging whether the first modification time is identical with the second modification time; if the decompressed files are the same, determining that the decompressed files are not edited; if not, determining that the decompressed files have been edited.
In an alternative, the program 910 may be specifically further configured to cause the processor 902 to perform the following operations: before comparing the file information of the at least one compressed package with the file information of the corresponding decompressed file, acquiring the current time and the creation time of the decompressed file, and calculating the time interval between the current time and the creation time; judging whether the time interval is larger than or equal to a preset interval or not; if yes, executing the operation of comparing the file information of the at least one compression packet with the file information of the corresponding decompressed file; otherwise, the decompressed file is not processed.
In an alternative, the program 910 may be specifically further configured to cause the processor 902 to perform the following operations: before comparing the file information of the at least one compressed package with the file information of the corresponding decompressed file, obtaining a third file size of the at least one compressed package and a second file size of the corresponding decompressed file, and calculating a file size difference between the second file size and the third file size; judging whether the file size difference is larger than or equal to a preset difference; if yes, executing the operation of comparing the file information of the at least one compression packet with the file information of the corresponding decompressed file; otherwise, the decompressed file is not processed.
In an alternative manner, the program 910 may be specifically further configured to cause the processor 902 to perform the further operation of "searching for a decompressed file corresponding to the at least one compressed packet": acquiring the catalog of the at least one compression package and the file name of the original file of the at least one compression package; and searching for a decompressed file with the same file name as the original file under the catalog or a sub-catalog with the same name as the compressed package.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual system, or other apparatus. Various general-purpose systems may also be used with the teachings herein. The required structure for a construction of such a system is apparent from the description above. In addition, the present invention is not directed to any particular programming language. It will be appreciated that the teachings of the present invention described herein may be implemented in a variety of programming languages, and the above description of specific languages is provided for disclosure of enablement and best mode of the present invention.
In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be construed as reflecting the intention that: i.e., the claimed invention requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the apparatus of the embodiments may be adaptively changed and disposed in one or more apparatuses different from the embodiments. The modules or units or components of the embodiments may be combined into one module or unit or component and, furthermore, they may be divided into a plurality of sub-modules or sub-units or sub-components. Any combination of all features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or units of any method or apparatus so disclosed, may be used in combination, except insofar as at least some of such features and/or processes or units are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings), may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments herein include some features but not others included in other embodiments, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments can be used in any combination.
Various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that some or all of the functions of some or all of the components in a cleaning device for decompressed files according to embodiments of the present invention may be implemented in practice using a microprocessor or Digital Signal Processor (DSP). The present invention can also be implemented as an apparatus or device program (e.g., a computer program and a computer program product) for performing a portion or all of the methods described herein. Such a program embodying the present invention may be stored on a computer readable medium, or may have the form of one or more signals. Such signals may be downloaded from an internet website, provided on a carrier signal, or provided in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the words first, second, third, etc. do not denote any order. These words may be interpreted as names.

Claims (18)

1. A method of cleaning up decompressed files, wherein the method comprises:
under the condition that the storage space release requirement is met, acquiring at least one compressed package in the storage space and file information of the at least one compressed package, wherein the file information comprises: at least one of file name, storage path, file size, creation time, modification time;
searching a decompressed file corresponding to the at least one compressed package, and obtaining file information of the decompressed file;
comparing the file information of the at least one compressed package with the file information of the corresponding decompressed file, and judging whether the decompressed file meets the cleaning condition according to the comparison result;
if yes, cleaning the decompressed file to release the storage space occupied by the decompressed file;
the cleaning the decompressed file further includes:
deleting the decompressed file;
or, removing the mark of the storage address pointed by the decompressed file in a file management list;
before said comparing the file information of the at least one compressed package with the file information of the corresponding decompressed file, the method further comprises:
Acquiring a third file size of the at least one compressed package and a second file size of the corresponding decompressed file, and calculating a file size difference between the second file size and the third file size;
judging whether the file size difference is larger than or equal to a preset difference;
if yes, executing the step of comparing the file information of the at least one compressed package with the file information of the corresponding decompressed file;
otherwise, the decompressed file is not processed.
2. The method of claim 1, wherein the condition to meet storage space release requirements further comprises:
detecting that the occupancy rate of the storage space is higher than a preset occupancy rate threshold value;
or the set file cleaning time is reached;
or receiving a file cleaning instruction sent by a remote server;
or, a user-triggered storage space release command is detected.
3. The method of claim 1, wherein comparing the file information of the at least one compressed package with the file information of the corresponding decompressed file, and determining whether the decompressed file satisfies the cleaning condition according to the comparison result further comprises:
Comparing the file information of the at least one compressed package with the file information of the corresponding decompressed file, and judging whether the decompressed file is edited or not according to a comparison result;
if the decompressed file is not edited, determining that a cleaning condition is met;
and if the decompressed file is edited, determining that the cleaning condition is not met.
4. The method of claim 3, wherein comparing the file information of the at least one compressed package with the file information of the corresponding decompressed file, and determining whether the decompressed file has been edited according to the comparison result further comprises:
comparing the first MD5 value of the original file of the at least one compressed packet with the second MD5 value of the corresponding decompressed file, and judging whether the first MD5 value is the same as the second MD5 value;
if the decompressed files are the same, determining that the decompressed files are not edited;
if not, determining that the decompressed files have been edited.
5. The method of claim 3, wherein comparing the file information of the at least one compressed package with the file information of the corresponding decompressed file, and determining whether the decompressed file has been edited according to the comparison result further comprises:
Comparing the first file size of the original file of the at least one compressed package with the second file size of the corresponding decompressed file, and judging whether the first file size and the second file size are the same or not;
if the decompressed files are the same, determining that the decompressed files are not edited;
if not, determining that the decompressed files have been edited.
6. The method of claim 3, wherein comparing the file information of the at least one compressed package with the file information of the corresponding decompressed file, and determining whether the decompressed file has been edited according to the comparison result further comprises:
comparing the first modification time of the original file of the at least one compressed package with the second modification time of the corresponding decompressed file, and judging whether the first modification time is identical with the second modification time;
if the decompressed files are the same, determining that the decompressed files are not edited;
if not, determining that the decompressed files have been edited.
7. The method of claim 1, wherein prior to said comparing the file information of the at least one compressed package with the file information of the corresponding decompressed file, the method further comprises:
Acquiring a current time and a creation time of the decompressed file, and calculating a time interval between the current time and the creation time;
judging whether the time interval is larger than or equal to a preset interval or not;
if yes, executing the step of comparing the file information of the at least one compressed package with the file information of the corresponding decompressed file;
otherwise, the decompressed file is not processed.
8. The method of claim 1, wherein the looking up the decompressed file corresponding to the at least one compressed package further comprises:
acquiring the catalog of the at least one compression package and the file name of the original file of the at least one compression package;
and searching for a decompressed file with the same file name as the original file under the catalog or a sub-catalog with the same name as the compressed package.
9. A cleaning device for decompressed files, wherein the device comprises:
the compressed package acquisition module is suitable for acquiring at least one compressed package in the storage space and file information of the at least one compressed package under the condition of meeting the release requirement of the storage space;
the decompressed file obtaining module is suitable for searching a decompressed file corresponding to the at least one compressed package to obtain file information of the decompressed file, and the file information comprises: at least one of file name, storage path, file size, creation time, modification time;
The comparison module is suitable for comparing the file information of the at least one compressed package with the file information of the corresponding decompressed file, and judging whether the decompressed file meets the cleaning condition according to a comparison result;
the file cleaning module is suitable for cleaning the decompressed file when the decompressed file meets cleaning conditions so as to release the storage space occupied by the decompressed file;
the file cleaning module is suitable for deleting the decompressed file; or, removing the mark of the storage address pointed by the decompressed file in a file management list;
the apparatus further comprises: the second judging module is suitable for acquiring a third file size of the at least one compressed package and a second file size of the corresponding decompressed file, and calculating a file size difference between the second file size and the third file size; judging whether the file size difference is larger than or equal to a preset difference; if yes, triggering the comparison module to start operation, and if not, not triggering the comparison module to start operation.
10. The apparatus of claim 9, wherein the condition to meet storage space release requirements further comprises:
Detecting that the occupancy rate of the storage space is higher than a preset occupancy rate threshold value;
or the set file cleaning time is reached;
or receiving a file cleaning instruction sent by a remote server;
or, a user-triggered storage space release command is detected.
11. The apparatus of claim 9, wherein the comparison module is further adapted to:
comparing the file information of the at least one compressed package with the file information of the corresponding decompressed file, and judging whether the decompressed file is edited or not according to a comparison result;
if the decompressed file is not edited, determining that a cleaning condition is met;
and if the decompressed file is edited, determining that the cleaning condition is not met.
12. The apparatus of claim 11, wherein the comparison module is further adapted to:
comparing the first MD5 value of the original file of the at least one compressed packet with the second MD5 value of the corresponding decompressed file, and judging whether the first MD5 value is the same as the second MD5 value;
if the decompressed files are the same, determining that the decompressed files are not edited;
if not, determining that the decompressed files have been edited.
13. The apparatus of claim 11, wherein the comparison module is further adapted to:
Comparing the first file size of the original file of the at least one compressed package with the second file size of the corresponding decompressed file, and judging whether the first file size and the second file size are the same or not;
if the decompressed files are the same, determining that the decompressed files are not edited;
if not, determining that the decompressed files have been edited.
14. The apparatus of claim 11, wherein the comparison module is further adapted to:
comparing the first modification time of the original file of the at least one compressed package with the second modification time of the corresponding decompressed file, and judging whether the first modification time is identical with the second modification time;
if the decompressed files are the same, determining that the decompressed files are not edited;
if not, determining that the decompressed files have been edited.
15. The apparatus of claim 9, wherein the apparatus further comprises: the first judging module is suitable for acquiring the current time and the creation time of the decompressed file, and calculating the time interval between the current time and the creation time; judging whether the time interval is larger than or equal to a preset interval or not; if yes, triggering the comparison module to start operation, and if not, not triggering the comparison module to start operation.
16. The apparatus of claim 9, wherein the decompressed file acquisition module is further adapted to:
acquiring the catalog of the at least one compression package and the file name of the original file of the at least one compression package;
and searching for a decompressed file with the same file name as the original file under the catalog or a sub-catalog with the same name as the compressed package.
17. A computing device, comprising: the device comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete communication with each other through the communication bus;
the memory is configured to store at least one executable instruction that causes the processor to perform the method of cleaning up decompressed files according to any of claims 1-8.
18. A computer storage medium having stored therein at least one executable instruction for causing a processor to perform the method of cleaning a decompressed file according to any of claims 1-8.
CN201811108150.9A 2018-09-21 2018-09-21 Method and device for cleaning decompressed file, computing equipment and computer storage medium Active CN110941597B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811108150.9A CN110941597B (en) 2018-09-21 2018-09-21 Method and device for cleaning decompressed file, computing equipment and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811108150.9A CN110941597B (en) 2018-09-21 2018-09-21 Method and device for cleaning decompressed file, computing equipment and computer storage medium

Publications (2)

Publication Number Publication Date
CN110941597A CN110941597A (en) 2020-03-31
CN110941597B true CN110941597B (en) 2023-10-31

Family

ID=69904739

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811108150.9A Active CN110941597B (en) 2018-09-21 2018-09-21 Method and device for cleaning decompressed file, computing equipment and computer storage medium

Country Status (1)

Country Link
CN (1) CN110941597B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116263760A (en) * 2021-12-15 2023-06-16 华为终端有限公司 File storage method, file access method, electronic device and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101582067A (en) * 2008-05-15 2009-11-18 国际商业机器公司 Method and system for reducing storage requirements during decompressing compressed file
CN102148859A (en) * 2011-01-20 2011-08-10 南京烽火星空通信发展有限公司 Network file service method
CN103605800A (en) * 2013-12-06 2014-02-26 贝壳网际(北京)安全技术有限公司 File processing method and file processing system
CN104021160A (en) * 2014-05-26 2014-09-03 北京金山安全软件有限公司 Client data cleaning method and device
CN106708928A (en) * 2016-11-17 2017-05-24 广州视源电子科技股份有限公司 File managing method and device
CN107016123A (en) * 2017-04-27 2017-08-04 广东欧珀移动通信有限公司 File management method and terminal device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10176182B2 (en) * 2015-08-31 2019-01-08 International Business Machines Corporation File deletion in storage devices based on the deletion priority rules

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101582067A (en) * 2008-05-15 2009-11-18 国际商业机器公司 Method and system for reducing storage requirements during decompressing compressed file
CN102148859A (en) * 2011-01-20 2011-08-10 南京烽火星空通信发展有限公司 Network file service method
CN103605800A (en) * 2013-12-06 2014-02-26 贝壳网际(北京)安全技术有限公司 File processing method and file processing system
CN104021160A (en) * 2014-05-26 2014-09-03 北京金山安全软件有限公司 Client data cleaning method and device
CN106708928A (en) * 2016-11-17 2017-05-24 广州视源电子科技股份有限公司 File managing method and device
CN107016123A (en) * 2017-04-27 2017-08-04 广东欧珀移动通信有限公司 File management method and terminal device

Also Published As

Publication number Publication date
CN110941597A (en) 2020-03-31

Similar Documents

Publication Publication Date Title
JP5732536B2 (en) System, method and non-transitory computer-readable storage medium for scalable reference management in a deduplication-based storage system
US10055134B2 (en) Data compression method and storage system
CN111324427B (en) Task scheduling method and device based on DSP
CN106648445B (en) Data storage method and device for web crawler
CN111400005A (en) Data processing method and device and electronic equipment
US11360684B2 (en) Data storage method and apparatus, storage medium and computer device
CN105786997A (en) IOS-system-based image caching and compression method
CN104461404A (en) Metadata storage method, device and system
CN110708369A (en) File deployment method and device for equipment nodes, scheduling server and storage medium
CN110941597B (en) Method and device for cleaning decompressed file, computing equipment and computer storage medium
CN110045924B (en) Hierarchical storage method and device, electronic equipment and computer readable storage medium
CN110069217B (en) Data storage method and device
CN108897858B (en) Distributed cluster index fragmentation evaluation method and device and electronic equipment
CN106708865B (en) Method and device for accessing window data in stream processing system
CN109246234B (en) Image file downloading method and device, electronic equipment and storage medium
CN113468118B (en) File increment storage method, device and storage medium based on blockchain
CN108121514B (en) Meta information updating method and device, computing equipment and computer storage medium
WO2016176045A1 (en) System, method, and apparatus for updating data in a distributed storage system
EP3296878B1 (en) Electronic device and page merging method therefor
CN114089912B (en) Data processing method and device based on message middleware and storage medium
CN111045787B (en) Rapid continuous experiment method and system
CN115525431A (en) Method, device and equipment for controlling rendering machine and storage medium
CN111625500B (en) File snapshot method and device, electronic equipment and storage medium
WO2017028744A1 (en) Method and device for determining to-be-deployed resources
CN109033189B (en) Compression method and device of link structure log, server and readable storage medium

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
GR01 Patent grant
GR01 Patent grant