CN104133822B - A kind of method and device that file on memorizer is scanned - Google Patents

A kind of method and device that file on memorizer is scanned Download PDF

Info

Publication number
CN104133822B
CN104133822B CN201310296298.0A CN201310296298A CN104133822B CN 104133822 B CN104133822 B CN 104133822B CN 201310296298 A CN201310296298 A CN 201310296298A CN 104133822 B CN104133822 B CN 104133822B
Authority
CN
China
Prior art keywords
file
memorizer
scan
data storehouse
information data
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.)
Active
Application number
CN201310296298.0A
Other languages
Chinese (zh)
Other versions
CN104133822A (en
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.)
Tencent Technology Shenzhen Co Ltd
Tencent Cloud Computing Beijing Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201310296298.0A priority Critical patent/CN104133822B/en
Priority to PCT/CN2014/079900 priority patent/WO2015007125A1/en
Publication of CN104133822A publication Critical patent/CN104133822A/en
Application granted granted Critical
Publication of CN104133822B publication Critical patent/CN104133822B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/11File system administration, e.g. details of archiving or snapshots
    • 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

Landscapes

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

Abstract

The invention discloses a kind of method and device being scanned the file on memorizer, described method includes: be scanned memorizer according to file information data storehouse, searches the renewal file on memorizer;Obtain the attribute information updating file;According to the attribute information of renewal file, update described file information data storehouse;Delete and described file information data storehouse has had, but when the present scan memorizer attribute information of undiscovered file.The present invention is when being scanned memorizer, only need to obtain the attribute information updating file on memorizer, update file information data storehouse accordingly, the attribute information of the All Files in the file information data storehouse after renewal and deletion action is exported as scanning result, it is greatly saved the resource spent by multiple scanning, accelerates scanning speed.

Description

A kind of method and device that file on memorizer is scanned
Technical field
The present invention relates to communication technical field, be specifically related to scanning technique field, particularly relate to a kind of to depositing The method and device that file on reservoir is scanned.
Background technology
Along with the development of electronic science and technology, many electric terminals, such as desktop computer, notebook computer, Smart mobile phone, personal digital assistant, progress into daily life, become its requisite one Part.Meanwhile, various memorizeies are swarmed and are showed, and such as CF (Compact Flash, dodge by compression Deposit) card, SD (Secure Digital, safe digital) storage card, MMC (Multimedia Card, Multimedia) storage card, hard disk etc..Memorizer can be used for storing music, image, video, application software Deng file, electric terminal can be built in, or exist independent of electric terminal.When memorizer directly or leads to Cross mediation device when being connected with electric terminal, in order to file each in memorizer is unified, is managed concentratedly, Facilitating user to check Miscellaneous Documents information in memorizer, the operating system on electric terminal would generally be to storage The file of device storage is scanned, to obtain in memorizer the attribute letters such as the metadata of each file, thumbnail Breath, in order to follow-up show this information on electric terminal, selects for user operation.
But, obtain in memorizer the attribute informations such as the metadata of each file, thumbnail the longest, meeting Scan efficiency is caused to reduce, in the case of particularly big in memory storage capabilities, storage number of files is many, Its scanning process will spend the biggest time overhead.Further, in existing technology, electric terminal is every Secondary when being connected with memorizer, the All Files in memorizer will be rescaned, obtain each literary composition in memorizer The attribute information of part.
Summary of the invention
In view of above reason, the present invention proposes a kind of method being scanned the file on memorizer and dress Put, solve the technical problem that background section above is mentioned.
A kind of method that file on memorizer is scanned, described method includes:
According to file information data storehouse, memorizer is scanned, searches the renewal file on described memorizer, Wherein said file information data storehouse record has institute on the described memorizer that memorizer described in last scan obtains Documentary attribute information, described renewal file includes: terminate to present scan to start the phase from last scan Between, on described memorizer in have the file of amendment and newly-increased file;
Obtain the attribute information of described renewal file;
According to the attribute information of described renewal file, update described file information data storehouse;
Delete and described file information data storehouse had, but when memorizer described in present scan not The attribute information of the file found;
By the All Files of record in the described file information data storehouse after renewal and deletion action Attribute information exports as present scan result.
Accordingly, present invention also offers a kind of file scanning device, described device includes:
Ff module, for being scanned memorizer according to file information data storehouse, searches described Renewal file on memorizer, wherein said file information data storehouse record has memorizer described in last scan The attribute information of All Files on the described memorizer obtained, described renewal file includes: from last scan Terminate to present scan start period, on described memorizer in have amendment file and increase newly file;
Data obtaining module, for obtaining the attribute information of described renewal file;
Information updating module, for the attribute information according to described renewal file, updates described fileinfo Data base;
Information deletion module, has had in described file information data storehouse for deleting, but at this Scan the attribute information of undiscovered file during described memorizer;
Output module, for remembering in the described file information data storehouse after renewal and deletion action The attribute information of the All Files of record exports as present scan result.
Compared to prior art, the technical scheme that the present invention proposes according to file information data storehouse to memorizer It is scanned, finds the renewal file on memorizer, according to the attribute information of described renewal file, more New described file information data storehouse, and delete file information data storehouse has had, but sweep at this Retouch the attribute information of undiscovered file during memorizer, then can be by directly reading through updating and deleting In file information data storehouse after operation, the attribute information item of the All Files of record obtains present scan Result.Present invention, avoiding every external memory when being connected with electric terminal, will be by rescaning storage Each file on device obtains its attribute information, and only need to search the renewal file on memorizer, obtains it Corresponding attribute information, and update file information data storehouse accordingly, it is greatly saved multiple scanning and is consumed The resource taken, accelerates scanning speed, improves scan efficiency.
Accompanying drawing explanation
Fig. 1 for the embodiment of the present invention one provide a kind of to the method that the file on memorizer is scanned Schematic flow sheet;
A kind of method that the file on memorizer is scanned that Fig. 2 provides for the embodiment of the present invention one Applied environment schematic diagram;
Memorizer is scanned according to file information data storehouse by Fig. 3 for what the embodiment of the present invention one provided, The schematic flow sheet of the step updating file on lookup memorizer;
Fig. 4 for the embodiment of the present invention two provide a kind of to the method that the file on memorizer is scanned Schematic flow sheet;
Fig. 5 for the embodiment of the present invention three provide a kind of to the device that the file on memorizer is scanned Structural representation;
Fig. 6 for the embodiment of the present invention four provide a kind of to the device that the file on memorizer is scanned Structural representation.
Detailed description of the invention
The present invention is described in further detail with embodiment below in conjunction with the accompanying drawings.It is understood that Specific embodiment described herein is only used for explaining the present invention, rather than limitation of the invention.Additionally also It should be noted that for the ease of describing, accompanying drawing illustrate only part related to the present invention rather than complete Portion's content.
The method and device being scanned the file on memorizer of the embodiment of the present invention can run on peace Equipped with in the operating system platform of smart machine, this smart machine can be that mobile phone, individual digital help Any one in reason, panel computer, desktop computer etc., can include centre in this smart machine Combination in any in reason device, memorizer, switching device, power supply, clock signal generators etc., above-mentioned in Combination in any in central processor, memorizer, switching device, power supply, clock signal generators etc. is used for Realize the function to the method and device that the file on memorizer is scanned of embodiments of the invention.
Embodiment one
Fig. 1 for the embodiment of the present invention one provide a kind of to the method that the file on memorizer is scanned Schematic flow sheet.Method described in the present embodiment can realize carrying out the file on memorizer by terminal Scanning.As in figure 2 it is shown, terminal 21 includes storing device 211, processing means 212, display device 213.The software program of the method exists in storage device 211, and processing means 212 performs, display dress One interface of 213 offer is provided, can be used for the result that the file on memorizer is scanned by display.See Fig. 1, the method includes:
Step S101, according to file information data storehouse, memorizer is scanned, searches on memorizer more New file;
Wherein, file information data storehouse record has All Files on the memorizer that last scan memorizer obtains Attribute information.Particularly, when present scan is preliminary scan, record in file information data storehouse On memorizer, the attribute information of All Files is empty.In the present embodiment, the attribute information bag of described file Include the pathname of file, the nearest modification time of file, the size of file, file place file ID (Identity, identity) value.Certainly, the attribute information of described file is not limited to this, such as If during the file that current file is picture or video format, its attribute information also includes corresponding with this document Other information such as thumbnail.Preferably, the pass of the attribute information of each file of file information data storehouse record Key assignments is the pathname of file, and file information data storehouse is using key value as access index.
Update file to include terminating to present scan to start period from last scan, on memorizer in have and repair The file changed and newly-increased file.
Memorizer is scanned according to file information data storehouse by Fig. 3 for what the embodiment of the present invention one provided, The schematic flow sheet of the step updating file on lookup memorizer, sees Fig. 3, and this step includes:
Sub-step S1011, on memorizer storage file be scanned, obtain Current Scan file road Footpath title;
In this embodiment, can use recursive fashion that the file on memorizer is scanned, obtain and currently sweep Retouching the pathname of file, wherein, the pathname of described Current Scan file has uniqueness, it is possible to Uniquely identify this document.Such as, the entitled 1.JPEG of Current Scan file, record on electric terminal Storage position is the picture sub-folder under the file 1 of H dish, then can be denoted as by the pathname of acquisition For: H: file 1: picture: 1.JPEG.
Sub-step S1012, judge whether the pathname of Current Scan file is present in file information data storehouse In, if it is, perform sub-step S1014, otherwise, perform sub-step S1013;
After the pathname getting Current Scan file, search whether to deposit from file information data storehouse At the attribute information using the pathname of Current Scan file as key value, if it has, then judge current The pathname of scanning file is present in file information data storehouse, otherwise, then judges Current Scan file Pathname be not present in file information data storehouse.
Sub-step S1013, it is not present in file information data storehouse when the pathname judging Current Scan file Time middle, then judge that Current Scan file is as terminating to present scan to start period, memorizer from last scan Upper newly-increased file, performs sub-step S1017;
If search the pathname less than Current Scan file from file information data storehouse, then judge When carrying out last scan, this current scanning file is not present in memorizer, for terminating from last scan File newly-increased on period memorizer, i.e. change file on memorizer is started to present scan.
Sub-step S1014, in the pathname judging Current Scan file is present in file information data storehouse Time, the nearest modification time of the Current Scan file on acquisition memorizer, perform sub-step S1015;
If find the pathname of Current Scan file from file information data storehouse, obtain current The nearest modification time of the Current Scan file on memorizer.Described nearest modification time include year, the moon, Day, time, grading information.
Sub-step S1015, the nearest modification time of the Current Scan file judged on the memorizer got are No more than the nearest modification time of the Current Scan file of record in file information data storehouse, if it is, hold Row sub-step S1016, otherwise, performs sub-step S1017;
Sub-step S1016, it is more than when the nearest modification time of the Current Scan file on the memorizer got In file information data storehouse during the nearest modification time of Current Scan file of record, then judge Current Scan File for terminating to present scan to start period from last scan, on memorizer in have the file of amendment, Perform sub-step S1017;
After the nearest modification time of the Current Scan file got on memorizer, during to this nearest amendment Between compare, when this with the nearest modification time of Current Scan file of record in file information data storehouse Modification time is more than the nearest modification time of the Current Scan file of record in file information data storehouse recently Time, illustrate the Current Scan file on memorizer compared with during last scan, its content there occurs change, For terminating to present scan to start period from last scan, on memorizer in have the file of amendment.Such as, The nearest modification time of the Current Scan file on the memorizer got is T1:2013 May 20 10: 8, in file information data storehouse, the nearest modification time of the Current Scan file of record was T2:2013 On May 1,14: 10 in, it is judged that time T1 is more than time T2, and Current Scan file was for sweep from last time Retouch during end starts to present scan, on memorizer in have the file of amendment.
The alternative document of storage on memorizer is scanned by sub-step S1017, continuation, it is judged that scanned literary composition Part be whether newly-increased file or in have the file of amendment.
Judging that the file content whether file being currently scanned is newly-increased on memorizer has amendment After file, continue the alternative document of storage on memorizer is scanned, in the present embodiment Whether state file that the method for sub-step S1011-sub-step S1016 judges to be scanned on memorizer The file of amendment is had for file content newly-increased on memorizer.
Step S102, acquisition update the attribute information of file;
Wherein, update file attribute information include the pathname of file, the nearest modification time of file, The size of file, ID (Identity, the identity) value of file place file.Certainly, described more The attribute information of new file is not limited to this, if such as update the file that file is picture or video format, Its attribute information also includes other information such as the thumbnail corresponding with this document.
For step S1011 get newly-increased file or in have the pathname of file of amendment Claim, in step S1014 gets, have the nearest modification time of the file of amendment, performing this step During rapid S102, described pathname, nearest modification time can be directly read.
Step S103, according to update file attribute information, update file information data storehouse;
File information data storehouse is the attribute information of All Files on recording medium.When present scan is sent out Existing: relatively last scan, when having the file of amendment or newly-increased file in memorizer exists, need more Change the record in file information data storehouse.
According to the attribute information updating file acquired in step S102, update file information data storehouse Step includes:
When having the file of amendment in updating file corresponding to file and being, by every in file information data storehouse Piece of content has what the nearest modification time of the file of amendment was updated on memorizer to have amendment in this part The nearest modification time of file;
When updating file corresponding to file and being newly-increased file, by the every a newly-increased literary composition on memorizer The attribute information of part adds to file information data storehouse.
Step S104, deletion file information data storehouse have had, but at present scan memorizer not The attribute information of the file found;
When present scan, relatively last scan, except there may be the literary composition having amendment in content on memorizer When part or newly-increased file, it is also possible to occur that some file has been deleted.According to each literary composition on memorizer Part is scanned the pathname of acquired each file, can determine whether out record in file information data storehouse When file corresponding to which attribute information is present scan, non-existent file on memorizer, then deletes File information data storehouse records the attribute information of this document.
In order to what the more detailed description embodiment of the present invention one proposed is scanned the file on memorizer Method, existing illustration.Such as, during the complete memorizer of last scan, record in file information data storehouse Memorizer on the part attribute information of All Files as shown in the table:
The pathname of file The nearest modification time of file
H: file 1: A: 1.JPEG 10: 0 on the 1st January in 2013
H: file 1: B: 2.JPEG 17: 30 on the 20th March in 2013
H: file 2: C: 3.JPEG 8: 45 on the 1st June in 2013
H: file 3: D: 4.JPEG 13: 8 on the 23rd May in 2013
When present scan memorizer, on memorizer, the part attribute information of All Files is as shown in the table:
The pathname of file The nearest modification time of file
H: file 1: A: 1.JPEG 10: 0 on the 1st January in 2013
H: file 2: C: 3.JPEG 13: 40 on the 1st June in 2013
H: file 2: C: 5.JPEG 11: 23 on the 3rd June in 2013
H: file 3: D: 4.JPEG 21: 17 on the 3rd June in 2013
H: file 3: D: 6.JPEG 15: 32 on the 2nd June in 2013
After the most scanned to the file on memorizer, in obtaining on memorizer, have the file of amendment For " H: file 2: C: 3.JPEG ", " H: file 3: D: 4.JPEG ";Increase newly File is: " H: file 2: C: 5.JPEG ", " H: file 3: D: 6.JPEG ".Now, It is updated including to file information data storehouse: the file of amendment will be had in file information data storehouse Nearest modification time " 1 day 8: 45 June in 2013 that " H: file 2: C: 3.JPEG " is corresponding Point " it is updated to " 13: 40 on the 1st June in 2013 ";Repair having in file information data storehouse Nearest modification time " the May 23 in 2013 that the file " H: file 3: D: 4.JPEG " changed is corresponding At 13: 8 day " it is updated to " 21: 17 on the 3rd June in 2013 ";By file " H: file 2: C: 5.JPEG " and " H: file 3: D: 6.JPEG " each self-corresponding pathname, repair recently Change the time and other attribute informations add to file information data storehouse.
Then, deletion file information data storehouse has had, but has not found at present scan memorizer The attribute information corresponding to file " H: file 1: B: 2.JPEG ".
For follow-up lookup or call the convenience of file on memorizer, in a preferred reality of the present embodiment Execute in mode:
Step S101 also includes being scanned memorizer according to folder information data base, searches memorizer On more new folder;
Wherein, the genus that the All Files that folder information data-base recording has last scan memorizer to obtain presss from both sides Property information, described more new folder include from last scan terminate to present scan start period, described in deposit The file of amendment and newly-increased file is had on reservoir;The attribute information of file includes file Pathname, the nearest modification time of file, the ID value of file place parent folder, file Under various types of file numbers;
Judge process to the more new folder on memorizer, with the judgement to the renewal file on memorizer Process is similar to, and repeats no more here;
Step S102 also includes that the attribute information obtaining more new folder, this process update file with obtaining The process of attribute information is similar to, and repeats no more here;
Step S103 also includes the attribute information according to more new folder, updates folder information data base, This process is similar with the process updating file information data storehouse, repeats no more here;
Step S104 also includes having had in Delete Folder information database, but deposits at present scan The attribute information of undiscovered file during reservoir, this process has been deposited with deleting in file information data storehouse Have, but the process of the attribute information of undiscovered file is similar to when present scan memorizer, the most not Repeat again.
To sum up, the method being scanned the file on memorizer of the embodiment of the present invention one, according to file Memorizer is scanned by information database, finds the renewal file on memorizer, according to described renewal The attribute information of file, updates described file information data storehouse, and deletes in file information data storehouse Have, but the attribute information of undiscovered file when present scan memorizer.The embodiment of the present invention one Enable to when every time scanning memorizer can complete with multiplexing last scan time file information database in remember The attribute information of All Files on the memorizer of record, it is not necessary to reacquire again, as long as searching on memorizer Update file, obtain the attribute information of its correspondence, and update information database accordingly, decrease because obtaining Time spent by the attribute information of All Files on access to memory, accelerate scanning speed.
Embodiment two
Fig. 4 for the embodiment of the present invention two provide a kind of to the method that the file on memorizer is scanned Schematic flow sheet.Seeing Fig. 4, the method includes:
Step S401, judge whether present scan is preliminary scan, if it is, perform step S402, no Then, step S403 is performed;
In the present embodiment, can pass through to search whether to there is the file information data storehouse corresponding with memorizer, Judge whether present scan is preliminary scan.When memory built-in is in electric terminal, fileinfo number It is storable in electric terminal or memorizer according to storehouse.In view of there is multiple mobile memory with electronics eventually The situation that end connects, if file information data library storage is on electric terminal, can take the biggest internal memory empty Between, it is preferred that file information data library storage is in memory.Can be by searching depositing of this secondary scan Whether reservoir exists corresponding file information data storehouse, judges whether present scan is first Scanning, if it is, judge that present scan is non-preliminary scan, otherwise, then judges that present scan is as just Secondary scanning.
Step S402, set up and store record have the fileinfo of the attribute information of All Files on memorizer Data base, terminates;
When judging that present scan is preliminary scan, set up the literary composition corresponding to memorizer with this secondary scan Part information database, starts to be scanned each file on memorizer, obtains the attribute information of each file, And its attribute information is added to the file information data storehouse set up.Treat All Files on memorizer Attribute information all add to file information data storehouse after, by file information data library storage now To memorizer, when scanning for next time.
Step S403, according to file information data storehouse, memorizer is scanned, searches on memorizer more New file;
This step and being scanned memorizer according to file information data storehouse in embodiment one, lookup is deposited The step updating file on reservoir is identical, repeats no more here.
Step S404, acquisition update the attribute information of file;
This step is identical, the most no longer with the step obtaining the attribute information updating file in embodiment one Repeat.
Step S405, according to update file attribute information, update file information data storehouse;
This step updates file information data storehouse with the attribute information according to renewal file in embodiment one Step is identical, repeats no more here.
Step S406, deletion file information data storehouse have had, but at present scan memorizer not The attribute information of the file found;
Deletion file information data storehouse in this step and embodiment one has, but has swept at this The step of the attribute information retouching the undiscovered file of memorizer is identical, repeats no more here.
Step S407, by through updating and record all in file information data storehouse after deletion action The attribute information of file exports as present scan result;
Update file information data storehouse according to the attribute information updating file, and delete file information data Storehouse has, but after the attribute information of the undiscovered file of present scan memorizer, file has been believed When record present scan in breath data base, the attribute information of the All Files of storage on memorizer, now may be used Export as present scan result, update in electric terminal user interface about on memorizer The attribute information of file.
One of the present embodiment preferred embodiment in, when performing step S403, once find After certain file has file or the newly-increased file of amendment on memorizer in being, also can directly perform step S404, obtains file or the attribute information of newly-increased file having amendment in finding, holds Row step S403 searches other guide on memorizer the file of amendment or a newly-increased file, search procedure with Acquisition process is the most alternately.In the present embodiment, it is preferred that every default time cycle, root According to the attribute information of the file with newly-increased file having amendment in getting in step S404, timing is the most more A new file information data storehouse.
For reducing the computation burden of electric terminal operating system main thread TMain so that it is main thread is as far as possible It is only used for realizing User Interface, it is preferred that sub-line journey can be introduced in electric terminal operating system Realize method that the file on memorizer is scanned, this sub-line journey include scanning sub-line journey TScan and Process sub-line journey TUpdate.
Main thread start after, initialising subscriber interface control, get memorizer catalogue after, startup is swept Retouch sub-line journey TScan and process sub-line journey TUpdate.Scanning sub-line journey TScan has performed above-mentioned steps After S401-S404, on default time cycle, the memorizer that will get in have the file of amendment It is sent to by the Handler (identifying with AHandler) of main thread with the attribute information of newly-increased file Main thread.
The message processing function of the AHandler of main thread extracts described time cycle built-in storage from message Having file and the attribute information of newly-increased file of amendment on, notice processes sub-line journey TUpdate pair File information data storehouse is updated processing.Concrete renewal processing procedure is: construct a task model UpdateTask, it has file and the attribute of newly-increased file of amendment in including on storage memorizer Information content, adds task model UpdateTask to the work team processing sub-line journey TUpdate afterwards In row, process the work of sub-line journey Tupdate with triggering.Process sub-line journey TUpdate and initially etc. stay in this In work queue, once queue not empty, process sub-line journey Tupdate according to task model UpdateTask In the content that comprises, update file information data storehouse.
After scanning sub-line journey Tscan completes the scanning of All Files on memorizer, can determine whether out that file is believed Do not exist on memorizer when in breath data base, the file corresponding to which attribute information of record is present scan File, then process sub-line journey TUpdate by main thread notice and delete in file information data storehouse Through have, but the attribute information of undiscovered file when present scan memorizer, and will be through updating Sweep as this with the attribute information of the All Files of record in the file information data storehouse after deletion action Retouch result to export.
To sum up, the method that the file on memorizer is scanned of the embodiment of the present invention two, it is judged that this When scanning is for preliminary scan, sets up and the record that prestores has the file of the attribute information of All Files on memorizer Information database, it is judged that when present scan is non-preliminary scan, according to file information data storehouse to memorizer It is scanned, finds the renewal file on memorizer, according to the attribute information of described renewal file, more New described file information data storehouse, and delete file information data storehouse has had, but sweep at this Retouch the attribute information of undiscovered file during memorizer, the most at last through the literary composition updated and after deletion action In part information database, the attribute information of the All Files of record exports as present scan result.This Inventive embodiments two enable to when every time scanning memorizer can with multiplexing last scan complete time file letter The attribute information of All Files on the memorizer of record in breath data base, it is not necessary to reacquire again, as long as looking into Look for the renewal file on memorizer, obtain the attribute information of its correspondence, and update information database accordingly, Decrease because of the time spent by the attribute information of All Files on acquisition memorizer, improve scan efficiency. Meanwhile, the embodiment of the present invention two proposes to use scanning sub-line journey and process sub-line journey to realize on memorizer The method that file is scanned, reduces the computation burden of main thread in electric terminal operating system.
Embodiment three
Fig. 5 for the embodiment of the present invention three provide a kind of to the device that the file on memorizer is scanned Structural representation.Seeing Fig. 5, this device includes: search module 501, for according to file information data Memorizer is scanned by storehouse, searches the renewal file on memorizer;Acquisition module 502, for obtaining more The attribute information of new file;More new module 503, for the attribute information according to renewal file, updates file Information database;Removing module 504, has had in file information data storehouse for deleting, but at this The attribute information of undiscovered file during secondary scanning memorizer.
In the present embodiment, the memorizer that file information data storehouse record obtains when having last scan memorizer The attribute information of upper All Files.Particularly, when present scan is preliminary scan, file information data In storehouse, on the memorizer of record, the attribute information content of All Files is empty.The attribute information bag of described file Include the pathname of file, the nearest modification time of file, the size of file, file place file ID (Identity, identity) value.Certainly, the attribute information of described file is not limited to this, such as If during the file that current file is picture or video format, its attribute information also includes corresponding with this document Other information such as thumbnail.Preferably, the pass of the attribute information of each file of file information data storehouse record Key assignments is the pathname of file, and file information data storehouse is using key value as access index.Update file Terminate to present scan to start period including from last scan, on memorizer in have the file of amendment and new The file increased.
In the present embodiment, search module 501 to include:
First acquiring unit 5011, for being scanned the file of storage on memorizer, obtains and currently sweeps Retouch the pathname of file;
First judging unit 5012, for judging whether the pathname of Current Scan file is present in file In information database;
First determines unit 5013, for when judging that the pathname of Current Scan file is not present in file Time in information database, then judge that Current Scan file is as terminating to present scan to start the phase from last scan Between, file newly-increased on memorizer;
Second acquisition unit 5014, for when judging that the pathname of Current Scan file is present in file letter Time in breath data base, the nearest modification time of the Current Scan file on acquisition memorizer;
Second judging unit 5015, for judging the nearest of Current Scan file on the memorizer that gets Whether modification time is more than the nearest modification time of the Current Scan file of record in file information data storehouse;
Second determines unit 5016, for repairing recently when the Current Scan file on the memorizer got When changing the nearest modification time that the time is more than the Current Scan file of record in file information data storehouse, it is judged that Current Scan file for from last scan terminate to present scan start period, on memorizer in have amendment File.
In the present embodiment, the attribute information updating file that acquisition module 502 obtains includes the road of file Footpath title, the nearest modification time of file, the size of file, file place file ID (Identity, Identity) value.Certainly, the attribute information of described renewal file is not limited to this, if such as updating literary composition When part is the file of picture or video format, its attribute information also includes the thumbnail etc. corresponding with this document Other information.For the first acquiring unit 5011 get newly-increased file or in have amendment The pathname of file, has the nearest amendment of the file of amendment in second acquisition unit 5014 gets Time, acquisition module 502 can directly read first acquiring unit 5011 obtain pathname, second The nearest modification time that acquiring unit 5014 obtains.
In the present embodiment, more new module 503 includes:
Amendment unit 5031, when having the file of amendment in when file corresponding to renewal file being, will In file information data storehouse, every piece of content has the nearest modification time of the file of amendment to be updated on memorizer Have the nearest modification time of file of amendment in this part;
Adding device 5032, for when updating file corresponding to file and being newly-increased file, by memorizer On the attribute information of every a newly-increased file add to file information data storehouse.
In the present embodiment, when present scan, relatively last scan, interior except there may be on memorizer When the file of Rong Shangyou amendment or newly-increased file, it is also possible to occur that some file has been deleted.Delete mould Block 504 is scanned the road of acquired each file according to searching module 501 to each file on memorizer Footpath title, can determine whether out that in file information data storehouse, the file corresponding to which attribute information of record is this Non-existent file on memorizer during secondary scanning, then deletes in file information data storehouse and records this document Attribute information.
For follow-up lookup or call the convenience of file on memorizer, in a preferred reality of the present embodiment Execute in mode, search module 501, be additionally operable to according to folder information data base, memorizer is scanned, Search the more new folder on memorizer;Acquisition module 502 is additionally operable to obtain the attribute letter of more new folder Breath;More new module 503 is additionally operable to the attribute information according to more new folder, updates folder information data Storehouse;Removing module 504 is additionally operable to have had in Delete Folder information database, but present scan The attribute information of undiscovered file during memorizer.
The present embodiment propose the device that the file on memorizer is scanned with implement one propose to depositing The method that file on reservoir is scanned belongs to same inventive concept, the most detailed description Detail content, be referred to embodiment one.
To sum up, the device being scanned the file on memorizer of the embodiment of the present invention three, according to file Memorizer is scanned by information database, finds the renewal file on memorizer, according to described renewal The attribute information of file, updates described file information data storehouse, and deletes in file information data storehouse Have, but the attribute information of undiscovered file when present scan memorizer.The embodiment of the present invention three Enable to when every time scanning memorizer can complete with multiplexing last scan time file information database in remember The attribute information of All Files on the memorizer of record, it is not necessary to reacquire again, as long as searching on memorizer Update file, obtain the attribute information of its correspondence, and update information database accordingly, decrease because obtaining Time spent by the attribute information of All Files on access to memory, accelerate scanning speed.
Embodiment four
Fig. 6 for the embodiment of the present invention four provide a kind of to the device that the file on memorizer is scanned Structural representation.Seeing Fig. 6, this device includes:
Scanning judge module 601, is used for judging whether present scan is preliminary scan, when present scan is just During secondary scanning, set up and the record that prestores has the file information data of the attribute information of All Files on memorizer Storehouse, when present scan is non-preliminary scan, sends control signal to searching module 602;
Search module 602 and scan, for receiving, the control signal that judge module 601 sends, believe according to file Breath data base be scanned memorizer, searches the renewal file on memorizer;
Acquisition module 603, for obtaining the attribute information updating file;
More new module 604, for the attribute information according to renewal file, updates file information data storehouse;
Removing module 605, has had in file information data storehouse for deleting, but has deposited at present scan The attribute information of undiscovered file during reservoir;
Output module 606, for by record in the file information data storehouse after renewal and deletion action The attribute information of All Files export as present scan result.
In the present embodiment, scanning judge module 601 can be corresponding with memorizer by searching whether existence File information data storehouse, judge whether present scan is preliminary scan.When memory built-in is in electronics During terminal, file information data storehouse is storable in electric terminal or memorizer.Multiple in view of existing The situation that mobile memory is connected with electric terminal, if file information data library storage is on electric terminal, The biggest memory headroom can be taken, it is preferred that file information data library storage is in memory.Scanning judges Module 601 can be by searching in the memorizer of this secondary scan whether there is corresponding fileinfo Data base, judges whether present scan is preliminary scan, if it is, scanning judge module 601 is sentenced Disconnected present scan is non-preliminary scan, and otherwise, then scanning judge module 601 judges that present scan is first Scanning.
When present scan is preliminary scan, scanning judge module 601 sets up the storage with this secondary scan File information data storehouse corresponding to device, starts to be scanned each file on memorizer, obtains each literary composition The attribute information of part, and its attribute information is added to the file information data storehouse set up.Treat to deposit After the attribute information of All Files all adds to file information data storehouse on reservoir, scan judge module File information data storehouse now is prestored to memorizer, when scanning for next time by 601.
Updated file information data storehouse in more new module 604, removing module 505 deletes fileinfo number According to what storehouse had had, but after the attribute information of the undiscovered file of present scan, will be through more In file information data storehouse newly and after deletion action, the attribute information of the All Files of record is as this Scanning result exports, and updates the attribute letter about the file on memorizer in electric terminal user interface Breath.
One of the present embodiment preferred embodiment in, once find storage searching module 602 After on device, certain file has file or the newly-increased file of amendment in being, can be directly to acquisition module 603 Sending control signal, notice acquisition module 603 obtains in finding and has the file of amendment or newly-increased The attribute information of file, then looks up module 602 and searches other guide on memorizer again and have the file of amendment Or newly-increased file, search module 602 and acquisition module 603 alternation successively.In the present embodiment, Preferably, more new module 604 can get according to acquisition module 603 every the default time cycle Inside having file and the attribute information of newly-increased file of amendment, timing updates a file information data storehouse.
The present embodiment propose the device that the file on memorizer is scanned with implement two propose to depositing The method that file on reservoir is scanned belongs to same inventive concept, the most detailed description Detail content, be referred to embodiment two.
To sum up, the device that the file on memorizer is scanned of the embodiment of the present invention four, it is judged that this When scanning is for preliminary scan, setting up and store record has the file of the attribute information of All Files on memorizer Information database, it is judged that when present scan is non-preliminary scan, according to file information data storehouse to memorizer It is scanned, finds the renewal file on memorizer, according to the attribute information of described renewal file, more New described file information data storehouse, and delete file information data storehouse has had, but sweep at this Retouch the attribute information of undiscovered file during memorizer, the most at last through the literary composition updated and after deletion action In part information database, the attribute information of the All Files of record exports as present scan result.This Inventive embodiments four enable to when every time scanning memorizer can with multiplexing last scan complete time file letter The attribute information of All Files on the memorizer of record in breath data base, it is not necessary to reacquire again, as long as looking into Look for the renewal file on memorizer, obtain the attribute information of its correspondence, and update information database accordingly, Decrease because of the time spent by the attribute information of All Files on acquisition memorizer, improve scan efficiency.
All or part of content in the technical scheme that above example provides can be real by software programming Existing, its software program is stored in the storage medium that can read, storage medium such as: hard in computer Dish, computer readable memory, CD or floppy disk etc..
The foregoing is only presently preferred embodiments of the present invention, be not limited to the present invention, all in the present invention Spirit and principle within, any modification, equivalent substitution and improvement etc. made, should be included in this Within bright protection domain.

Claims (12)

1. the method that the file on memorizer is scanned, it is characterised in that described method includes:
According to file information data storehouse, memorizer is scanned, searches the renewal file on described memorizer, Wherein said file information data storehouse record has institute on the described memorizer that memorizer described in last scan obtains Documentary attribute information, described renewal file includes terminating to present scan to start period from last scan, The file of amendment and newly-increased file is had on described memorizer;
Obtain the attribute information of described renewal file;
According to the attribute information of described renewal file, update described file information data storehouse;
Delete and described file information data storehouse had, but when memorizer described in present scan not The attribute information of the file found;
Genus by the All Files of the described file information data storehouse record through updating and after deletion action Property information exports as present scan result.
The method being scanned the file on memorizer the most according to claim 1, its feature exists In, described according to file information data storehouse, memorizer is scanned, searches the renewal on described memorizer Also include before the step of file:
Judge whether present scan is preliminary scan;
When present scan is preliminary scan, setting up and store record has the attribute of All Files on memorizer The file information data storehouse of information;
When present scan is non-preliminary scan, perform described according to file information data storehouse, memorizer to be entered Row scanning, searches the step updating file on described memorizer.
The method being scanned the file on memorizer the most according to claim 2, its feature exists In, described judge that whether present scan is that the step of preliminary scan includes:
Search whether to there is the file information data storehouse corresponding with described memorizer, if it is present sentence Determining present scan is non-preliminary scan, otherwise, then judges that present scan is as preliminary scan.
The method being scanned the file on memorizer the most according to claim 1, its feature exists In, the attribute information of described file includes: the pathname of file, the nearest modification time of file, literary composition The size of part, the ID value of file place file.
The method being scanned the file on memorizer the most according to claim 4, its feature exists In, described according to file information data storehouse, memorizer is scanned, searches the renewal on described memorizer The step of file includes:
The file of storage on described memorizer is scanned, obtains the pathname of Current Scan file;
Judge whether the pathname of described Current Scan file is present in described file information data storehouse;
When the pathname of described Current Scan file is not present in described file information data storehouse, then Judge that described Current Scan file is as terminating to present scan to start period, described memorizer from last scan Upper newly-increased file;
When the pathname of described Current Scan file is present in described file information data storehouse, obtain The nearest modification time of the described Current Scan file on described memorizer;
The nearest modification time of the described Current Scan file on described memorizer that judgement gets is the biggest The nearest modification time of the described Current Scan file of record in described file information data storehouse;
When the nearest modification time of the Current Scan file on the described memorizer got is more than described file In information database during the nearest modification time of described Current Scan file of record, then judge described currently Scanning file for from last scan terminate to present scan start period, on described memorizer in have amendment File.
The method being scanned the file on memorizer the most according to claim 4, its feature exists In, the described attribute information according to described renewal file, update the step bag in described file information data storehouse Include:
When having the file of amendment in the file that described renewal file is corresponding is, by described fileinfo number The nearest modification time having the file of amendment according to piece of content every in storehouse is updated on described memorizer and this part Inside have the nearest modification time that the file of amendment is corresponding;
When the file that described renewal file is corresponding is newly-increased file, by every a new on described memorizer The attribute information of the file increased adds to described file information data storehouse.
7. the device that the file on memorizer is scanned, it is characterised in that described device includes:
Search module, for memorizer being scanned according to file information data storehouse, search described storage Renewal file on device, wherein said file information data storehouse record has memorizer described in last scan to obtain Described memorizer on the attribute information of All Files, described renewal file include from last scan terminate to Present scan starts period, on described memorizer in have the file of amendment and newly-increased file;
Acquisition module, for obtaining the attribute information of described renewal file;
More new module, for the attribute information according to described renewal file, updates described file information data Storehouse;
Removing module, has had in described file information data storehouse for deleting, but at present scan The attribute information of undiscovered file during described memorizer;
Output module, for remembering in the described file information data storehouse after renewal and deletion action The attribute information of the All Files of record exports as present scan result.
The device being scanned the file on memorizer the most according to claim 7, its feature exists In, described device also includes scanning judge module;
Described scanning judge module is used for:
Judge whether present scan is preliminary scan;
When present scan is preliminary scan, setting up and store record has the attribute of All Files on memorizer The file information data storehouse of information;
When present scan is non-preliminary scan, send control signal to described lookup module;
Described lookup module is used for: receive the control signal that described scanning judge module sends, according to file Memorizer is scanned by information database, searches the renewal file on described memorizer.
The device being scanned the file on memorizer the most according to claim 8, its feature exists In, described scanning judge module judge when whether present scan is preliminary scan specifically for:
Search whether to there is the file information data storehouse corresponding with described memorizer, if it is, judge Present scan is non-preliminary scan, otherwise, then judges that present scan is preliminary scan.
The device that file on memorizer is scanned the most according to claim 7, its feature Being, the attribute information of described file includes: the pathname of file, the nearest modification time of file, The size of file, the ID value of file place file.
11. devices that the file on memorizer is scanned according to claim 10, its feature Being, described lookup module includes:
First acquiring unit, for being scanned the file of storage on described memorizer, obtains and currently sweeps Retouch the pathname of file;
First judging unit, described for judging whether the pathname of described Current Scan file is present in In file information data storehouse;
First determines unit, for being not present in described file when the pathname of described Current Scan file Time in information database, it is judged that described Current Scan file is for terminate from the beginning of present scan from last scan Period, file newly-increased on described memorizer;
Second acquisition unit, for being present in described file letter when the pathname of described Current Scan file Time in breath data base, obtain the nearest modification time of described Current Scan file on described memorizer;
Second judging unit, the described Current Scan file on the described memorizer that judgement gets Recently whether modification time is more than the described Current Scan file of record in described file information data storehouse Nearly modification time;
Second determines unit, for repairing recently when the Current Scan file on the described memorizer got The time that changes is more than the nearest modification time of the described Current Scan file of record in described file information data storehouse Time, it is judged that described Current Scan file for from last scan terminate to present scan start period, described in deposit The file of amendment is had on reservoir.
12. devices that the file on memorizer is scanned according to claim 10, its feature Being, described more new module includes:
Amendment unit, is used for when having the file of amendment in the file that described renewal file is corresponding is, will In described file information data storehouse, to have the nearest modification time of the file of amendment to be updated to described for every piece of content Nearest modification time corresponding with the file having amendment in this part on memorizer;
Adding device, for when the file that described renewal file is corresponding is newly-increased file, deposits described On reservoir, the attribute information of every a newly-increased file adds to described file information data storehouse.
CN201310296298.0A 2013-07-15 2013-07-15 A kind of method and device that file on memorizer is scanned Active CN104133822B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201310296298.0A CN104133822B (en) 2013-07-15 2013-07-15 A kind of method and device that file on memorizer is scanned
PCT/CN2014/079900 WO2015007125A1 (en) 2013-07-15 2014-06-16 Method and apparatus for scanning file in memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310296298.0A CN104133822B (en) 2013-07-15 2013-07-15 A kind of method and device that file on memorizer is scanned

Publications (2)

Publication Number Publication Date
CN104133822A CN104133822A (en) 2014-11-05
CN104133822B true CN104133822B (en) 2016-09-14

Family

ID=51806501

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310296298.0A Active CN104133822B (en) 2013-07-15 2013-07-15 A kind of method and device that file on memorizer is scanned

Country Status (2)

Country Link
CN (1) CN104133822B (en)
WO (1) WO2015007125A1 (en)

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104462296B (en) * 2014-11-28 2020-12-04 小米科技有限责任公司 File management method and device and terminal
CN105825084B (en) * 2015-01-06 2019-10-18 阿里巴巴集团控股有限公司 Method for carrying out matching detection to the object with image
CN105022838A (en) * 2015-08-18 2015-11-04 深圳市为有视讯有限公司 Method for allowing camera equipment to have fast access to video files and picture files in memory card of camera equipment
CN105389509A (en) * 2015-11-16 2016-03-09 北京奇虎科技有限公司 Document scanning method and apparatus
CN105653648A (en) * 2015-12-28 2016-06-08 北京金山安全软件有限公司 File acquisition method and device and electronic equipment
CN106528594A (en) * 2016-09-20 2017-03-22 海信集团有限公司 Downloaded file querying method and device
CN106802812A (en) * 2016-12-02 2017-06-06 乐视控股(北京)有限公司 A kind of method of load document, device and electronic equipment
CN106844566B (en) * 2016-12-30 2020-11-20 联想(北京)有限公司 Data processing method and system, detected device and processing device
CN106909632A (en) * 2017-01-23 2017-06-30 努比亚技术有限公司 Garbage files searching method and terminal
CN107657051B (en) * 2017-10-16 2020-03-17 Oppo广东移动通信有限公司 Picture label generation method, terminal device and storage medium
CN107766488B (en) * 2017-10-17 2021-08-06 Oppo广东移动通信有限公司 Information query method, terminal and computer readable storage medium
CN109951731B (en) * 2017-12-21 2021-06-15 深圳Tcl数字技术有限公司 Method, system and storage medium for solving repeated scanning of external storage device
CN110086789B (en) * 2019-04-17 2021-07-13 腾讯科技(深圳)有限公司 Data transmission method, device, equipment and medium
CN110287159B (en) * 2019-06-03 2021-11-12 北京一览群智数据科技有限责任公司 File processing method and device
CN110347661A (en) * 2019-07-05 2019-10-18 北京红山信息科技研究院有限公司 Method, apparatus, server and the storage medium that data source is quasi real time put in storage
CN112445519B (en) * 2020-12-03 2022-02-15 平安科技(深圳)有限公司 File change control method, device, equipment and storage medium
CN113722279B (en) * 2021-08-19 2024-03-01 北京达佳互联信息技术有限公司 Method, device, equipment and storage medium for determining size of folder

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1674673A (en) * 2005-05-13 2005-09-28 北京中星微电子有限公司 System for mobile terminal receiving multimedia content, method and apparatus thereof
CN102014214A (en) * 2010-12-23 2011-04-13 广东欧珀移动通信有限公司 Hand-held terminal powered-on/powered-off method and identification method of memory card of hand-held terminal
CN102289484A (en) * 2011-08-03 2011-12-21 Tcl集团股份有限公司 Method for scanning multimedia files of storage equipment based on android system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101609448A (en) * 2008-06-19 2009-12-23 鸿富锦精密工业(深圳)有限公司 Database active scan system and method
US9110919B2 (en) * 2009-10-30 2015-08-18 Symantec Corporation Method for quickly identifying data residing on a volume in a multivolume file system
CN102081620A (en) * 2009-11-26 2011-06-01 中国移动通信集团贵州有限公司 Method and device for controlling database object change
CN102480494B (en) * 2010-11-23 2014-04-02 金蝶软件(中国)有限公司 File updating method, device and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1674673A (en) * 2005-05-13 2005-09-28 北京中星微电子有限公司 System for mobile terminal receiving multimedia content, method and apparatus thereof
CN102014214A (en) * 2010-12-23 2011-04-13 广东欧珀移动通信有限公司 Hand-held terminal powered-on/powered-off method and identification method of memory card of hand-held terminal
CN102289484A (en) * 2011-08-03 2011-12-21 Tcl集团股份有限公司 Method for scanning multimedia files of storage equipment based on android system

Also Published As

Publication number Publication date
CN104133822A (en) 2014-11-05
WO2015007125A1 (en) 2015-01-22

Similar Documents

Publication Publication Date Title
CN104133822B (en) A kind of method and device that file on memorizer is scanned
US9792340B2 (en) Identifying data items
CN100464308C (en) Method and system for updating user vocabulary synchronouslly
CN101330657B (en) Address list system and implementing method thereof
CN103559276B (en) A kind of method and its device for clearing up garbage files
CN113568995B (en) Dynamic tile map manufacturing method and tile map system based on search conditions
CN107016123B (en) File management method and terminal device
CN109726177A (en) A kind of mass file subregion indexing means based on HBase
CN105760232B (en) Offline cache method and system for IOS application
CN110399348A (en) File deletes method, apparatus, system and computer readable storage medium again
CN110245145A (en) Structure synchronization method and apparatus of the relevant database to Hadoop database
CN102937924A (en) File allocation table (FAT) data recovery method based on file characteristic and file system
CN100363890C (en) System and method for synchronously renewing file of remote computer
CN111046041A (en) Data processing method and device, storage medium and processor
CN103123651A (en) Method of rapidly searching multiple same-kind paper, device and mobile equipment
CN109165196A (en) A kind of compressed file management method, device, computer equipment and storage medium
CN103425694A (en) Relational data searching method and device
CN101442833B (en) Communication terminal device, access controlling method, and smart card
JP4142866B2 (en) Database synchronization apparatus and program
CN106126555A (en) A kind of file management method and file system
CN101014059A (en) Method for storing and extending data information of electric phone book
CN101382961A (en) Method for making update file and updating data
CN106874486A (en) Method and mobile terminal that a kind of Folder Name shows
CN118120212A (en) File deduplication method, device and equipment
CN103914481B (en) Date storage method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20190729

Address after: Shenzhen Futian District City, Guangdong province 518044 Zhenxing Road, SEG Science Park 2 East Room 403

Co-patentee after: Tencent cloud computing (Beijing) limited liability company

Patentee after: Tencent Technology (Shenzhen) Co., Ltd.

Address before: Shenzhen Futian District City, Guangdong province 518044 Zhenxing Road, SEG Science Park 2 East Room 403

Patentee before: Tencent Technology (Shenzhen) Co., Ltd.