CN108121783A - A kind of automatic cleaning method, device, computer and storage medium for storing data - Google Patents

A kind of automatic cleaning method, device, computer and storage medium for storing data Download PDF

Info

Publication number
CN108121783A
CN108121783A CN201711372057.4A CN201711372057A CN108121783A CN 108121783 A CN108121783 A CN 108121783A CN 201711372057 A CN201711372057 A CN 201711372057A CN 108121783 A CN108121783 A CN 108121783A
Authority
CN
China
Prior art keywords
file
clearance
data
accounting value
capacity
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201711372057.4A
Other languages
Chinese (zh)
Inventor
方圆
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Skyworth Digital Technology Co Ltd
Original Assignee
Shenzhen Skyworth Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Skyworth Digital Technology Co Ltd filed Critical Shenzhen Skyworth Digital Technology Co Ltd
Priority to CN201711372057.4A priority Critical patent/CN108121783A/en
Publication of CN108121783A publication Critical patent/CN108121783A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/162Delete operations

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (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 invention discloses a kind of automatic cleaning method, device, computer and storage medium for storing data, this method includes:It obtains the current of data partition and has used spatial content;According to currently having used capacity accounting value with what the gross space capacity of spatial content and data partition determined data partition;According to determining data scrubbing strategy with capacity accounting value;File for clearance is determined according to data scrubbing strategy, and deletes file for clearance.The effect for clearing up data automatically in the case of user's unaware is realized, improves the experience sense of user, while avoids the system performance caused by memory space inadequate and declines.

Description

A kind of automatic cleaning method, device, computer and storage medium for storing data
Technical field
The present embodiments relate to field of communication technology more particularly to it is a kind of store the automatic cleaning methods of data, device, Computer and storage medium.
Background technology
With the development of the communication technology, the function of the equipment such as computer and intelligent terminal is stronger and stronger.User is Meet demand, the application software installed in the terminal are also more and more.Application software can often generate largely in use Temporary file, the internal storage space for causing terminal is fewer and fewer, so as to can not continue to install other application software, and So that operating system is slow, the experience sense of user is reduced.
At present, intelligent terminal such as Intelligent set top box clears up garbage files by installing third party's cleaning application software.But It is that third party's cleaning application software needs user oneself that application market is gone to be downloaded, and manually clicks on and remove button Side starts scale removal process.Obviously, the mode of this manual cleaning garbage files is complex, and for that will not install and make It is cleared up with third party for the user of application software, data scrubbing can not be carried out using this manual mode.
The content of the invention
The embodiment of the present invention provides a kind of automatic cleaning method, device, computer and storage medium for storing data, with reality Data are cleared up automatically in the case of present user's unaware.
In a first aspect, an embodiment of the present invention provides it is a kind of store data automatic cleaning method, including:
It obtains the current of data partition and has used spatial content;
According to described currently the data partition has been determined with the gross space capacity of spatial content and the data partition Capacity accounting value is used;
According to described data scrubbing strategy has been determined with capacity accounting value;
File for clearance is determined according to the data scrubbing strategy, and deletes the file for clearance.
Second aspect, the embodiment of the present invention additionally provide a kind of automatic cleaning apparatus for storing data, including:
Spatial content acquisition module has been used, spatial content has been used for obtaining the current of data partition;
Capacity accounting value determining module is used, for current having used the total of spatial content and the data partition according to described What spatial content determined the data partition has used capacity accounting value;
Data scrubbing strategy determining module, for determining data scrubbing strategy with capacity accounting value according to;
File determining module for clearance, for determining file for clearance according to the data scrubbing strategy;
File removing module for clearance, for deleting the file for clearance.
The third aspect, the embodiment of the present invention additionally provide a kind of computer, including memory, processor and are stored in storage On device and the computer program that can run on a processor, the processor are realized when performing described program as the present invention is arbitrary real Apply the automatic cleaning method of the storage data described in example.
Fourth aspect, the embodiment of the present invention additionally provide a kind of computer readable storage medium, are stored thereon with computer Program realizes the automatic cleaning method of the storage data as described in any embodiment of the present invention when the program is executed by processor.
The embodiment of the present invention obtains current data partition capacity accounting value by equipment automatically, according to it is different Different data scrubbing strategies is determined with capacity accounting value, and further determines that each data scrubbing strategy is corresponding for clearance File, and delete file for clearance, realizes equipment and clears up data automatically in the case of user's unaware, without downloading the Tripartite clears up application software, cleaning instruction is sent without user, in the case where avoiding the system performance caused by memory space inadequate In the case of drop, device intelligence is improved, improves the experience sense of user.
Description of the drawings
Fig. 1 is a kind of flow chart of the automatic cleaning method for storage data that the embodiment of the present invention one provides;
Fig. 2 is a kind of flow chart of automatic cleaning method for storing data provided by Embodiment 2 of the present invention;
Fig. 3 is a kind of flow chart of the automatic cleaning method for storage data that the embodiment of the present invention three provides;
Fig. 4 is a kind of structure diagram of the automatic cleaning apparatus for storage data that the embodiment of the present invention four provides;
Fig. 5 is a kind of structure diagram for computer that the embodiment of the present invention five provides.
Specific embodiment
The present invention is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched The specific embodiment stated is used only for explaining the present invention rather than limitation of the invention.It also should be noted that in order to just Part related to the present invention rather than entire infrastructure are illustrated only in description, attached drawing.
Embodiment one
A kind of flow chart of the automatic cleaning method for storage data that Fig. 1 provides for the embodiment of the present invention one, the present embodiment Situation data cached in cleaning memory space is applicable to, this method can be applied to computer and intelligent terminal etc. and carry out data The situation of cleaning, the situation of data scrubbing in being particularly suitable in set-top-box opening to set-top box, this method can be by storing The automatic cleaning apparatus of data performs, and specifically comprises the following steps:
Step 110, the current of acquisition data partition have used spatial content.
Wherein, data (data) subregion is for storage and point of application related data in storage inside (Flash) Area.The size of the current residual space capacity of data partition directly affects the speed of terminal operating speed.When working as data partition , it is necessary to the hash in data partition be cleared up, to ensure larger memory space when preceding remaining space capacity is smaller And faster terminal operating speed.It can be received after starting up of terminal with spatial content to obtain the current of data partition It is obtained during start broadcast or in order to avoid exception occurs in starting up of terminal, when being spaced one section after receiving start broadcast Between obtain, can also be terminal startup after timing acquisition.
Step 120, basis have currently determined having used for data partition with the gross space capacity of spatial content and data partition Capacity accounting value.
Wherein, will currently data partition be determined as with the ratio of spatial content and the gross space capacity of data partition With capacity accounting value.Optionally, according to residual capacity accounting value can also be calculated with capacity accounting value.In the present embodiment, The storage size of present terminal can be characterized with capacity accounting value or residual capacity accounting value, so being accounted for capacity Whether ratio or residual capacity accounting value can be as clearing up data and how to clear up the basis for estimation of data.
Step 130, basis determine data scrubbing strategy with capacity accounting value.
Wherein, different data scrubbing strategies can be determined with capacity accounting value according to different so that data scrubbing More targeted and diversity.
Optionally, step 130 specifically includes:
If capacity accounting value has been used to be more than or equal to the first default accounting value, data scrubbing strategy is cleaning application software number Meet the file and subdirectory of the first preset condition according to this and in cleaning safe digital card sdcard catalogues;If capacity accounting is used Value is more than or equal to the second default accounting value and less than the first default accounting value, then data scrubbing strategy is cleaning application of software data And meet the file and subdirectory of the second preset condition in cleaning sdcard catalogues;If capacity accounting value is used to be more than or equal to the Three preset accounting values and less than the second default accounting value, then data scrubbing strategy is cleaning application of software data and cleaning Meet the file and subdirectory of the 3rd preset condition in sdcard catalogues;If capacity accounting value is used to be less than the 3rd default accounting Value, then data scrubbing strategy is without clearing up data manipulation;Wherein, the first default accounting value, the second default accounting value and the Three default accounting values are sequentially reduced.
It should be noted that the 3rd default accounting value can be as the spatial content accounting threshold without data scrubbing operation Value.When capacity accounting value has been used to be less than the 3rd default accounting value, representing terminal, the speed of service is being just under the storage space volume Often, the phenomenon that being not in interim card, data scrubbing operation need not be carried out.It is default when capacity accounting value has been used to be more than or equal to the 3rd , it is necessary to be met accordingly in application of software data and safe digital card sdcard catalogues by clearing up in data partition during accounting value Preset condition file and subdirectory, to discharge memory space, and ensure use capacity accounting value less than space after release Capacity accounting threshold value, so that normal operation of terminal.
Optionally, meeting the file of the first preset condition and subdirectory includes:Meet the first preset format the first file, The subdirectory for meeting the second preset format, the audio file, the image text of the 4th preset format of satisfaction that meet the 3rd preset format Part, the video file for meeting the 5th preset format and satisfaction occupy the single file that memory space is more than default value;
The file and subdirectory for meeting the second preset condition include:Meet the first file of the first preset format, meet the The subdirectory of two preset formats, the audio file for meeting the 3rd preset format and the image file for meeting the 4th preset format;
The file and subdirectory for meeting the 3rd preset condition include:Meet the first file and satisfaction of the first preset format The subdirectory of second preset format.
Wherein, it is bigger with capacity accounting value, it is necessary to cleaning data it is then more.Illustratively, the first default accounting value Such as can be 90%, the second default accounting value for example can be 70%, and the 3rd default accounting value for example can be 50%, optional , it can Bu Tong use the speed of service of capacity accounting value true according to user demand and terminal that above three, which presets accounting value, Fixed, the numerical value for presetting accounting value in the present embodiment to above three is not specifically limited.It is more than or equal to when with capacity accounting value During the first default accounting value, except to clear up the first file for meeting corresponding preset format, subdirectory, audio file, image text Outside part, shared memory is larger for these opposite files video file and occupy memory space more than present count are also cleared up The single file of value.Optionally, default value could be provided as 10M, i.e. cleaning occupies the single text that memory space is more than 10M Part.First file refers to that file format belongs to the file of the first preset format, and illustratively, the first file can be included but not It is confined to:The entitled apk, log of suffix, tmp, temp, pgf, m4a, fsb, trc, dat, bytes, mqcc, assetbundle, The text of txt, xml, zip, bdcfg, obb, diff, jar, npk, gla, pak, org, unity3d, bin, log, mmap2 or dat Part.Meeting the subdirectory of the second preset format can include but is not limited to:The entitled cache, dailylog of catalogue, dailylognew、crashlog、uil-images、vcache、launcher_cache、screenshot、force_apps_ The subdirectory of cache, bg_pic_cache or log.Meeting the audio file of the 3rd preset format can include but is not limited to: The entitled mp3, m4a of suffix, wav, amr, awb, aac, flac, mid, midi, xmf, rtttl, rtx, ota, wma, ra, mka, The audio file of m3u or pls.Meeting the image file of the 4th preset format can include but is not limited to:The entitled jpg of suffix, The image file of jpeg, gif, png, bmp or wbmp.Meeting the video file of the 5th preset format can include but not limit to In:The entitled mpeg, mp4 of suffix, mov, m4v, 3gp, 3gpp, 3g2,3gpp2, avi, divx, wmv, asf, flv, mkv, mpg, The video file of rmvb, rm, vob or f4v.
Step 140 determines file for clearance according to data scrubbing strategy, and deletes file for clearance.
Wherein, the data scrubbing strategy determined according to step 130 further determines that file for clearance.File for clearance determines Afterwards, file for clearance is deleted, to discharge memory space, the system performance caused by memory space inadequate is avoided to decline. In the present embodiment, due to need not during hash in cleaning application of software data and safe digital card sdcard catalogues User participates in, it is possible to data is cleared up automatically in the case of user's unaware, so as to improve user experience.
Optionally, file for clearance is determined according to data scrubbing strategy in step 140, including:
Obtain current mounted application software list;The caching mesh of each application software in traversal applications software matrix Record, is determined as file for clearance by All Files in CACHE DIRECTORY.
Wherein, the cleaning of application data is by obtaining current mounted application software list, and traversal is each should The file for clearance in application data is determined with the CACHE DIRECTORY of software, and then deletes file for clearance, it is clear to realize Manage application data.Each application software corresponds to a CACHE DIRECTORY.Since the file in CACHE DIRECTORY is that can clear up , so in order to discharge the memory space of bigger, it can be by the CACHE DIRECTORY of each application software in all application software lists Under All Files be all determined as file for clearance.
Optionally, file for clearance is determined according to data scrubbing strategy in step 140, further included:
The preset condition of file for clearance in sdcard catalogues is determined according to data scrubbing strategy;Obtain sdcard catalogues; Travel through each file and subdirectory in sdcard catalogues, and will meet the preset condition of file for clearance file and subdirectory it is true It is set to file for clearance.
Wherein, the default item that the file for clearance needs in sdcard catalogues meet can be determined according to data scrubbing strategy Part determines file for clearance according to the corresponding preset condition of data scrubbing strategy.After obtaining sdcard catalogues, travel through and detect Whether each file and subdirectory meet the preset condition of file for clearance in sdcard catalogues, if so, being determined as clearance File.In the present embodiment, by using preset condition, the partial document under the selective catalogue by sdcard is determined as clearance File so that the cleaning of file is more targeted, will not delete vital document by mistake.
Illustratively, if data scrubbing strategy is cleaning application of software data and cleaning safe digital card sdcard catalogues The middle file and subdirectory for meeting the first preset condition, then determine the file in the CACHE DIRECTORY of all application software in terminal For file for clearance, while All Files and subdirectory in sdcard catalogues are detected, the file of above-mentioned suffix name condition will be met And meet the subdirectory of above-mentioned directory name condition and be determined as file for clearance.It is entitled by suffix name and catalogue in the present embodiment Basis of characterization determines file for clearance, convenient and efficient, and resolution is high, and memory source caused by avoiding sophisticated identification mode disappears Consumption.
The embodiment of the present invention obtains current data partition capacity accounting value by equipment automatically, according to it is different Different data scrubbing strategies is determined with capacity accounting value, and further determines that each data scrubbing strategy is corresponding for clearance File, and delete file for clearance, realizes equipment and clears up data automatically in the case of user's unaware, without downloading the Tripartite clears up application software, cleaning instruction is sent without user, in the case where avoiding the system performance caused by memory space inadequate In the case of drop, device intelligence is improved, improves the experience sense of user.
Embodiment two
Fig. 2 be it is provided by Embodiment 2 of the present invention it is a kind of store data automatic cleaning method flow chart, the present embodiment It is optimized on the basis of above-described embodiment, after file for clearance is determined according to data scrubbing strategy, it is also necessary to detect It whether there is vital document in file for clearance.
After optimization, a kind of automatic cleaning method for storing data specifically includes following steps:
Step 210, the current of acquisition data partition have used spatial content.
Step 220, basis have currently determined having used for data partition with the gross space capacity of spatial content and data partition Capacity accounting value.
Step 230, basis determine data scrubbing strategy with capacity accounting value.
Step 240 determines file for clearance according to data scrubbing strategy.
If in step 250, file for clearance, there are vital documents, it is determined that shared by the file for clearance in addition to vital document Spatial content to be released.And perform step 270.
Wherein, vital document is provided with vital document mark.It, will be in data partition according to user demand in the present embodiment Some files pre-set vital document mark, and to characterize these files as vital document, vital document mark can be pre- If symbol, figure, image or logical bit " 1 " or " 0 ".There may be weights in the file for clearance determined according to step 240 File is wanted, so, it is necessary to detect with the presence or absence of vital document in file for clearance, to avoid deletion before file for clearance is deleted Vital document.Wherein, spatial content to be released is the memory space shared by the file for clearance in addition to vital document.
If file for clearance is deleted there is no vital document in step 260, file for clearance.
Wherein, there is no vital document in file for clearance, can directly delete file for clearance.
Step 270 has determined the object space capacity after clearing up with spatial content and spatial content to be released according to current.
Wherein, object space capacity is currently to subtract spatial content to be released with spatial content, obtained result.
If step 280, object space capacity meet cleaning condition, the file for clearance in addition to vital document is deleted.
Wherein, cleaning condition can be configured with spatial content threshold value according to default, can also be pre- according to the 3rd It is configured with spatial content if accounting value is corresponding.Spatial content threshold value or the 3rd default accounting value has wherein been used to correspond to Be that terminal can be with the corresponding minimum value for having used volume space of normal operation with spatial content.Therefore cleaning condition can be set It is set to:Less than being preset with spatial content threshold value or the 3rd, accounting value is corresponding to have used spatial content to object space capacity.This Whether object space capacity meets cleaning condition in embodiment, as judges whether object space capacity is less than and has used spatial content Threshold value or the 3rd default accounting value is corresponding has used spatial content.If so, characterization meets cleaning condition, do not have to delete at this time Vital document is it is also possible that normal operation of terminal;If it is not, then characterization is unsatisfactory for cleaning condition, need to delete vital document at this time It can just cause normal operation of terminal.
Wherein, after the spatial content to be released shared by the file for clearance in addition to vital document is discharged, obtain Meet cleaning condition with spatial content, need to only delete the file for clearance in addition to vital document at this time, it is important without deleting File carrys out further Free up Memory capacity.
If step 290, object space capacity are unsatisfactory for cleaning condition, vital document cleaning prompting message is generated.
Wherein, object space capacity is unsatisfactory for cleaning condition, needs to delete the file for clearance for including vital document at this time, To discharge more spatial contents, and make normal operation of terminal.In the present embodiment, before vital document is deleted, generation weight It wants file clean-up prompting message and is shown on terminal interface, to remind whether user deletes vital document, root It determines to delete the vital document according to user feedback, then the file for clearance for including vital document is directly deleted, if user feedback is The vital document is not deleted, then user is reminded separately to back up the vital document, and is deleted after backup is determined.
The embodiment of the present invention according to data scrubbing strategy after file for clearance is determined, if recognizing in file for clearance There are vital documents, it is determined that after the spatial content to be released shared by file for clearance and cleaning in addition to vital document Object space capacity;If object space capacity meets cleaning condition, the file for clearance in addition to vital document is deleted;If target Spatial content is unsatisfactory for cleaning condition, then generates vital document cleaning prompting message.So as to avoid in the ignorant situation of user Under delete vital document in file for clearance, improve the experience sense of user.
Embodiment three
A kind of flow chart of the automatic cleaning method for storage data that Fig. 3 provides for the embodiment of the present invention three, the present embodiment It is optimized on the basis of above-described embodiment, after file for clearance is determined according to data scrubbing strategy, it is thus necessary to determine that treat The file hierarchies of cleaning, and delete the corresponding file for clearance of file hierarchies for clearance.
After optimization, a kind of automatic cleaning method for storing data specifically includes following steps:
Step 310, the current of acquisition data partition have used spatial content.
Step 320, basis have currently determined having used for data partition with the gross space capacity of spatial content and data partition Capacity accounting value.
Step 330, basis determine data scrubbing strategy with capacity accounting value.
Step 340 determines file for clearance according to data scrubbing strategy.
Step 350, the division for carrying out file hierarchies to file for clearance according to cleaning priority and/or document time.
Wherein, the cleaning priority of each file can be pre-set in data partition, can also be according to user The frequency clicked on or used determines.Illustratively, the frequency clicked on or used is higher, and cleaning priority is higher.It clears up excellent First grade refers to the significance level of file.Cleaning priority is higher, and corresponding file is more important, so clear first during cleaning file Manage the low file of priority.Optionally, cleaning priority can be divided into the first file hierarchies, the second file hierarchies and the 3rd file Grade, and machine increases corresponding priority successively.Optionally, document time is the creation time of file, due to the establishment of file Time is different, it is possible to using a prefixed time interval as a file hierarchies, so as to divide documents into multiple files etc. Grade, the creation time of file is more early, and file hierarchies are lower, then it represents that the significance level of file is lower.Optionally, each file etc. The corresponding prefixed time interval of grade can be identical or different.Illustratively, the prefixed time interval of each file hierarchies can be One day or a week, such as the file that the file created on November 26th, 2017 is the first file hierarchies, at 2017 11 The file that the moon 27 created is the file of the second file hierarchies, is the 3rd file hierarchies in the file that on November 28th, 2017 creates File.The prefixed time interval of each file hierarchies can also temporally range incrementation, for example, being earned every day November 28 in 2017 The file built is the file of the 3rd file hierarchies, the file created in November 21 days to 2017 November in 2017 27 Time of Day For the file of the second file hierarchies, the file created in November 21 days to 2017 October in 2017 20 Time of Day is the first text The file of part grade.In the present embodiment, the more late file of creation time is determined that file hierarchies are higher, avoids the newest establishment of user File cannot back up or apply in time.
In the present embodiment, can according to the cleaning priority of each file in file for clearance, to file for clearance into Row division, to obtain the corresponding file for clearance of each file hierarchies.It can also be according to the text of each file in file for clearance The part time divides file for clearance, to obtain the corresponding file for clearance of each file hierarchies.It can also be according to cleaning Priority and document time divide file for clearance, to the elder generation according to cleaning priority and document time in the present embodiment Order does not limit afterwards.Such as:After can first being divided according to cleaning priority to file for clearance, further according to document time The file for clearance of each file hierarchies to obtaining further is divided.
Spatial content to be released shared by step 360, the corresponding file for clearance of each file hierarchies of acquisition.
Wherein, after the division of file hierarchies is carried out to file for clearance, it is determined that each file hierarchies are corresponding for clearance File.The spatial content to be released shared by the corresponding file for clearance of each file hierarchies is obtained, illustratively, by file etc. The spatial content to be released for being determined as this document grade with value of spatial content shared by All Files in grade.
Step 370, basis have currently used spatial content, have used the sky to be released of spatial content threshold value and each file hierarchies Between capacity determine file hierarchies for clearance.
Wherein, with spatial content threshold value it has been to make the minimum value for having used spatial content of normal operation of terminal, that is, has used sky Between capacity be more than when having used spatial content threshold value, the normal operation of terminal can be affected, and need further to carry out data at this time Cleaning has used spatial content to reduce.Optionally, according to can currently be calculated with spatial content threshold value with spatial content and Go out the minimum value of gross space capacity to be released.According to the minimum value of gross space capacity to be released and the sky to be released of each file hierarchies Between capacity determine file hierarchies for clearance.Optionally, whether detect the spatial content to be released of the first file hierarchies can reach To the minimum value of gross space capacity to be released, if so, the file hierarchies that the first file hierarchies are determined as to clear up.If it is not, Whether then detect the sum of the spatial content to be released of the first file hierarchies and the spatial content to be released of the second file hierarchies can be with The minimum value of gross space capacity to be released, if so, the first file hierarchies and the second file hierarchies are determined as the text that can be cleared up Part grade.Sequence detection successively, until the file hierarchies for determining to clear up.
Step 380 deletes the corresponding file for clearance of file hierarchies for clearance.
Wherein, after the file hierarchies for determining to clear up, without all files for clearance are deleted, need to only delete Except the corresponding file for clearance of file hierarchies for clearance, can also avoid under the system performance caused by the memory space inadequate Drop, ensure that the normal operation of terminal.In the present embodiment, since file hierarchies for clearance are according to file from low to high Hierarchal order, i.e., from low to high file significance level order determine, so when the low corresponding sky to be released of file hierarchies Between capacity when reaching the minimum value of gross space capacity to be released, the corresponding file for clearance of document retaining grade that can be high, So that file for clearance is deleted according to file hierarchies, user experience is further improved.
The embodiment of the present invention after file for clearance is determined according to data scrubbing strategy, according to cleaning priority and/or Document time carries out file for clearance the division of file hierarchies;It obtains and is treated shared by the corresponding file for clearance of each file hierarchies Free up Memory capacity;According to currently having used spatial content, used the spaces to be released of spatial content threshold value and each file hierarchies Capacity determines file hierarchies for clearance;Delete the corresponding file for clearance of file hierarchies for clearance.So that file for clearance It is deleted according to file hierarchies, further improves user experience.It also ensures that terminal operating is normal simultaneously, is not in card The phenomenon that pausing.
Example IV
Fig. 4 show a kind of structure diagram of the automatic cleaning apparatus of storage data of the offer of the embodiment of the present invention four. The present embodiment is applicable to situation data cached in cleaning memory space.The automatic cleaning apparatus of the storage data can be placed in intelligence In energy set-top box, the concrete structure of the device includes:Mould is determined with capacity accounting value with spatial content acquisition module 410, Block 420, data scrubbing strategy determining module 430, file determining module 440 for clearance and file removing module 450 for clearance.
Wherein, with spatial content acquisition module 410 spatial content has been used for obtaining the current of data partition;It has used Capacity accounting value determining module 420 currently determines data with the gross space capacity of spatial content and data partition for basis Subregion has used capacity accounting value;Data scrubbing strategy determining module 430 determines that data are clear with capacity accounting value for basis Reason strategy;File determining module 440 for clearance, for determining file for clearance according to data scrubbing strategy;File for clearance is deleted Except module 450, for deleting file for clearance.
Optionally, data scrubbing strategy determining module 430 specifically includes:
First Prune Policies determination unit if for capacity accounting value have been used to be more than or equal to the first default accounting value, counts Meet the first preset condition according to Prune Policies to clear up in application of software data and cleaning safe digital card sdcard catalogues File and subdirectory;
Second Prune Policies determination unit, if for being more than or equal to the second default accounting value with capacity accounting value and being less than First default accounting value, then data scrubbing strategy is pre- to meet second in cleaning application of software data and cleaning sdcard catalogues If the file and subdirectory of condition;
3rd Prune Policies determination unit, if for being more than or equal to the 3rd default accounting value with capacity accounting value and being less than Second default accounting value, then data scrubbing strategy is pre- to meet the 3rd in cleaning application of software data and cleaning sdcard catalogues If the file and subdirectory of condition;
4th cleaning policy determining unit, if for capacity accounting value have been used to be less than the 3rd default accounting value, data are clear Reason strategy is without clearing up data manipulation.
Wherein, the first default accounting value, the second default accounting value and the 3rd default accounting value are sequentially reduced.
Optionally, meeting the file of the first preset condition and subdirectory includes:Meet the first preset format the first file, The subdirectory for meeting the second preset format, the audio file, the image text of the 4th preset format of satisfaction that meet the 3rd preset format Part, the video file for meeting the 5th preset format and satisfaction occupy the single file that memory space is more than default value;Meet The file and subdirectory of second preset condition include:Meet the first file of the first preset format, meet the second preset format Subdirectory, the audio file for meeting the 3rd preset format and the image file for meeting the 4th preset format;It is default to meet the 3rd The file and subdirectory of condition include:Meet the first file of the first preset format and meet the specific item of the second preset format Record.
Optionally, file determining module 440 for clearance includes:
Application software list acquiring unit, for obtaining current mounted application software list;
Document determining unit for clearance, will be slow for the CACHE DIRECTORY of each application software in traversal applications software matrix It deposits All Files in catalogue and is determined as file for clearance.
Optionally, file determining module 440 for clearance further includes:
Preset condition determination unit, for determining the default of file for clearance in sdcard catalogues according to data scrubbing strategy Condition;
Sdcard catalogue acquiring units, for obtaining sdcard catalogues;
Document determining unit for clearance for traveling through each file and subdirectory in sdcard catalogues, and satisfaction is treated clearly The file and subdirectory for managing the preset condition of file are determined as file for clearance.
Optionally, which further includes:
First spatial content determining module to be released, if for there are vital documents in file for clearance, it is determined that except weight The spatial content to be released shared by the file for clearance outside file is wanted, wherein, vital document is provided with vital document mark;
Object space capacity determining module currently determines to clear up with spatial content and spatial content to be released for basis Object space capacity afterwards;
First file removing module if meeting cleaning condition for object space capacity, is deleted in addition to vital document File for clearance;
Prompting message generation module is cleared up, if being unsatisfactory for cleaning condition for object space capacity, generates vital document Clear up prompting message.
Optionally, which further includes:
File hierarchies division module, it is excellent according to clearing up for after file for clearance is determined according to data scrubbing strategy First grade and/or document time carry out file for clearance the division of file hierarchies;
Second spatial content acquisition module to be released is treated for obtaining shared by the corresponding file for clearance of each file hierarchies Free up Memory capacity;
File hierarchies determining module for clearance, for according to currently used spatial content, used spatial content threshold value with And the spatial content to be released of each file hierarchies determines file hierarchies for clearance;
Correspondingly, file removing module 450 for clearance, which further includes the second file, deletes unit, for deleting text for clearance The corresponding file for clearance of part grade.
The automatic cleaning apparatus of storage data provided in an embodiment of the present invention can perform any embodiment of the present invention and be provided Storage data automatic cleaning method, possess perform storage data the corresponding function module of automatic cleaning method and beneficial to effect Fruit.
Embodiment five
Fig. 5 is a kind of structure diagram for computer that the embodiment of the present invention five provides, as shown in figure 5, the computer bag It includes:Processor 510, memory 520 and communication interface 530;The quantity of processor 510 can be one or more, Fig. 5 in equipment In by taking a processor 510 as an example;Processor 510, memory 520 and communication interface 530 in equipment can by bus or Other modes connect, in Fig. 5 exemplified by being connected by bus.
Memory 520 is used as a kind of computer readable storage medium, and journey is can perform available for storage software program, computer Sequence and module, as stored the corresponding program instruction/module of automatic cleaning method of data in the embodiment of the present invention (for example, depositing Store up having used spatial content acquisition module 410, having used capacity accounting value determining module 420, number in the automatic cleaning apparatus of data According to Prune Policies determining module 430, file determining module 440 for clearance and file removing module 450 for clearance).Processor 510 Software program, instruction and module in memory 520 are stored in by operation, so as to perform the various function application of equipment with And data processing, that is, realize the automatic cleaning methods of above-mentioned storage data.
Memory 520 mainly includes storing program area and storage data field, wherein, storing program area can store operation system Application program needed for system, at least one function;Storage data field can be stored uses created data etc. according to terminal.This Outside, memory 520 can include high-speed random access memory, can also include nonvolatile memory, for example, at least one Disk memory, flush memory device or other non-volatile solid state memory parts.In some instances, memory 520 can be into one Step is included compared with the remotely located memory of processor 510, these remote memories can pass through network connection to equipment.On The example for stating network includes but not limited to internet, intranet, LAN, mobile radio communication and combinations thereof.
Communication interface 530 is used to communicate with the network element of miscellaneous equipment such as client or other servers etc..
Embodiment six
The present embodiment provides a kind of computer readable storage mediums, are stored thereon with computer program, which is processed The automatic cleaning method of the storage data as described in any embodiment of the present invention is realized when device performs.
By the description above with respect to embodiment, it is apparent to those skilled in the art that, the present invention It can be realized by software and required common hardware, naturally it is also possible to which by hardware realization, but the former is more in many cases Good embodiment.Based on such understanding, what technical scheme substantially in other words contributed to the prior art Part can be embodied in the form of software product, which can be stored in computer readable storage medium In, floppy disk, read-only memory (Read-Only Memory, ROM), random access memory (Random such as computer Access Memory, RAM), flash memory (FLASH), hard disk or CD etc., including some instructions with so that a computer is set Standby (can be personal computer, server or the network equipment etc.) performs the method described in each embodiment of the present invention.
Note that it above are only presently preferred embodiments of the present invention and institute's application technology principle.It will be appreciated by those skilled in the art that The invention is not restricted to specific embodiment described here, can carry out for a person skilled in the art various apparent variations, It readjusts and substitutes without departing from protection scope of the present invention.Therefore, although being carried out by above example to the present invention It is described in further detail, but the present invention is not limited only to above example, without departing from the inventive concept, also It can include other more equivalent embodiments, and the scope of the present invention is determined by scope of the appended claims.

Claims (10)

1. a kind of automatic cleaning method for storing data, which is characterized in that including:
It obtains the current of data partition and has used spatial content;
According to described currently having used for the data partition has been determined with the gross space capacity of spatial content and the data partition Capacity accounting value;
According to described data scrubbing strategy has been determined with capacity accounting value;
File for clearance is determined according to the data scrubbing strategy, and deletes the file for clearance.
2. according to the method described in claim 1, it is characterized in that, data scrubbing plan has been determined with capacity accounting value according to described It omits, including:
If described used capacity accounting value to be more than or equal to the first default accounting value, the data scrubbing strategy is soft for cleaning application Number of packages meets the file and subdirectory of the first preset condition according to this and in cleaning safe digital card sdcard catalogues;
If described used capacity accounting value to be more than or equal to the second default accounting value and less than the described first default accounting value, described Data scrubbing strategy meets the file and son of the second preset condition to clear up in application of software data and cleaning sdcard catalogues Catalogue;
If described used capacity accounting value to be more than or equal to the 3rd default accounting value and less than the described second default accounting value, described Data scrubbing strategy meets the file and son of the 3rd preset condition to clear up in application of software data and cleaning sdcard catalogues Catalogue;
If described used capacity accounting value to be less than the 3rd default accounting value, the data scrubbing strategy is without clearing up data Operation;
Wherein, the described first default accounting value, the second default accounting value and the 3rd default accounting value are sequentially reduced.
3. according to the method described in claim 2, it is characterized in that, determine file for clearance according to the data scrubbing strategy, Including:
Obtain current mounted application software list;
The CACHE DIRECTORY of each application software in the application software list is traveled through, All Files in CACHE DIRECTORY is determined as treating Clear up file.
4. according to the method described in claim 2, it is characterized in that, determine file for clearance according to the data scrubbing strategy, Including:
The preset condition of file for clearance in sdcard catalogues is determined according to the data scrubbing strategy;
Obtain the sdcard catalogues;
Each file and subdirectory in the sdcard catalogues are traveled through, and the text of the preset condition of the file for clearance will be met Part and subdirectory are determined as file for clearance.
5. according to the method described in claim 2, it is characterized in that, the satisfaction file of the first preset condition and subdirectory bag It includes:Meet the first file of the first preset format, the subdirectory of the second preset format of satisfaction, the audio of the 3rd preset format of satisfaction It is empty that file, the image file for meeting the 4th preset format, the video file for meeting the 5th preset format and satisfaction occupy storage Between be more than default value single file;
The file for meeting the second preset condition and subdirectory include:Meet the first file of the first preset format, meet the The subdirectory of two preset formats, the audio file for meeting the 3rd preset format and the image file for meeting the 4th preset format;
The file for meeting the 3rd preset condition and subdirectory include:Meet the first file and satisfaction of the first preset format The subdirectory of second preset format.
6. according to the method described in claim 1, it is characterized in that, file for clearance is being determined according to the data scrubbing strategy Afterwards, further include:
If in file for clearance, there are vital documents, it is determined that be released shared by the file for clearance in addition to the vital document Spatial content, wherein, the vital document is provided with vital document mark;
According to described currently the object space capacity after clearing up has been determined with spatial content and the spatial content to be released;
If the object space capacity meets cleaning condition, the file for clearance in addition to the vital document is deleted;
If the object space capacity is unsatisfactory for cleaning condition, vital document cleaning prompting message is generated.
7. according to the method described in claim 1, it is characterized in that, file for clearance is being determined according to the data scrubbing strategy Afterwards, including:
The division of file hierarchies is carried out to file for clearance according to cleaning priority and/or document time;
Obtain the spatial content to be released shared by the corresponding file for clearance of each file hierarchies;
It currently used spatial content according to described, used the spatial content to be released of spatial content threshold value and each file hierarchies true Fixed file hierarchies for clearance;
Correspondingly, the file for clearance is deleted, including:
Delete the corresponding file for clearance of the file hierarchies for clearance.
8. a kind of automatic cleaning apparatus for storing data, which is characterized in that including:
Spatial content acquisition module has been used, spatial content has been used for obtaining the current of data partition;
Capacity accounting value determining module is used, for according to the current gross space for having used spatial content and the data partition What capacity determined the data partition has used capacity accounting value;
Data scrubbing strategy determining module, for determining data scrubbing strategy with capacity accounting value according to;
File determining module for clearance, for determining file for clearance according to the data scrubbing strategy;
File removing module for clearance, for deleting the file for clearance.
9. a kind of computer including memory, processor and stores the computer that can be run on a memory and on a processor Program, which is characterized in that the processor realizes the storage data as described in any in claim 1-7 when performing described program Automatic cleaning method.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is by processor The automatic cleaning method of the storage data as described in any in claim 1-7 is realized during execution.
CN201711372057.4A 2017-12-19 2017-12-19 A kind of automatic cleaning method, device, computer and storage medium for storing data Pending CN108121783A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711372057.4A CN108121783A (en) 2017-12-19 2017-12-19 A kind of automatic cleaning method, device, computer and storage medium for storing data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711372057.4A CN108121783A (en) 2017-12-19 2017-12-19 A kind of automatic cleaning method, device, computer and storage medium for storing data

Publications (1)

Publication Number Publication Date
CN108121783A true CN108121783A (en) 2018-06-05

Family

ID=62229321

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711372057.4A Pending CN108121783A (en) 2017-12-19 2017-12-19 A kind of automatic cleaning method, device, computer and storage medium for storing data

Country Status (1)

Country Link
CN (1) CN108121783A (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109656629A (en) * 2018-12-26 2019-04-19 深圳创维-Rgb电子有限公司 A kind of EMMC adaptive regulation method, storage medium and terminal device
CN110134652A (en) * 2019-05-10 2019-08-16 Oppo广东移动通信有限公司 Recovery method, device, electronic equipment and the storage medium of cache file
CN110222040A (en) * 2019-05-21 2019-09-10 深圳壹账通智能科技有限公司 A kind of data processing method and device
CN110347550A (en) * 2019-06-10 2019-10-18 烽火通信科技股份有限公司 The safety monitoring processing method and system of Android system terminal equipment
CN110727446A (en) * 2019-09-25 2020-01-24 光通天下网络科技股份有限公司 Automatic deployment method, device, equipment and medium
CN111221790A (en) * 2019-10-25 2020-06-02 苏州浪潮智能科技有限公司 Log file processing method and device and computer readable storage medium
CN111488320A (en) * 2020-04-17 2020-08-04 上海思询信息科技有限公司 Method for cleaning service application program log in Kubernetes
CN111858514A (en) * 2020-07-27 2020-10-30 博泰车联网(南京)有限公司 Data writing method and device and computer storage medium
CN112328327A (en) * 2020-11-20 2021-02-05 杭州迪普科技股份有限公司 Configuration partition sorting method and device
CN112416868A (en) * 2020-11-16 2021-02-26 珠海格力电器股份有限公司 Data cleaning method, device and storage medium
CN113641376A (en) * 2020-05-11 2021-11-12 深圳Tcl新技术有限公司 Upgrade optimization method of intelligent terminal and intelligent terminal
CN114546267A (en) * 2022-02-14 2022-05-27 深圳源创存储科技有限公司 Solid state disk based on big data calculation and solid state disk system

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101635651A (en) * 2009-08-31 2010-01-27 杭州华三通信技术有限公司 Method, system and device for managing network log data
CN102333079A (en) * 2011-02-25 2012-01-25 北京兴宇中科科技开发股份有限公司 Method for clearing disk space
CN103761306A (en) * 2014-01-22 2014-04-30 深圳市欧珀通信软件有限公司 Smart terminal file cleaning method and device
CN104035769A (en) * 2014-05-30 2014-09-10 北京金山安全软件有限公司 Processing method and device for space shortage
CN104657182A (en) * 2015-03-05 2015-05-27 北京畅游天下网络技术有限公司 Method and device for cleaning system junk of mobile equipment
CN105068844A (en) * 2015-08-26 2015-11-18 广东欧珀移动通信有限公司 Method and apparatus for solving problem of no startup of Android terminal
CN105700827A (en) * 2016-01-07 2016-06-22 福建天晴数码有限公司 Android APP migration method and system
CN106354601A (en) * 2016-08-12 2017-01-25 深圳Tcl数字技术有限公司 Storage space management method and device for data partition
WO2017114200A1 (en) * 2015-12-31 2017-07-06 阿里巴巴集团控股有限公司 Method and device for packet cleaning

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101635651A (en) * 2009-08-31 2010-01-27 杭州华三通信技术有限公司 Method, system and device for managing network log data
CN102333079A (en) * 2011-02-25 2012-01-25 北京兴宇中科科技开发股份有限公司 Method for clearing disk space
CN103761306A (en) * 2014-01-22 2014-04-30 深圳市欧珀通信软件有限公司 Smart terminal file cleaning method and device
CN104035769A (en) * 2014-05-30 2014-09-10 北京金山安全软件有限公司 Processing method and device for space shortage
CN104657182A (en) * 2015-03-05 2015-05-27 北京畅游天下网络技术有限公司 Method and device for cleaning system junk of mobile equipment
CN105068844A (en) * 2015-08-26 2015-11-18 广东欧珀移动通信有限公司 Method and apparatus for solving problem of no startup of Android terminal
WO2017114200A1 (en) * 2015-12-31 2017-07-06 阿里巴巴集团控股有限公司 Method and device for packet cleaning
CN105700827A (en) * 2016-01-07 2016-06-22 福建天晴数码有限公司 Android APP migration method and system
CN106354601A (en) * 2016-08-12 2017-01-25 深圳Tcl数字技术有限公司 Storage space management method and device for data partition

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109656629A (en) * 2018-12-26 2019-04-19 深圳创维-Rgb电子有限公司 A kind of EMMC adaptive regulation method, storage medium and terminal device
CN110134652A (en) * 2019-05-10 2019-08-16 Oppo广东移动通信有限公司 Recovery method, device, electronic equipment and the storage medium of cache file
CN110222040A (en) * 2019-05-21 2019-09-10 深圳壹账通智能科技有限公司 A kind of data processing method and device
CN110347550A (en) * 2019-06-10 2019-10-18 烽火通信科技股份有限公司 The safety monitoring processing method and system of Android system terminal equipment
CN110727446A (en) * 2019-09-25 2020-01-24 光通天下网络科技股份有限公司 Automatic deployment method, device, equipment and medium
CN111221790A (en) * 2019-10-25 2020-06-02 苏州浪潮智能科技有限公司 Log file processing method and device and computer readable storage medium
CN111488320A (en) * 2020-04-17 2020-08-04 上海思询信息科技有限公司 Method for cleaning service application program log in Kubernetes
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
CN111858514A (en) * 2020-07-27 2020-10-30 博泰车联网(南京)有限公司 Data writing method and device and computer storage medium
CN112416868A (en) * 2020-11-16 2021-02-26 珠海格力电器股份有限公司 Data cleaning method, device and storage medium
CN112328327A (en) * 2020-11-20 2021-02-05 杭州迪普科技股份有限公司 Configuration partition sorting method and device
CN112328327B (en) * 2020-11-20 2023-10-27 杭州迪普科技股份有限公司 Configuration partition arrangement method and device
CN114546267A (en) * 2022-02-14 2022-05-27 深圳源创存储科技有限公司 Solid state disk based on big data calculation and solid state disk system
CN114546267B (en) * 2022-02-14 2022-11-18 深圳源创存储科技有限公司 Solid state disk based on big data calculation and solid state disk system

Similar Documents

Publication Publication Date Title
CN108121783A (en) A kind of automatic cleaning method, device, computer and storage medium for storing data
JP5814436B2 (en) Caching information system and method
US9369507B2 (en) Systems and methods for reliable backup of media
US9251187B2 (en) Metadata-driven version management service in pervasive environment
CN110401724B (en) File management method, file transfer protocol server and storage medium
KR20080106412A (en) A data storage management method and device
US20150350371A1 (en) Caching and syncing mechanisms for a cloud library
US20110246721A1 (en) Method and apparatus for providing automatic synchronization appliance
WO2009088709A2 (en) Storage device having direct user access
KR20130101645A (en) Contents filtering apparatus and method thereof
EP2418809A1 (en) Method and apparatus for processing and updating service contents in a distributed file system
US20160352811A1 (en) Streaming zip
US20220179831A1 (en) Management of content
CN103369002B (en) A kind of method and system of resource downloading
US20170011049A1 (en) Attribute analyzer for data backup
CN105786539B (en) File downloading method and device
CN105653209A (en) Object storage data transmitting method and device
CN103595808B (en) A kind of file update information method for pushing and device
EP2406733A1 (en) Download management of discardable files
US20100332506A1 (en) Marking sought after content items on network media devices
US20130179398A1 (en) Device for synchronously sharing files and method for synchronously sharing files
CN103888513B (en) Server end multifile method for down loading and system
CN106341485A (en) Cloud storage method and device
CN104111940A (en) Mobile terminal and file storage method implemented by same
US20140214768A1 (en) Reducing backup bandwidth by remembering downloads

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: 20180605

RJ01 Rejection of invention patent application after publication