[go: up one dir, main page]

CN105279278B - The searching method and device of file - Google Patents

The searching method and device of file Download PDF

Info

Publication number
CN105279278B
CN105279278B CN201510783262.4A CN201510783262A CN105279278B CN 105279278 B CN105279278 B CN 105279278B CN 201510783262 A CN201510783262 A CN 201510783262A CN 105279278 B CN105279278 B CN 105279278B
Authority
CN
China
Prior art keywords
file
information
search
index
memory
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
CN201510783262.4A
Other languages
Chinese (zh)
Other versions
CN105279278A (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.)
Zhuhai Baoqu Technology Co Ltd
Original Assignee
Zhuhai Seal Interest 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 Zhuhai Seal Interest Technology Co Ltd filed Critical Zhuhai Seal Interest Technology Co Ltd
Priority to CN201510783262.4A priority Critical patent/CN105279278B/en
Publication of CN105279278A publication Critical patent/CN105279278A/en
Application granted granted Critical
Publication of CN105279278B publication Critical patent/CN105279278B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/156Query results presentation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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)
  • Library & Information Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present invention proposes the searching method and device of a kind of file.Wherein, this method comprises: receiving the starting request that user sends;It is requested based on starting, pre-generated index file is loaded onto memory, wherein index file is pre-stored in the specified directory of terminal, and comprising the file information of each file stored in terminal in index file, the file information includes filename;Receive the search file information of user's input;Search file information is matched with the filename of each file in the index file in memory, and using the file comprising search file information as the search result of search file information;And display search result.The searching method and device of the file of the embodiment, avoid in file search, repeatedly traverse the time consumed by the file of terminal storage space, can reduce the time for obtaining search result, improve the efficiency of search file, reduce the consumption to the resource of terminal.

Description

The searching method and device of file
Technical field
The present invention relates to field of computer technology more particularly to the searching methods and device of a kind of file.
Background technique
With the development of science and technology and the demand of user, the memory space of terminal such as computer is increasing, in terminal The files such as a large amount of audio, video and text are typically stored with, and as the file stored in terminal is more and more, user is very Hardly possible quickly finds the file of its needs from multiple files.The storage position for the file that needs are checked especially is had forgotten in user When, in order to obtain the file of oneself needs, the usual way of user is at present: the function of search of the file in computer is called, And the filename of file required for inputting, and searched for totally, computer will be according to the demand of user in computer All Files traverse one time, with acquisition and the matched file of filename, and show corresponding search result on a user interface.
However, the mode of above-mentioned search file the problem is that: when the file of terminal is more, traversal All Files need The time to be consumed is very long, and the efficiency of search file is lower, cannot provide required file for user in time, and the file of user is searched Cable body is tested poor, and during prolonged file search, needs CPU (Central Processing Unit, center Processor) hardware supported, therefore, prolonged ergodic process is also very big to terminal CPU consumption.
Summary of the invention
The present invention is directed to solve at least some of the technical problems in related technologies.For this purpose, of the invention First purpose is to propose a kind of searching method of file, and this method is obtained according to the index file in memory and search file Information-related search result is avoided in file search, repeatedly traverses the time consumed by the file of terminal storage space, from And the time for obtaining search result can be reduced, the efficiency of search file is improved, the consumption to the resource of terminal is reduced.
Second object of the present invention is to propose a kind of searcher of file.
To achieve the above object, first aspect present invention embodiment proposes a kind of searching method of file, comprising: receives The starting request that user sends;It is requested based on the starting, pre-generated index file is loaded onto memory, wherein described Index file is pre-stored in the specified directory of terminal, each file in the index file comprising storing in the terminal The file information, the file information includes filename;Receive the search file information of user's input;By described search text Part information is matched with the filename of each file in the index file in the memory, and will include described search file Search result of the file of information as described search the file information;And display described search result.
Optionally, described to pre-generate the index file, it specifically includes: the current file system log of reading terminals, And the current file system log is parsed, to obtain the file letter of each file in the current system log Breath, wherein the file information further includes first identifier information, the second identifier information of the upper directory of current file and file Type information;Based on the file information of each file, a tree structure is established, wherein each of described tree structure Include the file information with file corresponding to each node on node;And the file of node each in the tree structure is believed Breath is stored, to generate the index file.
Optionally, before the index file pre-generated is loaded onto memory, the method also includes: obtain the finger Determine the renewal time information of the index file in catalogue, and the current file system log of reading terminals;When according to the update Between information judge whether the file information in the current file system log has update;If there is update, according to update file The file information the index file in the specified directory is updated, and using updated index file as the index File.
Optionally, after the index file pre-generated is loaded onto memory, the method also includes: it obtains in described The renewal time information of index file in depositing, and the current file system log of reading terminals;Believed according to the renewal time Breath judges whether the file information in the current file system log has update;If there is update, according to the text for updating file Part information is updated the index file in the memory.
Optionally, during carrying out file search, the method also includes: the file system journal progress to terminal Monitoring;When monitoring the file information update in the file system journal, according to the file information of update file to described Index file in memory is updated.
Optionally, described that index file is loaded onto memory, specifically include: mapping mode based on memory will be stored in finger The index file determined in catalogue maps to memory.
Optionally, while the display described search result, the method also includes: display and described search file The relevant prompt information of information, wherein the prompt information is used to provide the described the search link of search file information, so that institute State the relevant search result that user obtains described search the file information according to described search link from internet.
Optionally, after the display described search result, the method also includes: export the index text in the memory Part, and the index file in the specified directory is updated with the index file in the memory.
The searching method of file according to an embodiment of the present invention will be preparatory after receiving the starting request of user's transmission The pre-generated index file being stored in the specified directory of terminal is loaded onto memory, and in the search for receiving user's input After the file information, search file information is matched with the filename of each file in the index file in memory, and will Search result of the file comprising search file information as search file information, and the search knot of display search file information Fruit.It is scanned in a manner of obtaining with the information-related search result of search file relative to the memory space to terminal For, by the way that the index file being stored in terminal is loaded onto memory, and during file search, according in memory Index file obtains and the information-related search result of search file, avoids in file search, and it is empty repeatedly to traverse terminal storage Between file consumed by the time, so as to reduce obtain search result time, improve the efficiency of search file, reduce Consumption to the resource of terminal.
To achieve the above object, second aspect of the present invention embodiment proposes a kind of searcher of file, comprising: first Receiving module, for receiving the starting request of user's transmission;Loading module will be pre-generated for being requested based on the starting Index file be loaded onto memory, wherein the index file is pre-stored in the specified directory of terminal, the index file In comprising the file information of each file stored in the terminal, the file information includes filename;Second receiving module, For receiving the search file information of user's input;Search module is used for described search the file information and the memory In index file in the filename of each file matched, and using the file comprising described search the file information as institute State the search result of search file information;And display module, for showing described search result.
Optionally, described device further include: preprocessing module, for the current file system log of reading terminals, and it is right The current file system log is parsed, to obtain the file information of each file in the current system log, In, the file information includes first identifier information, the second identifier information of the upper directory of current file, file type information And filename;Based on the file information of each file, a tree structure is established, wherein each of described tree structure Include the file information with file corresponding to each node on node;And the file of node each in the tree structure is believed Breath is stored, to generate the index file.
Optionally, described device further include: first processing module, the index for will be pre-generated in the loading module File is loaded onto before memory, obtain the renewal time information of the index file in the specified directory, and reading terminals are worked as Preceding document system log, and whether the file information in the current file system log is judged according to the renewal time information There is update, and when the file information in the current file system log has update, according to the file information for updating file Index file in the specified directory is updated.
Optionally, described device further include: Second processing module, the index for will be pre-generated in the loading module File is loaded onto after memory, obtains the renewal time information of the index file in the memory, and reading terminals ought be above Part system log;Judge whether the file information in the current file system log has more according to the renewal time information Newly;If there is update, the index file in the memory is updated according to the file information for updating file.
Optionally, described device further include: third processing module is used for during carrying out file search, to terminal File system journal be monitored, and when monitoring the file information in the file system journal and updating, according to update The file information of file is updated the index file in the memory.
Optionally, the loading module, is specifically used for: mapping mode based on memory, the rope that will be stored in specified directory Quotation part maps to memory.
Optionally, the display module, is also used to: while the display described search result, display is searched with described The relevant prompt information of rope the file information, wherein the prompt information is used to provide the described the search link of search file information, So that the user links the relevant search result for obtaining described search the file information from internet according to described search.
Optionally, described device further include: update module is used for after the display module shows described search result, The index file in the memory is exported, and the text of the index in the specified directory is updated with the index file in the memory Part.
The searcher of file according to an embodiment of the present invention receives the starting that user sends by the first receiving module and asks It asks, the pre-generated index file being pre-stored in the specified directory of terminal is loaded onto memory by loading module, and is passed through Second receiving module receives the search file information of user's input, and search module is literary by the index in search file information and memory The filename of each file in part is matched, and searching using the file comprising search file information as search file information Rope as a result, and display module show search file information search result.It is carried out relative to by the memory space to terminal It searches for in a manner of obtaining the search result information-related with search file, passes through the index file that will be stored in terminal It is loaded onto memory, and during file search, is obtained according to the index file in memory information-related with search file Search result is avoided in file search, is repeatedly traversed the time consumed by the file of terminal storage space, is obtained so as to reduce The time for obtaining search result, the efficiency of search file is improved, the consumption to the resource of terminal is reduced.
Detailed description of the invention
Fig. 1 is the flow chart of the searching method of file according to an embodiment of the invention.
Fig. 2 is the schematic diagram that index file is loaded onto the interface after memory.
Fig. 3 is the schematic diagram at the interface for the search result that search file information is " 1234 ".
Fig. 4 is the schematic diagram at the interface for the search result that search file information is " 12345 ".
Fig. 5 is the schematic diagram at the interface for the search result that search file information is " a beautiful mind ".
Fig. 6 is the flow chart of the searching method of file in accordance with another embodiment of the present invention.
Fig. 7 is the structural schematic diagram of the searcher of file according to an embodiment of the invention.
Fig. 8 is the structural schematic diagram of the searcher of file in accordance with another embodiment of the present invention.
Specific embodiment
The embodiment of the present invention is described below in detail, examples of the embodiments are shown in the accompanying drawings, wherein from beginning to end Same or similar label indicates same or similar element or element with the same or similar functions.Below with reference to attached The embodiment of figure description is exemplary, it is intended to is used to explain the present invention, and is not considered as limiting the invention.
Below with reference to the accompanying drawings the searching method and device of the file of the embodiment of the present invention are described.
Fig. 1 is the flow chart of the searching method of file according to an embodiment of the invention.
As shown in Figure 1, the searching method of this document includes:
S101 receives the starting request that user sends.
Pre-generated index file is loaded onto memory based on starting request by S102.
Wherein, above-mentioned index file is pre-stored in the specified directory of terminal, and comprising depositing in terminal in index file The file information of each file of storage, the file information can include but is not limited to filename.
It should be noted that the terminal in the present embodiment, which can be personal computer PC, mobile phone, tablet computer etc., to be had respectively The hardware device of kind operating system.
In addition, in order to describe conveniently, it is in the embodiment of invention, the application program with file search function is referred to as fast Fast search software, it is to be understood that in practical applications, can also have answering for file search function with other name nominatings Use program.
In one embodiment of the invention, after receiving the starting request of user's transmission, can determine whether user whether the One-shot fast search software, if starting fast search software for the first time, then the current file system log of reading terminals, And current file system log is parsed, to obtain the file information of each file in current system log, and it is based on The file information of each file establishes a tree structure, and the file information of node each in tree structure is deposited Storage, to generate index file.
It wherein, can also include first identifier information, current file in above-mentioned the file information other than including filename The information such as second identifier information, file type information and the filename of upper directory.Wherein, above-mentioned file type information can wrap Include the types such as file .JPG .gif .mav .doc.
Wherein, it should be noted that include the file with file corresponding to each node on each node of tree structure Information, the i.e. node with file of tree structure are corresponding, i.e., a node indicates a file, and include the text of this document on node Part information.
For example, the system of terminal is Windows XP system, the corresponding file system journal of the system is USN (Update Service Number Journal or Change Journal, renewal sequence number) log, USN log is to NTFS (New Technology File System, New Technology File System) volume in modified information progress relative recording function.? During establishing index file, USN log can be read, and parse to it, and is established entirely using these log informations Index file a, wherein Journal node of USN log is contained uniquely indicates the one of this document under current system subregion A mark ID, while also containing the mark ID of oneself father node (upper directory), there are also file type information (distinguish file and File).A tree structure can be established based on these above-mentioned information, each node of tree structure includes current file Identify ID, father node identifies ID, file type, filename.One such tree structure is established to each system partitioning, Then established tree index information is stored in an index file by each node.
In order to provide accurate search result for user, in one embodiment of the invention, will pre-generate Index file be loaded onto before memory, the renewal time information of the index file in specified directory can also be obtained, and read The current file system log of terminal, and whether the file information in current file system log is judged according to renewal time information There is update, and if it is judged that the file information in current file system log has update, then according to the file for updating file Information is updated the index file in specified directory, thereby it is ensured that the index file being loaded onto memory is updated Index file, and then the accuracy of subsequent file search can be improved.
In general, index file, which is loaded onto the mode in memory, to be had very much, for example, the mode of file reading can be used, it will The file information of each node in index file is read into memory, and the mode that generallys use is different, by index file plus It is loaded onto the difference of time consumed by memory, it is different to the consumption of the I/O (Input/Output, input/output) of terminal.
In one embodiment of the invention, in order to improve the speed that index file is loaded onto memory, load rope is reduced Consumption of the quotation part to the I/O of terminal can map the index file being stored in specified directory in such a way that memory maps To memory.
S103 receives the search file information of user's input.
Specifically, after index file is loaded onto memory, the interface form of fast search software as shown in Fig. 2, at this point, The extension name (i.e. the suffix of file) that user can input search file information such as filename or file in search box carries out Search.
S104 matches search file information with the filename of each file in the index file in memory, and Using the file comprising search file information as the search result of search file information.
It specifically, can will be in search file information and index file after the search file information for receiving user's input The filename of each file be compared, if in filename including search file information, using corresponding file as searching The search result of rope the file information.
Specifically, each node of traversal tree structure, and by the filename on search file information and node into The list of search hit is added if in the filename of the node including search file information in corresponding node by row comparison In, the anabolic process of routing information corresponding to the file on the node are as follows: the node is traced back into root node, filename in turn String together be exactly file on node routing information.
S105 shows search result.
Wherein, it should be noted that, can be currently entered according to user during user inputs search file information Search file information acquisition search result.
For example, the form at the interface of fast search software is as shown in Figure 2 after index file is loaded onto memory, it is assumed that use Family needs search file entitled " 12345 ", and when user inputs search file name " 12345 ", user often changes a search file Information can get the search result with search file information matches currently entered, and display in time is believed with current search file Cease corresponding search result.It is assumed that the search file information of active user's input is " 1234 ", search file information is " 1234 " The form of corresponding search result, as shown in figure 3, include three files in search interface list as seen in Figure 3, this When, user can click directly on the file of the file shown in search interface list entitled " 12345 ", to realize the visit to this document It asks.In addition, if user continues input 5, at this point, being obtained after the search file information for receiving user's input is " 12345 " The corresponding search knot of current search the file information as a result, and show that search file information is in the form of a list in interface The search result of " 12345 ", wherein search file information is the form of the search result of " 12345 ", as shown in Figure 4.As a result, As can be seen that the process of a search file information is changed every time in user, it will display and search file information phase in interface The search result matched.
In one embodiment of the invention, in order to enable user can obtain more with search file is information-related searches Rope can also show prompt information relevant to search file information as a result, while showing search result.
Wherein, above-mentioned prompt information is used to provide the search link of search file information, so that user links according to search The relevant search result of search file information is obtained from internet.
For example, entitled " a beautiful mind " in the file that user inputs in search box as shown in Figure 2, it is assumed that file is entitled " a beautiful mind " is a film, at this point, text relevant to filename " a beautiful mind " can be obtained from the memory space of terminal Part, and display and filename " a beautiful mind " related search result on a user interface, if do not searched in the terminal With the file of filename " a beautiful mind ", i.e. search result is 0, and the form at interface is as shown in figure 5, if receive user's click The prompt information of " being scanned for from internet ", at this point, the searching at internet hunt " a beautiful mind " using search engine Rope as a result, as a result, from network for user provide with " a beautiful mind " related search result, facilitate in users from networks Search result is obtained, the efficiency obtained in users from networks with " a beautiful mind " related search result is improved.
The searching method of the file of the embodiment of the present invention will pre-save after receiving the starting request of user's transmission Pre-generated index file in the specified directory of terminal is loaded onto memory, and in the search file for receiving user's input After information, search file information is matched with the filename of each file in the index file in memory, and will include Search result of the file of search file information as search file information, and the search result of display search file information. Relative to the memory space to terminal scan in a manner of obtaining with the information-related search result of search file come It says, by the way that the index file being stored in terminal is loaded onto memory, and during file search, according to the rope in memory Quotation part obtains and the information-related search result of search file, avoids repeatedly traversing terminal storage space in file search File consumed by the time improve the efficiency of search file so as to reduce the time for obtaining search result, reduce pair The consumption of the resource of terminal.
Fig. 6 is the flow chart of the searching method of file in accordance with another embodiment of the present invention.
As shown in fig. 6, the searching method of this document includes:
S601 receives the starting request that user sends.
Pre-generated index file is loaded onto memory based on starting request by S602.
Wherein, above-mentioned index file is pre-stored in the specified directory of terminal.
Above-mentioned index file is pre-stored in the specified directory of terminal, and every comprising storing in terminal in index file The file information of a file, the file information can include but is not limited to filename.
It should be noted that the terminal in the present embodiment, which can be personal computer PC, mobile phone, tablet computer etc., to be had respectively The hardware device of kind operating system.
In one embodiment of the invention, after receiving the starting request of user's transmission, can determine whether user whether the One-shot fast search software, if starting fast search software for the first time, then the current file system log of reading terminals, And current file system log is parsed, to obtain the file information of each file in current system log, and it is based on The file information of each file establishes a tree structure, and the file information of node each in tree structure is deposited Storage, to generate index file.
Wherein, in above-mentioned the file information other than including filename, above-mentioned the file information can also include that first identifier is believed The information such as second identifier information, file type information and the filename of upper directory of breath, current file.Wherein, above-mentioned file Type information may include the types such as file .JPG .gif .mav .doc.
Wherein, it should be noted that include the file with file corresponding to each node on each node of tree structure Information, the i.e. node with file of tree structure are corresponding, i.e., a node indicates a file, and include the text of this document on node Part information.
Index file, which is loaded onto the mode in memory, to be had very much, for example, the mode of file reading can be used, by index text The file information of each node in part is read into memory, and the mode generallyd use is different, index file is loaded onto interior Time consumed by depositing is different, different to the consumption of the I/O (Input/Output, input/output) of terminal.
In one embodiment of the invention, in order to improve the speed that index file is loaded onto memory, load rope is reduced Consumption of the quotation part to the I/O of terminal can map the index file being stored in specified directory in such a way that memory maps To memory.
S603 obtains the renewal time information of the index file in memory, and the current file system log of reading terminals.
S604 judges whether the file information in current file system log has update according to renewal time information.
Specifically, it after reading the current file system log of terminal, needs to the text in current file system log Whether part information has update to be judged, there are many specific judgment mode, can be selected according to the actual application.
For example, can be by the respective file in the file information and index file of each file in current file system log The file information be compared, if pair in the file information and index file of some file in current file system log Answer the file information of file different, it is determined that have update in the file information in current file system log.
For another example the temporal information for generating index file can be obtained, and judge that current file information log is believed in the time Whether breath increases new log recording later, if current file information log also includes deleting for file after the temporal information It removes, move or the record such as newly-built, it is determined that have update in the file information in current file system;If the temporal information it Afterwards, there is no other records in current file information log, it is determined that the file information in current file system does not update.
S605 is updated index file according to the file information for updating file if there is update.
S606 receives the search file information of user's input.
Specifically, after index file is loaded onto memory, interface form in fast search software as shown in Fig. 2, this When, user can be inputted in search box the extension name (i.e. the suffix of file) of search file information such as filename or file into Row search.
S607 matches search file information with the filename of each file in the index file in memory, and Using the file comprising search file information as the search result of search file information.
It specifically, can will be in search file information and index file after the search file information for receiving user's input The filename of each file be compared, if in filename including search file information, using corresponding file as searching The search result of rope the file information.
S608 shows search result.
Wherein, it should be noted that, can be currently entered according to user during user inputs search file information Search file information acquisition search result.
For example, the form at the interface of fast search software is as shown in Figure 2 after index file is loaded onto memory, it is assumed that use Family needs search file entitled " 12345 ", and when user inputs search file name " 12345 ", user often changes a search file Information can get the search result with search file information matches currently entered, and display in time is believed with current search file Cease corresponding search result.It is assumed that the search file information of active user's input is " 1234 ", search file information is " 1234 " The form of corresponding search result, as shown in figure 3, include three files in search interface list as seen in Figure 3, this When, user can click directly on the file of the file shown in search interface list entitled " 12345 ", to realize the visit to this document It asks.In addition, if user continues input 5, at this point, being obtained after the search file information for receiving user's input is " 12345 " The corresponding search knot of current search the file information as a result, and show that search file information is in the form of a list in interface The search result of " 12345 ", wherein search file information is the form of the search result of " 12345 ", as shown in Figure 4.As a result, As can be seen that the process of a search file information is changed every time in user, it will display and search file information phase in interface The search result matched.
The searching method of the file of the embodiment of the present invention, the index file in the specified directory that will be pre-stored in terminal It is loaded onto after memory, also the current file system log of reading terminals, and is judging the file in current file system log After information has update, index file is updated, and after user inputs search file information, from updated index file It is middle acquisition with the information-related search result of search file, as a result, relative to by the memory space to terminal scan for It obtains for the mode with the information-related search result of search file, by the way that the index file being stored in terminal to be loaded onto Memory, and during file search, it is obtained and the information-related search knot of search file according to the index file in memory Fruit avoids in file search, repeatedly traverses the time consumed by the file of terminal storage space, is searched for so as to reduce As a result time improves the efficiency of search file, reduces the consumption to the resource of terminal.
Further, in another embodiment of the present invention, in order to further accurately be provided for user and search file The search result that information matches, during user carries out file search, can also file system journal to terminal into Row monitoring, and when monitoring the file information update in file system journal, according to the file information of update file to memory In index file be updated.
Further, in another embodiment of the present invention, after monitoring user and exiting fast search software, that is, exist After user searches for, the index file in exportable memory, and the rope in specified directory is updated with the index file in memory Quotation part subsequent is receiving user to facilitate that is, with pervious index file in the index file of memory covering specified directory Starting request after, index file updated in specified directory is loaded onto memory, and accurately provide and search for for user The related search result of the file information.
In order to realize above-described embodiment, the present invention also proposes a kind of searcher of file.
Fig. 7 is the structural schematic diagram of the searcher of file according to an embodiment of the invention.
As shown in fig. 7, the searcher of this document includes the first receiving module 11, loading module 12, the second receiving module 13, search module 14 and display module 15, in which:
First receiving module 11 is used to receive the starting request of user's transmission;Loading module 12 is used for based on starting request, Pre-generated index file is loaded onto memory, wherein index file is pre-stored in the specified directory of terminal, index text Comprising the file information of each file stored in terminal in part, the file information includes filename;Second receiving module 13 is used for Receive the search file information of user's input;Search module 14 is used for will be in the index file in search file information and memory The filename of each file is matched, and using the file comprising search file information as the search knot of search file information Fruit;And display module 15 is for showing search result.
Wherein, terminal can be personal computer PC, mobile phone, tablet computer etc. and set with the hardware of various operating systems It is standby.
Loading module 12 is specifically used for: mapping mode based on memory, and the index file being stored in specified directory is mapped To memory.
In addition, the preprocessing module 16 is for preparatory as shown in figure 8, above-mentioned apparatus can also include preprocessing module 16 Raw index file, specifically, preprocessing module 1 is used for: the current file system log of reading terminals, and to current file system Log is parsed, to obtain the file information of each file in current system log, based on the file information of each file, A tree structure is established, and the file information of node each in tree structure is stored, to generate index file.
Wherein, the file information may include first identifier information, the second identifier information of the upper directory of current file, text Part type information and filename.
Wherein, it should be noted that include the file with file corresponding to each node on each node of tree structure Information, the i.e. node with file of tree structure are corresponding, i.e., a node indicates a file, and include the text of this document on node Part information.
Specifically, after the first receiving module 11 receives the starting request of user's transmission, can determine whether it is for the first time The starting request of user's transmission is received, if receiving the starting request of user for the first time, cocoa passes through preprocessing module 16 Generate index file, wherein it is to be appreciated that the index file generated of preprocessing module 16 is just in the specified directory of terminal In.
In one embodiment of the invention, in order to provide accurate search result, as shown in figure 8, above-mentioned apparatus is also wrapped First processing module 17 is included, which is used in pre-generated index file is loaded by loading module 12 Before depositing, the renewal time information of the index file in specified directory, and the current file system log of reading terminals are obtained, and Judge whether the file information in current file system log has update according to renewal time information, and in current file system When the file information in log has update, the index file in specified directory is carried out more according to the file information for updating file Newly.
In another embodiment, in order to which accurate search result can be provided, as shown in figure 8, above-mentioned apparatus It can also include Second processing module 18, which is loaded onto pre-generated index file in loading module 12 After memory, the renewal time information of the index file in memory, and the current file system log of reading terminals are obtained;According to Renewal time information judges whether the file information in current file system log has update;It is literary according to updating if there is update The file information of part is updated the index file in memory.
In addition, in order to which accurate search result may further be provided, as shown in figure 8, above-mentioned apparatus can also include the Three processing modules 19, which is used for during carrying out file search, to the file system journal of terminal It is monitored, and when monitoring the file information update in file system journal, it is internal according to the file information for updating file Index file in depositing is updated.
In order to enable user can obtain search result more information-related with search file, above-mentioned display module 15 is also For: while showing search result, show prompt information relevant to search file information, wherein prompt information is used for The search link of search file information is provided, so that user obtains the phase of search file information according to search link from internet Close search result.
In addition, the update module 20 is used in display mould as shown in figure 8, above-mentioned apparatus can also include update module 20 After block 15 shows search result, the index file in memory is exported, and update in specified directory with the index file in memory Index file.
It should be noted that the explanation of the embodiment of the aforementioned searching method to file is also applied for the embodiment The searcher of file, details are not described herein again.
The searcher of the file of the embodiment of the present invention receives the starting that user sends by the first receiving module and requests, The pre-generated index file being pre-stored in the specified directory of terminal is loaded onto memory by loading module, and passes through second Receiving module receives the search file information of user's input, and search module will be in the index file in search file information and memory The filename of each file matched, and using the file comprising search file information as the search knot of search file information Fruit and display module show the search result of search file information.It is scanned for relative to by the memory space to terminal For in a manner of obtaining with the information-related search result of search file, loaded by the index file that will be stored in terminal To memory, and during file search, obtained and the information-related search of search file according to the index file in memory As a result, avoiding in file search, the time consumed by the file of terminal storage space is repeatedly traversed, is searched so as to reduce The time of hitch fruit improves the efficiency of search file, reduces the consumption to the resource of terminal.
In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ", " specifically show The description of example " or " some examples " etc. means specific features, structure, material or spy described in conjunction with this embodiment or example Point is included at least one embodiment or example of the invention.In the present specification, schematic expression of the above terms are not It must be directed to identical embodiment or example.Moreover, particular features, structures, materials, or characteristics described can be in office It can be combined in any suitable manner in one or more embodiment or examples.In addition, without conflicting with each other, the skill of this field Art personnel can tie the feature of different embodiments or examples described in this specification and different embodiments or examples It closes and combines.
In addition, term " first ", " second " are used for descriptive purposes only and cannot be understood as indicating or suggesting relative importance Or implicitly indicate the quantity of indicated technical characteristic.Define " first " as a result, the feature of " second " can be expressed or Implicitly include at least one this feature.In the description of the present invention, the meaning of " plurality " is at least two, such as two, three It is a etc., unless otherwise specifically defined.
Any process described otherwise above or method description are construed as in flow chart or herein, and expression includes It is one or more for realizing specific logical function or process the step of executable instruction code module, segment or portion Point, and the range of the preferred embodiment of the present invention includes other realization, wherein can not press shown or discussed suitable Sequence, including according to related function by it is basic simultaneously in the way of or in the opposite order, Lai Zhihang function, this should be of the invention Embodiment person of ordinary skill in the field understood.
Expression or logic and/or step described otherwise above herein in flow charts, for example, being considered use In the order list for the executable instruction for realizing logic function, may be embodied in any computer-readable medium, for Instruction execution system, device or equipment (such as computer based system, including the system of processor or other can be held from instruction The instruction fetch of row system, device or equipment and the system executed instruction) it uses, or combine these instruction execution systems, device or set It is standby and use.For the purpose of this specification, " computer-readable medium ", which can be, any may include, stores, communicates, propagates or pass Defeated program is for instruction execution system, device or equipment or the dress used in conjunction with these instruction execution systems, device or equipment It sets.The more specific example (non-exhaustive list) of computer-readable medium include the following: there is the electricity of one or more wirings Interconnecting piece (electronic device), portable computer diskette box (magnetic device), random access memory (RAM), read-only memory (ROM), erasable edit read-only storage (EPROM or flash memory), fiber device and portable optic disk is read-only deposits Reservoir (CDROM).In addition, computer-readable medium can even is that the paper that can print described program on it or other are suitable Medium, because can then be edited, be interpreted or when necessary with it for example by carrying out optical scanner to paper or other media His suitable method is handled electronically to obtain described program, is then stored in computer storage.
It should be appreciated that each section of the invention can be realized with hardware, software, firmware or their combination.Above-mentioned In embodiment, software that multiple steps or method can be executed in memory and by suitable instruction execution system with storage Or firmware is realized.It, and in another embodiment, can be under well known in the art for example, if realized with hardware Any one of column technology or their combination are realized: having a logic gates for realizing logic function to data-signal Discrete logic, with suitable combinational logic gate circuit specific integrated circuit, programmable gate array (PGA), scene Programmable gate array (FPGA) etc..
Those skilled in the art are understood that realize all or part of step that above-described embodiment method carries It suddenly is that relevant hardware can be instructed to complete by program, the program can store in a kind of computer-readable storage medium In matter, which when being executed, includes the steps that one or a combination set of embodiment of the method.
It, can also be in addition, each functional unit in each embodiment of the present invention can integrate in a processing module It is that each unit physically exists alone, can also be integrated in two or more units in a module.Above-mentioned integrated mould Block both can take the form of hardware realization, can also be realized in the form of software function module.The integrated module is such as Fruit is realized and when sold or used as an independent product in the form of software function module, also can store in a computer In read/write memory medium.
Storage medium mentioned above can be read-only memory, disk or CD etc..Although having been shown and retouching above The embodiment of the present invention is stated, it is to be understood that above-described embodiment is exemplary, and should not be understood as to limit of the invention System, those skilled in the art can be changed above-described embodiment, modify, replace and become within the scope of the invention Type.

Claims (10)

1. a kind of searching method of file, which comprises the following steps:
Receive the starting request that user sends;
It is requested based on the starting, pre-generated index file is loaded onto memory, wherein the index file pre-saves It is described comprising the file information of each file stored in the terminal in the index file in the specified directory of terminal The file information includes filename;
Receive the search file information of user's input;
Described search the file information is matched with the filename of each file in the index file in the memory, and will Search result of the file comprising described search the file information as described search the file information;And
Show described search result;
Wherein, while the display described search result, the method also includes:
Show prompt information relevant to described search the file information, wherein the prompt information is used to provide the described search text The search of part information links, so that the user links according to described search obtains described search the file information from internet Relevant search result;
After the index file pre-generated is loaded onto memory, the method also includes:
Obtain the renewal time information of the index file in the memory, and the current file system log of reading terminals;
Judge whether the file information in the current file system log has update according to the renewal time information;
If there is update, the index file in the memory is updated according to the file information for updating file;
Wherein, after the display described search result, further includes:
The index file in the memory is exported, and the index in the specified directory is updated with the index file in the memory File.
2. the searching method of file as described in claim 1, which is characterized in that described to pre-generate the index file, tool Body includes:
The current file system log of reading terminals, and the current file system log is parsed, to work as described in acquisition The file information of each file in preceding system log, wherein the file information further includes first identifier information, current file Upper directory second identifier information and file type information;
Based on the file information of each file, a tree structure is established, wherein on each node of the tree structure Include the file information with file corresponding to each node;And
The file information of node each in the tree structure is stored, to generate the index file.
3. the searching method of file as described in claim 1, which is characterized in that be loaded by the index file pre-generated Before memory, the method also includes:
Obtain the renewal time information of the index file in the specified directory, and the current file system log of reading terminals;
Judge whether the file information in the current file system log has update according to the renewal time information;
If there is update, the index file in the specified directory is updated according to the file information for updating file.
4. the searching method of file as described in claim 1, which is characterized in that described during carrying out file search Method further include:
The file system journal of terminal is monitored;
When monitoring the file information update in the file system journal, according to the file information of update file to described interior Index file in depositing is updated.
5. the searching method of file as described in claim 1, which is characterized in that described that index file is loaded onto memory, tool Body includes:
The index file being stored in specified directory is mapped to memory by mapping mode based on memory.
6. a kind of searcher of file characterized by comprising
First receiving module, for receiving the starting request of user's transmission;
Pre-generated index file is loaded onto memory, wherein the rope for requesting based on the starting by loading module Quotation part is pre-stored in the specified directory of terminal, includes each file stored in the terminal in the index file The file information, the file information include filename;
Second receiving module, for receiving the search file information of user's input;
Search module, for by the filename of each file in the index file in described search the file information and the memory It is matched, and using the file comprising described search the file information as the search result of described search the file information;And
Display module, for showing described search result;
Wherein, the display module, is also used to:
While the display described search result, prompt information relevant to described search the file information is shown, wherein institute The search link that prompt information is used to provide the described search file information is stated, so that the user links according to described search from mutual The relevant search result of described search the file information is obtained in networking;
Second processing module, for obtaining institute after pre-generated index file is loaded onto memory by the loading module State the renewal time information of the index file in memory, and the current file system log of reading terminals;When according to the update Between information judge whether the file information in the current file system log has update;If there is update, according to update file The file information the index file in the memory is updated;
Update module, for exporting the index file in the memory after the display module shows described search result, and The index file in the specified directory is updated with the index file in the memory.
7. the searcher of file as claimed in claim 6, which is characterized in that further include:
Preprocessing module is solved for the current file system log of reading terminals, and to the current file system log Analysis, to obtain the file information of each file in the current system log, wherein the file information includes first identifier Second identifier information, file type information and the filename of information, the upper directory of current file;
Based on the file information of each file, a tree structure is established, wherein on each node of the tree structure Include the file information with file corresponding to each node;And
The file information of node each in the tree structure is stored, to generate the index file.
8. the searcher of file as claimed in claim 6, which is characterized in that further include:
First processing module, for obtaining institute before pre-generated index file is loaded onto memory by the loading module The renewal time information of the index file in specified directory, and the current file system log of reading terminals are stated, and according to described Renewal time information judges whether the file information in the current file system log has update, and in the current file When the file information in system log has update, according to the file information of update file to the index file in the specified directory It is updated.
9. the searcher of file as claimed in claim 6, which is characterized in that further include:
Third processing module, for being monitored to the file system journal of terminal during carrying out file search, and When monitoring the file information update in the file system journal, according to the file information of update file in the memory Index file is updated.
10. the searcher of file as claimed in claim 6, which is characterized in that the loading module is specifically used for:
The index file being stored in specified directory is mapped to memory by mapping mode based on memory.
CN201510783262.4A 2015-11-13 2015-11-13 The searching method and device of file Active CN105279278B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510783262.4A CN105279278B (en) 2015-11-13 2015-11-13 The searching method and device of file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510783262.4A CN105279278B (en) 2015-11-13 2015-11-13 The searching method and device of file

Publications (2)

Publication Number Publication Date
CN105279278A CN105279278A (en) 2016-01-27
CN105279278B true CN105279278B (en) 2019-03-12

Family

ID=55148292

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510783262.4A Active CN105279278B (en) 2015-11-13 2015-11-13 The searching method and device of file

Country Status (1)

Country Link
CN (1) CN105279278B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111858495B (en) * 2020-07-23 2024-04-05 珠海豹趣科技有限公司 File information acquisition method and device, storage medium and electronic equipment

Families Citing this family (27)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106528604A (en) * 2016-09-26 2017-03-22 平安科技(深圳)有限公司 Data cache control method and system
CN106777253A (en) * 2016-12-27 2017-05-31 努比亚技术有限公司 The update method and device of a kind of dictionary
CN107066506B (en) * 2017-01-11 2020-12-08 中国科学院空间应用工程与技术中心 A method and device for improving retrieval efficiency of space science and application data
CN108462598B (en) * 2017-02-21 2022-03-11 阿里巴巴集团控股有限公司 A log generation method, log analysis method and device
CN108874820B (en) * 2017-05-11 2021-11-30 广东爱瓦力科技股份有限公司 System file searching method
CN107291943B (en) * 2017-07-11 2020-09-22 苏州浪潮智能科技有限公司 Picture searching method and device
CN108628915A (en) * 2017-07-26 2018-10-09 北京视联动力国际信息技术有限公司 A kind of record queries method and device
CN107480233A (en) * 2017-08-07 2017-12-15 郑州云海信息技术有限公司 A kind of method and system of daily record data positioning
CN110109876A (en) * 2018-01-09 2019-08-09 腾讯科技(深圳)有限公司 A kind of file search method and its equipment, storage medium, terminal
CN108762979B (en) * 2018-04-17 2021-08-10 厦门市美亚柏科信息股份有限公司 A terminal information backup method and backup device based on matching tree
CN108763582B (en) * 2018-06-11 2023-04-21 腾讯科技(深圳)有限公司 File searching method, device, terminal and storage medium
JP7225588B2 (en) * 2018-07-23 2023-02-21 京セラドキュメントソリューションズ株式会社 Information storage device, information communication system and information communication method
CN109271361B (en) * 2018-08-13 2020-07-24 华东计算技术研究所(中国电子科技集团公司第三十二研究所) Distributed storage method and system for massive small files
CN109471838B (en) * 2018-10-19 2020-05-22 北京字节跳动网络技术有限公司 Directory document operation method and device, electronic equipment and readable storage medium
CN109271578A (en) * 2018-10-26 2019-01-25 努比亚技术有限公司 Application program searching method, mobile terminal and computer storage medium
CN110503436B (en) * 2019-08-28 2022-08-30 中国银行股份有限公司 Payment message processing method and system for transmitting image file through SWIFT
CN110955632A (en) * 2019-11-18 2020-04-03 珠海豹趣科技有限公司 File index generation method and device
CN111209256A (en) * 2020-01-07 2020-05-29 深信服科技股份有限公司 File monitoring method and device, electronic equipment and storage medium
CN111580881B (en) * 2020-04-30 2023-06-16 支付宝(杭州)信息技术有限公司 File loading method, device and electronic device
CN111858494B (en) * 2020-07-23 2024-05-17 珠海豹趣科技有限公司 File acquisition method and device, storage medium and electronic equipment
CN112612754B (en) * 2020-12-31 2024-07-05 深圳市大富网络技术有限公司 File searching method, system, device and computer storage medium
CN112835638B (en) * 2021-01-28 2024-12-06 广州致远电子股份有限公司 Configuration information management method and device based on embedded application program
CN112784253B (en) * 2021-02-09 2024-06-11 珠海豹趣科技有限公司 File system information acquisition method and device, electronic equipment and storage medium
CN115705353B (en) * 2021-08-10 2025-07-11 腾讯科技(深圳)有限公司 A method and device for index processing based on full-text search
CN114647630B (en) * 2022-03-31 2025-05-13 金蝶票据云科技(深圳)有限公司 File synchronization, information generation method, device, computer equipment and storage medium
CN114996215B (en) * 2022-06-16 2025-12-23 中国联合网络通信集团有限公司 File search methods, devices, equipment, and storage media
CN115794745B (en) * 2023-01-29 2023-07-18 深圳市乐凡信息科技有限公司 File searching method, system, equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101118555A (en) * 2007-09-10 2008-02-06 腾讯科技(深圳)有限公司 Association information generating system of key words and generation method thereof
CN101702158A (en) * 2009-10-28 2010-05-05 卓望数码技术(深圳)有限公司 Index file creation synchronized method and search system
CN102081649A (en) * 2010-12-31 2011-06-01 深圳联友科技有限公司 Method and system for searching computer files

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7877456B2 (en) * 2008-04-08 2011-01-25 Post Dahl Co. Limited Liability Company Data file forwarding storage and search

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101118555A (en) * 2007-09-10 2008-02-06 腾讯科技(深圳)有限公司 Association information generating system of key words and generation method thereof
CN101702158A (en) * 2009-10-28 2010-05-05 卓望数码技术(深圳)有限公司 Index file creation synchronized method and search system
CN102081649A (en) * 2010-12-31 2011-06-01 深圳联友科技有限公司 Method and system for searching computer files

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111858495B (en) * 2020-07-23 2024-04-05 珠海豹趣科技有限公司 File information acquisition method and device, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN105279278A (en) 2016-01-27

Similar Documents

Publication Publication Date Title
CN105279278B (en) The searching method and device of file
US10291704B2 (en) Networked solutions integration using a cloud business object broker
US20160300016A1 (en) Relocating medical data
US20190034811A1 (en) Service layer augmentation of response to semantically-informed query of arbitrary external data sources
CN109408689A (en) Data capture method, device, system and electronic equipment
KR20100017222A (en) Managing status of search index generation in handheld book reader device
CN110362727A (en) Third party for search system searches for application
CN105045877A (en) Database data fragmentation storage method and apparatus and data query method and apparatus
US20140244784A1 (en) Website Impersonation System and Method
KR101621385B1 (en) System and method for searching file in cloud storage service, and method for controlling file therein
CN110502232A (en) The routing address configuration method and configuration device of page application
CN108647304A (en) Report display system, method, computer equipment and storage medium
CN108154024A (en) A kind of data retrieval method, device and electronic equipment
CN106294417A (en) A kind of data reordering method, device and electronic equipment
CN109902067A (en) File processing method and device, storage medium and computer equipment
CN112015696A (en) Data access method, data relationship setting method, data access device, data relationship setting device and storage medium
KR101157453B1 (en) System development apparatus and method for personalized service using contet-based recommendation method
US11586643B2 (en) Enabling dynamic data capture with database objects
JPH11232278A (en) Information source recommendation device
CN103678008A (en) Data reading method and corresponding data reading device
CN108197323A (en) Applied to distributed system map data processing method
CN107451229B (en) A database query method and device
CN106657227B (en) The method and device of resource is subscribed in a kind of change
KR20120004953A (en) Method for monitoring user experience performance of web service and recording media and computing device recording program for it
CN105095283A (en) Quasi-friend recommending method in social networking system and quasi-friend recommending system in social networking system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20181205

Address after: 519030 Room 105-53811, No. 6 Baohua Road, Hengqin New District, Zhuhai City, Guangdong Province

Applicant after: Zhuhai Leopard Technology Co.,Ltd.

Address before: 519070, six level 601F, 10 main building, science and technology road, Tangjia Bay Town, Zhuhai, Guangdong.

Applicant before: Zhuhai Juntian Electronic Technology Co.,Ltd.

Applicant before: BEIJING KINGSOFT INTERNET SECURITY SOFTWARE Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant