CN110275870A - Management method, device, computer equipment and the storage medium of cache file - Google Patents
Management method, device, computer equipment and the storage medium of cache file Download PDFInfo
- Publication number
- CN110275870A CN110275870A CN201910429526.4A CN201910429526A CN110275870A CN 110275870 A CN110275870 A CN 110275870A CN 201910429526 A CN201910429526 A CN 201910429526A CN 110275870 A CN110275870 A CN 110275870A
- Authority
- CN
- China
- Prior art keywords
- file
- caching
- frequency
- default value
- accounting
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000003860 storage Methods 0.000 title claims abstract description 56
- 238000007726 management method Methods 0.000 title claims abstract description 23
- 238000000034 method Methods 0.000 claims abstract description 20
- 230000006835 compression Effects 0.000 claims description 17
- 238000007906 compression Methods 0.000 claims description 17
- 238000004590 computer program Methods 0.000 claims description 15
- 238000000151 deposition Methods 0.000 claims description 4
- 238000001514 detection method Methods 0.000 claims description 4
- 230000006837 decompression Effects 0.000 description 6
- 230000006870 function Effects 0.000 description 4
- 230000000737 periodic effect Effects 0.000 description 3
- 230000000717 retained effect Effects 0.000 description 3
- 230000002123 temporal effect Effects 0.000 description 3
- 102220621241 Proline-rich membrane anchor 1_S32A_mutation Human genes 0.000 description 2
- 238000004140 cleaning Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 1
- 230000010485 coping Effects 0.000 description 1
- 238000012217 deletion Methods 0.000 description 1
- 230000037430 deletion Effects 0.000 description 1
- 238000009826 distribution Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000002708 enhancing effect Effects 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/16—File or folder operations, e.g. details of user interfaces specifically adapted to file systems
- G06F16/162—Delete operations
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/172—Caching, prefetching or hoarding of files
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/174—Redundancy elimination performed by the file system
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Memory System Of A Hierarchy Structure (AREA)
Abstract
The invention discloses a kind of management method of cache file, device, computer equipment and storage mediums, it is related to data processing technique, main technical schemes of the invention are as follows: obtain file in caching use memory capacity, and detect it is described with memory capacity in the caching can the accounting of storage file total capacity whether reach the first preset accounting;If it is described in memory capacity and the caching can the accounting of storage file total capacity reach the first preset accounting, obtain the frequency of use of each file corresponding programme in the frequency of use of each file in the caching and the caching;According to the frequency of use of file corresponding programme each in the frequency of use of file each in the caching and/or the caching, retain, compress or delete corresponding file in the caching.Present invention is mainly used for the effective percentage for improving storage file in caching.
Description
Technical field
The present invention relates to technical field of data processing more particularly to a kind of management methods of cache file, device, computer
Equipment and storage medium.
Background technique
In computer technology, the raising of the running papers such as application program, video and picture efficiency and fluency, caching
Technology is indispensable.CPU can directly read the file in caching, not solve CPU arithmetic speed and memory read-write rate not
The contradiction matched improves the operational efficiency of file.
Traditional system cache file management method is mainly the temporary file that periodic cleaning program generates, such as it is straight
It connects deletion or recycle bin is added, i.e., scan to come all cache files, be cleared up, disadvantage of this is that do not have area
Divide whether user can really use these cache files, the temporal cache file or some records of the generation of different programs are answered
This is treated with a certain discrimination.Real unwanted file is emptied, and remains with the file that may be reused.
Summary of the invention
The present invention provides management method, device, computer equipment and the storage medium of a kind of cache file, slow for improving
Deposit the effective percentage of middle file storage.
The embodiment of the invention provides a kind of management methods of cache file, which comprises
Obtain file in caching use memory capacity, and can be stored in memory capacity and the caching described in detecting
Whether the accounting of file total capacity reaches the first preset accounting;
If it is described in memory capacity and the caching can the accounting of storage file total capacity reach the first preset accounting,
Then obtain the frequency of use of each file corresponding programme in the frequency of use of each file in the caching and the caching;
Frequency is used according to file corresponding programme each in the frequency of use of file each in the caching and/or the caching
Rate retains, compresses or deletes corresponding file in the caching.
The embodiment of the invention provides a kind of managing device of cache file, described device includes:
Detection module use memory capacity for obtain file in caching, and has used memory capacity and institute described in detecting
State in caching can the accounting of storage file total capacity whether reach the first preset accounting;
Obtain module, if for it is described with memory capacity in the caching can the accounting of storage file total capacity reach
First preset accounting then obtains each file corresponding programme in the frequency of use of each file in the caching and the caching
Frequency of use;
Management module, for according to belonging to each file in the frequency of use of file each in the caching and/or the caching
The frequency of use of program retains, compresses or deletes corresponding file in the caching.
A kind of computer equipment, including memory, processor and storage are in the memory and can be in the processing
The computer program run on device, the processor realize the manager of above-mentioned cache file when executing the computer program
Method.
A kind of computer readable storage medium, the computer-readable recording medium storage have computer program, the meter
Calculation machine program realizes the management method of above-mentioned cache file when being executed by processor.
Management method, device, computer equipment and the storage medium of above-mentioned cache file obtain file in caching first
Used memory capacity, and detect it is described with memory capacity in the caching can the accounting of storage file total capacity whether reach
First preset accounting, if it is described with memory capacity in the caching can the accounting of storage file total capacity to reach first preset
Accounting then obtains the frequency of use of each file corresponding programme in the frequency of use of each file in the caching and caching, according to
In the caching in the frequency of use of each file and/or caching each file corresponding programme frequency of use, retain, compression or delete
Corresponding file in the caching.Compared with the file in current periodic cleaning caching, the embodiment of the present invention is being determined with depositing
When seeing that storage file total capacity accounting reaches certain numerical value in storage capacity and caching, frequency of use file-based and/or caching
In the frequency of use of each file corresponding programme file is retained, compressed or is deleted, to can have through the embodiment of the present invention
The file for being actually needed and being cached in caching is distinguished on effect ground, so that the temporal cache file of the generation of different programs or one
A little records should treat with a certain discrimination, to improve the effective percentage of file storage in caching.
Detailed description of the invention
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below by institute in the description to the embodiment of the present invention
Attached drawing to be used is needed to be briefly described, it should be apparent that, the accompanying drawings in the following description is only some implementations of the invention
Example, for those of ordinary skill in the art, without any creative labor, can also be according to these attached drawings
Obtain other attached drawings.
Fig. 1 is a flow chart of the management method of cache file in one embodiment of the invention;
Fig. 2 is the flow chart that cache file is handled in one embodiment of the invention;
Fig. 3 is another flow chart that cache file is handled in one embodiment of the invention;
Fig. 4 is another flow chart that cache file is handled in one embodiment of the invention;
Fig. 5 is the structural block diagram of the managing device of cache file in one embodiment of the invention;
Fig. 6 is a schematic diagram of computer equipment in one embodiment of the invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are some of the embodiments of the present invention, instead of all the embodiments.Based on this hair
Embodiment in bright, every other implementation obtained by those of ordinary skill in the art without making creative efforts
Example, shall fall within the protection scope of the present invention.
In one embodiment, as shown in Figure 1, providing a kind of management method of cache file, this method comprises the following steps:
S10, obtain file in caching use memory capacity, and detecting described used can in memory capacity and the caching
Whether the accounting of storage file total capacity reaches the first preset accounting.
It wherein, has been the total capacity of storage file in caching with memory capacity, the first preset accounting is according to actual needs
It is set, such as the first preset accounting can be arranged to 75%, 80% or 90%, the embodiment of the present invention is not specifically limited.
For example, getting file in caching has been 3G with memory capacity, if in caching can storage file total capacity be 4G, first is preset
Accounting is 80%, then can determine with memory capacity in caching can the accounting of storage file total capacity be not up to first and preset account for
Than.
S20, if it is described with memory capacity in the caching can the accounting of storage file total capacity to reach first preset
Accounting then obtains the frequency of use of each file corresponding programme in the frequency of use of each file in the caching and the caching.
It should be noted that required text when the operation of each application program can be stored in the caching of the embodiment of the present invention
Part.In determining caching in memory capacity and caching can the accounting of storage file total capacity reach the first preset accounting when,
I.e. when the file stored in caching will take the memory space of caching, obtain caching in each cache file frequency of use with
And the frequency of use of program corresponding to each cache file, i.e. access times and file corresponding programme of the file within the unit time
Frequency of use, so that in the next steps according to the frequency of use of file in caching and the use frequency of file corresponding programme
Rate the operation such as is compressed, deleted or is retained to the file in caching, and the embodiment of the present invention is not specifically limited.Wherein, originally
The corresponding one or more files of program in inventive embodiments, i.e., can uniquely determine a program by the file in caching.
S30, according to the use of file corresponding programme each in the frequency of use of file each in the caching and/or the caching
Frequency retains, compresses or deletes corresponding file in the caching.
In embodiments of the present invention, individually the file in caching can be carried out according to the frequency of use of file each in caching
Processing can also individually be handled the file in caching according to the frequency of use of in caching file corresponding programme, can also
The file in caching is handled with the frequency of use of file in binding cache and the frequency of use of file corresponding programme, this hair
Bright embodiment is not specifically limited.It should be noted that program where the frequency of use of file is less than or equal to it in caching makes
Use frequency.
Wherein it is possible to retain according to actual needs the file being commonly used in caching near-mid term, again convenient for user
Corresponding file data is directly obtained when secondary use from caching;For the file that does not use of caching near-mid term, can by its from
It is deleted in caching, guarantees the free memory of caching in certain data value range with this;For even in caching near-mid term
You can be compressed the file that uses according to certain compression factor, with this guarantee in caching can storage file effective storage
Space.
As shown in Fig. 2, in one embodiment provided by the invention, step S30: according to making for file each in the caching
With the frequency of use of file corresponding programme each in frequency and the caching, retain, compress or delete corresponding text in the caching
Part, comprising:
S301 calculates the weight of the frequency of use of each file and the frequency of use of the file corresponding programme in the caching
With.
Wherein, the weight and the corresponding weighted value product of frequency of use and the file corresponding programme for file
The mutually adduction of the corresponding weighted value product of frequency of use, the weighted value of the frequency of use of the frequency of use and program of file can be with
Set according to actual needs, the weighted value of the frequency of use of the frequency of use and program of file and be 1.For example, obtaining
It is 9 that into caching, the frequency of use of A file, which is the frequency of use of the A program where 8, A file, if the power of A file frequency of use
The weighted value that weight values are arranged to the frequency of use of 0.7, A program is set as 0.3, then according to the frequency of use and A journey for calculating A file
The weight of sequence and be 8.3.
S302 retains, compresses or deletes corresponding file in the caching according to the size of the weight sum.
In embodiments of the present invention, the file in caching can specifically be handled according to the size of weight sum, it is such as slow
In depositing the weight of some file and be greater than the first default value, then retain this document;Such as caching in some file weight and
Less than the first default value, then need further to judge whether the weighted value of this document is greater than the second default value, if more than then
This document is compressed;If this document is removed from the cache by the weighted value of this document less than the second default value.
The embodiment of the invention provides a kind of management methods of cache file, and file has used storage first in acquisition caching
Capacity, and detect it is described with memory capacity in the caching can the accounting of storage file total capacity whether to reach first preset
Accounting, if it is described in memory capacity and the caching can the accounting of storage file total capacity reach the first preset accounting,
The frequency of use for obtaining each file corresponding programme in the frequency of use of each file in the caching and caching, according to the caching
In the frequency of use of each file and/or the frequency of use of each file corresponding programme in caching, retain, compress or delete the caching
In corresponding file.With current periodic cleaning caching in file compared with, the embodiment of the present invention determine use memory capacity and
When seeing that storage file total capacity accounting reaches certain numerical value in caching, each file in frequency of use file-based and/or caching
The frequency of use of corresponding programme retains file, compressed or is deleted, to can efficiently differentiate through the embodiment of the present invention
The file cached is actually needed in caching, so that the temporal cache file or some records of the generation of different programs are answered
This is treated with a certain discrimination, to improve the effective percentage of file storage in caching.
As shown in figure 3, in one embodiment provided by the invention, step S30: described according to the big of the weight sum
It is small, retain, compress or delete corresponding file in the caching, comprising:
S301 judges the weight and whether less than the first default value.
Wherein, the first default value can be configured according to actual needs, such as need by weight and less than 3 times caching text
Part is deleted, then can set 3 for the first default value;If desired weight and cache file less than 5 times are deleted, then it can be by the
One default value is set as 5, and the embodiment of the present invention is not specifically limited.
S302A, if the weight and less than the first default value, by the weight and less than the text of the first default value
Part is deleted.
S302B, if the weight and be more than or equal to the first default value, judge the weight and whether less than second in advance
Setting value.
Wherein, step S302B is the step arranged side by side of step S302A, in step S302A, for weight and less than first
The file of default value is deleted;In step S302A, also needed for weight and more than or equal to the file of the first default value
It is determined the weight of this document and whether less than the second default value, it is preset that second default value is greater than described first
Numerical value and to the weight and more than or equal to first default value compress less than the file of the second default value.
S303B, to the weight and more than or equal to first default value and less than the file of the second default value into
Row compression.
S304B retains to the weight and more than or equal to the file of second default value.
For the embodiment of the present invention, deleted for weight and less than the file of the first default value;For weight and
Whether the file more than or equal to the first default value also need to further determine that the weight of this document and less than the second default value,
Wherein the second default value is greater than first default value, then by weight and is more than or equal to first default value and small
It is compressed in the file of the second default value, is protected to weight and more than or equal to the file of second default value
It stays.Therefore the embodiment of the present invention carries out effective area to the file in caching according to the first default value and the second default value
Point, to treat the processing method of different frequency of use files with a certain discrimination, i.e., according to frequency of use from low to high to the text in caching
Part is deleted respectively, compressed or is retained.
As shown in figure 4, in one embodiment provided by the invention, step S30: described according to the big of the weight sum
It is small, retain, compress or delete corresponding file in the caching, comprising:
S31 judges the weight and whether is more than or equal to the second default value.
S32A, if the weight and be more than or equal to second default value, retain the weight and be more than or equal to institute
State the file of the second default value.
Wherein, the second default value is set according to actual needs, as needed preset time number in caching
File more than or equal to 10 times retains, then can set 3 for the second default value;If desired preset time indegree in caching
File more than or equal to 15 times retains, then can set 5 for the second default value, the embodiment of the present invention is not specifically limited.
S32B is obtained if the weight and being less than second default value and described is less than second default value
The memory capacity of file.
Wherein, step S32B is the step arranged side by side of step S32A, whether is more than or equal in the frequency of use for judging file
After two default values, if the frequency of use of file is more than or equal to second default value, it is big to retain the frequency of use
In the file for being equal to second default value;If the frequency of use of the file is less than second default value, obtain
The memory capacity less than the second default value file.
In embodiments of the present invention, the file for frequency of use less than the second default value then needs further really
The operation of progress required for the fixed file less than the second default value, that is, obtain depositing less than the second default value file in caching
Store up capacity, that is, occupy spatial cache capacity, in order in the next steps according to occupy spatial cache capacity, in caching
File selectively deleted or compressed.
S33B is compressed or is deleted to the file for being less than second default value according to the memory capacity of the file
It removes.
For the embodiment of the present invention, after whether the frequency of use for judging file is more than or equal to the second default value, if
The frequency of use of file is more than or equal to second default value, then it is preset more than or equal to described second to retain the frequency of use
The file of numerical value;If the frequency of use of the file is less than second default value, obtain described pre- less than described second
The memory capacity of setting value file, and the file for being less than second default value is compressed according to the memory capacity of file
Or delete, the frequency so as to effectively be used according to file in caching carries out compression or delete operation, realizes targeted
File in caching is handled, the effective percentage of file storage in caching is improved.
In one embodiment provided by the invention, step S33B: the memory capacity according to the file is to being less than
The file of second default value is compressed or is deleted, and is specifically included: obtain the file memory capacity and the text
Frequency of use of the part within the scope of preset time;Third default value is greater than to the memory capacity and within the scope of preset time
Frequency of use deleted less than the file of the 4th default value;Third preset number is less than or equal to the memory capacity
The file that value and the frequency of use within the scope of preset time are greater than the 4th default value is compressed.Wherein, third is pre-
Setting value is set according to actual needs, the biggish file of memory space is occupied in caching for determining, the third is pre-
Setting value is specifically as follows 10M, 20M, 30M etc., and the embodiment of the present invention is not specifically limited.4th default value is for relatively more single
The frequency of use of file in position time caching, and the 4th default value is less than the second default value.For example, third default value is
30M, the 4th default value are to use 5 times per minute;Then it can be greater than 30M and access times per minute to memory capacity in this example
File less than 5 is deleted, and is less than or equal to 30M to memory capacity and file of the access times per minute more than or equal to 5 carries out
Compression occupies lesser memory space with the file that this guarantees to store in the buffer.
For the embodiment of the present invention, although the program being of little use, if its cache file generated is smaller, no
It can preferentially selection delete, but delete those bigger cachings being also of little use.Reduce file selecting different compression ratios
Also the speed of compression and the relationship of compression ratio are contemplated that when volume: when bigger compression ratio needs more long compression time and decompression
Between.
In one embodiment provided by the invention, after being compressed to the file in caching, in order to guarantee to cache
The storage validity of middle compressed file, the method also includes: obtain compressed file in the caching makes in preset time
Use frequency;If frequency of use of the compressed file in preset time is greater than predetermined frequency, the compressed file is carried out
Decompression, which contracts, to be stored in the caching;If frequency of use of the compressed file in preset time is less than or equal to predetermined frequency,
Then the file is deleted from the caching.Wherein, predetermined frequency can be set according to actual needs, such as by preset frequency
Rate is arranged to the number that file is frequently used in caching, and the specific predetermined frequency can be the second above-mentioned default value,
I.e. when the color files in caching in preset time frequency of use be greater than the second default value when, need to the compressed file into
Row decompression, in order to which program quickly obtains this document from caching;And for often not made in preset time in caching
Compressed file then needs from caching directly to delete the compressed file, to reduce the memory space occupied in caching.
It should be noted that if frequency of use of the compressed file in preset time is less than or equal to predetermined frequency, then also need
Further to judge that frequency of use of the compressed file in preset time, will compression if being less than whether less than the first default value
File is directly deleted from caching;If frequency of use of the compressed file in preset time is preset between predetermined frequency and first
Between numerical value, then retain the storage of the compressed file in the buffer.
In one embodiment provided by the invention, in order to improve the efficiency that program obtains file in caching, to caching
The enough situations in middle space are to the file compressed to caching unzips it.Even it is described use memory capacity and
In the caching can storage file total capacity accounting be lower than the second preset accounting, then in the caching compressed file carry out
Decompression.Wherein, it is set according to actual needs when the second preset accounting, if the second preset accounting is 20%, 30%
Deng the embodiment of the present invention is not specifically limited.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each process
Execution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present invention constitutes any limit
It is fixed.
In one embodiment, a kind of managing device of cache file, the managing device of the cache file and above-mentioned reality are provided
The management method for applying cache file in example corresponds.As shown in figure 5, the managing device of the cache file includes detection module
10, module 20 and management module 30 are obtained.Detailed description are as follows for each functional module:
Detection module 10 use memory capacity for obtain file in caching, and detect it is described used memory capacity and
In the caching can the accounting of storage file total capacity whether reach the first preset accounting;
Obtain module 20, if for it is described with memory capacity in the caching can the accounting of storage file total capacity reach
To the first preset accounting, then each file corresponding programme in the frequency of use of each file and the caching is obtained in the caching
Frequency of use;
Management module 30, for according to file each in the frequency of use of file each in the caching and/or caching institute
The frequency of use for belonging to program, retains, compresses or deletes corresponding file in the caching.
Specifically, the management module 30, comprising:
Computing unit 31, for calculating the use of the frequency of use of each file and the file corresponding programme in the caching
The weight of frequency and the weight and the corresponding weighted value product of frequency of use and the file corresponding programme for file
The mutually adduction of the corresponding weighted value product of frequency of use;
Administrative unit 32 retains, compresses or deletes corresponding text in the caching for the size according to the weight sum
Part.
The management module 30, further includes:
Judging unit 33, for judging the weight and whether less than the first default value;
Unit 34 is deleted, if for the weight and less than the first default value, by the weight and in advance less than first
The file of setting value is deleted;
The judging unit 33 judges the weight if being also used to the weight and being more than or equal to the first default value
Whether less than the second default value, second default value is greater than first default value;
Compression unit 35, for the weight and more than or equal to first default value and less than the second default value
File compressed;
Stick unit 36, for being protected to the weight and more than or equal to the file of second default value
It stays.
The judging unit 33 is also used to judge the weight and whether is more than or equal to the second default value;
The stick unit 36, if being also used to the weight and being more than or equal to second default value, described in reservation
Weight and file more than or equal to second default value;
Acquiring unit 37 obtains if for the weight and being less than second default value and described is less than described the
The memory capacity of two default value files;According to the memory capacity of the file to be less than second default value file into
Row compression is deleted.
Acquiring unit 37, for obtaining the use of the memory capacity and the file of the file within the scope of preset time
Frequency;
Unit 34 is deleted, for being greater than third default value and the use within the scope of preset time to the memory capacity
Frequency is deleted less than the file of the 4th default value;
Compression unit 35, for being less than or equal to third default value to the memory capacity and within the scope of preset time
The file that frequency of use is greater than the 4th default value is compressed.
Acquiring unit 37, for obtaining frequency of use of the compressed file in preset time in the caching;
Decompression module 40 will if being greater than predetermined frequency for frequency of use of the compressed file in preset time
The compressed file is unziped it and is stored in the caching;
Unit 34 is deleted, if being less than or equal to predetermined frequency for frequency of use of the compressed file in preset time,
Then the file is deleted from the caching.
Further, described device further include:
Decompression module 40, if for it is described used memory capacity in the caching can the accounting of storage file total capacity it is low
In the second preset accounting, then the compressed file in the caching is unziped it.
The specific of managing device about cache file limits the management method that may refer to above for cache file
Restriction, details are not described herein.Modules in the managing device of above-mentioned cache file can be fully or partially through software, hard
Part and combinations thereof is realized.Above-mentioned each module can be embedded in the form of hardware or independently of in the processor in computer equipment,
It can also be stored in a software form in the memory in computer equipment, execute the above modules in order to which processor calls
Corresponding operation.
In one embodiment, a kind of computer equipment is provided, which can be terminal, internal structure
Figure can be as shown in Figure 6.The computer equipment includes processor, the memory, network interface, display connected by system bus
Screen and input unit.Wherein, the processor of the computer equipment is for providing calculating and control ability.The computer equipment is deposited
Reservoir includes non-volatile memory medium, built-in storage.The non-volatile memory medium is stored with operating system and computer journey
Sequence.The built-in storage provides environment for the operation of operating system and computer program in non-volatile memory medium.The calculating
The network interface of machine equipment is used to communicate with external server by network connection.When the computer program is executed by processor with
Realize the management method of any one aforementioned cache file.
In one embodiment, a kind of computer equipment is provided, including memory, processor and storage are on a memory
And the computer program that can be run on a processor, processor perform the steps of when executing computer program
Obtain file in caching use memory capacity, and can be stored in memory capacity and the caching described in detecting
Whether the accounting of file total capacity reaches the first preset accounting;
If it is described in memory capacity and the caching can the accounting of storage file total capacity reach the first preset accounting,
Then obtain the frequency of use of each file corresponding programme in the frequency of use of each file in the caching and the caching;
Frequency is used according to file corresponding programme each in the frequency of use of file each in the caching and/or the caching
Rate retains, compresses or deletes corresponding file in the caching.
In one embodiment, a kind of computer readable storage medium is provided, computer program is stored thereon with, is calculated
Machine program performs the steps of when being executed by processor
Obtain file in caching use memory capacity, and can be stored in memory capacity and the caching described in detecting
Whether the accounting of file total capacity reaches the first preset accounting;
If it is described in memory capacity and the caching can the accounting of storage file total capacity reach the first preset accounting,
Then obtain the frequency of use of each file corresponding programme in the frequency of use of each file in the caching and the caching;
Frequency is used according to file corresponding programme each in the frequency of use of file each in the caching and/or the caching
Rate retains, compresses or deletes corresponding file in the caching.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with
Relevant hardware is instructed to complete by computer program, the computer program can be stored in a non-volatile computer
In read/write memory medium, the computer program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein,
To any reference of memory, storage, database or other media used in each embodiment provided herein,
Including non-volatile and/or volatile memory.Nonvolatile memory may include read-only memory (ROM), programming ROM
(PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM) or flash memory.Volatile memory may include
Random access memory (RAM) or external cache.By way of illustration and not limitation, RAM is available in many forms,
Such as static state RAM (SRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double data rate sdram (DDRSDRAM), enhancing
Type SDRAM (ESDRAM), synchronization link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM
(RDRAM), direct memory bus dynamic ram (DRDRAM) and memory bus dynamic ram (RDRAM) etc..
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each function
Can unit, module division progress for example, in practical application, can according to need and by above-mentioned function distribution by different
Functional unit, module are completed, i.e., the internal structure of described device is divided into different functional unit or module, more than completing
The all or part of function of description.
Embodiment described above is merely illustrative of the technical solution of the present invention, rather than its limitations;Although referring to aforementioned reality
Applying example, invention is explained in detail, those skilled in the art should understand that: it still can be to aforementioned each
Technical solution documented by embodiment is modified or equivalent replacement of some of the technical features;And these are modified
Or replacement, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution should all
It is included within protection scope of the present invention.
Claims (10)
1. a kind of management method of cache file, which is characterized in that the described method includes:
Obtain file in caching use memory capacity, and detecting described used can storage file in memory capacity and the caching
Whether the accounting of total capacity reaches the first preset accounting;
If it is described in memory capacity and the caching can the accounting of storage file total capacity reach the first preset accounting, obtain
Take the frequency of use of each file corresponding programme in the frequency of use of each file in the caching and the caching;
According to the frequency of use of file corresponding programme each in the frequency of use of file each in the caching and/or the caching, protect
Stay, compress or delete corresponding file in the caching.
2. the method according to claim 1, wherein the frequency of use according to file each in the caching and
The frequency of use of each file corresponding programme in the caching, retains, compresses or deletes corresponding file in the caching, comprising:
Calculate the weight of the frequency of use of each file and the frequency of use of the file corresponding programme and the power in the caching
The corresponding power of frequency of use of the corresponding weighted value product of frequency of use and the file corresponding programme heavy and that be file
The mutually adduction of weight values product;
According to the size of the weight sum, retain, compress or delete corresponding file in the caching.
3. according to the method described in claim 2, retain it is characterized in that, the size according to the weight sum, compression or
Delete corresponding file in the caching, comprising:
If the weight of the file and less than the first default value, the file is deleted;
If the weight of the file and being more than or equal to the first default value and less than the second default value, the file is carried out
Compression, wherein second default value is greater than first default value;
If the weight of the file and be more than or equal to second default value, retain the file.
4. according to the method described in claim 2, retain it is characterized in that, the size according to the weight sum, compression or
Delete corresponding file in the caching, comprising:
If the weight of the file and be more than or equal to second default value, retain the file;
If the weight of the file and being less than second default value, obtains and described be less than the second default value file
Memory capacity;
The file for being less than second default value is compressed or deleted according to the memory capacity of the file.
5. according to the method described in claim 4, it is characterized in that, the memory capacity according to the file is described to being less than
The file of second default value is compressed or is deleted, comprising:
Obtain the frequency of use of the memory capacity and the file of the file within the scope of preset time;
To frequency of use of the memory capacity greater than third default value and within the scope of preset time less than the 4th preset number
The file of value is deleted;
Third default value is less than or equal to the memory capacity and the frequency of use within the scope of preset time is greater than the 4th in advance
The file of setting value is compressed.
6. -5 any method according to claim 1, which is characterized in that the method also includes:
Obtain frequency of use of the compressed file in preset time in the caching;
If frequency of use of the compressed file in preset time is greater than predetermined frequency, the compressed file is decompressed
It contracts and stores in the caching;
If frequency of use of the compressed file in preset time is less than or equal to predetermined frequency, by the compressed file from institute
It states and is deleted in caching.
7. the method according to claim 1, wherein the method also includes:
If it is described used in memory capacity and the caching can storage file total capacity accounting lower than the second preset accounting, it is right
Compressed file in the caching unzips it.
8. a kind of managing device of cache file, which is characterized in that described device includes:
Detection module use memory capacity for obtain file in caching, and detects and described memory capacity use to delay with described
In depositing can the accounting of storage file total capacity whether reach the first preset accounting;
Obtain module, if for it is described in memory capacity and the caching can the accounting of storage file total capacity reach first
Preset accounting then obtains the use of each file corresponding programme in the frequency of use of each file in the caching and the caching
Frequency;
Management module, for according to file corresponding programme each in the frequency of use of file each in the caching and/or the caching
Frequency of use, retain, compress or delete corresponding file in the caching.
9. a kind of computer equipment, including memory, processor and storage are in the memory and can be in the processor
The computer program of upper operation, which is characterized in that the processor realized when executing the computer program as claim 1 to
The management method of any one of 7 cache files.
10. a kind of computer readable storage medium, the computer-readable recording medium storage has computer program, and feature exists
In the manager of realization cache file as described in any one of claim 1 to 7 when the computer program is executed by processor
Method.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910429526.4A CN110275870A (en) | 2019-05-22 | 2019-05-22 | Management method, device, computer equipment and the storage medium of cache file |
PCT/CN2019/120604 WO2020233046A1 (en) | 2019-05-22 | 2019-11-25 | Cache file management method and apparatus, computer device, and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910429526.4A CN110275870A (en) | 2019-05-22 | 2019-05-22 | Management method, device, computer equipment and the storage medium of cache file |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110275870A true CN110275870A (en) | 2019-09-24 |
Family
ID=67959065
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910429526.4A Pending CN110275870A (en) | 2019-05-22 | 2019-05-22 | Management method, device, computer equipment and the storage medium of cache file |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN110275870A (en) |
WO (1) | WO2020233046A1 (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020233046A1 (en) * | 2019-05-22 | 2020-11-26 | 深圳壹账通智能科技有限公司 | Cache file management method and apparatus, computer device, and storage medium |
CN112487029A (en) * | 2020-11-11 | 2021-03-12 | 杭州电魂网络科技股份有限公司 | Progressive cache elimination method and device, electronic equipment and storage medium |
WO2021057665A1 (en) * | 2019-09-27 | 2021-04-01 | Oppo广东移动通信有限公司 | Data storage method and apparatus, mobile terminal, and storage medium |
CN113641376A (en) * | 2020-05-11 | 2021-11-12 | 深圳Tcl新技术有限公司 | Upgrade optimization method of intelligent terminal and intelligent terminal |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113721842B (en) * | 2021-07-29 | 2023-08-22 | 苏州浪潮智能科技有限公司 | IO management method, system, equipment and computer readable storage medium |
CN114063917B (en) * | 2021-11-11 | 2024-01-30 | 天津兆讯电子技术有限公司 | Method and microcontroller for fast reading program data |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030200233A1 (en) * | 2002-04-19 | 2003-10-23 | Canon Kabushiki Kaisha | Document management system, document management method, program and storage medium |
CN105956035A (en) * | 2016-04-25 | 2016-09-21 | 乐视控股(北京)有限公司 | File storage method and device |
CN107590144A (en) * | 2016-07-07 | 2018-01-16 | 中兴通讯股份有限公司 | A kind of file memory method and terminal |
CN107665098A (en) * | 2017-09-05 | 2018-02-06 | 联想(北京)有限公司 | Information processing method, storage device and computer-readable storage medium |
CN109165196A (en) * | 2018-08-09 | 2019-01-08 | 佛山长意云信息技术有限公司 | A kind of compressed file management method, device, computer equipment and storage medium |
CN109656885A (en) * | 2018-12-18 | 2019-04-19 | Oppo广东移动通信有限公司 | Memory space monitoring method and device, electric terminal, storage medium |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110275870A (en) * | 2019-05-22 | 2019-09-24 | 深圳壹账通智能科技有限公司 | Management method, device, computer equipment and the storage medium of cache file |
-
2019
- 2019-05-22 CN CN201910429526.4A patent/CN110275870A/en active Pending
- 2019-11-25 WO PCT/CN2019/120604 patent/WO2020233046A1/en active Application Filing
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030200233A1 (en) * | 2002-04-19 | 2003-10-23 | Canon Kabushiki Kaisha | Document management system, document management method, program and storage medium |
CN105956035A (en) * | 2016-04-25 | 2016-09-21 | 乐视控股(北京)有限公司 | File storage method and device |
CN107590144A (en) * | 2016-07-07 | 2018-01-16 | 中兴通讯股份有限公司 | A kind of file memory method and terminal |
CN107665098A (en) * | 2017-09-05 | 2018-02-06 | 联想(北京)有限公司 | Information processing method, storage device and computer-readable storage medium |
CN109165196A (en) * | 2018-08-09 | 2019-01-08 | 佛山长意云信息技术有限公司 | A kind of compressed file management method, device, computer equipment and storage medium |
CN109656885A (en) * | 2018-12-18 | 2019-04-19 | Oppo广东移动通信有限公司 | Memory space monitoring method and device, electric terminal, storage medium |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020233046A1 (en) * | 2019-05-22 | 2020-11-26 | 深圳壹账通智能科技有限公司 | Cache file management method and apparatus, computer device, and storage medium |
WO2021057665A1 (en) * | 2019-09-27 | 2021-04-01 | Oppo广东移动通信有限公司 | Data storage method and apparatus, mobile terminal, and storage medium |
CN113641376A (en) * | 2020-05-11 | 2021-11-12 | 深圳Tcl新技术有限公司 | Upgrade optimization method of intelligent terminal and intelligent terminal |
CN113641376B (en) * | 2020-05-11 | 2024-06-04 | 深圳Tcl新技术有限公司 | Intelligent terminal upgrading optimization method and intelligent terminal |
CN112487029A (en) * | 2020-11-11 | 2021-03-12 | 杭州电魂网络科技股份有限公司 | Progressive cache elimination method and device, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
WO2020233046A1 (en) | 2020-11-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110275870A (en) | Management method, device, computer equipment and the storage medium of cache file | |
CN103744617B (en) | The merging compression method of a kind of key-value storage Data File and device | |
CN110309109B (en) | Data monitoring method, device, computer equipment and storage medium | |
CN108595503A (en) | Document handling method and server | |
DE102012208141A1 (en) | Compensation for decreasing functionality | |
CN103412825B (en) | A kind of memory release method and device | |
CN106371764A (en) | Virtual block device-based data processing method and apparatus | |
CN107632791A (en) | The distribution method and system of a kind of memory space | |
CN102999444A (en) | Method and device for replacing data in caching module | |
CN107850983A (en) | The management method of computer system, storage device and data | |
CN110162260A (en) | File batch processing method, device, computer equipment and storage medium | |
CN110851427A (en) | Database capacity changing method and device | |
CN107885859A (en) | A kind of method, apparatus and computer-readable recording medium of file number quota | |
CN106649654A (en) | Data updating method and device | |
CN116450287A (en) | Method, device, equipment and readable medium for managing storage capacity of service container | |
CN108829616A (en) | A kind of data cached management method, device, computer equipment and storage medium | |
CN107357686A (en) | A kind of daily record delet method and device | |
CN106569683A (en) | Method and equipment for performing batch processing of applications on mobile terminal | |
CN106844236A (en) | The date storage method and device of terminal device | |
CN109977074B (en) | HDFS-based LOB data processing method and device | |
CN114528179B (en) | Data acquisition program state monitoring method, device, equipment and storage medium | |
US20160253591A1 (en) | Method and apparatus for managing performance of database | |
CN106202374A (en) | A kind of data processing method and device | |
CN114281260A (en) | Storage method, device, equipment and medium applied to distributed storage system | |
CN109857656A (en) | Adaptation method, device, computer equipment and storage medium based on test |
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 | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20190924 |