CN110134652A - Recovery method, device, electronic equipment and the storage medium of cache file - Google Patents
Recovery method, device, electronic equipment and the storage medium of cache file Download PDFInfo
- Publication number
- CN110134652A CN110134652A CN201910390226.XA CN201910390226A CN110134652A CN 110134652 A CN110134652 A CN 110134652A CN 201910390226 A CN201910390226 A CN 201910390226A CN 110134652 A CN110134652 A CN 110134652A
- Authority
- CN
- China
- Prior art keywords
- file
- cache file
- memory
- cache
- executable
- 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
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/13—File access structures, e.g. distributed indices
-
- 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/1727—Details of free space management 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)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the present application discloses recovery method, device, electronic equipment and the storage medium of a kind of cache file.Wherein method includes: when memory is loaded into executable file, judge whether executable file is important cache file according to the attribute information of executable file, if important cache file, then executable file is marked, judge whether the residual capacity of the memory meets preset condition, if being unsatisfactory for preset condition, unlabelled cache file in memory is recycled.User is when using electronic equipment, important cache file and high frequency access file can be generated in the memory of electronic equipment, by the residual capacity memory for judging memory, to be recycled to unessential cache file and non-high frequency access file, to retain important cache file, to improve the access speed of file.
Description
Technical field
This application involves art file management technology fields, and in particular to a kind of recovery method of cache file, device, electronics are set
Standby and storage medium.
Background technique
Linux kernel Memory recycle mechanism is to carry out memory by the rule of LRU (least recently used) in memory anxiety
Recycling, is recovered if it is file cache, just needs to re-read from external storage when next time visits again, which can compare
Time-consuming has especially used for a long time in electronic equipment, and performance is more under external storage fragment serious situation, when re-reading
It is low.
Present technology realization is recycled by the page least recently used in system, this has some defects in fact
, it is more likely that it is exactly that some file caches are just recovered, soon just needs to have accessed again, at this time need to do again
I/O operation.Will lead in this way system performance reduction, make electronic equipment open application program or access file when speed compared with
Slowly.
Summary of the invention
The embodiment of the present application provides a kind of recovery method of cache file, device, electronic equipment and storage medium.It can be right
Insignificant file and the cache file of non-high frequency access are recycled, and the speed of access file is improved.
In order to solve the above technical problems, present applicant proposes following technical schemes:
In a first aspect, the embodiment of the present application provides a kind of recovery method of cache file, the method comprise the steps that
When memory is loaded into executable file, the executable text is judged according to the attribute information of the executable file
Whether part is important cache file;
If important cache file, then the cache file is marked;
Judge whether the residual capacity of the memory meets preset condition;
If being unsatisfactory for the preset condition, unlabelled cache file in the memory is recycled.
Second aspect, the embodiment of the present application provide a kind of recyclable device of cache file, and wherein described device includes:
First judgment module, for being believed according to the attribute of the executable file when memory is loaded into executable file
Breath judges whether the executable file is important cache file;
Mark module marks the cache file if be important cache file for the executable file
Note;
Second judgment module, for judging whether the residual capacity of the memory meets preset condition;
First recycling module, if the residual capacity for the memory is unsatisfactory for the preset condition, described in recycling
Unlabelled cache file in memory.
The third aspect, the embodiment of the present application provide a kind of electronic equipment, including memory, processor and are stored in storage
On device and the computer program that can run on a processor, the processor realize above-mentioned cache file when executing described program
The step of recovery method.
Fourth aspect, the embodiment of the present application provide a kind of storage medium, are stored thereon with computer program, the calculating
Machine program realizes the step of recovery method of above-mentioned cache file when being executed by processor.
In the embodiment of the present application, when memory is loaded into executable file, sentenced according to the attribute information of executable file
Whether disconnected executable file is that important cache file is then marked executable file if important cache file, judges institute
Whether the residual capacity for stating memory meets preset condition, if being unsatisfactory for preset condition, recycles unlabelled caching in memory
File.User can generate important cache file and high frequency access file when using electronic equipment in the memory of electronic equipment,
By judging the residual capacity memory of memory, to be recycled to unessential cache file and non-high frequency access file, with
Retain important cache file, to reduce by IO number, promotes the speed of access file.
Detailed description of the invention
In order to more clearly explain the technical solutions in the embodiments of the present application, make required in being described below to embodiment
Attached drawing is briefly described, it should be apparent that, the drawings in the following description are only some examples of the present application, for
For those skilled in the art, without creative efforts, it can also be obtained according to these attached drawings other attached
Figure.
Fig. 1 is the schematic diagram of a scenario of cache file recycling provided by the embodiments of the present application.
Fig. 2 is the first pass schematic diagram of the recovery method of cache file provided by the embodiments of the present application.
Fig. 3 is the second procedure schematic diagram of the recovery method of cache file provided by the embodiments of the present application.
Fig. 4 is the first structure diagram of the recyclable device of cache file provided by the embodiments of the present application.
Fig. 5 is the second structural schematic diagram of the recyclable device of cache file provided by the embodiments of the present application.
Fig. 6 is the structural schematic diagram of electronic equipment provided by the embodiments of the present application.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of embodiments of the present application, instead of all the embodiments.It is based on
Embodiment in the application, those skilled in the art's every other implementation obtained without creative efforts
Example, shall fall in the protection scope of this application.
In the following description, the specific embodiment of the application will refer to the step as performed by one or multi-section computer
And symbol illustrates, unless otherwise stating clearly.Therefore, these steps and operation will have to mention for several times is executed by computer, this paper institute
The computer execution of finger includes by representing with the computer processing unit of the electronic signal of the data in a structuring pattern
Operation.This operation is converted at the data or the position being maintained in the memory system of the computer, reconfigurable
Or in addition change the running of the computer in mode known to the tester of this field.The maintained data structure of the data
For the provider location of the memory, there is the specific feature as defined in the data format.But the application principle is with above-mentioned text
Word illustrates that be not represented as a kind of limitation, this field tester will appreciate that plurality of step and behaviour as described below
Also it may be implemented in hardware.
Term " first ", " second " and " third " in the application etc. are for distinguishing different objects, rather than for retouching
State particular order.In addition, term " includes " and " having " and their any deformations, it is intended that cover and non-exclusive include.
Such as contain series of steps or module process, method, system, product or equipment be not limited to listed step or
Module, but some embodiments further include the steps that not listing or module or some embodiments further include for these processes,
Method, product or equipment intrinsic other steps or module.
The embodiment of the present application provides recovery method, device, electronic equipment and the storage medium of a kind of cache file.
Referring to Fig. 1, Fig. 1 is the schematic diagram of a scenario of cache file recycling provided by the embodiments of the present application.
Shown in Fig. 1, electronic equipment before opening platform in application, electronic equipment can read the corresponding file of the foreground application
1, when reading file 1, cache file 1 can be generated in the memory of electronic equipment.
At this time there are two background applications, the corresponding background application of file 2 is the front opening in the corresponding background application of file 3
Application, corresponding cache file is respectively cache file 2 and cache file 3 in memory for file 2 and file 3.For example,
When unread file 3, cache file 1 and cache file 2 and other cache files are stored in memory, at this point, memory
Residual capacity be it is enough, be capable of the smooth operation of safeguards system or application program.Cache file 1 is marked, is prevented
Only cache file 1 is recovered in Out of Memory.
When reading file 3, the residual capacity of memory is insufficient at this time, needs to recycle other cache files,
The normal reading of energy safeguard file 3 retains cache file 1 and cache file 3, that is, protects at this point, recycling to cache file 2
The normal reading for having hindered file 3, when reading file 1 next time, due to the corresponding cache file of file 1 in memory
Or existing, the speed for reading again file 1 can be promoted.
Corresponding, the corresponding foreground application of file 1, when opening next time, speed can also correspond to promotion, reduce simultaneously
IO number, improves the access speed to file.
The recovery method for the cache file recorded in the embodiment of the present application can be applied to mobile phone, plate, computer, intelligence and wear
The electronic equipments such as equipment are worn, are described in detail separately below.
Referring to Fig. 2, Fig. 2 is the first pass schematic diagram of the recovery method of cache file provided by the embodiments of the present application.
The recovery method for the cache file recorded in the embodiment of the present application can mark cache file important in memory
Note locking, recycles unessential file, reduces I/O operation to improve the speed of access file.
In step s101, when being loaded into executable file in memory, the attribute information of executable file is obtained.
It is opening in application, memory needs to be loaded into executable file, at this point it is possible to obtain the attribute letter of executable file
Breath, the attribute information of executable file may include the signing messages of file or the identification information of executable file, Huo Zheke
Execute the type etc. of file.
Wherein, the identification information of executable file can be the mark of the corresponding application program of this document, for example, by can
The identification information for executing file, learns that the application is the application program of instant messaging class, it is possible to determine that the application is important
's.It can also learn that the corresponding application program of this document is foreground application by identification information, it is important in systems.
Wherein, the type of executable file can be system file and system file, for example, the corresponding type of this document is
Type in system file, has lacked this document, and system is not normally functioning.The type of executable file can be application
The master file of program and secondary file have lacked this article for example, the corresponding type of this document is the master file of application program
Part, application program cannot normally open operation.
The attribute information of the file of loading is also possible to other information, above only to enumerate, and should not make rising limit to the application
System.
In step s 102, according to the attribute information of executable file, judge whether executable file is important caching text
Part.
Wherein important cache file can be the master file of the file either application program of system operation, or use
The vital document etc. that family is being edited.
By the attribute information of executable file, judge this document judge whether it is vital document.
If executable file is not vital document, S103 is entered step.
If executable file is vital document, S104 is entered step.
In step s 103, it is not necessary that executable file is marked.
In step S104, the executable file for important cache file is marked.
It is understood that cannot be recycled to this document when executable file is important cache file.Such as this can
When executing the master file that file is application program operation, this document is recycled, foreground application closing is will lead to, uses
Family needs to re-start I/O operation, could open the application program when future time opens the corresponding application program of this document,
It will lead to a kind of application program to have already turned on, but be again turned on the problem of still reloading, this reduces answer
With the opening speed of program.
Therefore, important cache file is marked in the embodiment of the present application, is prevented in memory low memory, returned
Cache file releasing memory is received, important cache file is caused also to be recovered.
In step s105, judge whether the residual capacity of memory meets preset condition.
It is limit residual capacity when system operates normally that wherein preset condition, which can be the residual capacity of memory, surplus
Remaining memory size is greater than limit residual capacity, then it is assumed that free memory capacity meets preset condition.
When preset condition is also possible to next application program opening, the free memory of the application program can be operated normally
Capacity, when normally next application program can be opened, then it is assumed that free memory capacity meets preset condition.
Preset condition is also possible to memory free memory capacity and current one or more applies committed memory capacity
Ratio be not less than default ratio, i.e., not less than default ratio, free memory capacity be it is enough, meet default
Condition.
Preset condition is also possible to the preset range of free memory capacity, as long as free memory capability value is in preset range
It is interior, then illustrate free memory capacity be it is enough, meet preset condition.
When the free memory capacity for judging memory meets preset condition, then S106 is entered step.
When the free memory capacity for judging memory is unsatisfactory for preset condition, then S107 is entered step.
In step s 106, without recycling the cache file in buffer.
It is understood that then free memory capacity can ensure when the residual capacity of memory meets preset condition
The normal operation of system or application program, at this time without being recycled to the cache file in memory.
In step s 107, unlabelled cache file in memory is recycled.
It when the residual capacity for judging memory is unsatisfactory for preset condition, then needs to recycle cache file, to protect
Hinder the normal operation of application program or system, at this point, the cache file of label is important cache file, then to not marking
The cache file of note is recycled.
The cache file of label can be the corresponding cache file of foreground application, user when using application program,
Naturally it is not intended to this application program to be closed, then unlabelled cache file is recycled, unlabelled cache file pair
The background application answered also is closed naturally, at this point, when opening foreground application again, due to the caching text of the foreground application
Part is not recovered, then can quickly open the application, reduce I/O operation, improves the access speed of file, while ensureing
The normal operation of system or application program.
In conclusion in the embodiment of the present application, when memory is loaded into executable file, according to the category of executable file
Property information judges whether executable file is important cache file, if important cache file, then marks to executable file
Note, judges whether the residual capacity of the memory meets preset condition, if being unsatisfactory for preset condition, recycles and does not mark in memory
The cache file of note.User can generate important cache file and high frequency in the memory of electronic equipment when using electronic equipment
Access file, by judge the residual capacity memory of memory, to unessential cache file and non-high frequency access file into
Row recycling, to reduce by IO number, promotes the speed of access file to retain important cache file.
Referring to Fig. 3, Fig. 3 is the second procedure signal of the recovery method of the cache file provided in the embodiment of the present application
Figure.The recovery method for the cache file recorded in the embodiment of the present application can carry out cache file important in memory
Label locking, recycles unessential file, reduces I/O operation to improve the speed of access file.Wherein specifically include following step
It is rapid:
In step s 201, when memory is loaded into executable file, the attribute information of executable file is obtained.
It is understood that an executable file can be generated in memory when user opens application program, this
When, the attribute information of available executable file, to judge the type of application program.
In step S202, according to attribute information judge executable file whether be foreground application cache file.
By the attribute information of executable file, the type of the corresponding application program of executable file is judged, to sentence
Disconnected executable file whether be executable file whether be foreground application cache file.
If executable file is not the cache file of foreground application, enter step in S203.
If executable file is the cache file of foreground application, enter step in S204.
In step S203, it is not necessary that executable file is marked.
It is understood that if executable file is unessential cache file, in memory memory source deficiency, and
When be recovered, nor affect on the high frequency of user and use application or the normal use of foreground application.
In step S204, executable file is marked.
If judging, the executable file being loaded into for the cache file of foreground application, is marked file, prevents from depositing
When reservoir low memory, the cache file of foreground application is recycled when system recycles cache file, prevents from using
When the application is opened at family next time, I/O operation is re-started, is caused slower using opening speed.
In step S205, judge whether the residual capacity in memory meets preset condition.
It is understood that preset condition can be greater than or equal to limit residual capacity for the remaining capacity value of memory
Value, the limit remaining capacity value are the free memory capability value that system or next application program can operate normally.
When the residual capacity for judging memory meets preset condition, enter step in S206.
When the residual capacity for judging memory is unsatisfactory for preset condition, enter step in S207.
In step S206, without being recycled to cache file.
It is understood that when the free memory capacity of memory meets preset condition, then without to cache file into
Row recycling, to discharge system memory resource, at this point, application program and system can operate normally.
In step S207, priority is correspondingly arranged to unlabelled cache file.
It is understood that in unlabelled cache file, the cache file including background application, but some backstages are answered
With being that user is commonly used, for example, user, which often opens " e-book " application program, sees novel.At this time it is considered that " electronics
The priority of this application program of book " is higher, to unmarked cache file corresponding to " e-book " be arranged higher excellent
First grade.If user only opens " Taobao " once in a while, unmarked cache file setting corresponding to " Taobao " is lower preferential
Grade.Similarly, the priority of unmarked cache file can be arranged in user according to the hobby of oneself, can also answering by user
The priority of unmarked cache file is set with access times.
In step S208, high frequency access cache file and non-high frequency access cache file are identified according to priority.
It is understood that the cache file that priority is higher, then corresponding application program access times of cache file
Higher, then it is also just higher to read the frequency of the cache file of the application for memory.
The lower cache file of priority, then the corresponding application program access times of cache file are also lower, then memory
The frequency for reading the cache file of the application is also just lower.
One preset value can be arranged to priority, greater than the priority of preset value, corresponding cache file is high frequency
Access cache file.The cache file that priority is less than preset value is that non-high frequency accesses file.
In step S209, non-high frequency access cache file is recycled.
It in the free memory off-capacity of memory, needs to recycle cache file, can first recycle at this time non-
High frequency access cache file, with safeguards system or the normal operation of application program.
In step S210, after recycling non-high frequency access file, if the residual capacity of memory is unsatisfactory for default item
Part recycles non-high frequency access cache file according to priority from low to high.
After recycling non-high frequency access cache file, if free memory capacity is still unsatisfactory for preset condition, need
High frequency access cache file is recycled, high frequency access cache file can be recycled according to priority height at this time, it can
First to be recycled to the lower high frequency access cache file of priority, then again to the higher high frequency of priority access file into
Row recycling.
In step S211, judge whether the free memory capacity of memory meets preset condition.
After to the recycling of unlabelled cache file, judge whether the free memory capacity of memory meets default item
Part, to decide whether to continue the cache file that recycling marks.
If the free memory capacity of reservoir meets preset condition, enter step in S212, without the caching to label
File is recycled.
If the free memory capacity of reservoir meets preset condition, enter step in S213, to the cache file of label
Corresponding rank is set.
It is understood that the free memory capacity of memory is unsatisfactory for preset condition, in the cache file of label, first
To the cache file degree of establishment of label, rank is lower, illustrates that the significance level of the cache file of label is lower, if label
The corresponding rank of cache file is higher, then the important Chengdu of cache file is higher.
In step S214, according to the cache file of rank recycling label, preset until the residual capacity of memory meets
Condition.
It can be recycled since the cache file of the lower label of rank, until the residual capacity of memory meets default item
Until part.For example, the corresponding application of cache file of the lower label of rank is " e-book ", and the higher label of rank is slow
Depositing the corresponding application of file is the application of instant messaging class, then first clears up " e-book " corresponding cache file.Until depositing
The free memory capacity of reservoir meets preset condition.
In conclusion, when memory is loaded into executable file, obtaining executable file in embodiment provided by the present application
Attribute information, judge whether executable file is the corresponding cache file of foreground application according to attribute information, if then to can
It executes file to be marked, then judges whether the residual capacity of memory meets preset condition, if not satisfied, then to unlabelled
Cache file is correspondingly arranged priority, is then recycled according to priority to unlabelled cache file, all recycling
After unlabelled cache file, judge whether the residual capacity of memory meets preset condition, if not satisfied, then to label
Cache file degree of establishment, then according to the cache file of rank recycling label, until the free memory capacity in memory is full
Until sufficient preset condition.
By the way that vital document is marked in the embodiment of the present application, important cache file is avoided to provide in memory memory
It is recovered when the deficiency of source, when opening this document next time, reduces I/O operation, improve the speed of access file.
Referring to Fig. 4, Fig. 4 is the first structure diagram of the recyclable device of cache file provided by the embodiments of the present application.
Wherein described device include: first judgment module 410, mark module 420, the second judgment module 430, the first recycling module 440,
Third judgment module 450, rank setup module 460 and the second recycling module 470.
First judgment module 410 is used for when memory is loaded into executable file, according to the attribute of the executable file
Information judges whether the executable file is important cache file.
It is opening in application, memory needs to be loaded into executable file, at this point it is possible to obtain the attribute letter of executable file
Breath, the attribute information of executable file may include the signing messages of file or the identification information of executable file, Huo Zheke
Execute the type etc. of file.
Wherein, the identification information of executable file can be the mark of the corresponding application program of this document, for example, by can
The identification information for executing file, learns that the application is the application program of instant messaging class, it is possible to determine that the application is important
's.It can also learn that the corresponding application program of this document is foreground application by identification information, it is important in systems.
Wherein important cache file can be the master file of the file either application program of system operation, or use
The vital document etc. that family is being edited.
By the attribute information of executable file, judge this document judge whether it is vital document.
Please refer to fig. 5, Fig. 5 is the second structural representation of recyclable device of cache file provided by the embodiments of the present application
Figure.Wherein, first judgment module 410 includes: the first judging submodule 411 and determining submodule 412.
First judging submodule 411, for judge the executable file whether be foreground application cache file.
When user opens application program, an executable file can be generated in memory, at this point it is possible to which obtaining can hold
The attribute information of style of writing part, to judge the type of application program.
By the attribute information of executable file, the type of the corresponding application program of executable file is judged, to sentence
Disconnected executable file whether be executable file whether be foreground application cache file.
Submodule 412 is determined, for determining that the executable file is when first judging submodule is judged as YES
The important cache file.
Mark module 420, for when the first judgment module is judged as YES, the cache file to be marked.
It is understood that cannot be recycled to this document when executable file is important cache file.Such as this can
When executing the master file that file is application program operation, this document is recycled, foreground application closing is will lead to, uses
Family needs to re-start I/O operation, could open the application program when future time opens the corresponding application program of this document,
It will lead to a kind of application program to have already turned on, but be again turned on the problem of still reloading, this reduces answer
With program or the opening speed of file.
Therefore, important cache file is marked in the embodiment of the present application, is prevented in memory low memory, returned
Cache file releasing memory is received, important cache file is caused also to be recovered.
Second judgment module 430, for judging whether the residual capacity of the memory meets preset condition.
It is limit residual capacity when system operates normally that wherein preset condition, which can be the residual capacity of memory, surplus
Remaining memory size is greater than limit residual capacity, then it is assumed that free memory capacity meets preset condition.
When preset condition is also possible to next application program opening, the free memory of the application program can be operated normally
Capacity, when normally next application program can be opened, then it is assumed that free memory capacity meets preset condition.
Preset condition is also possible to memory free memory capacity and current one or more applies committed memory capacity
Ratio be not less than default ratio, i.e., not less than default ratio, free memory capacity be it is enough, meet default
Condition.
Preset condition is also possible to the preset range of free memory capacity, as long as free memory capability value is in preset range
It is interior, then illustrate free memory capacity be it is enough, meet preset condition.
Judged by 430 free memory capacity of first judgment module, it is whether sufficient to obtain free memory capacity.
First recycling module 440 when being judged as NO for first judgment module, recycles unlabelled slow in the memory
Deposit file.
It when the residual capacity for judging memory is unsatisfactory for preset condition, then needs to recycle cache file, to protect
Hinder the normal operation of application program or system, at this point, the cache file of label is important cache file, then to not marking
The cache file of note is recycled.
The cache file of label can be the corresponding cache file of foreground application, user when using application program,
Naturally it is not intended to this application program to be closed, then unlabelled cache file is recycled, unlabelled cache file pair
The background application answered also is closed naturally, at this point, when opening foreground application again, due to the caching text of the foreground application
Part is not recovered, then can quickly open the application, reduce I/O operation, improves the access speed of file, while ensureing
The normal operation of system or application program.
Referring to Fig. 5, wherein the first recycling module 440 further include: submodule 441, identification submodule is arranged in priority
442, non-high frequency recycling submodule 443, high frequency recycle submodule 444.
Submodule 441 is arranged in priority, for being correspondingly arranged priority to the unlabelled cache file.
It is understood that in unlabelled cache file, the cache file including background application, but some backstages are answered
With being that user is commonly used, for example, user, which often opens " e-book " application program, sees novel.At this time it is considered that " electronics
The priority of this application program of book " is higher, to unmarked cache file corresponding to " e-book " be arranged higher excellent
First grade.If user only opens " Taobao " once in a while, unmarked cache file setting corresponding to " Taobao " is lower preferential
Grade.Similarly, the priority of unmarked cache file can be arranged in user according to the hobby of oneself, can also answering by user
The priority of unmarked cache file is set with access times.
Identify submodule 442, it is slow for identifying that high frequency access cache file and non-high frequency access according to the priority
Deposit file.
It is understood that the cache file that priority is higher, then corresponding application program access times of cache file
Higher, then it is also just higher to read the frequency of the cache file of the application for memory.
The lower cache file of priority, then the corresponding application program access times of cache file are also lower, then memory
The frequency for reading the cache file of the application is also just lower.
One preset value can be arranged to priority, greater than the priority of preset value, corresponding cache file is high frequency
Access cache file.The cache file that priority is less than preset value is that non-high frequency accesses file.
Non- high frequency recycles submodule 443, for recycling the non-high frequency access cache file.
It in the free memory off-capacity of memory, needs to recycle cache file, can first recycle at this time non-
High frequency access cache file, with safeguards system or the normal operation of application program.
High frequency recycles submodule 444, is used for after recycling the non-high frequency access file, if the residue of the memory
Capacity is unsatisfactory for preset condition, then recycles the non-high frequency access cache file from low to high according to the priority.
After recycling non-high frequency access cache file, if free memory capacity is still unsatisfactory for preset condition, need
High frequency access cache file is recycled, high frequency access cache file can be recycled according to priority height at this time, it can
First to be recycled to the lower high frequency access cache file of priority, then again to the higher high frequency of priority access file into
Row recycling.
Third judgment module 450, for caching text unlabelled in the memory described in first recycling module recycling
After part, judge whether the residual capacity of the memory meets preset condition.
After to the recycling of unlabelled cache file, judge whether the free memory capacity of memory meets default item
Part, to decide whether to continue the cache file that recycling marks.
Rank setup module 460, if the residual capacity for the memory is unsatisfactory for the preset condition, to mark
Corresponding rank is arranged in the cache file of note.
It is understood that the free memory capacity of memory is unsatisfactory for preset condition, in the cache file of label, first
To the cache file degree of establishment of label, rank is lower, illustrates that the significance level of the cache file of label is lower, if label
The corresponding rank of cache file is higher, then the important Chengdu of cache file is higher.
Second recycling module 470, for recycling the cache file of the label according to the rank, until the memory
Residual capacity meet preset condition.
It can be recycled since the cache file of the lower label of rank, until the residual capacity of memory meets default item
Until part.For example, the corresponding application of cache file of the lower label of rank is " e-book ", and the higher label of rank is slow
Depositing the corresponding application of file is the application of instant messaging class, then first clears up " e-book " corresponding cache file.Until depositing
The free memory capacity of reservoir meets preset condition.
In conclusion, when memory is loaded into executable file, obtaining executable file in embodiment provided by the present application
Attribute information, judge whether executable file is the corresponding cache file of foreground application according to attribute information, if then to can
It executes file to be marked, then judges whether the residual capacity of memory meets preset condition, if not satisfied, then to unlabelled
Cache file is correspondingly arranged priority, is then recycled according to priority to unlabelled cache file, all recycling
After unlabelled cache file, judge whether the residual capacity of memory meets preset condition, if not satisfied, then to label
Cache file degree of establishment, then according to the cache file of rank recycling label, until the free memory capacity in memory is full
Until sufficient preset condition.
By the way that vital document is marked in the embodiment of the present application, important cache file is avoided to provide in memory memory
It is recovered when the deficiency of source, when opening this document next time, reduces I/O operation, improve the speed of access file.
Referring to Fig. 6, Fig. 6 is the structural schematic diagram of electronic equipment provided by the embodiments of the present application.
Electronic equipment 500 includes: display unit 501, input unit 502, memory 503, central processing unit 504, power supply
The components such as 504 and sensor 506.It will be understood by those skilled in the art that electronic devices structure shown in figure is not constituted pair
The restriction of electronic equipment may include perhaps combining certain components or different components than illustrating more or fewer components
Arrangement.Wherein:
Display unit 501 can be used for showing information input by user or the information and electronic equipment that are supplied to user
Various graphical user interface, these graphical user interface can be made of figure, text, icon, video and any combination thereof.
Display unit 501 may include display panel, optionally, can use liquid crystal display (LCD, Liquid Crystal
Display), the forms such as Organic Light Emitting Diode (OLED, Organic Light-Emitting Diode) configure display surface
Plate.Further, touch sensitive surface can cover display panel, after touch sensitive surface detects touch operation on it or nearby,
Central processing unit 504 is sent to determine the type of touch event, subsequent central processing unit 504 exists according to the type of touch event
Corresponding visual output is provided on display panel.Although touch sensitive surface and display panel are as two independent portions in Fig. 6
Part realizes input and input function, but in some embodiments it is possible to touch sensitive surface and display panel is integrated and realize
Output and input function.
Input unit 502 can be used for receiving the number or character information of input, and generate and user setting and function
Control related keyboard, mouse, operating stick, optics or trackball signal input.Specifically, in a specific embodiment
In, input unit 502 may include touch sensitive surface and other input equipments.Touch sensitive surface, also referred to as touch display screen or touching
Control plate, collect user on it or nearby touch operation (such as user using any suitable object such as finger, stylus or
Operation of the attachment on touch sensitive surface or near touch sensitive surface), and corresponding connection dress is driven according to preset formula
It sets.Optionally, touch sensitive surface may include both touch detecting apparatus and touch controller.Wherein, touch detecting apparatus is examined
The touch orientation of user is surveyed, and detects touch operation bring signal, transmits a signal to touch controller;Touch controller from
Touch information is received on touch detecting apparatus, and is converted into contact coordinate, then gives central processing unit 504, and can be received
Order that central processing unit 504 is sent simultaneously is executed.Furthermore, it is possible to using resistance-type, condenser type, infrared ray and surface sound
The multiple types such as wave realize touch sensitive surface.In addition to touch sensitive surface, input unit 502 can also include other input equipments.Specifically
Ground, other input equipments can include but is not limited to physical keyboard, function key (such as volume control button, switch key etc.),
One of trace ball, mouse, operating stick etc. are a variety of.
Memory 503 can be used for storing software program and module, and processor 504 is stored in memory 503 by operation
Software program and module, thereby executing various function application and data processing.Memory 504 can mainly include storage journey
Sequence area and storage data area, wherein storing program area can the (ratio of application program needed for storage program area, at least one function
Such as sound-playing function, image player function) etc.;Storage data area, which can be stored, uses created number according to electronic equipment
According to (such as audio data, phone directory etc.) etc..In addition, memory 503 may include high-speed random access memory, can also wrap
Include nonvolatile memory, a for example, at least disk memory, flush memory device or other volatile solid-state parts.
Correspondingly, memory 503 can also include Memory Controller, to provide processor 504 and input unit 502 to memory
503 access.
Electronic equipment further includes the power supply 505 (such as battery) powered to all parts, it is preferred that power supply can pass through electricity
Management system and central processing unit 504 are logically contiguous, thus by power-supply management system realize management charging, electric discharge and
The functions such as power managed.Power supply 505 can also include one or more direct current or AC power source, recharging system, electricity
The random components such as source fault detection circuit, power adapter or inverter, power supply status indicator.
Electronic equipment may also include at least one sensor 506, such as optical sensor, pressure sensor, motion sensor
And other sensors.Specifically, optical sensor may include ambient light sensor and proximity sensor, wherein ambient light sensing
Device can adjust the brightness of display panel according to the light and shade of ambient light, and proximity sensor can be moved in one's ear in electronic equipment
When, close display panel and/or backlight.As a kind of motion sensor, gravity accelerometer can detect all directions
The size of upper (generally three axis) acceleration, can detect that size and the direction of gravity, can be used to identify mobile phone posture when static
Application (such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function (for example pedometer, strikes
Hit) etc.;Other biographies such as gyroscope, barometer, hygrometer, thermometer, infrared sensor for can also configure as electronic equipment
Sensor, details are not described herein.
Although being not shown, electronic equipment can also include camera, bluetooth module etc., and details are not described herein.Specifically at this
In embodiment, the central processing unit 504 in electronic equipment can be according to following instruction, by one or more application program
The corresponding executable file of process be loaded into memory 503, and be stored in memory by central processing unit 504 to run
Application program in 503, to realize various functions:
When memory is loaded into executable file, the executable text is judged according to the attribute information of the executable file
Whether part is important cache file;
If important cache file, then the executable file is marked;
Judge whether the residual capacity of the memory meets preset condition;
If being unsatisfactory for the preset condition, unlabelled cache file in the memory is recycled.
It will appreciated by the skilled person that all or part of the steps in the various methods of above-described embodiment can be with
It is completed by instructing, or relevant hardware is controlled by instruction to complete, which can store computer-readable deposits in one
In storage media, and is loaded and executed by processor.
For this purpose, the embodiment of the present application provides a kind of storage medium, wherein being stored with a plurality of instruction, which can be processed
Device is loaded, to execute the step in the recovery method of any cache file provided by the embodiment of the present application.For example, should
Instruction can execute following steps:
When memory is loaded into executable file, the executable text is judged according to the attribute information of the executable file
Whether part is important cache file;
If important cache file, then the executable file is marked;
Judge whether the residual capacity of the memory meets preset condition;
If being unsatisfactory for the preset condition, unlabelled cache file in the memory is recycled.
The specific implementation of above each operation can be found in the embodiment of front, and details are not described herein.
Wherein, which may include: read-only memory (ROM, Read Only Memory), random access memory
Body (RAM, Random Access Memory), disk or CD etc..
By the instruction stored in the storage medium, any caching text provided by the embodiment of the present application can be executed
Step in the recovery method of part, it is thereby achieved that the recycling side of any cache file provided by the embodiment of the present application
Beneficial effect achieved by method is detailed in the embodiment of front, and details are not described herein.
Above to a kind of recovery method of cache file, device, electronic equipment and storage provided by the embodiment of the present application
Medium is described in detail, and specific examples are used herein to illustrate the principle and implementation manner of the present application, with
The explanation of upper embodiment is merely used to help understand the present processes and its core concept;Meanwhile for the technology of this field
Personnel, according to the thought of the application, there will be changes in the specific implementation manner and application range, in conclusion this theory
Bright book content should not be construed as the limitation to the application.
Claims (11)
1. a kind of recovery method of cache file, which is characterized in that the described method includes:
When memory is loaded into executable file, judge that the executable file is according to the attribute information of the executable file
No is important cache file;
If important cache file, then the executable file is marked;
Judge whether the residual capacity of the memory meets preset condition;
If being unsatisfactory for the preset condition, unlabelled cache file in the memory is recycled.
2. the recovery method of cache file according to claim 1, which is characterized in that do not marked in recycling the memory
After the cache file of note, the method also includes:
Judge whether the residual capacity of the memory meets preset condition;
If being unsatisfactory for the preset condition, corresponding rank is arranged to the cache file of label;
The cache file of the label is recycled according to the rank, until the residual capacity of the memory meets preset condition.
3. the recovery method of cache file according to claim 1, which is characterized in that in the recycling memory not
The cache file of label, comprising:
Priority is correspondingly arranged to the unlabelled cache file;
According to priority recycling is unlabelled cache file.
4. the recovery method of cache file according to claim 3, which is characterized in that described to be recycled according to the priority
Described is unlabelled cache file, comprising:
High frequency access cache file and non-high frequency access cache file are identified according to the priority;
Recycle the non-high frequency access cache file;
After recycling the non-high frequency access file, if the residual capacity of the memory is unsatisfactory for preset condition, basis
The priority recycles the non-high frequency access cache file from low to high.
5. the recovery method of cache file according to claim 1, which is characterized in that described according to the executable file
Attribute information judge whether the executable file is important cache file, comprising:
Judge the executable file whether be foreground application cache file;
If so, determining that the executable file is the important cache file.
6. a kind of recyclable device of cache file, which is characterized in that described device includes:
First judgment module, for being sentenced according to the attribute information of the executable file when memory is loaded into executable file
Whether the executable file that breaks is important cache file;
Mark module, for when the first judgment module is judged as YES, the cache file to be marked;
Second judgment module, for judging whether the residual capacity of the memory meets preset condition;
First recycling module, it is unlabelled slow in the memory for recycling when second judgment module is judged as NO
Deposit file.
7. the recyclable device of cache file according to claim 6, which is characterized in that described device further include:
Third judgment module, after unlabelled cache file in the memory described in first recycling module recycling,
Judge whether the residual capacity of the memory meets preset condition;
Rank setup module, for the cache file of label being arranged corresponding when the third judgment module is judged as NO
Rank;
Second recycling module, for recycling the cache file of the label according to the rank, until the residue of the memory
Capacity meets preset condition.
8. the recyclable device of cache file according to claim 6, which is characterized in that first recycling module includes:
Submodule is arranged in priority, for being correspondingly arranged priority to the unlabelled cache file;
Submodule is identified, for identifying high frequency access cache file and non-high frequency access cache file according to the priority;
Non- high frequency recycles submodule, for recycling the non-high frequency access cache file;
High frequency recycles submodule, is used for after recycling the non-high frequency access file, if the residual capacity of the memory is not
Meet preset condition, then the non-high frequency access cache file is recycled according to the priority from low to high.
9. the recyclable device of cache file according to claim 6, which is characterized in that the first judgment module includes:
First judging submodule, for judge the executable file whether be foreground application cache file;
Submodule is determined, for when first judging submodule is judged as YES, determining that the executable file is described heavy
Want cache file.
10. a kind of electronic equipment characterized by comprising
The memory for being stored with executable program code, the processor coupled with the memory;
The processor calls the executable program code stored in the memory, executes as claim 1 to 5 is any
Step in the recovery method of cache file described in.
11. a kind of storage medium, which is characterized in that the storage medium is stored with a plurality of instruction, and described instruction is suitable for processor
It is loaded, the step in the recovery method of 1 to 5 described in any item cache files is required with perform claim.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910390226.XA CN110134652A (en) | 2019-05-10 | 2019-05-10 | Recovery method, device, electronic equipment and the storage medium of cache file |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910390226.XA CN110134652A (en) | 2019-05-10 | 2019-05-10 | Recovery method, device, electronic equipment and the storage medium of cache file |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110134652A true CN110134652A (en) | 2019-08-16 |
Family
ID=67573236
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910390226.XA Pending CN110134652A (en) | 2019-05-10 | 2019-05-10 | Recovery method, device, electronic equipment and the storage medium of cache file |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110134652A (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111488316A (en) * | 2020-04-12 | 2020-08-04 | 杭州迪普科技股份有限公司 | File cache recovery method and device |
CN112947859A (en) * | 2021-02-26 | 2021-06-11 | 拉卡拉支付股份有限公司 | Temporary file processing method, device, electronic equipment, medium and program product |
CN113609082A (en) * | 2021-06-25 | 2021-11-05 | 苏州浪潮智能科技有限公司 | File system defragmentation method, device and storage medium |
CN115061945A (en) * | 2022-06-28 | 2022-09-16 | 珠海豹趣科技有限公司 | Garbage recycling method and device for luajit |
CN115390752A (en) * | 2022-08-10 | 2022-11-25 | 中科豪联(杭州)技术有限公司 | Multi-disk cache file management method |
CN115481444A (en) * | 2022-11-10 | 2022-12-16 | 荣耀终端有限公司 | File protection method and electronic equipment |
CN116185890A (en) * | 2023-04-23 | 2023-05-30 | 荣耀终端有限公司 | Memory recycling method and electronic equipment |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102609363A (en) * | 2012-02-01 | 2012-07-25 | 蓝汛网络科技(北京)有限公司 | Cache server and ageing method for same |
CN103019962A (en) * | 2012-12-21 | 2013-04-03 | 华为技术有限公司 | Data cache processing method, device and system |
CN105808447A (en) * | 2016-03-29 | 2016-07-27 | 海信集团有限公司 | Memory reclaiming method and device for terminal device |
US9582559B1 (en) * | 2012-06-29 | 2017-02-28 | EMC IP Holding Company LLC | Multi-site storage system with replicated file system synchronization utilizing virtual block storage appliances |
CN106649146A (en) * | 2013-05-21 | 2017-05-10 | 青岛海信移动通信技术股份有限公司 | Memory release method and apparatus |
CN106960028A (en) * | 2017-03-20 | 2017-07-18 | 上海与德科技有限公司 | The management method and managing device of a kind of terminal document |
CN108121783A (en) * | 2017-12-19 | 2018-06-05 | 深圳创维数字技术有限公司 | A kind of automatic cleaning method, device, computer and storage medium for storing data |
CN108959505A (en) * | 2018-06-27 | 2018-12-07 | 平安科技(深圳)有限公司 | A kind of method and terminal device of management caching picture |
CN109299297A (en) * | 2018-07-06 | 2019-02-01 | 平安科技(深圳)有限公司 | A kind of image cache method for cleaning and terminal device |
CN109324983A (en) * | 2017-07-31 | 2019-02-12 | 武汉斗鱼网络科技有限公司 | A kind of method, storage medium, equipment and the system of automatic cleaning cache file |
CN109656603A (en) * | 2019-01-15 | 2019-04-19 | Oppo广东移动通信有限公司 | Method for upgrading system, device, storage medium and electronic equipment |
-
2019
- 2019-05-10 CN CN201910390226.XA patent/CN110134652A/en active Pending
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102609363A (en) * | 2012-02-01 | 2012-07-25 | 蓝汛网络科技(北京)有限公司 | Cache server and ageing method for same |
US9582559B1 (en) * | 2012-06-29 | 2017-02-28 | EMC IP Holding Company LLC | Multi-site storage system with replicated file system synchronization utilizing virtual block storage appliances |
CN103019962A (en) * | 2012-12-21 | 2013-04-03 | 华为技术有限公司 | Data cache processing method, device and system |
CN106649146A (en) * | 2013-05-21 | 2017-05-10 | 青岛海信移动通信技术股份有限公司 | Memory release method and apparatus |
CN105808447A (en) * | 2016-03-29 | 2016-07-27 | 海信集团有限公司 | Memory reclaiming method and device for terminal device |
CN106960028A (en) * | 2017-03-20 | 2017-07-18 | 上海与德科技有限公司 | The management method and managing device of a kind of terminal document |
CN109324983A (en) * | 2017-07-31 | 2019-02-12 | 武汉斗鱼网络科技有限公司 | A kind of method, storage medium, equipment and the system of automatic cleaning cache file |
CN108121783A (en) * | 2017-12-19 | 2018-06-05 | 深圳创维数字技术有限公司 | A kind of automatic cleaning method, device, computer and storage medium for storing data |
CN108959505A (en) * | 2018-06-27 | 2018-12-07 | 平安科技(深圳)有限公司 | A kind of method and terminal device of management caching picture |
CN109299297A (en) * | 2018-07-06 | 2019-02-01 | 平安科技(深圳)有限公司 | A kind of image cache method for cleaning and terminal device |
CN109656603A (en) * | 2019-01-15 | 2019-04-19 | Oppo广东移动通信有限公司 | Method for upgrading system, device, storage medium and electronic equipment |
Non-Patent Citations (1)
Title |
---|
杜书猛: "混合云环境下基于Hadoop的内存级缓存策略优化研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111488316A (en) * | 2020-04-12 | 2020-08-04 | 杭州迪普科技股份有限公司 | File cache recovery method and device |
CN111488316B (en) * | 2020-04-12 | 2023-09-22 | 杭州迪普科技股份有限公司 | File cache recovery method and device |
CN112947859A (en) * | 2021-02-26 | 2021-06-11 | 拉卡拉支付股份有限公司 | Temporary file processing method, device, electronic equipment, medium and program product |
CN113609082A (en) * | 2021-06-25 | 2021-11-05 | 苏州浪潮智能科技有限公司 | File system defragmentation method, device and storage medium |
CN113609082B (en) * | 2021-06-25 | 2023-07-18 | 苏州浪潮智能科技有限公司 | File system defragmentation method, device and storage medium |
CN115061945A (en) * | 2022-06-28 | 2022-09-16 | 珠海豹趣科技有限公司 | Garbage recycling method and device for luajit |
CN115390752A (en) * | 2022-08-10 | 2022-11-25 | 中科豪联(杭州)技术有限公司 | Multi-disk cache file management method |
CN115481444A (en) * | 2022-11-10 | 2022-12-16 | 荣耀终端有限公司 | File protection method and electronic equipment |
CN115481444B (en) * | 2022-11-10 | 2023-03-31 | 荣耀终端有限公司 | File protection method and electronic equipment |
CN116185890A (en) * | 2023-04-23 | 2023-05-30 | 荣耀终端有限公司 | Memory recycling method and electronic equipment |
CN116185890B (en) * | 2023-04-23 | 2023-09-19 | 荣耀终端有限公司 | Memory recycling method and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110134652A (en) | Recovery method, device, electronic equipment and the storage medium of cache file | |
CN103530040B (en) | Object element moving method, device and electronic equipment | |
CN110069306A (en) | A kind of message display method and terminal device | |
US20170003812A1 (en) | Method for providing a feedback in response to a user input and a terminal implementing the same | |
JP6068660B2 (en) | Character selection method, character selection device, terminal device, program, and recording medium | |
CN103154875A (en) | Alert display on a portable electronic device | |
CN106973099A (en) | A kind of data-updating method, apparatus and system | |
CN108595218A (en) | A kind of method and apparatus of loading system dynamic base | |
CN106201427A (en) | A kind of application program launching method and terminal unit | |
CN110221885A (en) | A kind of interface display method and terminal device | |
CN110489025A (en) | Interface display method and terminal device | |
CN107300417A (en) | Detection method, device, storage medium and the terminal of ambient light | |
CN106527888A (en) | Screen-sliding page searching method and device | |
CN110032473A (en) | Data guard method, device, electronic equipment and system | |
JPWO2010095255A1 (en) | Information processing apparatus, display control method, and display control program | |
CN107390922A (en) | virtual touch control method, device, storage medium and terminal | |
US9377949B2 (en) | Method and terminal device for selecting character | |
CN109195206A (en) | Control method, storage medium and the electronic equipment of display screen state | |
CN106933576A (en) | A kind of terminal unlock method, device and computer equipment | |
CN106886351A (en) | A kind of display methods of terminal time information, device and computer equipment | |
CN106709330A (en) | Method and device for recording file execution behavior | |
CN114546113B (en) | Menu operation method and device, storage medium and electronic equipment | |
CN107069844B (en) | Charging method, device and terminal | |
CN113901001B (en) | File identification processing method and device | |
CN113641292B (en) | Method and electronic equipment for operating on touch screen |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190816 |
|
RJ01 | Rejection of invention patent application after publication |