CN105912671A - Method and device for cleaning up useless files - Google Patents

Method and device for cleaning up useless files Download PDF

Info

Publication number
CN105912671A
CN105912671A CN201610225383.1A CN201610225383A CN105912671A CN 105912671 A CN105912671 A CN 105912671A CN 201610225383 A CN201610225383 A CN 201610225383A CN 105912671 A CN105912671 A CN 105912671A
Authority
CN
China
Prior art keywords
path
file
application
corresponding relation
under
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
CN201610225383.1A
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.)
Nubia Technology Co Ltd
Original Assignee
Nubia 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 Nubia Technology Co Ltd filed Critical Nubia Technology Co Ltd
Priority to CN201610225383.1A priority Critical patent/CN105912671A/en
Publication of CN105912671A publication Critical patent/CN105912671A/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 invention provides a method and device for cleaning up useless files. The method comprises the steps that when a terminal detects that an application establishes a new folder besides a folder of which the file name is a package name, a first correspondence relation between the package name of the application and a route of the newly established folder can be saved; and when the terminal detects unloading of the application, a route corresponding to the package name of the unloaded application can be sought in the first correspondence relation, and a part of or all the films under the found route will be deleted.

Description

A kind of method and apparatus clearing up garbage files
Technical field
Present document relates to but be not limited to terminal technology, a kind of method and apparatus clearing up garbage files.
Background technology
Memory space in mobile phone (such as Android (Android) mobile phone) is all limited, although now The memory space of mobile phone is all strengthening, but after mobile phone uses the long period, memory space is the most not enough, Wherein having a lot of memory space to be taken by garbage files, these garbage files major parts are something lost after application unloading The garbage files stayed, mobile phone uses the time the longest, and garbage files is the most.Mobile phone is in unloading application at present Time, simply delete the All Files applied under the file of the file entitled bag name of storage on mobile phone, And apply outside the file of file entitled bag name, often create new file, to store user's use During produce part data, and the file under newly created file application unloading time do not have quilt Unloading, thus cause the waste of memory space.
Summary of the invention
In order to solve the problems referred to above, the present invention proposes a kind of method and apparatus clearing up garbage files, energy Enough save memory space.
In order to achieve the above object, the present invention proposes a kind of method clearing up garbage files, including:
Terminal detects to be applied when creating new file outside the file of file entitled bag name, preserves The first corresponding relation between bag name and the path of newly created file of application;
When terminal detects application unloading, the bag name of the application searching unloading in the first corresponding relation is corresponding Path, delete the part or all of file under the path that finds.
Optionally, behind the path that the bag name of the described application searching unloading in the first corresponding relation is corresponding, Also include before part or all of file under the path that described deletion finds:
All files under the path found described in described terminal demonstration;
Described terminal receives the first deletion instruction from user, deletes described first and deletes in instruction File;Wherein, described first delete instruction include described in part or all of file under the path that finds.
Optionally, when described terminal detects application unloading, described lookup in the first corresponding relation unloads Path corresponding to the bag name of application before also include:
Whether described query field of terminal user deletes the garbage files that the application of described unloading is left over;
Described terminal receives the second deletion instruction from described user.
Optionally, the first correspondence between described bag name and the path of newly created file preserving application Relation includes:
Described terminal preserves the bag name of described application, the path of described newly created file and represents rubbish Whether file was deleted is designated the corresponding pass of first represented between the mark that garbage files is not deleted System;
The path that the bag name of the described application searching unloading in the first corresponding relation is corresponding includes:
Described terminal is searched the bag name of the application of described unloading in the first corresponding relation and represents garbage files The path of the mark correspondence not being deleted.
Optionally, the method also includes:
Described terminal detects that all files under a certain path is deleted, in described first corresponding relation Search the mark whether expression garbage files corresponding to the deleted path of all files is deleted, will search To represent that the mark that whether is deleted of garbage files changes to represent the mark that garbage files has been deleted.
Optionally, behind the path that the bag name of the described application searching unloading in the first corresponding relation is corresponding, Also include before part or all of file under the path that described deletion finds:
Non-deleted file is there is under the path that finds in described terminal judges described in going out.
Optionally, the first correspondence between described bag name and the path of newly created file preserving application Relation includes:
Described terminal searches the path that the bag name of described application is corresponding in described first corresponding relation, it is judged that The path going out described newly created file is not mated with the path found, and preserves the bag of described application The first corresponding relation between name and the path of described newly created file.
Optionally, after all files under the path that described deletion finds, the method also includes:
Described in described terminal deletion, the first correspondence between bag name and the path of correspondence of the application of unloading is closed System.
The embodiment of the present invention also proposed a kind of method clearing up garbage files, including:
Terminal detects to be applied when creating new file outside the file of file entitled bag name, preserves The bag name of application, the path of newly created file and indicate whether unloaded to be designated expression and do not unloaded The second corresponding relation between the mark carried;
Terminal detects when memory space is less than or equal to predetermined threshold value, look-up table in the second corresponding relation Show the path that the most unloaded mark is corresponding, delete the part or all of file under the path found.
Optionally, behind the described path searching the mark correspondence representing the most unloaded in the second corresponding relation, Also include before part or all of file under the path that described deletion finds:
All files under the path found described in described terminal demonstration;
Described terminal receives the 3rd deletion instruction from user, and that deletes under the path that finds is whole File or delete described 3rd delete instruction in file;Wherein, described 3rd deletion instruction includes described Part or all of file under the path found.
Optionally, when described terminal detects that described application unloads, the method also includes:
Described terminal searches corresponding the indicating whether of bag name of the application of unloading in described second corresponding relation By find, unloaded mark, indicates whether that unloaded mark changes to represent the most unloaded mark Know.
Optionally, after all files under the path that described deletion finds, the method also includes:
The second corresponding relation that path that described terminal deletion all files has been deleted is corresponding.
Optionally, described preserve application bag name, the path of newly created file and indicate whether to be unloaded The second corresponding relation being designated between the mark representing the most unloaded carried includes:
Described terminal searches the path that the bag name of described application is corresponding in the second corresponding relation, it is judged that institute The path stating newly created file and the path found are not mated, and preserve the bag name of described application, new The mark whether path of the file created, the most unloaded mark of expression and expression garbage files are deleted Know for representing the mark that garbage files is not deleted;
The described path searching the mark correspondence representing the most unloaded in the second corresponding relation includes:
Described terminal is searched the most unloaded mark of described expression in described second corresponding relation and represents not The path of the mark correspondence being deleted.
Optionally, the method also includes:
Described terminal detects that all files under a certain path is deleted, in described second corresponding relation Search the mark whether expression garbage files corresponding to the deleted path of all files is deleted, will search To represent that the mark that whether is deleted of garbage files changes to represent the mark that garbage files has been deleted.
Optionally, behind the described path searching the mark correspondence representing the most unloaded in the second corresponding relation, Also include before part or all of file under the path that described deletion finds:
Non-deleted file is there is under the path that finds in described terminal judges described in going out.
The embodiment of the present invention also proposed a kind of device clearing up garbage files, including:
First memory module, for detect apply create outside the file of file entitled bag name new During file, preserve the first corresponding relation between bag name and the path of newly created file of application;
First removing module, when being used for detecting application unloading, searches unloading in the first corresponding relation The path corresponding to bag name of application, deletes the part or all of file under the path found.
Optionally, described first removing module specifically for:
When application unloading being detected, the road that the bag name of the application searching unloading in the first corresponding relation is corresponding Footpath, all files under the path found described in display;Receive the first deletion instruction from user, Delete described first and delete the file in instruction;Wherein, described first delete instruction include described in find Path under part or all of file.
Optionally, described first removing module specifically for:
When application unloading being detected, ask the user whether to delete the garbage files that the application of described unloading is left over; Receive the second deletion instruction from described user, the first corresponding relation is searched the application of unloading The path that bag name is corresponding, deletes the part or all of file under the path found.
Optionally, described first removing module specifically for:
When application unloading being detected, the road that the bag name of the application searching unloading in the first corresponding relation is corresponding Footpath, it is judged that described in there is non-deleted file under the path that finds, delete under the path found Part or all of file.
Optionally, described first memory module specifically for:
Detect and apply when creating new file outside the file of file entitled bag name, described One corresponding relation is searched the path that the bag name of described application is corresponding, it is judged that described newly created file Path do not mate with the path found, preserve application bag name and the path of newly created file Between the first corresponding relation.
Optionally, described first removing module specifically for:
When application unloading being detected, the road that the bag name of the application searching unloading in the first corresponding relation is corresponding Footpath, deletes the part or all of file under the path that finds, delete the application of described unloading bag name and Corresponding the first corresponding relation between path.
The embodiment of the present invention also proposed a kind of device clearing up garbage files, including:
Second memory module, for detect apply create outside the file of file entitled bag name new During file, preserve bag name, the path of newly created file of application and indicate whether unloaded mark Knowledge is the second corresponding relation between the mark that expression is the most unloaded;
Second removing module, is used for detecting when memory space is less than or equal to predetermined threshold value, right second The middle path searched and represent that the most unloaded mark is corresponding should be related to, delete the part under the path found Or all files.
Optionally, described second removing module specifically for:
Detect when memory space is less than or equal to predetermined threshold value, search in the second corresponding relation and represented Unloaded identifies corresponding path, all files under the path found described in display;
Described terminal receives the 3rd deletion instruction from user, and that deletes under the path that finds is whole File or delete described 3rd delete instruction in file;Wherein, described 3rd deletion instruction includes described Part or all of file under the path found.
Optionally, described second removing module specifically for:
Detect when memory space is less than or equal to predetermined threshold value, search in the second corresponding relation and represented The path that unloaded mark is corresponding, deletes the part or all of file under the path found, and deletes complete The second corresponding relation that path that portion's file has been deleted is corresponding.
Optionally, described second removing module specifically for:
Detect when memory space is less than or equal to predetermined threshold value, search in the second corresponding relation and represented The path that unloaded mark is corresponding, it is judged that described in there is non-deleted file under the path that finds, Delete the part or all of file under the path found.
Compared with prior art, the present invention includes: terminal detects the file applied in file entitled bag name When creating new file outside folder, preserve between bag name and the path of newly created file of application First corresponding relation;When terminal detects application unloading, the first corresponding relation is searched the application of unloading Path corresponding to bag name, delete the part or all of file under the path found.Or, terminal is examined Measure and apply when creating new file outside the file of file entitled bag name, preserve application bag name, The path of newly created file and indicate whether unloaded being designated between the mark representing the most unloaded The second corresponding relation;Terminal detects when memory space is less than or equal to predetermined threshold value, corresponding second Relation is searched the path representing that the most unloaded mark is corresponding, delete the part under the path found or All files.By the solution of the present invention, it is less than or equal to predetermined threshold value in application unloading or memory space Time, the file lower part outside the file of the file entitled bag name deleting application or all files, from And save memory space.
Accompanying drawing explanation
Illustrating the accompanying drawing in the embodiment of the present invention below, the accompanying drawing in embodiment is for this Bright is further appreciated by, and is used for explaining the present invention, is not intended that and the present invention is protected model together with description The restriction enclosed.
Fig. 1 is the hardware architecture diagram of the mobile terminal realizing each embodiment of the present invention;
Fig. 2 is the wireless communication system schematic diagram of mobile terminal as shown in Figure 1;
Fig. 3 is the flow chart of the method for first embodiment of the invention cleaning garbage files;
Fig. 4 is the flow chart of the method for second embodiment of the invention cleaning garbage files;
Fig. 5 is the structure composition schematic diagram of the device of third embodiment of the invention cleaning garbage files;
Fig. 6 is the structure composition schematic diagram of the device of fourth embodiment of the invention cleaning garbage files.
The realization of the object of the invention, functional characteristics and advantage will in conjunction with the embodiments, do referring to the drawings further Explanation.
Detailed description of the invention
For the ease of the understanding of those skilled in the art, below in conjunction with the accompanying drawings the present invention is further retouched State, can not be used for limiting the scope of the invention.It should be noted that in the case of not conflicting, Embodiment in the application and the various modes in embodiment can be mutually combined.
Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not used to limit Determine the present invention.
The mobile terminal realizing each embodiment of the present invention is described referring now to accompanying drawing.In follow-up description In, use for represent element such as " module ", " parts " or " unit " suffix only for Be conducive to the explanation of the present invention, itself do not have specific meaning.Therefore, " module " and " parts " can Mixedly to use.
Mobile terminal can be implemented in a variety of manners.Such as, the terminal described in the present invention can include (individual digital helps for such as mobile phone, smart phone, notebook computer, digit broadcasting receiver, PDA Reason), PAD (panel computer), PMP (portable media player), the movement of guider etc. The fixed terminal of terminal and such as numeral TV, desk computer etc..Hereinafter it is assumed that terminal is mobile Terminal.However, it will be understood by those skilled in the art that, except be used in particular for mobile purpose element it Outward, structure according to the embodiment of the present invention can also apply to the terminal of fixed type.
Fig. 1 is the hardware configuration signal of the mobile terminal realizing each embodiment of the present invention.
Mobile terminal 100 can include user input unit 130, output unit 150, memorizer 160, control Device 180 processed and power subsystem 190 etc..Fig. 1 shows the mobile terminal with various assembly, but should manage Solve be, it is not required that implement all assemblies illustrated.Can alternatively implement more or less of assembly. Will be discussed in more detail below the element of mobile terminal.
It is mobile to control that user input unit 130 can generate key input data according to the order of user's input The various operations of terminal.User input unit 130 allows user to input various types of information, and permissible Including keyboard, metal dome, touch pad (such as, detection due to touched and cause resistance, pressure, electricity The sensitive component of change held etc.), roller, rocking bar etc..Especially, when touch pad as a layer When being superimposed upon on display unit 151, touch screen can be formed.
Output unit 150 can include display unit 151 etc..
Display unit 151 may be displayed on the information processed in mobile terminal 100.Such as, mobile terminal is worked as 100 when being in telephone calling model, display unit 151 can show and call or other communicate (such as, civilian This information receiving and transmitting, multimedia file download etc.) relevant user interface (UI) or graphic user interface (GUI).When mobile terminal 100 is in video calling pattern or image capture mode, display unit 151 The image of capture and/or the image of reception can be shown, the UI of video or image and correlation function is shown Or GUI etc..
Meanwhile, when display unit 151 and touch pad the most superposed on one another to form touch screen time, aobvious Show that unit 151 can serve as input equipment and output device.Display unit 151 can include liquid crystal display (LCD), thin film transistor (TFT) LCD (TFT-LCD), Organic Light Emitting Diode (OLED) display, flexibility At least one in display, three-dimensional (3D) display etc..Some in these display can be by structure Making as transparence to allow user to watch from outside, this is properly termed as transparent display, typical transparent aobvious Show that device can for example, TOLED (transparent organic light emitting diode) display etc..Want according to specific Embodiment, mobile terminal 100 can include two or more display units (or other display device), example As, mobile terminal can include outernal display unit (not shown) and inner display unit (not shown).Touch Screen can be used for detecting touch input pressure and touch input position and touch input area.
Memorizer 160 can store the process performed by controller 180 and control the software program etc. of operation Deng, or can temporarily store oneself through output maybe will export data (such as, telephone directory, message, Still image, video etc.).And, memorizer 160 can store and be applied to touch screen about when touch Time the vibration of various modes of output and the data of audio signal.
Memorizer 160 can include the storage medium of at least one type, described storage medium include flash memory, Hard disk, multimedia card, card-type memorizer (such as, SD or DX memorizer etc.), random access storage device (RAM), static random-access memory (SRAM), read only memory (ROM), electrically erasable Read only memory (EEPROM), programmable read only memory (PROM), magnetic storage, disk, light Dish etc..And, mobile terminal 100 can be connected the storage function performing memorizer 160 with by network Network storage device cooperation.
Controller 180 generally controls the overall operation of mobile terminal.Such as, controller 180 performs and voice Control that call, data communication, video calling etc. are relevant and process.It addition, controller 180 can wrap Including the multi-media module 1810 for reproducing (or playback) multi-medium data, multi-media module 1810 can be with structure Make in controller 180, or it is so structured that separate with controller 180.Controller 180 can perform mould Formula identifying processing, to be identified as character by the handwriting input performed on the touchscreen or picture drafting input Or image.
Power subsystem 190 receives external power or internal power under the control of controller 180 and provides behaviour Make the suitable electric power needed for each element and assembly.
Various embodiment described herein can be to use such as computer software, hardware or its any group The computer-readable medium closed is implemented.Implementing for hardware, embodiment described herein can pass through Use application-specific IC (ASIC), digital signal processor (DSP), digital signal processing device (DSPD), programmable logic device (PLD), field programmable gate array (FPGA), processor, control Device processed, microcontroller, microprocessor, it is designed to perform in the electronic unit of function described herein At least one is implemented, and in some cases, such embodiment can be implemented in controller 180. For software implement, the embodiment of such as process or function can with allow perform at least one function or The single software module of operation is implemented.Software code can be write by with any suitable programming language Software application (or program) implement, software code can be stored in memorizer 160 and by controlling Device 180 processed performs.
So far, oneself is through describing mobile terminal according to its function.Below, for the sake of brevity, will describe Various types of mobile terminals of such as folded form, board-type, oscillating-type, slide type mobile terminal etc. In slide type mobile terminal as example.Therefore, the present invention can be applied to any kind of mobile whole End, and it is not limited to slide type mobile terminal.
As shown in Figure 1 mobile terminal 100 may be constructed such that and utilizes via frame or packet transmission data The most wired and wireless communication system and satellite-based communication system operate.
The communication system being wherein operable to according to the mobile terminal of the present invention is described referring now to Fig. 2.
Such communication system can use different air interfaces and/or physical layer.Such as, by communication system The air interface that system uses includes such as frequency division multiple access (FDMA), time division multiple acess (TDMA), CDMA (CDMA) move lead to UMTS (UMTS) (especially, Long Term Evolution (LTE)), the whole world Communication system (GSM) etc..As non-limiting example, explained below relates to cdma communication system, But such teaching is equally applicable to other type of system.
With reference to Fig. 2, cdma wireless communication system can include multiple mobile terminal 100, multiple base station (BS) 270, base station controller (BSC) 275 and mobile switching centre (MSC) 280.MSC280 is configured to Interface is formed with Public Switched Telephony Network (PSTN) 290.MSC280 is also structured to and can be via returning Journey circuit is couple to the BSC275 of base station 270 and forms interface.If back haul link can be according to connecing that Ganji knows Any one in Kou constructs, and described interface includes such as E1/T1, ATM, IP, PPP, frame relay, HDSL, ADSL or xDSL.It will be appreciated that system as shown in Figure 2 can include multiple BSC2750。
Each BS270 can service one or more subregion (or region), by multidirectional antenna or sensing certain party To antenna cover each subregion radially away from BS270.Or, each subregion can be by being used for Two or more antennas of diversity reception cover.Each BS270 may be constructed such that the multiple frequencies of support are divided Join, and the distribution of each frequency has specific frequency spectrum (such as, 1.25MHz, 5MHz etc.).
Intersecting that subregion and frequency are distributed can be referred to as CDMA Channel.BS270 can also be referred to as base Station transceiver subsystem (BTS) or other equivalent terms.In this case, term " base station " is permissible For broadly representing single BSC275 and at least one BS270.Base station can also be referred to as " cellular station ". Or, each subregion of specific BS270 can be referred to as multiple cellular station.
As shown in Figure 2, broadcast singal is sent in system the shifting operated by broadcsting transmitter (BT) 295 Dynamic terminal 100.Broadcast reception module 111 is arranged on mobile terminal 100 and sentences reception as shown in Figure 1 The broadcast singal sent by BT295.In fig. 2 it is shown that several global positioning systems (GPS) satellite 300. Satellite 300 helps to position at least one in multiple mobile terminals 100.
In fig. 2, depict multiple satellite 300, it is understood that be, it is possible to use any number of defend Star obtains useful location information.GPS module 115 is generally configured to and satellite 300 as shown in Figure 1 Coordinate the location information wanted with acquisition.Substitute GPS tracking technique or outside GPS tracking technique, Other technology of the position that can follow the tracks of mobile terminal can be used.It addition, at least one gps satellite 300 Can optionally or additionally process satellite dmb transmission.
As a typical operation of wireless communication system, BS270 receives from various mobile terminals 100 Reverse link signal.Mobile terminal 100 generally participates in call, information receiving and transmitting communicates with other type of.Special The each reverse link signal determining base station 270 reception is processed in specific BS270.The data obtained It is forwarded to the BSC275 being correlated with.BSC provides call resource distribution and the soft handover included between BS270 The mobile management function of the coordination of process.The data received also are routed to MSC280 by BSC275, its Extra route service for forming interface with PSTN290 is provided.Similarly, PSTN290 with MSC280 forms interface, MSC Yu BSC275 forms interface, and BSC275 correspondingly controls BS270 Forward link signals to be sent to mobile terminal 100.
Based on above-mentioned mobile terminal hardware configuration and communication system, each embodiment of the inventive method is proposed.
As it is shown on figure 3, first embodiment of the invention proposes a kind of method clearing up garbage files, including:
Step 300, terminal detect to apply and create new file outside the file of file entitled bag name During folder, preserve the first corresponding relation between bag name and the path of newly created file of application.
In this step, terminal can be created outside the file of file entitled bag name detecting to apply every time When building new file, all preserve the first corresponding relation;Can also apply at filename detecting every time When creating new file outside the file for bag name, in the first corresponding relation, first search the bag of application The path that name is corresponding, and judge whether the path of newly created file mates with the path found, as Fruit does not mates, and just preserves the first corresponding relation;If the path found has one with newly created literary composition The path of part folder matches, and does not the most preserve the first corresponding relation.
Wherein, when the literary composition that the path of newly created file is identical with the path found or newly created Part presss from both sides the sub-folder of file corresponding to the path being to look for, and the path of newly created file is described Matching with the path found, the path that newly created file is otherwise described is with the path found not Coupling.
When step 301, terminal detect application unloading, the first corresponding relation is searched the application of unloading Path corresponding to bag name, delete the part or all of file under the path found.
In this step, when the path only one of which found, delete the whole literary compositions under the path found Part or optionally delete the partial document under the path found.
When the path found has multiple, can delete all files under all paths found, Or optionally delete all files under the path that part lookup arrives or all lookups of selective deletion To path under partial document or the selective partial document deleted under the path that part lookup arrives.
Any one situation above-mentioned all saves memory space.
Optionally, behind the path that the bag name of the application searching unloading in the first corresponding relation is corresponding, deleting Except also including before the part or all of file under the path found:
All files under the path that terminal demonstration finds;Terminal receives the first deletion from user Instruction, deletes the file in the first deletion instruction;Wherein, first the path that instruction includes finding is deleted Under part or all of file.
Wherein, when terminal receive from user when not deleting instruction, process ends.
Wherein, all files under the path that terminal demonstration finds can use multiple display modes.Example As, when the path only one of which found, it is whole that terminal can directly display under the path found File, it is also possible to first show the file that the path found is corresponding, if user puts open file folder, then All Files under the path that display finds.
When the path found has multiple, it is complete that terminal can directly display under all paths found Portion's file, it is also possible to first show the file that all paths found are corresponding, if user's point is opened a certain Individual file, then show the All Files of the file a little opened.
So, user, when selecting to delete file, can select a file, it is also possible to selects concrete File.
Wherein, when terminal receive from user when not deleting instruction, process ends.
Optionally, when terminal detects application unloading, the first corresponding relation is searched the application of unloading Also include before the path that bag name is corresponding:
Whether query field of terminal user deletes the garbage files that the application of unloading is left over;Terminal receives uses by oneself The second deletion instruction at family.
Wherein, when terminal receive from user when not deleting instruction, process ends.
Optionally, behind the path that the bag name of the application searching unloading in the first corresponding relation is corresponding, deleting Except also including before the part or all of file under the path found:
Terminal judges goes out to there is non-deleted file under the path found.
Wherein, when the All Files judged under the path found is the most deleted, or search less than unloading Path corresponding to the bag name of application time, process ends.
Optionally, in step 300, preserve between bag name and the path of newly created file of application First corresponding relation includes:
Terminal preserves the bag name of application, the path of newly created file and represents whether garbage files is deleted That removes is designated the first corresponding relation represented between the mark that garbage files is not deleted;Accordingly,
The path that the bag name of the application searching unloading in the first corresponding relation is corresponding includes:
Terminal is searched the bag name of the application of unloading in the first corresponding relation and represents that garbage files is not deleted Path corresponding to mark.
Optionally, the method also includes:
Terminal detects that all files under a certain path is deleted, and searches all in the first corresponding relation What path that file is deleted was corresponding represents the mark that whether is deleted of garbage files, the expression that will find The mark whether garbage files is deleted changes to represent the mark that garbage files has been deleted.
Wherein, whether all files under the most how terminal detects a certain path is deleted can use this The technology of knowing of skilled person realizes, the protection domain being not intended to limit the present invention, the most no longer Repeat.
Optionally, after deleting all files under the path found, the method also includes:
The first corresponding relation between bag name and the path of correspondence of the application of terminal deletion unloading.
Seeing Fig. 4, second embodiment of the invention also proposed a kind of method clearing up garbage files, including:
Step 400, terminal detect to apply and create new file outside the file of file entitled bag name During folder, preserve bag name, the path of newly created file of application and indicate whether unloaded being designated Represent the second corresponding relation between the most unloaded mark.
In this step, terminal can be created outside the file of file entitled bag name detecting to apply every time When building new file, all preserve the first corresponding relation;Can also apply at filename detecting every time When creating new file outside the file for bag name, in the second corresponding relation, first search the bag of application The path that name is corresponding, and judge whether the path of newly created file mates with the path found, as Fruit does not mates, and just preserves the second corresponding relation;If the path found has one with newly created literary composition The path of part folder matches, and does not the most preserve the second corresponding relation.
Wherein, when the literary composition that the path of newly created file is identical with the path found or newly created Part presss from both sides the sub-folder of file corresponding to the path being to look for, and the path of newly created file is described Matching with the path found, the path that newly created file is otherwise described is with the path found not Coupling.
Step 401, terminal detect when memory space is less than or equal to predetermined threshold value, in the second corresponding pass System searches the path representing that the most unloaded mark is corresponding, deletes the part under the path found or complete Portion's file.
In this step, when the path only one of which found, delete the whole literary compositions under the path found Part or optionally delete the partial document under the path found.
When the path found has multiple, can delete all files under all paths found, Or optionally delete all files under the path that part lookup arrives or all lookups of selective deletion To path under partial document or the selective partial document deleted under the path that part lookup arrives.
Any one situation above-mentioned all saves memory space.
Optionally, search after representing the path that the most unloaded mark is corresponding in the second corresponding relation, Also include before deleting the part or all of file under the path found:
All files under the path found described in terminal demonstration;
Terminal receives the 3rd deletion instruction from user, deletes all files under the path found Or delete the file in the 3rd deletion instruction;Wherein, the 3rd delete instruction include described in the path that finds Under part or all of file.
Wherein, when terminal receive from user when not deleting instruction, process ends.
Wherein, all files under the path that terminal demonstration finds can use multiple display modes.Example As, when the path only one of which found, it is whole that terminal can directly display under the path found File, it is also possible to first show the file that the path found is corresponding, if user puts open file folder, then All Files under the path that display finds.
When the path found has multiple, it is complete that terminal can directly display under all paths found Portion's file, it is also possible to first show the file that all paths found are corresponding, if user's point is opened a certain Individual file, then show the All Files of the file a little opened.
So, user, when selecting to delete file, can select a file, it is also possible to selects concrete File.
Wherein, when terminal receive from user when not deleting instruction, process ends.
Optionally, when terminal detects that described application unloads, the method also includes:
Indicating whether that the bag name of the application that terminal searches unloading in the second corresponding relation is corresponding is unloaded By find, mark, indicates whether that unloaded mark changes to represent the most unloaded mark.
Optionally, after deleting all files under the path found, the method also includes:
The second corresponding relation that path that terminal deletion all files has been deleted is corresponding.
Optionally, preserve bag name, the path of newly created file of application and indicate whether unloaded The second corresponding relation being designated between the mark representing the most unloaded includes:
Terminal searches the path that the bag name of application is corresponding in the second corresponding relation, it is judged that newly created literary composition Path and the path found of part folder are not mated, and preserve the bag name of application, the road of newly created file Whether footpath, the most unloaded mark of expression and expression garbage files were deleted and were designated expression garbage files The mark not being deleted;Accordingly,
The path searching the mark correspondence representing the most unloaded in the second corresponding relation includes:
Terminal is searched in the second corresponding relation and is represented the most unloaded mark and represent the mark not being deleted Corresponding path.
Optionally, the method also includes:
Terminal detects that all files under a certain path is deleted, and searches all in the second corresponding relation What path that file is deleted was corresponding represents the mark that whether is deleted of garbage files, the expression that will find The mark whether garbage files is deleted changes to represent the mark that garbage files has been deleted.
Wherein, whether all files under the most how terminal detects a certain path is deleted can use this The technology of knowing of skilled person realizes, the protection domain being not intended to limit the present invention, the most no longer Repeat.
Optionally, search after representing the path that the most unloaded mark is corresponding in the second corresponding relation, Also include before deleting the part or all of file under the path found:
Terminal judges goes out to there is non-deleted file under the path found.
Wherein, when the All Files judged under the path found is the most deleted, or search less than unloading Path corresponding to the bag name of application time, process ends.
Seeing Fig. 5, third embodiment of the invention also proposed a kind of device clearing up garbage files, including:
First memory module, for detect apply create outside the file of file entitled bag name new During file, preserve the first corresponding relation between bag name and the path of newly created file of application;
First removing module, when being used for detecting application unloading, searches unloading in the first corresponding relation The path corresponding to bag name of application, deletes the part or all of file under the path found.
Wherein, the first memory module and the first removing module can be arranged in the controller 180 of Fig. 1.
In the device of the embodiment of the present invention, the first removing module specifically for:
When application unloading being detected, the road that the bag name of the application searching unloading in the first corresponding relation is corresponding Footpath, all files under the path that display finds;Receive the first deletion instruction from user, delete Except first deletes the file in instruction;Wherein, first the part that instruction includes under the path found is deleted Or all files.
In the device of the embodiment of the present invention, the first removing module specifically for:
When application unloading being detected, ask the user whether to delete the garbage files that the application of unloading is left over;Connect Receiving the second deletion instruction from user, the bag name of the application searching unloading in the first corresponding relation is right The path answered, deletes the part or all of file under the path found.
In the device of the embodiment of the present invention, the first removing module specifically for:
When application unloading being detected, the road that the bag name of the application searching unloading in the first corresponding relation is corresponding Footpath, it is judged that there is non-deleted file under the path found, deletes the portion under the path found Divide or all files.
In the device of the embodiment of the present invention, the first memory module specifically for:
Detect and apply when creating new file outside the file of file entitled bag name, right first The path that the bag name of middle lookup application is corresponding should be related to, it is judged that the path of newly created file and lookup To path do not mate, preserve application bag name and the path of newly created file between the first couple Should be related to.
In the device of the embodiment of the present invention, the first removing module specifically for:
When application unloading being detected, the road that the bag name of the application searching unloading in the first corresponding relation is corresponding Footpath, deletes the part or all of file under the path found, and deletes bag name and the correspondence of the application of unloading Path between the first corresponding relation.
Seeing Fig. 6, fourth embodiment of the invention proposes a kind of device clearing up garbage files, including:
Second memory module, for detect apply create outside the file of file entitled bag name new During file, preserve bag name, the path of newly created file of application and indicate whether unloaded mark Knowledge is the second corresponding relation between the mark that expression is the most unloaded;
Second removing module, is used for detecting when memory space is less than or equal to predetermined threshold value, right second The middle path searched and represent that the most unloaded mark is corresponding should be related to, delete the part under the path found Or all files.
Wherein, the second memory module and the second removing module can be arranged in the controller 180 of Fig. 1.
In the device of the embodiment of the present invention, the second removing module specifically for:
Detect when memory space is less than or equal to predetermined threshold value, search in the second corresponding relation and represented The path that unloaded mark is corresponding, all files under the path that display finds;
Terminal receives the 3rd deletion instruction from user, deletes all files under the path found Or delete the file in the 3rd deletion instruction;Wherein, the 3rd deletion instruction includes under the path found Partly or entirely file.
In the device of the embodiment of the present invention, the second removing module specifically for:
Detect when memory space is less than or equal to predetermined threshold value, search in the second corresponding relation and represented The path that unloaded mark is corresponding, deletes the part or all of file under the path found, and deletes complete The second corresponding relation that path that portion's file has been deleted is corresponding.
In the device of the embodiment of the present invention, the second removing module specifically for:
Detect when memory space is less than or equal to predetermined threshold value, search in the second corresponding relation and represented The path that unloaded mark is corresponding, it is judged that there is non-deleted file under the path found, delete Except the part or all of file under the path found.
It should be noted that in this article, term " include ", " comprising " or its any other become Body is intended to comprising of nonexcludability, so that include the process of a series of key element, method, article Or device not only includes those key elements, but also includes other key elements being not expressly set out, or Also include the key element intrinsic for this process, method, article or device.There is no more restriction In the case of, statement " including ... " key element limited, it is not excluded that including the mistake of this key element Journey, method, article or device there is also other identical element.
The invention described above embodiment sequence number, just to describing, does not represent the quality of embodiment.
Through the above description of the embodiments, those skilled in the art is it can be understood that arrive above-mentioned Embodiment method can add the mode of required general hardware platform by software and realize, naturally it is also possible to logical Cross hardware, but a lot of in the case of the former is more preferably embodiment.Based on such understanding, the present invention's The part that prior art is contributed by technical scheme the most in other words can be with the form body of software product Revealing to come, this computer software product is stored in a storage medium (such as ROM/RAM, magnetic disc, light Dish) in, including some instructions with so that a station terminal equipment (can be mobile phone, computer, service Device, air-conditioner, or the network equipment etc.) perform the method described in each embodiment of the present invention.
These are only the preferred embodiments of the present invention, not thereby limit the scope of the claims of the present invention, every Utilize equivalent structure or equivalence flow process conversion that description of the invention and accompanying drawing content made, or directly or Connect and be used in other relevant technical fields, be the most in like manner included in the scope of patent protection of the present invention.

Claims (25)

1. the method clearing up garbage files, it is characterised in that including:
Terminal detects to be applied when creating new file outside the file of file entitled bag name, preserves The first corresponding relation between bag name and the path of newly created file of application;
When terminal detects application unloading, the bag name of the application searching unloading in the first corresponding relation is corresponding Path, delete the part or all of file under the path that finds.
Method the most according to claim 1, it is characterised in that described look in the first corresponding relation After looking for path corresponding to the bag name of the application of unloading, the part or complete under the path that described deletion finds Also include before portion's file:
All files under the path found described in described terminal demonstration;
Described terminal receives the first deletion instruction from user, deletes described first and deletes in instruction File;Wherein, described first delete instruction include described in part or all of file under the path that finds.
Method the most according to claim 1, it is characterised in that described terminal detects application unloading Time, also include before the path that the bag name of the described application searching unloading in the first corresponding relation is corresponding:
Whether described query field of terminal user deletes the garbage files that the application of described unloading is left over;
Described terminal receives the second deletion instruction from described user.
4. according to the method described in claim 1 or 2 or 3, it is characterised in that described preservation application The first corresponding relation between the path of bag name and newly created file includes:
Described terminal preserves the bag name of described application, the path of described newly created file and represents rubbish Whether file was deleted is designated the corresponding pass of first represented between the mark that garbage files is not deleted System;
The path that the bag name of the described application searching unloading in the first corresponding relation is corresponding includes:
Described terminal is searched the bag name of the application of described unloading in the first corresponding relation and represents garbage files The path of the mark correspondence not being deleted.
Method the most according to claim 4, it is characterised in that the method also includes:
Described terminal detects that all files under a certain path is deleted, in described first corresponding relation Search the mark whether expression garbage files corresponding to the deleted path of all files is deleted, will search To represent that the mark that whether is deleted of garbage files changes to represent the mark that garbage files has been deleted.
6. according to the method described in claim 1 or 2 or 3, it is characterised in that described corresponding first Behind the path that the bag name of the application searching unloading in relation is corresponding, under the path that described deletion finds Partly or entirely also include before file:
Non-deleted file is there is under the path that finds in described terminal judges described in going out.
7. according to the method described in claim 1 or 2 or 3, it is characterised in that described preservation application The first corresponding relation between the path of bag name and newly created file includes:
Described terminal searches the path that the bag name of described application is corresponding in described first corresponding relation, it is judged that The path going out described newly created file is not mated with the path found, and preserves the bag of described application The first corresponding relation between name and the path of described newly created file.
8. according to the method described in claim 1 or 2 or 3, it is characterised in that described deletion finds Path under all files after, the method also includes:
Described in described terminal deletion, the first correspondence between bag name and the path of correspondence of the application of unloading is closed System.
9. the method clearing up garbage files, it is characterised in that including:
Terminal detects to be applied when creating new file outside the file of file entitled bag name, preserves The bag name of application, the path of newly created file and indicate whether unloaded to be designated expression and do not unloaded The second corresponding relation between the mark carried;
Terminal detects when memory space is less than or equal to predetermined threshold value, look-up table in the second corresponding relation Show the path that the most unloaded mark is corresponding, delete the part or all of file under the path found.
Method the most according to claim 9, it is characterised in that described in the second corresponding relation Search after representing the path that the most unloaded mark is corresponding, the part under the path that described deletion finds Or also include before all files:
All files under the path found described in described terminal demonstration;
Described terminal receives the 3rd deletion instruction from user, and that deletes under the path that finds is whole File or delete described 3rd delete instruction in file;Wherein, described 3rd deletion instruction includes described Part or all of file under the path found.
11. according to the method described in claim 9 or 10, it is characterised in that when described terminal detects During described application unloading, the method also includes:
Described terminal searches corresponding the indicating whether of bag name of the application of unloading in described second corresponding relation By find, unloaded mark, indicates whether that unloaded mark changes to represent the most unloaded mark Know.
12. according to the method described in claim 9 or 10, it is characterised in that described deletion finds After all files under path, the method also includes:
The second corresponding relation that path that described terminal deletion all files has been deleted is corresponding.
13. according to the method described in claim 9 or 10, it is characterised in that the bag of described preservation application Name, the path of newly created file and indicate whether unloaded to be designated the mark representing the most unloaded Between the second corresponding relation include:
Described terminal searches the path that the bag name of described application is corresponding in the second corresponding relation, it is judged that institute The path stating newly created file and the path found are not mated, and preserve the bag name of described application, new The mark whether path of the file created, the most unloaded mark of expression and expression garbage files are deleted Know for representing the mark that garbage files is not deleted;
The described path searching the mark correspondence representing the most unloaded in the second corresponding relation includes:
Described terminal is searched the most unloaded mark of described expression in described second corresponding relation and represents not The path of the mark correspondence being deleted.
14. methods according to claim 13, it is characterised in that the method also includes:
Described terminal detects that all files under a certain path is deleted, in described second corresponding relation Search the mark whether expression garbage files corresponding to the deleted path of all files is deleted, will search To represent that the mark that whether is deleted of garbage files changes to represent the mark that garbage files has been deleted.
15. according to the method described in claim 9 or 10, it is characterised in that described in the second corresponding pass System search after representing the path that the most unloaded mark is corresponding, under the path that described deletion finds Partly or entirely also include before file:
Non-deleted file is there is under the path that finds in described terminal judges described in going out.
16. 1 kinds of devices clearing up garbage files, it is characterised in that including:
First memory module, for detect apply create outside the file of file entitled bag name new During file, preserve the first corresponding relation between bag name and the path of newly created file of application;
First removing module, when being used for detecting application unloading, searches unloading in the first corresponding relation The path corresponding to bag name of application, deletes the part or all of file under the path found.
17. devices according to claim 16, it is characterised in that described first removing module is concrete For:
When application unloading being detected, the road that the bag name of the application searching unloading in the first corresponding relation is corresponding Footpath, all files under the path found described in display;Receive the first deletion instruction from user, Delete described first and delete the file in instruction;Wherein, described first delete instruction include described in find Path under part or all of file.
18. devices according to claim 16, it is characterised in that described first removing module is concrete For:
When application unloading being detected, ask the user whether to delete the garbage files that the application of described unloading is left over; Receive the second deletion instruction from described user, the first corresponding relation is searched the application of unloading The path that bag name is corresponding, deletes the part or all of file under the path found.
19. devices according to claim 16, it is characterised in that described first removing module is concrete For:
When application unloading being detected, the road that the bag name of the application searching unloading in the first corresponding relation is corresponding Footpath, it is judged that described in there is non-deleted file under the path that finds, delete under the path found Part or all of file.
20. devices according to claim 16, it is characterised in that described first memory module is concrete For:
Detect and apply when creating new file outside the file of file entitled bag name, described One corresponding relation is searched the path that the bag name of described application is corresponding, it is judged that described newly created file Path do not mate with the path found, preserve application bag name and the path of newly created file Between the first corresponding relation.
21. devices according to claim 16, it is characterised in that described first removing module is concrete For:
When application unloading being detected, the road that the bag name of the application searching unloading in the first corresponding relation is corresponding Footpath, deletes the part or all of file under the path that finds, delete the application of described unloading bag name and Corresponding the first corresponding relation between path.
22. 1 kinds of devices clearing up garbage files, it is characterised in that including:
Second memory module, for detect apply create outside the file of file entitled bag name new During file, preserve bag name, the path of newly created file of application and indicate whether unloaded mark Knowledge is the second corresponding relation between the mark that expression is the most unloaded;
Second removing module, is used for detecting when memory space is less than or equal to predetermined threshold value, right second The middle path searched and represent that the most unloaded mark is corresponding should be related to, delete the part under the path found Or all files.
23. devices according to claim 22, it is characterised in that described second removing module is concrete For:
Detect when memory space is less than or equal to predetermined threshold value, search in the second corresponding relation and represented Unloaded identifies corresponding path, all files under the path found described in display;
Described terminal receives the 3rd deletion instruction from user, and that deletes under the path that finds is whole File or delete described 3rd delete instruction in file;Wherein, described 3rd deletion instruction includes described Part or all of file under the path found.
24. devices according to claim 22, it is characterised in that described second removing module is concrete For:
Detect when memory space is less than or equal to predetermined threshold value, search in the second corresponding relation and represented The path that unloaded mark is corresponding, deletes the part or all of file under the path found, and deletes complete The second corresponding relation that path that portion's file has been deleted is corresponding.
25. devices according to claim 22, it is characterised in that described second removing module is concrete For:
Detect when memory space is less than or equal to predetermined threshold value, search in the second corresponding relation and represented The path that unloaded mark is corresponding, it is judged that described in there is non-deleted file under the path that finds, Delete the part or all of file under the path found.
CN201610225383.1A 2016-04-12 2016-04-12 Method and device for cleaning up useless files Pending CN105912671A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610225383.1A CN105912671A (en) 2016-04-12 2016-04-12 Method and device for cleaning up useless files

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610225383.1A CN105912671A (en) 2016-04-12 2016-04-12 Method and device for cleaning up useless files

Publications (1)

Publication Number Publication Date
CN105912671A true CN105912671A (en) 2016-08-31

Family

ID=56745904

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610225383.1A Pending CN105912671A (en) 2016-04-12 2016-04-12 Method and device for cleaning up useless files

Country Status (1)

Country Link
CN (1) CN105912671A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106777286A (en) * 2016-12-29 2017-05-31 北京猎豹移动科技有限公司 A kind of method for cleaning and electronic equipment
CN110737604A (en) * 2019-08-30 2020-01-31 北京奇艺世纪科技有限公司 method, device, electronic equipment and storage medium for automatically cleaning memory

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103577567A (en) * 2013-10-29 2014-02-12 广东欧珀移动通信有限公司 Method for uninstalling application and deleting garbage file in Android system
US20140215371A1 (en) * 2013-01-30 2014-07-31 Samsung Electronics Co., Ltd Data managing method and electronic device thereof
CN104866510A (en) * 2014-02-26 2015-08-26 北京金山安全软件有限公司 Method and device for removing residual file and method and device for establishing feature library of residual file
CN104965731A (en) * 2015-06-02 2015-10-07 广东欧珀移动通信有限公司 Data processing method and electronic terminal

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140215371A1 (en) * 2013-01-30 2014-07-31 Samsung Electronics Co., Ltd Data managing method and electronic device thereof
CN103577567A (en) * 2013-10-29 2014-02-12 广东欧珀移动通信有限公司 Method for uninstalling application and deleting garbage file in Android system
CN104866510A (en) * 2014-02-26 2015-08-26 北京金山安全软件有限公司 Method and device for removing residual file and method and device for establishing feature library of residual file
CN104965731A (en) * 2015-06-02 2015-10-07 广东欧珀移动通信有限公司 Data processing method and electronic terminal

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106777286A (en) * 2016-12-29 2017-05-31 北京猎豹移动科技有限公司 A kind of method for cleaning and electronic equipment
CN110737604A (en) * 2019-08-30 2020-01-31 北京奇艺世纪科技有限公司 method, device, electronic equipment and storage medium for automatically cleaning memory

Similar Documents

Publication Publication Date Title
CN105242898B (en) Mobile terminal split screen display available device and method
CN105893498A (en) Method and device for achieving screen capture and method and device for searching for images
CN106648369A (en) Switching device and method for application program
CN105915623A (en) Device and method of processing application installation package
CN105491227A (en) Message ranking method and terminal
CN106610770A (en) Picture viewing method and device
CN105808659A (en) Mobile terminal and webpage screen capturing method thereof
CN104951514A (en) Audio playing method and device
CN106095464B (en) A kind of method and device of the seamless operation of application program
CN105892803A (en) Quick setting method for setting items and mobile terminal
CN105843478A (en) Icon display control method and apparatus for shortcut switch
CN105760055A (en) Mobile terminal and control method thereof
CN104866095B (en) Mobile terminal and its desktop management method and apparatus
CN105955650A (en) Human-computer interaction operation method and device
CN105912671A (en) Method and device for cleaning up useless files
CN106230804A (en) Picture sharing method, terminal and server
CN105681434A (en) Application data synchronization method and device of mobile terminal
CN105183830A (en) Picture browsing method and apparatus
CN105744508B (en) Game data backup method and mobile terminal
CN106169966B (en) Wireless Test Toolset configuration device and method
CN106559577A (en) Mobile terminal and its control method
CN107194243A (en) A kind of mobile terminal and the method for installing application program
CN106598844A (en) Mobile terminal and method for calculating code defect rate of mobile terminal
CN106557555A (en) media playing method and device
CN105824510B (en) The method and apparatus for realizing display

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20160831

RJ01 Rejection of invention patent application after publication