CN106909632A - Garbage files searching method and terminal - Google Patents

Garbage files searching method and terminal Download PDF

Info

Publication number
CN106909632A
CN106909632A CN201710058961.1A CN201710058961A CN106909632A CN 106909632 A CN106909632 A CN 106909632A CN 201710058961 A CN201710058961 A CN 201710058961A CN 106909632 A CN106909632 A CN 106909632A
Authority
CN
China
Prior art keywords
file
path
folder
modification time
files
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.)
Withdrawn
Application number
CN201710058961.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 CN201710058961.1A priority Critical patent/CN106909632A/en
Publication of CN106909632A publication Critical patent/CN106909632A/en
Withdrawn 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/17Details of further file system functions
    • G06F16/1737Details of further file system functions for reducing power consumption or coping with limited storage space, e.g. in mobile devices
    • 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/14Details of searching files based on file metadata
    • G06F16/148File search processing

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Library & Information Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A kind of garbage files searching method and terminal are announced herein, including:Folder path table is set up, the folder path table is used to record path and its modification time of All Files folder;Whether changed when detecting the modification time of file compared to last scan;When being changed when the modification time of the file is compared to last scan, the path of the file is read from the folder path table and the garbage files under the path are scanned.The application can only scan the garbage files having in the file changed, and realize differential scanning, and the file do not changed no longer is made whether the judgement of garbage files, it is to avoid multiple scanning, so as to reach the purpose of lifting sweep speed.

Description

Garbage files searching method and terminal
Technical field
The application is related to field of terminal technology, espespecially a kind of garbage files searching method and terminal.
Background technology
With science and technology it is growing, mobile terminal have become user use temperature highest electronic equipment, it is right The Consumer's Experience requirement more and more higher of mobile terminal various functions, the systemic-function that mobile terminal is carried is also more and more, therewith And the system rubbish for coming also can be more and more, targetedly rubbish search and clearing function just obtain terminal user's once release Extensive concern and use.Garbage files searching algorithm, as the core technology that garbage-cleaning function is maximum on Consumer's Experience influence One of.
In correlation technique, for how faster more accurately to search for and the garbage files of mobile terminal are identified, while and The power consumption and performance fluency of mobile terminal are turned round and look to provide more preferably user experience, effective solution party is not proposed also at present Case.
The content of the invention
In order to solve the above-mentioned technical problem, a kind of garbage files searching method and terminal be the embodiment of the invention provides.
The embodiment of the invention provides as follows:
Embodiment of the present invention first aspect provides a kind of garbage files searching method, including:
Folder path table is set up, when the folder path table is used for path and its modification for recording All Files folder Between;
Whether changed when detecting the modification time of file compared to last scan;
When being changed when the modification time of the file is compared to last scan, read from the folder path table Simultaneously scan the garbage files under the path in the path of the file.
Alternatively, it is described detection file modification time compared to last scan when whether change after, also include:
When being not changed in when the modification time of the file is compared to last scan, the file is not scanned.
Alternatively, it is described to set up after the folder path table, also include:
According to the store path that All Files in local storage and/or peripheral memory is pressed from both sides, the file road is updated Footpath table.
Alternatively, the store path pressed from both sides according to All Files in local storage and/or peripheral memory, updates institute Folder path table is stated, including:
Traversal local storage and/or peripheral memory in All Files folder store path and with the folder path Existing entry is compared in table;Statistics increases path newly and has deleted path, and the newly-increased path is write into the file road Footpath table and record corresponding document folder modification time in, the corresponding entry that will delete path is deleted from the folder path table Remove.
Alternatively, it is described set up folder path table before, also include:Carried out for the file for only including discarded record Mark;
Before whether being changed when the modification time of the detection file is compared to last scan, for the mark mould The marked file of block does not perform scanning, is added directly to garbage files treatment progress.
Embodiment of the present invention second aspect provides a kind of terminal, including:
Folder path maintenance module, for setting up folder path table, the folder path table is used to record all The path of file and its modification time;
Whether detection module, change during for detecting the modification time of file compared to last scan;
Scan module, when being changed during for the modification time in the file compared to last scan, from the text The path of the file is read in part folder routing table and scan the garbage files under the path.
Alternatively, the scan module, is additionally operable to not have when the modification time of the file is compared to last scan During change, the file is not scanned.
Alternatively, the folder path maintenance module, is additionally operable to according to institute in local storage and/or peripheral memory There is the store path of file, update the folder path table.
Alternatively, also include:
Mark module, for being marked for the file for only including discarded record;
The scan module, is additionally operable to not perform scanning for the marked file of the mark module, and its is direct Added to garbage files treatment progress.
The embodiment of the present invention third aspect provides a kind of terminal, including:Processor and memory, the memory storage have Computer executable instructions, realize following method when the computer executable instructions are by the computing device:
Folder path table is set up, when the folder path table is used for path and its modification for recording All Files folder Between;
Whether changed when detecting the modification time of file compared to last scan;
When being changed when the modification time of the file is compared to last scan, read from the folder path table Simultaneously scan the garbage files under the path in the path of the file.
A kind of garbage files searching method and terminal are the embodiment of the invention provides, a mobile terminal document system is safeguarded All files folder routing table, only scanning has garbage files in the file changed, realizes differential scanning, do not changed File be no longer made whether the judgement of garbage files, it is to avoid multiple scanning, so as to reach the purpose of lifting sweep speed.
Brief description of the drawings
Accompanying drawing is used for providing further understanding technical solution of the present invention, and constitutes a part for specification, with this The embodiment of application for explaining technical scheme, does not constitute the limitation to technical solution of the present invention together.
Fig. 1 is the hardware architecture diagram for realizing each optional mobile terminal of embodiment one of the invention;
Fig. 2 is the wireless communication system schematic diagram of mobile terminal as shown in Figure 1;
Fig. 3 is the schematic flow sheet of embodiment of the present invention garbage files searching method;
Fig. 4 is the implementation procedure schematic diagram of garbage files scanning in the embodiment of the present invention;
Fig. 5 is the schematic flow sheet of garbage files scanning in the example of the embodiment of the present invention one;
Fig. 6 is the renewal schematic flow sheet of file routing table in the example of the embodiment of the present invention one;
Fig. 7 is the composition structural representation of embodiment of the present invention garbage files searcher.
The realization of the object of the invention, functional characteristics and advantage will be described further referring to the drawings in conjunction with the embodiments.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
The mobile terminal of each embodiment of the invention is realized referring now to Description of Drawings.In follow-up description, use For represent element such as " module ", " part " or " unit " suffix only for being conducive to explanation of the invention, itself Not specific meaning.Therefore, " module " can be used mixedly with " part ".
Mobile terminal can be implemented in a variety of manners.For example, the terminal described in the present invention can include such as moving Phone, smart phone, notebook computer, digit broadcasting receiver, PDA (personal digital assistant), PAD (panel computer), PMP The mobile terminal of (portable media player), guider etc. and such as numeral TV, desktop computer etc. are consolidated Determine terminal.Hereinafter it is assumed that terminal is mobile terminal.However, it will be understood by those skilled in the art that, except being used in particular for movement Outside the element of purpose, construction according to the embodiment of the present invention can also apply to the terminal of fixed type.
Fig. 1 is that the hardware configuration of the mobile terminal for realizing each embodiment of the invention is illustrated.
Mobile terminal 1 00 can include wireless communication unit 110, A/V (audio/video) input block 120, user input Unit 130, sensing unit 140, output unit 150, memory 160, interface unit 170, controller 180 and power subsystem 190 Etc..
Fig. 1 shows the mobile terminal 1 00 with various assemblies, it should be understood that being not required for implementing all showing The component for going out.More or less component can alternatively be implemented.The element of mobile terminal 1 00 will be discussed in more detail below.
Wireless communication unit 110 can generally include one or more assemblies, and it allows mobile terminal 1 00 and radio communication Radio communication between system or network.For example, wireless communication unit 110 can include that broadcasting reception module 111, movement are logical At least one of letter module 112, wireless Internet module 113, short range communication module 114 and location information module 115.
Broadcasting reception module 111 receives broadcast singal and/or broadcast via broadcast channel from external broadcast management server Relevant information.Broadcast channel can include satellite channel and/or terrestrial channel.Broadcast management server can be generated and sent The broadcast singal and/or broadcast related information generated before the server or reception of broadcast singal and/or broadcast related information And send it to the server of terminal.Broadcast singal can include TV broadcast singals, radio signals, data broadcasting Signal etc..And, broadcast singal may further include the broadcast singal combined with TV or radio signals.Broadcast phase Pass information can also be provided via mobile communications network, and in this case, broadcast related information can be by mobile communication mould Block 112 is received.Broadcast singal can exist in a variety of manners, for example, it can be with the electronics of DMB (DMB) The form of program guide (EPG), the electronic service guidebooks (ESG) of digital video broadcast-handheld (DVB-H) etc. and exist.Broadcast Receiver module 111 can receive signal and broadcast by using various types of broadcast systems.Especially, broadcasting reception module 111 Can be wide by using such as multimedia broadcasting-ground (DMB-T), DMB-satellite (DMB-S), digital video Broadcast-hand-held (DVB-H), Radio Data System, the received terrestrial digital broadcasting integrated service of forward link media (MediaFLO@) Etc. (ISDB-T) digit broadcasting system receives digital broadcasting.Broadcasting reception module 111 may be constructed such that and be adapted to provide for extensively Broadcast the various broadcast systems and above-mentioned digit broadcasting system of signal.Via broadcasting reception module 111 receive broadcast singal and/ Or broadcast related information can be stored in memory 160 (or other types of storage medium).
Mobile communication module 112 sends radio signals to base station (for example, access point, node B etc.), exterior terminal And at least one of server and/or receive from it radio signal.Such radio signal can be logical including voice Words signal, video calling signal or the various types of data for sending and/or receiving according to text and/or Multimedia Message.
Wireless Internet module 113 supports the Wi-Fi (Wireless Internet Access) of mobile terminal.The module can be internally or externally It is couple to terminal.Wi-Fi (Wireless Internet Access) technology involved by the module can include WLAN (WLAN) (Wi-Fi), Wibro (WiMAX), Wimax (worldwide interoperability for microwave accesses), HSDPA (high-speed downlink packet access) etc..
Short range communication module 114 is the module for supporting junction service.Some examples of short-range communication technology include indigo plant Tooth TM, radio frequency identification (RFID), Infrared Data Association (IrDA), ultra wide band (UWB), purple honeybee TM etc..
Location information module 115 is the module for checking or obtaining the positional information of mobile terminal.Location information module 115 typical case is GPS (global positioning system).According to current technology, GPS calculate from three or more satellites away from Information application triangulation from information and correct time information and for calculating, so as to according to longitude, latitude and height Degree calculates three-dimensional current location information exactly.Currently, three satellites are used simultaneously for calculating the method for position and temporal information And the error of the position and temporal information for calculating is corrected by using an other satellite.Additionally, GPS can be by real-time Ground Continuous plus current location information carrys out calculating speed information.
A/V input blocks 120 are used to receive audio or video signal.A/V input blocks 120 can include the He of camera 121 Microphone 122, the static images that 121 pairs, camera is obtained in Video Capture pattern or image capture mode by image capture apparatus Or the view data of video is processed.Picture frame after treatment may be displayed on display unit 151.Processed through camera 121 Picture frame afterwards can be stored in memory 160 (or other storage mediums) or sent out via wireless communication unit 110 Send, two or more cameras 121 can be provided according to the construction of mobile terminal 1 00.Microphone 122 can be in telephone relation mould In formula, logging mode, speech recognition mode etc. operational mode sound (voice data), and energy are received via microphone 122 Enough is voice data by such acoustic processing.Audio (voice) data after treatment can be in the case of telephone calling model The form that being converted to can be sent to mobile communication base station via mobile communication module 112 is exported.Microphone 122 can be implemented various The noise of type eliminates (or suppression) algorithm and is being received and making an uproar of producing during sending audio signal with eliminating (or suppression) Sound or interference.
User input unit 130 can generate key input data to control mobile terminal 1 00 according to the order of user input Various operations.User input unit 130 allow the various types of information of user input, and can include keyboard, metal dome, Touch pad (for example, detection due to being touched caused by resistance, pressure, electric capacity etc. change sensitive component), roller, shake Bar etc..Especially, when touch pad is superimposed upon on display unit 151 in the form of layer, touch-screen can be formed.
Sensing unit 140 detects the current state of mobile terminal 1 00, (for example, mobile terminal 1 00 opens or closes shape State), the presence or absence of the contact (that is, touch input) of the position of mobile terminal 1 00, user for mobile terminal 1 00, mobile terminal The acceleration or deceleration movement of 100 orientation, mobile terminal 1 00 and direction etc., and generate for controlling mobile terminal 1 00 The order of operation or signal.For example, when mobile terminal 1 00 is embodied as sliding-type mobile phone, sensing unit 140 can be sensed The sliding-type phone is opened or closed.In addition, sensing unit 140 can detect power subsystem 190 whether provide electric power or Whether person's interface unit 170 couples with external device (ED).Sensing unit 140 can include proximity transducer 141.
Interface unit 170 is connected the interface that can pass through with mobile terminal 1 00 as at least one external device (ED).For example, External device (ED) can include wired or wireless head-band earphone port, external power source (or battery charger) port, wired or nothing Line FPDP, memory card port, the port for connecting the device with identification module, audio input/output (I/O) end Mouth, video i/o port, ear port etc..Identification module can be that storage uses each of mobile terminal 1 00 for verifying user Kind of information and subscriber identification module (UIM), client identification module (SIM), Universal Subscriber identification module (USIM) can be included Etc..In addition, the device (hereinafter referred to as " identifying device ") with identification module can take the form of smart card, therefore, know Other device can be connected via port or other attachment means with mobile terminal 1 00.Interface unit 170 can be used for reception and come from The input (for example, data message, electric power etc.) of the external device (ED) and input that will be received is transferred in mobile terminal 1 00 One or more elements can be used for transmitting data between mobile terminal 1 00 and external device (ED).
In addition, when mobile terminal 1 00 is connected with external base, interface unit 170 can serve as allowing by it by electricity Power provides to the path of mobile terminal 1 00 from base or can serve as allowing the various command signals being input into from base to pass through it It is transferred to the path of mobile terminal 1 00.Can serve as recognizing mobile terminal 1 00 from the various command signals or electric power of base input Whether signal base on is accurately fitted within.Output unit 150 is configured to be provided with vision, audio and/or tactile manner Output signal (for example, audio signal, vision signal, alarm signal, vibration signal etc.).Output unit 150 can include aobvious Show unit 151, dio Output Modules 152, alarm unit 153 etc..
Display unit 151 may be displayed on the information processed in mobile terminal 1 00.For example, when mobile terminal 1 00 is in electricity During words call mode, display unit 151 can show and converse or other communicate (for example, text messaging, multimedia file Download etc.) related user interface (UI) or graphic user interface (GUI).When mobile terminal 1 00 is in video calling pattern Or during image capture mode, display unit 151 can show the image of capture and/or the image of reception, show video or figure UI or GUI of picture and correlation function etc..
Meanwhile, when display unit 151 and touch pad in the form of layer it is superposed on one another to form touch-screen when, display unit 151 can serve as input unit and output device.Display unit 151 can include liquid crystal display (LCD), thin film transistor (TFT) In LCD (TFT-LCD), Organic Light Emitting Diode (OLED) display, flexible display, three-dimensional (3D) display etc. at least It is a kind of.Some in these displays may be constructed such that transparence to allow user to be watched from outside, and this is properly termed as transparent Display, typical transparent display can be, for example, TOLED (transparent organic light emitting diode) display etc..According to specific Desired implementation method, mobile terminal 1 00 can include two or more display units (or other display devices), for example, moving Dynamic terminal 100 can include outernal display unit (not shown) and inner display unit (not shown).Touch-screen can be used to detect Touch input pressure and touch input position and touch input area.
Dio Output Modules 152 can be in call signal reception pattern, call mode, record mould in mobile terminal 1 00 It is that wireless communication unit 110 is received or in memory when under the isotypes such as formula, speech recognition mode, broadcast reception mode In 160 store voice data transducing audio signal and be output as sound.And, dio Output Modules 152 can provide with The audio output of the specific function correlation that mobile terminal 1 00 is performed is (for example, call signal receives sound, message sink sound etc. Deng).Dio Output Modules 152 can include loudspeaker, buzzer etc..
Alarm unit 153 can provide output and be notified to mobile terminal 1 00 with by event.Typical event can be with Including calling reception, message sink, key signals input, touch input etc..In addition to audio or video is exported, alarm unit 153 can in a different manner provide output with the generation of notification event.For example, alarm unit 153 can be in the form of vibrating Output is provided, when calling, message or some other entrance communication (incoming communication) are received, alarm list Unit 153 can provide tactile output (that is, vibrating) to notify to user.Exported by providing such tactile, even if When in pocket of the mobile phone of user in user, user also can recognize that the generation of various events.Alarm unit 153 The output of the generation of notification event can be provided via display unit 151 or dio Output Modules 152.
Memory 160 can store software program for the treatment and control operation performed by controller 180 etc., Huo Zheke Temporarily to store oneself data (for example, telephone directory, message, still image, video etc.) through exporting or will export.And And, memory 160 can store the vibration of various modes on being exported when touching and being applied to touch-screen and audio signal Data.
Memory 160 can include the storage medium of at least one type, and the storage medium includes flash memory, hard disk, many Media card, card-type memory (for example, SD or DX memories etc.), random access storage device (RAM), static random-access storage Device (SRAM), read-only storage (ROM), Electrically Erasable Read Only Memory (EEPROM), programmable read only memory (PROM), magnetic storage, disk, CD etc..And, mobile terminal 1 00 can perform memory with by network connection The network storage device cooperation of 160 store function.
The overall operation of the generally control mobile terminal of controller 180.For example, controller 180 is performed and voice call, data Communication, video calling etc. related control and treatment.In addition, controller 180 can be included for reproducing (or playback) many matchmakers The multi-media module 181 of volume data, multi-media module 181 can be constructed in controller 180, or can be structured as and control Device 180 is separated.Controller 180 can be with execution pattern identifying processing, the handwriting input that will be performed on the touchscreen or picture Draw input and be identified as character or image.
Power subsystem 190 receives external power or internal power under the control of controller 180 and provides operation each unit Appropriate electric power needed for part and component.
Various implementation methods described herein can be with use such as computer software, hardware or its any combination of calculating Machine computer-readable recording medium is implemented.Implement for hardware, implementation method described herein can be by using application-specific IC (ASIC), digital signal processor (DSP), digital signal processing device (DSPD), programmable logic device (PLD), scene can Programming gate array (FPGA), processor, controller, microcontroller, microprocessor, it is designed to perform function described herein At least one in electronic unit is implemented, and in some cases, such implementation method can be implemented in controller 180. For software implementation, the implementation method of such as process or function can with allow to perform the single of at least one function or operation Software module is implemented.Software code can be come by the software application (or program) write with any appropriate programming language Implement, software code can be stored in memory 160 and performed by controller 180.
So far, oneself according to its function through describing mobile terminal 1 00.In addition, the mobile terminal 1 00 in the embodiment of the present invention Can be such as folded form, board-type, oscillating-type, sliding-type and other various types of mobile terminals, not do herein specifically Limit.
Mobile terminal 1 00 as shown in Figure 1 may be constructed such that using via frame or packet transmission data it is all if any Line and wireless communication system and satellite-based communication system are operated.
The communication system that mobile terminal wherein of the invention can be operated is described referring now to Fig. 2.
Such communication system can use different air interface and/or physical layer.For example, used by communication system Air interface includes such as frequency division multiple access (FDMA), time division multiple acess (TDMA), CDMA (CDMA) and universal mobile communications system System (UMTS) (especially, Long Term Evolution (LTE)), global system for mobile communications (GSM) etc..As non-limiting example, under The description in face is related to cdma communication system, but such teaching is equally applicable to other types of system.
With reference to Fig. 2, cdma wireless communication system can include multiple intelligent terminals 100, multiple base station (BS) 270, base station Controller (BSC) 275 and mobile switching centre (MSC) 280.MSC 280 is configured to and Public Switched Telephony Network (PSTN) 290 form interface.MSC 280 is also structured to be formed with the BSC 275 that can be couple to base station 270 via back haul link and connects Mouthful.If any one in the interface that back haul link can be known according to Ganji is constructed, the interface can include such as Europe mark Quasi- high power capacity digital circuit/Unite States Standard high power capacity digital circuit (E1/T1), asynchronous transfer mode (ATM), procotol (IP), point-to-point protocol (PPP), frame relay, high-bit-rate digital subscriber line road (HDSL), Asymmetrical Digital Subscriber Line (ADSL) Or all kinds digital subscriber line (xDSL).It will be appreciated that system can include multiple BSC 275 as shown in Figure 2.
Each BS 270 can service one or more subregions (or region), by multidirectional antenna or the day of sensing specific direction Each subregion of line covering is radially away from BS 270.Or, each subregion can by two for diversity reception or more Multiple antennas are covered.Each BS 270 may be constructed such that the multiple frequency distribution of support, and the distribution of each frequency has specific frequency Spectrum (for example, 1.25MHz, 5MHz etc.).
What subregion and frequency were distributed intersects can be referred to as CDMA Channel.BS 270 can also be referred to as base station transceiver System (BTS) or other equivalent terms.In this case, term " base station " can be used for broadly representing single BSC 275 and at least one BS 270.Base station can also be referred to as " cellular station ".Or, each subregion of specific BS 270 can be claimed It is multiple cellular stations.
As shown in Figure 2, broadcast singal is sent to broadcsting transmitter (BT) 295 mobile terminal operated in system 100.Broadcasting reception module 111 as shown in Figure 1 is arranged at mobile terminal 1 00 to receive the broadcast sent by BT 295 Signal.In fig. 2 it is shown that several global positioning system (GPS) satellites 300.Satellite 300 helps position multiple mobile terminals At least one of 100.
In fig. 2, multiple satellites 300 are depicted, it is understood that be, it is possible to use any number of satellite obtains useful Location information.Location information module 115 as shown in Figure 1 is (such as:GPS) it is generally configured to coordinate to obtain with satellite 300 The location information that must be wanted.Substitute GPS tracking techniques or outside GPS tracking techniques, it is possible to use can track mobile whole Other technologies of the position at end.In addition, at least one gps satellite 300 can optionally or additionally process satellite dmb biography It is defeated.
Used as a typical operation of wireless communication system, BS 270 receives the reverse strand from various mobile terminal 1s 00 Road signal.Mobile terminal 1 00 generally participates in call, information receiving and transmitting and other types of communication.Each of certain base station reception is anti- Processed in specific BS 270 to link signal.The data of acquisition are forwarded to the BSC 275 of correlation.BSC provides logical Words resource allocation and the mobile management function of the coordination including the soft switching process between BS 270.BSC 275 will also be received Data be routed to MSC 280, its provide for PSTN 290 formed interface extra route service.Similarly, PSTN 290 form interface with MSC 280, and MSC 280 and BSC 275 form interface, and BSC 275 correspondingly control BS 270 with by Forward link signals are sent to mobile terminal 1 00.
Use time with user terminal increases, and the user file that user preserves in the terminal can be more and more, or even Up to tens G up to a hundred, meanwhile, the accumulation of the useless garbage files that user produces in use also can be more and more.Such as Fruit is all catalogues of traversal and file of simple serial, and the time that garbage files search expends is intolerable user, right The systematic function of mobile terminal will also result in large effect, and with the growth of use time, due to increasing for file, search Suo Sudu also can be more and more slower.Therefore, the application provides a kind of garbage files searching method that can be applied to mobile terminal, to carry The search speed of garbage files is risen, and then lifts Consumer's Experience.
Embodiment one
As shown in figure 3, this application provides a kind of garbage files searching method, mobile terminal is applied to, including:
Step 301, sets up folder path table, the folder path table be used to record All Files folder path and its Modification time;
Whether step 302, change when detecting the modification time of file compared to last scan;If it is, continuing Step 303, otherwise continues step 304;
Step 303, when being changed when the modification time of the file is compared to last scan, from the folder path The path of the file is read in table and the garbage files under the path are scanned.
Step 304, when being not changed in when the modification time of the file is compared to last scan, the file is not scanned Folder.
In the present embodiment, maintenance includes the text of all files folder path and its modification time in mobile terminal document system Part presss from both sides routing table, and during scanning, whether detection file modification time changes, if changed, scans the rubbish under the path Rubbish file, if be not changed in, this document folder is not scanned.In this way, only scanning has the garbage files in the file changed, Differential scanning is realized, the file do not changed no longer is made whether the judgement of garbage files, it is to avoid multiple scanning, so that Reach the purpose of lifting sweep speed.
In the present embodiment, the folder path table maps to the data cached table of folder path, the folder path Data cached table storage is in internal memory.Can be with synchronized update folder path table when the data cached table of folder path updates.
In some implementations, it is described to set up after the folder path table, can also include:According to being locally stored The store path of All Files folder, updates the folder path table in device and/or peripheral memory.
Specifically, the more new technological process of folder path table can include:Open and update path thread;Traversal All Files folder Store path and be compared with existing entry in file routing table in database (such as allPaths tables);The newly-increased road of statistics Footpath and path is deleted, the newly-increased path is write into the folder path table and the modification time of corresponding document folder is recorded In, the corresponding entry that will delete path is deleted from folder path table.
In practical application, the renewal process of folder path table is a thread for running background.The renewal of file path Can regularly carry out, for example, it is " updating once daily " that can pre-set renewal frequency, updating path thread can be according to this Frequency is timed renewal.To avoid file path from updating occupying system resources, more new thread can be set to system relative Start when idle, for example:Start more new thread detecting when mobile terminal enters and charges the state for closing screen, carry out file road The renewal in footpath.
In practical application, routing database can be set up, by the storage of above-mentioned folder path table in routing database, Garbage files can obtain the content in the folder path table by read path database when scanning.
Due to more frequent to database manipulation, multiple rubbish scanning threads can all have the operation to routing table, easily go out The problems such as existing database is locked or database IO is abnormal, therefore, in the application, the method for a large amount of operating databases is used Transaction methods focus on the generic operation, to improve database processing efficiency.
For example, routing database pattern is as shown in table 1 below:
Table 1
Wherein, tables of data incidence relation explanation:Path_index field records in root_dir this using corresponding Caching ID indexes, with cach_path tables _ id fields association, be easy to the cache path of quick search application.
In practical application, garbage files can be performed by mode as shown in Figure 4 and scanned, specifically:Detection object:Only The memory of mobile terminal is detected, the peripheral hardwares such as SD card are not detected, the trigger condition of detection can include:Detected during bright screen, If condition meets, give notice, otherwise terminate.After starting scanning, can suspend halfway/scanning process is exited, return to and treat Machine state.Scanning enters holding state after completing.Scanning process can not be suspended, after the completion of scanning, the whole scanning of acquiescence construction As a result.Detect mobile terminal return key (Back keys) be triggered after, directly exit scanning interface, and terminate scanning.Detection To mobile terminal operating key (such as Home key) be triggered after, continue in background scanning.Charging is detected to close screen, enter ox shield, deposit During storage state change, the flow of background update folder path table is triggered.Wherein it is possible to operation is scanned in idle, and will Scanning result is preserved.When user enters plain scan interface, no longer it is scanned, the result of preservation is directly presented to use Family.During memory space inadequate, when the memory space for detecting mobile terminal is less than preset value, given notice message in status bar, To remind user storage space not enough.Hereafter, user can trigger the search of garbage files by clicking on the notification message, also To say, user click on notification message after mobile terminal can automatically into the scanning interface of garbage files and start scanning.
In some implementations, it is described set up folder path table before, also include:For only including discarded record File is marked;Before whether being changed when the modification time of the detection file is compared to last scan, for institute State the marked file of mark module and do not perform scanning, be added directly to garbage files treatment progress.So, having determined When file under certain file is all discarded record, rower is entered when can run into such file when garbage files are searched for Note, subsequently no longer scans with time-consuming, garbage files treatment progress is directly added it to, so as to subsequent execution garbage files Treatment.
In practical application, the scanning process of garbage files is the process of traversal storage, name, type according to file, big The parameter such as small judges whether this document belongs to garbage files.The optimization of garbage files sweep speed is to require consideration for how to reduce This process it is time-consuming.On the one hand it is the quantity for reducing traversal storage, and then reduces the consumption of whole garbage files search procedure When, on the other hand it is, using the independence and onrelevant of garbage files, by the lookup algorithm based on binary tree, further to carry Search efficiency is risen, the entirety for reducing garbage files search takes.
In practical application, mode shown in Fig. 4 can be provided for the state machine that garbage files are searched for by mobile terminal, lead to Cross the state and perform flow shown in Fig. 4, so as to the garbage files for realizing the application are searched for.
The application is described in detail by taking Android mobile phone as an example below.
The producing cause of garbage files:Android is applied when operation, and system can be in data subregions (data/ Data/ application bags name /) it is using one privately owned catalogue of generation, database file, configuration file, caching for depositing application File.After the cache file of privately owned catalogue is not used, system will not be removed automatically, be considered for some using itself, also not Understand oneself and remove cache file, this results in the unnecessary waste of memory space.One Android is applied except data subregions Privately owned catalogue, can also mobile phone storage and SD card storage generation alternative document, such as temporary file, promotional literature, empty folder, slow Deposit file etc..When unloading is applied, android system can only be unloaded applying the privately owned file in data subregions to delete The alternative document that the application of load is generated then has been remained in memory block.If being carried out clearly to these discarded records not in time Reason, gently then causes the waste of memory space, the heavy then normal function of influence system.
The class definition of garbage files:
1) rubbish is stored:Garbage files in memory space are referred to as storing rubbish.
Storage rubbish includes following several classes:
Empty folder:File not comprising file
Using exception:It is named as the file of LOST.DIR
Temporary file:Suffix is the file of .temp/.tmp forms
Thumbnail:The file of .thumbnails/.thumbnails_netease is named as, except the thumbnail of picture library
Journal file:Suffix is .log or the file being named as under Log files
Other regular garbage files:Wait to supplement
Acquisition modes:The storage of traversal mobile phone and SD card.
Note:Wherein 8 layers of file are at most only scanned in the space of storage garbage files, installation kit in traversal.
2) cache file:Cache file is divided into system cache and application cache.
System cache:Application operation during, by system be using generation cache file, its deposit path for "/ Data/data/ bags name/cache ".Acquisition modes:Call PackageManager.getPackageSizeInfo ().
Application cache:During application operation, the file generated for itself optimization or from the aspect of it by application, Store path is determined (interior of mobile phone is stored or SD card) by application.These files are deleted, the normal function applied will not be caused Influence.
Acquisition modes:First obtain mounted application in mobile phone, then caching of the bag name in rubbish dictionary by applying Routing table is inquired about.
3) Stub File is unloaded:
Unloading Stub File refers to using All Files produced in the process of running, after application is unloaded, also It is retained in the file in mobile phone.
Acquisition modes:Inquire about the unloading surviving path table of rubbish dictionary.
4) big file
Big file refers to all more than 20M in mobile phone, and suffix is not the file of .apk.
Acquisition modes:The storage of traversal mobile phone and SD card.
5) useless installation kit
Useless installation kit refers to all files with .apk as suffix in mobile phone.
Acquisition modes:Traversal storage (mobile phone memory and SD card).
In order to more easily recognize the rubbish type of each file in database, rubbish type mark can be pre-defined (Type) it is as follows:Type=0 does not have garbage files;Type=1 default scans;Type=2 applications abnormal document is pressed from both sides;Type=3 Thumbnail;Type=4 empty folders;Type=4 temporary files;Type=5 installation files;The big files of Type=6.
As shown in figure 5, scanning process can include:
Step 501, into rubbish function of search module;
Whether step 502, routing database updates completion;If it is, continuing step 404, otherwise continue step 503;
Step 503, pending file routing update is completed;
Step 504, the folder path table in read path database;
Step 505, reads type;
Step 506, if type=1, the lower path file of scanning file folder simultaneously updates the data last_modify/ in storehouse Type/size fields;
Step 407, such as figure type!=1, judge whether change per the corresponding modification time of paths;If it is continue Step 408, otherwise continues 411;
Step 508, judges type;
Step 509, if type is 2,3,4,5,6, the lower file of scanning this document folder, if having garbage files, update Type/size/last_modify fields;
Step 510, updates size/last_modify fields;
Step 511, reads record information, performs garbage files treatment.
As shown in fig. 6, the flow that file routing database updates in this example can include:
Step 601, opens garbage files search, searches subregion path (memory and SD card of mobile phone);
Step 602, if traveled throughIf it is, continuing step 403, otherwise continue step 404;
Step 603, unnecessary path in deletion database;
Step 604, inquires about allPaths tables, and the path whether there is
Step 605, by the path write into Databasce;
Step 606, reads next paths.
Above-mentioned example can also be applied to other electronic equipments, such as panel computer etc..
Embodiment two
As shown in fig. 7, the present embodiment provides a kind of terminal, including:
Folder path maintenance module 71, for setting up folder path table, the folder path table is used to record institute There are path and its modification time of file;
Whether detection module 72, change during for detecting the modification time of file compared to last scan;
Scan module 73, when being changed during for the modification time in the file compared to last scan, from described The path of the file is read in folder path table and the garbage files under the path are scanned.
Wherein, the scan module 73, it may also be used for do not have when the modification time of the file is compared to last scan When changing, the file is not scanned.
Wherein, the folder path maintenance module 71, it may also be used for according in local storage and/or peripheral memory The store path of All Files folder, updates the folder path table.
Wherein, above-mentioned terminal can also include:Mark module 74, for being carried out for the file for only including discarded record Mark;The scan module 73, is additionally operable to not perform scanning for the marked file of the mark module 74, and its is direct Added to garbage files treatment progress.
Terminal can realize the methods described of embodiment one in the present embodiment, and it is identical that it implements details, repeats no more.
Above-mentioned terminal in the present embodiment, maintenance includes the folder path of all files folder path and its modification time Table, during scanning, whether detection file modification time changes, if changed, scans the garbage files under the path, such as Fruit is not changed in, then do not scan this document folder.In this way, only scanning there are the garbage files in the file changed, difference is realized Scanning, the file do not changed no longer is made whether the judgement of garbage files, it is to avoid multiple scanning, so as to reach lifting The purpose of sweep speed.
Terminal can be mobile terminal in the present embodiment.In some implementations, the above-mentioned terminal of the present embodiment can be with In being the mobile terminal shown in Fig. 1.It should be noted that the folder path maintenance module in the above-mentioned terminal of the application offer 71st, during detection module 72, scan module 73 and mark module 74 can set controller 180 in Fig. 1.
Embodiment three
In the present embodiment, there is provided a kind of terminal, including:Processor and memory, the memory storage have computer Executable instruction, realizes following method when the computer executable instructions are by the computing device:
Folder path table is set up, when the folder path table is used for path and its modification for recording All Files folder Between;
Whether changed when detecting the modification time of file compared to last scan;
When being changed when the modification time of the file is compared to last scan, read from the folder path table Simultaneously scan the garbage files under the path in the path of the file.
In some implementations, when the computer executable instructions are by the computing device when realizing the above method Executable following operation:After whether being changed when the modification time of the detection file is compared to last scan, described When being not changed in when the modification time of file is compared to last scan, the file is not scanned.
In some implementations, when the computer executable instructions are by the computing device when realizing the above method Executable following operation:It is described to set up after the folder path table, according to institute in local storage and/or peripheral memory There is the store path of file, update the folder path table.
In some implementations, when the computer executable instructions are by the computing device when realizing the above method Executable following operation:Traversal local storage and/or peripheral memory in All Files folder store path and with the text Existing entry is compared in part folder routing table;Statistics increases path newly and has deleted path, and the newly-increased path write-in is described Folder path table simultaneously records the modification time of corresponding document folder, will delete the corresponding entry in path from the file road Deleted in the table of footpath.
In some implementations, when the computer executable instructions are by the computing device when realizing the above method Executable following operation:It is described set up folder path table before, for only include discarded record file be marked;Institute It is marked for the mark module before whether being changed when stating the modification time of detection file compared to last scan File does not perform scanning, is added directly to garbage files treatment progress.
Above-mentioned terminal in the present embodiment, maintenance includes the folder path of all files folder path and its modification time Table, during scanning, whether detection file modification time changes, if changed, scans the garbage files under the path, such as Fruit is not changed in, then do not scan this document folder.In this way, only scanning there are the garbage files in the file changed, difference is realized Scanning, the file do not changed no longer is made whether the judgement of garbage files, it is to avoid multiple scanning, so as to reach lifting The purpose of sweep speed.
In some implementations, terminal can be mobile terminal as shown in Figure 1 in the present embodiment.
Example IV
The present embodiment provides a kind of computer-readable recording medium, and be stored with computer executable instructions, the computer Following methods are realized when executable instruction is performed:
Folder path table is set up, when the folder path table is used for path and its modification for recording All Files folder Between;
Whether changed when detecting the modification time of file compared to last scan;
When being changed when the modification time of the file is compared to last scan, read from the folder path table Simultaneously scan the garbage files under the path in the path of the file.
Computer-readable recording medium in the present embodiment can be applied in mobile terminal, and maintenance includes all files folder Path and its folder path table of modification time, during scanning, whether detection file modification time changes, if becoming Change, then scan the garbage files under the path, if be not changed in, this document folder is not scanned.In this way, only scan to have being changed File in garbage files, realize differential scanning, the file do not changed no longer is made whether garbage files Judge, it is to avoid multiple scanning, so as to reach the purpose of lifting sweep speed.
Alternatively, in the present embodiment, above-mentioned storage medium can be included but is not limited to:USB flash disk, read-only storage (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disc or CD etc. is various can be with the medium of store program codes.
Alternatively, in the present embodiment, processor performs above-mentioned implementation according to the program code stored in storage medium The method and step of example.
Alternatively, the specific example in the present embodiment may be referred to the description in above-described embodiment, and the present embodiment is herein not Repeat again.
It should be noted that herein, term " including ", "comprising" or its any other variant be intended to non-row His property is included, so that process, method, article or device including a series of key elements not only include those key elements, and And also include other key elements being not expressly set out, or also include for this process, method, article or device institute are intrinsic Key element.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that including this Also there is other identical element in the process of key element, method, article or device.
The embodiments of the present invention are for illustration only, and the quality of embodiment is not represented.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hardware, but in many cases The former is more preferably implementation method.Based on such understanding, technical scheme is substantially done to prior art in other words The part for going out contribution can be embodied in the form of software product, and the computer software product is stored in a storage medium In (such as ROM/RAM, magnetic disc, CD), including some instructions are used to so that a station terminal equipment (can be mobile phone, computer, clothes Business device, air-conditioner, or network equipment etc.) perform method described in each embodiment of the invention.
The preferred embodiments of the present invention are these are only, the scope of the claims of the invention is not thereby limited, it is every to utilize this hair Equivalent structure or equivalent flow conversion that bright specification and accompanying drawing content are made, or directly or indirectly it is used in other related skills Art field, is included within the scope of the present invention.

Claims (10)

1. a kind of garbage files searching method, it is characterised in that including:
Folder path table is set up, the folder path table is used to record path and its modification time of All Files folder;
Whether changed when detecting the modification time of file compared to last scan;
When being changed when the modification time of the file is compared to last scan, read from the folder path table described Simultaneously scan the garbage files under the path in the path of file.
2. garbage files searching method according to claim 1, it is characterised in that the modification time of the detection file After whether being changed during compared to last scan, also include:
When being not changed in when the modification time of the file is compared to last scan, the file is not scanned.
3. garbage files searching method according to claim 2, it is characterised in that described to set up the folder path table Afterwards, also include:
According to the store path that All Files in local storage and/or peripheral memory is pressed from both sides, the folder path table is updated.
4. garbage files searching method according to claim 3, it is characterised in that it is described according to local storage and/or The store path of All Files folder in peripheral memory, updates the folder path table, including:
Traversal local storage and/or peripheral memory in All Files folder store path and with the folder path table in Existing entry is compared;Statistics increases path newly and has deleted path, and the newly-increased path is write into the folder path table And record corresponding document folder modification time in, the corresponding entry that will delete path is deleted from the folder path table.
5. garbage files searching method according to claim 1, it is characterised in that it is described set up folder path table it Before, also include:It is marked for the file for only including discarded record;
Before whether being changed when the modification time of the detection file is compared to last scan, for the mark module The file of mark does not perform scanning, is added directly to garbage files treatment progress.
6. a kind of terminal, it is characterised in that including:
Folder path maintenance module, for setting up folder path table, the folder path table is used to record All Files The path of folder and its modification time;
Whether detection module, change during for detecting the modification time of file compared to last scan;
Scan module, when being changed during for the modification time in the file compared to last scan, from the file The path of the file is read in routing table and the garbage files under the path are scanned.
7. terminal according to claim 6, it is characterised in that
The scan module, when being additionally operable to be not changed in when the modification time of the file is compared to last scan, does not sweep Retouch the file.
8. terminal according to claim 6, it is characterised in that
The folder path maintenance module, is additionally operable to what is pressed from both sides according to All Files in local storage and/or peripheral memory Store path, updates the folder path table.
9. terminal according to claim 6, it is characterised in that also include:
Mark module, for being marked for the file for only including discarded record;
The scan module, is additionally operable to not perform scanning for the marked file of the mark module, by its direct addition To garbage files treatment progress.
10. a kind of terminal, including:Processor and memory, it is characterised in that the memory storage has the executable finger of computer Order, realizes following method when the computer executable instructions are by the computing device:
Folder path table is set up, the folder path table is used to record path and its modification time of All Files folder;
Whether changed when detecting the modification time of file compared to last scan;
When being changed when the modification time of the file is compared to last scan, read from the folder path table described Simultaneously scan the garbage files under the path in the path of file.
CN201710058961.1A 2017-01-23 2017-01-23 Garbage files searching method and terminal Withdrawn CN106909632A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710058961.1A CN106909632A (en) 2017-01-23 2017-01-23 Garbage files searching method and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710058961.1A CN106909632A (en) 2017-01-23 2017-01-23 Garbage files searching method and terminal

Publications (1)

Publication Number Publication Date
CN106909632A true CN106909632A (en) 2017-06-30

Family

ID=59207863

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710058961.1A Withdrawn CN106909632A (en) 2017-01-23 2017-01-23 Garbage files searching method and terminal

Country Status (1)

Country Link
CN (1) CN106909632A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111752896A (en) * 2019-03-26 2020-10-09 青岛海信移动通信技术股份有限公司 Method and device for cleaning junk files in mobile terminal and mobile terminal
CN113704195A (en) * 2021-08-26 2021-11-26 北京琥珀创想科技有限公司 Android system junk file cleaning method and device
CN113722279A (en) * 2021-08-19 2021-11-30 北京达佳互联信息技术有限公司 Method, device and equipment for determining size of folder and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102654872A (en) * 2011-03-03 2012-09-05 腾讯科技(深圳)有限公司 Method and device for cleaning junk files generated by application programs
CN103886059A (en) * 2014-03-17 2014-06-25 可牛网络技术(北京)有限公司 Method and device for cleaning up files
CN104133822A (en) * 2013-07-15 2014-11-05 腾讯科技(深圳)有限公司 Method and device for scanning files in memory
CN106294773A (en) * 2016-08-11 2017-01-04 北京小米移动软件有限公司 Data clearing method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102654872A (en) * 2011-03-03 2012-09-05 腾讯科技(深圳)有限公司 Method and device for cleaning junk files generated by application programs
CN104133822A (en) * 2013-07-15 2014-11-05 腾讯科技(深圳)有限公司 Method and device for scanning files in memory
CN103886059A (en) * 2014-03-17 2014-06-25 可牛网络技术(北京)有限公司 Method and device for cleaning up files
CN106294773A (en) * 2016-08-11 2017-01-04 北京小米移动软件有限公司 Data clearing method and device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111752896A (en) * 2019-03-26 2020-10-09 青岛海信移动通信技术股份有限公司 Method and device for cleaning junk files in mobile terminal and mobile terminal
CN113722279A (en) * 2021-08-19 2021-11-30 北京达佳互联信息技术有限公司 Method, device and equipment for determining size of folder and storage medium
CN113722279B (en) * 2021-08-19 2024-03-01 北京达佳互联信息技术有限公司 Method, device, equipment and storage medium for determining size of folder
CN113704195A (en) * 2021-08-26 2021-11-26 北京琥珀创想科技有限公司 Android system junk file cleaning method and device

Similar Documents

Publication Publication Date Title
CN104808944B (en) Touch operation inducing method and device
CN106227867B (en) A kind of method and device of file management
CN105915623A (en) Device and method of processing application installation package
CN104991834A (en) Data recycle method and mobile terminal
CN106533928A (en) Method and device for updating unread message reminding identifier
CN106775372A (en) A kind of display adjusting method of suspension procedure disk, device and terminal
CN106791115A (en) A kind of information of mobile terminal clone method and mobile terminal
CN106909681A (en) A kind of information processing method and its device
CN110109528A (en) Management-control method, mobile terminal and the computer readable storage medium of application program
CN106961524A (en) A kind of method for information display and device
CN106507185A (en) A kind of information processing method and projection terminal
CN106598538A (en) Method and system for updating instruction set
CN104717543B (en) Method and device for achieving interactive operation between different split screens
CN106909632A (en) Garbage files searching method and terminal
CN106713661A (en) Mobile terminal and text displaying method
CN106488035A (en) A kind of mobile terminal and control method
CN106777251A (en) A kind of file management method and device
CN106776845A (en) A kind of information flow adaptive management method and terminal
CN106911486A (en) A kind of message push processing method, apparatus and system
CN106785419A (en) A kind of band spreading structure of terminal antenna
CN106686703A (en) Terminal and timer wakeup method
CN106254685B (en) A kind of content-label method and mobile terminal
CN105208203A (en) Mobile terminal, and data information management system and method
CN106658468A (en) Data card business switching method and terminal
CN106793027A (en) The processing method and terminal of abnormal power consumption

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
WW01 Invention patent application withdrawn after publication

Application publication date: 20170630

WW01 Invention patent application withdrawn after publication