CN110941597A - 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
CN110941597A
CN110941597A CN201811108150.9A CN201811108150A CN110941597A CN 110941597 A CN110941597 A CN 110941597A CN 201811108150 A CN201811108150 A CN 201811108150A CN 110941597 A CN110941597 A CN 110941597A
Authority
CN
China
Prior art keywords
file
decompressed
decompressed file
compressed packet
cleaning
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.)
Granted
Application number
CN201811108150.9A
Other languages
Chinese (zh)
Other versions
CN110941597B (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

Images

Landscapes

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

Abstract

The invention discloses a method and a device for cleaning a decompressed file, a computing device and a computer storage medium, wherein the method comprises the following steps: under the condition of meeting the requirement of storage space release, acquiring at least one compressed packet in the storage space and file information of the at least one compressed packet; searching a decompressed file corresponding to the at least one compressed and decompressed file packet, and acquiring file information of the decompressed file; comparing the file information of the at least one compressed packet 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 using the scheme of the invention, the decompressed files corresponding to the compressed packets meeting the cleaning condition 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 invention relates to the technical field of storage management, in particular to a method and a device for cleaning a decompressed file, computing equipment and a computer storage medium.
Background
With the advent of the information age, more and more information is acquired by people, 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 many adverse effects, such as that the storage space cannot store new data, the computing speed of the computing device becomes slow, the data acquisition speed of the network storage space becomes slow, and the like.
Therefore, the existing storage space cleaning tool software can start cleaning operation periodically or according to the operation of a user, and clean some useless 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 has found, through long-term research, that a storage space stores a compressed packet and a decompressed file corresponding to the compressed packet at the same time, but at present, no cleaning method and apparatus are available for effectively cleaning the compressed packet and the decompressed file corresponding to the compressed packet, so as to save the use of the storage space.
Disclosure of Invention
In view of the above, the present invention has been made to provide a method, an apparatus, a computing device and a computer storage medium for cleaning a decompressed file that overcome or at least partially solve the above-mentioned problems.
According to an aspect of the present invention, there is provided a method for cleaning a decompressed file, including: under the condition of meeting the requirement of storage space release, acquiring at least one compressed packet in the storage space and file information of the at least one compressed packet; searching a decompressed file corresponding to the at least one compressed and decompressed file packet, and acquiring file information of the decompressed file; comparing the file information of the at least one compressed packet 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 a decompressed file, including: the compressed packet acquisition module is suitable for acquiring at least one compressed packet in the storage space and file information of the at least one compressed packet under the condition of meeting the storage space release requirement. A decompressed file acquisition module, adapted to search a decompressed file corresponding to the at least one compressed and decompressed file packet, and acquire file information of the decompressed file; the comparison module is used for comparing the file information of the at least one compressed packet with the file information of the corresponding decompressed file and judging whether the decompressed file meets the cleaning condition or not according to the comparison result; and the file cleaning module is suitable for cleaning the decompressed file when the decompressed file meets the cleaning condition 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 processor, the memory and the communication interface complete mutual communication 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 method for cleaning the decompressed file.
According to still another aspect of the present invention, there is provided a computer storage medium, in which at least one executable instruction is stored, and the executable instruction causes a processor to execute operations corresponding to the method for cleaning the decompressed file.
According to the method, the device, the computing equipment and the computer storage medium for clearing the decompressed file, under the condition that the requirement for releasing the storage space is met, at least one compressed packet in the storage space and file information of the at least one compressed packet are obtained; searching a decompressed file corresponding to the at least one compressed and decompressed file packet, and acquiring file information of the decompressed file; comparing the file information of the at least one compressed packet 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 file corresponding to the compressed packet meeting the cleaning condition 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 technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
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 refer to like parts throughout the drawings. In the drawings:
FIG. 1 shows a flow diagram of a method of cleaning up decompressed files according to one embodiment of the invention;
FIG. 2 is a sub-flowchart of an alternative manner of S130 according to an embodiment of the present invention;
FIG. 3 is a detailed sub-flow diagram of an alternative manner of determining whether the decompressed file has been edited according to an embodiment of the present invention;
FIG. 4 is a detailed sub-flow diagram of yet another alternative manner of determining whether the decompressed file has been edited in accordance with an embodiment of the present invention;
FIG. 5 is a detailed sub-flow diagram of yet another alternative manner of determining whether the decompressed file has been edited in accordance with an embodiment of the present invention;
FIG. 6 shows a functional block diagram of a cleaning apparatus for decompressed files according to an embodiment of the present invention;
FIG. 7 shows a functional block diagram of a cleaning apparatus for decompressed files according to yet another embodiment of the present invention;
FIG. 8 shows a functional block diagram of a cleaning apparatus for decompressed files according to a further embodiment of the present invention;
FIG. 9 shows a schematic structural 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 shows a flowchart of a method of cleaning up a decompressed file according to an embodiment of the present invention. As shown in fig. 1, the method comprises the steps of:
step S110, acquiring at least one compressed packet in the storage space and file information of the at least one compressed packet under the condition that the storage space release requirement is met.
In the embodiment of the invention, the files stored in the storage space of the computing device comprise compressed packages, and the compressed packages are files obtained by compressing one or more files through various compression formats. For the convenience of the following description, the file included in the compressed package is referred to as an original file, i.e., the original file corresponding to the compressed package before being compressed is the original file. 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 the embodiment of the present invention, the condition for satisfying 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 reaching the set file cleaning time;
or receiving a file cleaning instruction sent by a remote server;
alternatively, a user-triggered memory space release command is detected.
The set file cleaning time may be, for example, a set file cleaning cycle is one week, and when the current time is one week of the last file cleaning time, the set file cleaning time is considered to be reached.
The storage space may be various types of memories in the computing device, such as Nor Flash memory, NAND Flash memory, Solid State Disk (SSD), mechanical hard disk (HDD), Hybrid Hard Disk (HHD), or network storage space, such as a cloud disk.
It may be appreciated that files stored in a storage space or network storage space of a computing device have file information including, but not limited to, one or more of a file name, a storage path, a file size, a creation time, a modification time, and the like.
Step S120, searching the decompressed file corresponding to the at least one compressed packet, and acquiring file information of the decompressed file;
in the embodiment of the present invention, the decompressed file corresponding to the compressed package may be a file decompressed by the compressed package, and the file decompressed by the compressed package may be an edited file or a file that has not been edited, and may also be referred to as a decompressed file corresponding to the compressed package, for example, the original files included in the compressed package a include file B, file C, and file D, and the file B1, file C1, and file D1 decompressed by the compressed package a are decompressed files corresponding to the compressed package a, and the file B1, the file C1, and the file D1 may be edited or not edited after being decompressed.
Step S130, comparing the file information of the at least one compressed packet with the file information of the corresponding decompressed file, and judging whether the decompressed file meets the cleaning condition according to the comparison result;
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 condition is not met, the decompressed file is not cleared.
In the embodiment of the present invention, for example, the decompressed file corresponding to the compressed package a includes file B1, file C1, and file D1, and according to the method of the embodiment, it is determined that file B1 and file D1 satisfy the cleaning condition, then the file B1 and the file D1 will be cleaned, so as to release the storage space occupied by file B1 and file D1, and file C1 will not be cleaned. Similarly, for example, the decompressed files corresponding to the compressed package B include file B2, file C2, file E2 and file D2, and if the method according to this embodiment determines that the file E2 satisfies the cleaning condition, the file E2 will be cleaned, and the other compressed files corresponding to the compressed package B, such as file B2, file C2 and file D2, will not be cleaned.
It is understood that the cleaning of the file may be to delete the file, or to remove the mark of the storage address pointed by the file in the file management list.
Therefore, the method for cleaning the decompressed file according to the embodiment of the invention comprises the following steps: under the condition of meeting the requirement of storage space release, acquiring at least one compressed packet in the storage space and file information of the at least one compressed packet; searching a decompressed file corresponding to the at least one compressed packet, and acquiring file information of the decompressed file; comparing the file information of the at least one compressed packet 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, and cleaning the decompressed file corresponding to the compressed packet meeting the cleaning condition in the storage space to save the use of the storage space.
As shown in fig. 2, which is a sub-flowchart of an optional manner of S130 in the embodiment of the present invention, the comparing the file information of the at least one compressed packet 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 includes:
step S210, comparing the file information of the at least one compressed packet 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;
in step S230, if the decompressed file is edited, it is determined that the cleaning condition is not satisfied.
According to the above alternative, in the embodiment of the present invention, for example, the decompressed file corresponding to the compressed package a has the file B1, the file C1 and the file D1, and it is determined that the file B1 and the file D1 are not edited, the file B1 and the file D1 are cleared to release the storage space occupied by the file B1 and the file D1, and the file C1 is edited and is not cleared.
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 indicates that the compressed package a also includes a file B1 and a file C1, and the files B1 and the file C1 are duplicated with the files included in the compressed package a, and if the unedited decompressed files (the file B1 and the file C1) are not used, the storage space is wasted. Therefore, according to the optional mode of the method for cleaning the decompressed file in the embodiment of the invention, the unedited decompressed file corresponding to the compressed packet is cleaned, and the waste of the storage space can be saved.
As shown in fig. 3, which is a detailed sub-flowchart of an optional manner of the step of determining whether the decompressed file has been edited according to the embodiment of the present invention, in an optional manner of the embodiment of the present invention, the comparing the file information of the at least one compressed packet 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 same, determining that the decompressed file is not edited;
in step S330, if they are not the same, it is determined that the decompressed file has been edited.
For example, the original files of the compressed package a include file B, file C, and file D, the corresponding decompressed files are file B1, file C1, and file D1, the MD5 value of file B is the same as the MD5 value of file B1, and the decompressed file B1 is considered not edited, while the MD5 value of file D is different from the MD5 value of file D1, and the decompressed file D1 is edited.
As shown in fig. 4, which is a detailed sub-flowchart of another optional manner of the step of determining whether the decompressed file has been edited according to the embodiment of the present invention, in an optional manner of the embodiment of the present invention, the comparing the file information of the at least one compressed packet 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 packet 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 same, determining that the decompressed file is not edited;
in step S430, if the two are not the same, it is determined that the decompressed file has been edited.
For example, the original files of the compressed package a include file B, file C, and file D, the corresponding decompressed files are file B1, file C1, and file D1, the file size of file B is the same as the file size of file B1, it is determined that the decompressed file B1 has not been edited, and the file size of file D is different from the file size of file D1, and the decompressed file D1 has been edited.
As shown in fig. 5, which is a detailed sub-flowchart of still another optional manner of the step of determining whether the decompressed file has been edited according to the embodiment of the present invention, in yet another optional manner of the embodiment of the present invention, the comparing the file information of the at least one compressed packet 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 a first modification time of the original file of the at least one compressed packet with a second modification time of the corresponding decompressed file, and determining whether the first modification time and the second modification time are the same;
step S520, if the same, determining that the decompressed file is not edited;
in step S530, if the two files are different, it is determined that the decompressed file is edited.
For example, the original files of the compressed package a include file B, file C, and file D, the corresponding decompressed files are file B1, file C1, and file D1, the modification time of file B is the same as the modification time of file B1, it is determined that the decompressed file B1 has not been edited, and the modification time of file D is different from the modification time of file D1, and the decompressed file D1 has been edited.
In an optional manner of the embodiment of the present invention, before the comparing the file information of the at least one compressed packet with the file information of the corresponding decompressed file, that is, between step S120 and step S130 in fig. 1, the method for clearing up the decompressed file further includes:
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 greater 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 packet 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 can be given in which 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 of the compression packet a and the current time is less than the preset interval (one month), the decompression file corresponding to the compression packet a is not processed, that is, the following step of "comparing the file information of the at least one compression packet with the file information of the corresponding decompression file" is not performed; and if the time interval between the creation time of the compressed packet B and the current time is greater than a preset interval (one month), the step of comparing the file information of the compressed packet B with the file information of the corresponding decompressed file is performed.
Therefore, through the above optional manner, the cleaning method of the above embodiment of the present invention can be performed on the decompressed file whose creation time exceeds the preset time length, and the decompressed file whose creation time does not exceed the preset time length is not processed, so as to avoid affecting the normal use of the decompressed file, and at the same time, the cleaning speed of the decompressed file can be increased due to the reduction of the processing range.
In an optional manner of the embodiment of the present invention, before the comparing the file information of the at least one compressed packet with the file information of the corresponding decompressed file, that is, between step S120 and step S130 in fig. 1, the method for clearing up the decompressed file further includes:
obtaining a third file size of the at least one compressed packet 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 or not;
if yes, executing the step of comparing the file information of the at least one compressed packet with the file information of the corresponding decompressed file;
otherwise, the decompressed file is not processed.
Therefore, through the above optional manner, the cleaning method of the embodiment of the present invention can be performed on the decompressed file having a large difference between the size of the decompressed file and the size of the compressed packet file, and the decompressed file having a small difference between the size of the decompressed file and the size of the compressed packet file is not processed, so that on one hand, the cleaning speed of the decompressed file can be increased due to the reduction of the processing range, and on the other hand, the cleaning efficiency is improved by selecting an appropriate processing object.
The two optional modes can be used in combination, that is, the cleaning method of the embodiment of the present invention is executed for the decompressed file whose creation time exceeds the preset time and whose size is greatly different from the size of the compressed packet 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 a directory of the at least one compressed package and a file name of an original file of the at least one compressed package;
and searching for the decompressed file with the same file name as the original file under the directory or the subdirectory with the same name as the compressed package.
By the optional mode, the search range of the decompressed file can be reduced, and the execution efficiency of the method is improved.
Fig. 6 shows a functional block diagram of a cleaning apparatus of decompressed files according to an embodiment of the present invention. As shown in fig. 6, the apparatus includes: a compressed packet obtaining module 610, a decompressed file obtaining module 620, a comparing module 630 and a file cleaning module 640.
The compressed packet obtaining module 610 is adapted to obtain at least one compressed packet in the storage space and file information of the at least one compressed packet under the condition that a storage space release requirement is met.
A decompressed file obtaining module 620, adapted to search for a decompressed file corresponding to the at least one compressed and decompressed file packet, and obtain file information of the decompressed file;
a comparing module 630, adapted to compare the file information of the at least one compressed packet with the file information of the corresponding decompressed file, and determine whether the decompressed file meets a cleaning condition according to a comparison result;
the file cleaning module 640 is adapted to clean the decompressed file when the decompressed file meets a cleaning condition, so as to release the storage space occupied by the decompressed file.
In an optional manner, the condition for satisfying 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 reaching the set file cleaning time; or receiving a file cleaning instruction sent by a remote server; alternatively, a user-triggered memory space release command is detected.
In an optional manner, the comparing module 630 is adapted to compare the file information of the at least one compressed packet with the file information of the corresponding decompressed file, and determine whether the decompressed file meets the cleaning condition according to the comparison result, further including: comparing the file information of the at least one compressed packet with the file information of the corresponding decompressed file, and judging whether the decompressed file is edited or not according to the comparison result; if the decompressed file is not edited, determining that a cleaning condition is met; if the decompressed file has been edited, it is determined that a clean-up condition is not satisfied.
In an optional manner, the comparing the file information of the at least one compressed packet 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 package with the second MD5 value of the corresponding decompressed file, and judging whether the first MD5 value and the second MD5 value are the same; if the data is the same as the data, determining that the decompressed file is not edited; and if not, determining that the decompressed file is edited.
In an optional manner, comparing the file information of the at least one compressed packet 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 packet 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; if the data is the same as the data, determining that the decompressed file is not edited; and if not, determining that the decompressed file is edited.
In an optional manner, comparing the file information of the at least one compressed packet 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 packet 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; if the data is the same as the data, determining that the decompressed file is not edited; and if not, determining that the decompressed file is edited.
In an optional manner, the searching for the decompressed file corresponding to the at least one compressed packet further includes: acquiring a directory of the at least one compressed package and a file name of an original file of the at least one compressed package; and searching for the decompressed file with the same file name as the original file under the directory or the subdirectory with the same name as the compressed package.
Fig. 7 shows a functional block diagram of a cleaning apparatus of decompressed files according to still another embodiment of the present invention. As shown in fig. 7, on the basis of fig. 6, the apparatus further includes: a first determining 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 greater than or equal to a preset interval or not; if so, the comparing module 630 is triggered to start the job, otherwise, the comparing module 630 is not triggered to start the job.
Fig. 8 shows a functional block diagram of a cleaning apparatus for decompressed files according to an embodiment of the present invention. As shown in fig. 8, on the basis of fig. 6, the apparatus further includes: a second determining module 660, configured 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 or not; if so, the comparing module 630 is triggered to start the job, otherwise, the comparing module 630 is not triggered to start the job.
The specific structure and operation principle of each module described above may refer to the description of the corresponding step in the method embodiment, and are not described herein again.
The embodiment of the invention provides a nonvolatile computer storage medium, wherein at least one executable instruction is stored in the computer storage medium, and the computer executable instruction can execute the method for cleaning the decompressed file in any method embodiment.
Fig. 9 is a schematic structural diagram of a computing device according to an embodiment of the present invention, and the specific embodiment of the present invention does not limit the specific implementation of the computing device.
As shown in fig. 9, the computing device may include: a processor (processor)902, a communication Interface 904, a memory 906, and a communication bus 908.
Wherein:
the processor 902, communication interface 904, and memory 906 communicate with one another 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 the relevant steps in the foregoing method for cleaning the decompressed file.
In particular, the program 910 may include program code that includes computer operating instructions.
The processor 902 may be a central processing unit CPU, or an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement an embodiment of the invention. The computing device includes one or more processors, which may be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs.
A memory 906 for storing a program 910. The memory 906 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 910 may specifically be configured to cause the processor 902 to perform the following operations:
under the condition of meeting the requirement of storage space release, acquiring at least one compressed packet in the storage space and file information of the at least one compressed packet;
searching a decompressed file corresponding to the at least one compressed and decompressed file packet, and acquiring file information of the decompressed file;
comparing the file information of the at least one compressed packet 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 optional manner, the condition for satisfying 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 reaching the set file cleaning time;
or receiving a file cleaning instruction sent by a remote server;
alternatively, a user-triggered memory space release command is detected
In an optional manner, the program 910 may specifically be further configured to enable the processor 902 to perform the further operations of "comparing the file information of the at least one compressed packet with the file information of the corresponding decompressed file, and determining whether the decompressed file satisfies the cleaning condition according to a comparison result": comparing the file information of the at least one compressed packet with the file information of the corresponding decompressed file, and judging whether the decompressed file is edited or not according to the comparison result; if the decompressed file is not edited, determining that a cleaning condition is met; if the decompressed file has been edited, it is determined that a clean-up condition is not satisfied.
In an optional manner, the program 910 may specifically be further configured to enable the processor 902 to perform the further operations of "comparing the file information of the at least one compressed packet 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 package with the second MD5 value of the corresponding decompressed file, and judging whether the first MD5 value and the second MD5 value are the same; if the data is the same as the data, determining that the decompressed file is not edited; and if not, determining that the decompressed file is edited.
In an optional manner, the program 910 may specifically be further configured to enable the processor 902 to perform the further operations of "comparing the file information of the at least one compressed packet 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 packet 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; if the data is the same as the data, determining that the decompressed file is not edited; and if not, determining that the decompressed file is edited.
In an optional manner, the program 910 may specifically be further configured to enable the processor 902 to perform the further operations of "comparing the file information of the at least one compressed packet 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 packet 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; if the data is the same as the data, determining that the decompressed file is not edited; and if not, determining that the decompressed file is edited.
In an alternative manner, the program 910 may specifically be further configured to cause the processor 902 to perform the following operations: before comparing the file information of the at least one compressed packet with the file information of the corresponding decompressed file, obtaining 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 greater than or equal to a preset interval or not; if so, executing the operation of comparing the file information of the at least one compressed 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 specifically be further configured to cause the processor 902 to perform the following operations: before comparing the file information of the at least one compressed packet with the file information of the corresponding decompressed file, obtaining a third file size of the at least one compressed packet 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 or not; if so, executing the operation of comparing the file information of the at least one compressed packet with the file information of the corresponding decompressed file; otherwise, the decompressed file is not processed.
In an optional manner, the program 910 may specifically be further configured to enable the processor 902 to perform the further operation of "searching for the decompressed file corresponding to the at least one compressed packet": acquiring a directory of the at least one compressed package and a file name of an original file of the at least one compressed package; and searching for the decompressed file with the same file name as the original file under the directory or the subdirectory with the same name as the compressed package.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, 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 interpreted as reflecting an intention that: that the invention as claimed 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 device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. 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. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements 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 included in other embodiments, rather than other features, 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 may be used in any combination.
The 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. It will be appreciated by those skilled in the art that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components of the decompressed file cleaning apparatus according to embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or 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 usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
The invention discloses:
A1. a method of cleaning up decompressed files, wherein the method comprises:
under the condition of meeting the requirement of storage space release, acquiring at least one compressed packet in the storage space and file information of the at least one compressed packet;
searching a decompressed file corresponding to the at least one compressed packet, and acquiring file information of the decompressed file;
comparing the file information of the at least one compressed packet 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.
A2. The method according to a1, wherein the condition for satisfying the storage space release requirement further comprises:
detecting that the occupancy rate of the storage space is higher than a preset occupancy rate threshold value;
or reaching the set file cleaning time;
or receiving a file cleaning instruction sent by a remote server;
alternatively, a user-triggered memory space release command is detected.
A3. The method according to A1, wherein the comparing the file information of the at least one compressed packet with the file information of the corresponding decompressed file, and determining whether the decompressed file satisfies a clean-up condition according to the comparison result further includes:
comparing the file information of the at least one compressed packet with the file information of the corresponding decompressed file, and judging whether the decompressed file is edited or not according to the comparison result;
if the decompressed file is not edited, determining that a cleaning condition is met;
if the decompressed file has been edited, it is determined that a clean-up condition is not satisfied.
A4, the method according to A3, wherein the comparing the file information of the at least one compressed packet 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 package with the second MD5 value of the corresponding decompressed file, and judging whether the first MD5 value and the second MD5 value are the same;
if the data is the same as the data, determining that the decompressed file is not edited;
and if not, determining that the decompressed file is edited.
The method according to A3, wherein comparing the file information of the at least one compressed packet 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 packet 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;
if the data is the same as the data, determining that the decompressed file is not edited;
and if not, determining that the decompressed file is edited.
The method according to A3, wherein comparing the file information of the at least one compressed packet 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 packet 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;
if the data is the same as the data, determining that the decompressed file is not edited;
and if not, determining that the decompressed file is edited.
The method according to A1, wherein before the comparing the file information of the at least one compressed packet with the file information of the corresponding decompressed file, the method further comprises:
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 greater 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 packet with the file information of the corresponding decompressed file;
otherwise, the decompressed file is not processed.
The method according to A1, wherein before the comparing the file information of the at least one compressed packet with the file information of the corresponding decompressed file, the method further comprises:
obtaining a third file size of the at least one compressed packet 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 or not;
if yes, executing the step of comparing the file information of the at least one compressed packet with the file information of the corresponding decompressed file;
otherwise, the decompressed file is not processed.
The method of A1, wherein the searching for the decompressed file corresponding to the at least one compressed packet further comprises:
acquiring a directory of the at least one compressed package and a file name of an original file of the at least one compressed package;
and searching for the decompressed file with the same file name as the original file under the directory or the subdirectory with the same name as the compressed package.
B10. A cleaning apparatus for decompressing files, wherein the apparatus comprises:
the compressed packet acquisition module is suitable for acquiring at least one compressed packet in the storage space and file information of the at least one compressed packet under the condition of meeting the storage space release requirement.
A decompressed file acquisition module, adapted to search a decompressed file corresponding to the at least one compressed packet, and acquire file information of the decompressed file;
the comparison module is used for comparing the file information of the at least one compressed packet with the file information of the corresponding decompressed file and judging whether the decompressed file meets the cleaning condition or not according to the comparison result;
and the file cleaning module is suitable for cleaning the decompressed file when the decompressed file meets the cleaning condition so as to release the storage space occupied by the decompressed file.
The apparatus of B11, wherein the condition for satisfying 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 reaching the set file cleaning time;
or receiving a file cleaning instruction sent by a remote server;
alternatively, a user-triggered memory space release command is detected.
The apparatus of B12, wherein the comparing module is further adapted to:
comparing the file information of the at least one compressed packet with the file information of the corresponding decompressed file, and judging whether the decompressed file is edited or not according to the comparison result;
if the decompressed file is not edited, determining that a cleaning condition is met;
if the decompressed file has been edited, it is determined that a clean-up condition is not satisfied.
The apparatus of B13, wherein the comparing module is further adapted to:
comparing the first MD5 value of the original file of the at least one compressed package with the second MD5 value of the corresponding decompressed file, and judging whether the first MD5 value and the second MD5 value are the same;
if the data is the same as the data, determining that the decompressed file is not edited;
and if not, determining that the decompressed file is edited.
The apparatus of B14, wherein the comparing module is further adapted to:
comparing the first file size of the original file of the at least one compressed packet 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;
if the data is the same as the data, determining that the decompressed file is not edited;
and if not, determining that the decompressed file is edited.
The apparatus of B15, wherein the comparing module is further adapted to:
comparing the first modification time of the original file of the at least one compressed packet 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;
if the data is the same as the data, determining that the decompressed file is not edited;
and if not, determining that the decompressed file is edited.
B16. the device according to B10, further comprising: the first judgment 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 greater than or equal to a preset interval or not; if yes, the comparison module is triggered to start operation, and if not, the comparison module is not triggered to start operation.
B17. the apparatus according to B10, further comprising: a second determining module, 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 or not; if yes, the comparison module is triggered to start operation, and if not, the comparison module is not triggered to start operation.
The apparatus according to B10, wherein the decompressed file obtaining module is further adapted to:
acquiring a directory of the at least one compressed package and a file name of an original file of the at least one compressed package;
and searching for the decompressed file with the same file name as the original file under the directory or the subdirectory with the same name as the compressed package.
C19. A computing device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction which causes the processor to execute the method for cleaning the decompressed file as described in any one of A1-A9.
D20. a computer storage medium having stored therein at least one executable instruction that causes a processor to execute the method of cleaning a decompressed file according to any of a1-a 9.

Claims (10)

1. A method of cleaning up decompressed files, wherein the method comprises:
under the condition of meeting the requirement of storage space release, acquiring at least one compressed packet in the storage space and file information of the at least one compressed packet;
searching a decompressed file corresponding to the at least one compressed packet, and acquiring file information of the decompressed file;
comparing the file information of the at least one compressed packet 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.
2. The method of claim 1, wherein the condition for satisfying a storage space release requirement further comprises:
detecting that the occupancy rate of the storage space is higher than a preset occupancy rate threshold value;
or reaching the set file cleaning time;
or receiving a file cleaning instruction sent by a remote server;
alternatively, a user-triggered memory space release command is detected.
3. The method of claim 1, wherein the comparing the file information of the at least one compressed packet with the file information of the corresponding decompressed file, and the determining whether the decompressed file satisfies a clean-up condition according to the comparison further comprises:
comparing the file information of the at least one compressed packet with the file information of the corresponding decompressed file, and judging whether the decompressed file is edited or not according to the comparison result;
if the decompressed file is not edited, determining that a cleaning condition is met;
if the decompressed file has been edited, it is determined that a clean-up condition is not satisfied.
4. The method of claim 3, wherein the comparing the file information of the at least one compressed packet with the file information of the corresponding decompressed file, and the determining whether the decompressed file has been edited according to the comparison further comprises:
comparing the first MD5 value of the original file of the at least one compressed package with the second MD5 value of the corresponding decompressed file, and judging whether the first MD5 value and the second MD5 value are the same;
if the data is the same as the data, determining that the decompressed file is not edited;
and if not, determining that the decompressed file is edited.
5. The method of claim 3, wherein comparing the file information of the at least one compressed packet with the file information of the corresponding decompressed file, and determining whether the decompressed file has been edited according to the comparison further comprises:
comparing the first file size of the original file of the at least one compressed packet 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;
if the data is the same as the data, determining that the decompressed file is not edited;
and if not, determining that the decompressed file is edited.
6. The method of claim 3, wherein comparing the file information of the at least one compressed packet with the file information of the corresponding decompressed file, and determining whether the decompressed file has been edited according to the comparison further comprises:
comparing the first modification time of the original file of the at least one compressed packet 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;
if the data is the same as the data, determining that the decompressed file is not edited;
and if not, determining that the decompressed file is edited.
7. The method of claim 1, wherein prior to said comparing the file information of the at least one compressed packet with the file information of the corresponding decompressed file, the method further comprises: :
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 greater 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 packet with the file information of the corresponding decompressed file;
otherwise, the decompressed file is not processed.
8. A cleaning apparatus for decompressing files, wherein the apparatus comprises:
the compressed packet acquisition module is suitable for acquiring at least one compressed packet in the storage space and file information of the at least one compressed packet under the condition of meeting the storage space release requirement.
A decompressed file acquisition module, adapted to search a decompressed file corresponding to the at least one compressed packet, and acquire file information of the decompressed file;
the comparison module is used for comparing the file information of the at least one compressed packet with the file information of the corresponding decompressed file and judging whether the decompressed file meets the cleaning condition or not according to the comparison result;
and the file cleaning module is suitable for cleaning the decompressed file when the decompressed file meets the cleaning condition so as to release the storage space occupied by the decompressed file.
9. A computing device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction which causes the processor to execute the method for cleaning the decompressed file according to any one of claims 1-7.
10. 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-7.
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 true CN110941597A (en) 2020-03-31
CN110941597B 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)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023109569A1 (en) * 2021-12-15 2023-06-22 华为技术有限公司 File storage method, file access method, electronic device, and storage medium
CN116701327A (en) * 2022-12-07 2023-09-05 荣耀终端有限公司 File processing method and electronic equipment

Citations (7)

* 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
US20170060886A1 (en) * 2015-08-31 2017-03-02 International Business Machines Corporation File deletion in storage devices based on the deletion priority rules
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

Patent Citations (7)

* 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
US20170060886A1 (en) * 2015-08-31 2017-03-02 International Business Machines Corporation File deletion in storage devices based on the deletion priority rules
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

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023109569A1 (en) * 2021-12-15 2023-06-22 华为技术有限公司 File storage method, file access method, electronic device, and storage medium
CN116701327A (en) * 2022-12-07 2023-09-05 荣耀终端有限公司 File processing method and electronic equipment

Also Published As

Publication number Publication date
CN110941597B (en) 2023-10-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
CN109614377B (en) File deletion method, device, equipment and storage medium of distributed file system
CN108234630B (en) Data reading method and device based on distributed consistency protocol
CN107451013B (en) Data recovery method, device and system based on distributed system
CN106294206B (en) Cache data processing method and device
CN111061752B (en) Data processing method and device and electronic equipment
CN105243027A (en) Method for storing data in storage device and memory controller
CN109033365B (en) Data processing method and related equipment
CN105786997A (en) IOS-system-based image caching and compression method
US20150026694A1 (en) Method of processing information, storage medium, and information processing apparatus
CN112416972A (en) Real-time data stream processing method, device, equipment and readable storage medium
CN104461404A (en) Metadata storage method, device and system
CN106708865B (en) Method and device for accessing window data in stream processing system
CN110941597B (en) Method and device for cleaning decompressed file, computing equipment and computer storage medium
CN111008107A (en) Big data cluster log storage method, device, equipment and storage medium
CN111984196B (en) File migration method, device, equipment and readable storage medium
CN111221468B (en) Storage block data deleting method and device, electronic equipment and cloud storage system
CN102609454A (en) Replica management method for distributed file system
CN108121514B (en) Meta information updating method and device, computing equipment and computer storage medium
CN116700623A (en) Data storage method, system, electronic equipment and storage medium
TWI528190B (en) Heterogeneous storing server and file storing method thereof
CN111597149B (en) Data cleaning method and device for database
US11003578B2 (en) Method and system for parallel mark processing
CN113126929A (en) Method, system, medium and terminal for removing duplicate of feature data
CN112269763A (en) File aggregation method and related device

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