CN110147350A - File search method, device, electronic equipment and storage medium - Google Patents

File search method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN110147350A
CN110147350A CN201910431477.8A CN201910431477A CN110147350A CN 110147350 A CN110147350 A CN 110147350A CN 201910431477 A CN201910431477 A CN 201910431477A CN 110147350 A CN110147350 A CN 110147350A
Authority
CN
China
Prior art keywords
file
text
event
index
local
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910431477.8A
Other languages
Chinese (zh)
Inventor
杜琛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Onething Technology Co Ltd
Original Assignee
Shenzhen Onething Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Onething Technology Co Ltd filed Critical Shenzhen Onething Technology Co Ltd
Priority to CN201910431477.8A priority Critical patent/CN110147350A/en
Publication of CN110147350A publication Critical patent/CN110147350A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/14Details of searching files based on file metadata
    • G06F16/148File search processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/162Delete operations

Landscapes

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

Abstract

A kind of file search method, which comprises receive the file search request for carrying text key word;According to the text key word, is scanned in the local file index based on file system filter driver, obtain file destination, wherein, the filename of the file destination is matched with the text key word, or, the content of text of the file destination is matched with the text key word;Export the storage address of the file destination.The present invention also provides a kind of file search device, electronic equipment and storage mediums.The present invention can improve the search efficiency of file.

Description

File search method, device, electronic equipment and storage medium
Technical field
The present invention relates to intelligent terminal technical field more particularly to a kind of file search method, device, electronic equipment and deposit Storage media.
Background technique
In office system (such as windows system), it usually needs quickly search some file destination, still The included search efficiency of windows system is extremely low, and currently used solution is usually that software everything is used to come fastly Fast search file name.
However, finding in practice, user often forgets about the filename of storage, and only remembers a part of text in file This content, and the lookup mode based on software everything may search the file needed less than user, search efficiency is general.
Summary of the invention
In view of the foregoing, it is necessary to a kind of file search method, device, electronic equipment and storage medium are provided, it can Improve the search efficiency of file.
The first aspect of the present invention provides a kind of file search method, which comprises
Receive the file search request for carrying text key word;
According to the text key word, scans for, obtain in the local file index based on file system filter driver Obtain file destination, wherein the filename of the file destination is matched with the text key word, or, the text of the file destination This content is matched with the text key word;
Export the storage address of the file destination.
In one possible implementation, before the file search that the reception carries text key word is requested, institute State method further include:
Read the file in current file system;
Sentenced for each file according to file suffixes name, file size and the file memory format of the file Whether the file that breaks is text file;
If the file is text file, filename and content of text based on the file create text file rope Draw, alternatively, based on the filename of the file, creating non-document file index if the file is non-document file;
According to text file index and non-document file index, the local file index is created.
In one possible implementation, the method also includes:
The file system filter driver is loaded into operating system by application program;
By the file system filter driver after load, the action event that the All Files occur is monitored;
The action event is pulled back into the file system filter driver, and passing through the file system filter driver will The action event feeds back to the application program;
By the application program, file corresponding with the action event in local file index is carried out more Newly.
In one possible implementation, the action event is document creation event, described to apply journey by described Sequence is updated to file corresponding with the action event in local file index and includes:
By the application program, judge whether corresponding first file of the document creation event is text file;
If corresponding first file of the document creation event is text file, updates and be directed in the local file index The filename and content of text of first file;Or,
If corresponding first file of the document creation event is non-document file, needle in the local file index is updated To the filename of first file.
In one possible implementation, the action event is file deletion event, described to apply journey by described Sequence is updated to file corresponding with the action event in local file index and includes:
By the application program, corresponding second text of file deletion event described in the local file index is deleted Part.
In one possible implementation, the action event is file modification event, described to apply journey by described Sequence is updated to file corresponding with the action event in local file index and includes:
By the application program, judge whether the corresponding third file of the file modification event is text file;
If the corresponding third file of the file modification event is text file, updates and be directed in the local file index The filename and content of text of the third file;Or,
If the corresponding third file of the file modification event is non-document file, needle in the local file index is updated To the filename of the third file.
In one possible implementation, the life cycle of the application program, the file system filter driver The life cycle three of life cycle and the operating system is consistent.
The second aspect of the present invention provides a kind of file search device, and described device includes:
Receiving module, for receiving the file search request for carrying text key word;
Search module, for being indexed in the local file based on file system filter driver according to the text key word In scan for, obtain file destination, wherein the filename of the file destination is matched with the text key word, or, described The content of text of file destination is matched with the text key word;
Output module, for exporting the storage address of the file destination.
The third aspect of the present invention provides a kind of electronic equipment, and the electronic equipment includes processor and memory, described Processor realizes the file search method when being used to execute the computer program stored in the memory.
The fourth aspect of the present invention provides a kind of computer readable storage medium, deposits on the computer readable storage medium Computer program is contained, the file search method is realized when the computer program is executed by processor.
By above technical scheme, in the present invention, the file search request for carrying text key word can receive, further Ground scans in the local file index based on file system filter driver according to the text key word, obtains target File, wherein the filename of the file destination is matched with the text key word, or, the content of text of the file destination It is matched with the text key word, finally, exporting the storage address of the file destination.As it can be seen that being based on file system in the present invention The local file index of system filtration drive can not only scan for the filename of file, can also be to the content of text of file It scans for, so as to improve the search efficiency of file.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this The embodiment of invention for those of ordinary skill in the art without creative efforts, can also basis The attached drawing of offer obtains other attached drawings.
Fig. 1 is a kind of flow chart of the preferred embodiment of file search method disclosed by the invention.
Fig. 2 is a kind of functional block diagram of the preferred embodiment of file search device disclosed by the invention.
Fig. 3 is the structural schematic diagram of the electronic equipment for the preferred embodiment that the present invention realizes file search method.
Specific embodiment
To better understand the objects, features and advantages of the present invention, with reference to the accompanying drawing and specific real Applying example, the present invention will be described in detail.It should be noted that in the absence of conflict, the embodiment of the present invention and embodiment In feature can be combined with each other.
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
Unless otherwise defined, all technical and scientific terms used herein and belong to technical field of the invention The normally understood meaning of technical staff is identical.Term as used herein in the specification of the present invention is intended merely to description tool The purpose of the embodiment of body, it is not intended that in the limitation present invention.
In order to make the foregoing objectives, features and advantages of the present invention clearer and more comprehensible, with reference to the accompanying drawing and specific real Applying mode, the present invention is described in further detail.
Wherein, the electronic equipment includes that one kind can be automatic to carry out numerical value meter according to the instruction for being previously set or storing It calculates and/or the electronic equipment of information processing, hardware includes but is not limited to microprocessor, specific integrated circuit (ASIC), can compile Journey gate array (FPGA), digital processing unit (DSP), embedded device etc..The electronic equipment may also include the network equipment and/or User equipment.Wherein, the network equipment includes but is not limited to the service of single network server, multiple network servers composition Device group or the cloud being made of a large amount of hosts or network server for being based on cloud computing (Cloud Computing), wherein cloud computing It is one kind of distributed computing, a super virtual computer consisting of a loosely coupled set of computers.The user Equipment include but is not limited to any one can with user by the modes such as keyboard, mouse, remote controler, touch tablet or voice-operated device into The electronic product of row human-computer interaction, for example, personal computer, tablet computer, smart phone, personal digital assistant PDA, game Machine, Interactive Internet TV IPTV, intellectual wearable device etc..Wherein, net locating for the user equipment and the network equipment Network includes but is not limited to internet, wide area network, Metropolitan Area Network (MAN), local area network, Virtual Private Network VPN etc..
Referring to Figure 1, Fig. 1 is a kind of flow chart of the preferred embodiment of file search method disclosed by the invention.Wherein, The sequence of step can change in the flow chart according to different requirements, and certain steps can be omitted.
S11, electronic equipment receive the file search request for carrying text key word.
In the embodiment of the present invention, when user requires to look up some file, user can input in application layer and carry text The file search of this keyword is requested.
Wherein, the text key word can be all or part of keyword in file name, alternatively, the text closes Keyword can be the Partial key word in the content of text that file includes.
As an alternative embodiment, reception described in step S11 carries the file search request of text key word Before, the method also includes:
Read the All Files in current file system;
Sentenced for each file according to file suffixes name, file size and the file memory format of the file Whether the file that breaks is text file;
If the file is text file, filename and content of text based on the file create text file rope Draw;
If the file is non-document file, based on the filename of the file, non-document file index is created;
According to text file index and non-document file index, the local file index is created.
In the optional embodiment, with NTFS (New Technology File System, new technology file system System) for, most of windows is such file system.A table MTF (Master File can be safeguarded in NTFS Table, main file table), all files and file name are stored in the MTF table, are just passed through when starting for the first time The content for reading the MTF table gets all file name and path, further, carries out screening to the All Files, with Distinguishing which file is text file, which file is non-document file, and creates local file index.If subsequent user behaviour Make file, local file can be indexed and be modified.
In general, the file suffixes name of text file can include but is not limited to doc, txt, json, the text of non-document file Part suffix name can include but is not limited to mp4, avi, mpg, mlv, and memory shared by text file is than memory shared by non-document file Want small, in addition, in order to avoid huge non-document file is modified as text file by malice, it is also necessary to reflect to text file Not.
Wherein, each different types of file, storage on computers can exist with different structures, these are various to have The structure of rule is described as file memory format, such as: the exe of windows platform, dll, sys file are referred to as PE file, And possessing oneself distinctive format, for example the first two byte of file is 4D5A, this is the mark of PE file, for another example MP4 lattice The file of formula, the content of 4-7 byte are exactly 66 74 79 70.It therefore, can be with root when identifying to text file Judged according to the file memory format of file in a computer,
Specifically, it is directed to each file, it can be according to file suffixes name, file size and the file of the file Storage format judges whether the file is text file, if the file suffixes name of the file belongs to the text of text file Part suffix name, and the file size of the file is no more than preset text file size (such as 10M), and the text of the file Part storage format is the file memory format of text file, then can determine that the file is text file, whereas if described It is more than preset text that the file suffixes name of file, which is not belonging to the file suffixes name of text file or the file size of the file, The file memory format of file size (such as 10M) or the file is the file memory format of non-document file, as long as above-mentioned Any one of three conditions or any two or three establishments can then determine that the file is non-document file.
After distinguishing text file and non-document file, for text file, it can be based on filename and content of text, Text file index is created, for non-document file, filename can be based on, creation non-document file indexes, and then according to institute State text file index and non-document file index, creation local file index.
Local file index based on aforesaid way creation can be with when the text key word of input is matched with filename Matched text file or non-document file are searched out to come, it, can be with when the text key word of input is matched with content of text Matched text file is searched out to come.
S12, electronic equipment are according to the text key word, in the local file index based on file system filter driver It scans for, obtains file destination.
The present invention is based on the file system filter driver MiniFilter of windows, and the file for including is indexed to local file Action event monitored.It is inserted into a MiniFilter module in the bottom of operating system, then the creation of file, deleting The action message removed, modify and check before operating successfully can choose interception by the MiniFilter modular filtration, user Or it lets pass, while also available to information such as the complete trails of file, title, content and attributes.
Since local file index is based on file system filter driver, no matter any behaviour be to file by previous user Making (creation, delete, modification) can be monitored by file system filter driver, and then modify local file index, in real time more New local file index.When subsequent user input text key word is searched, electronic equipment can be from filename and text Two aspects of this content are searched, to search out filename and the matched file destination of the text key word, alternatively, search Content of text and the matched file destination of the text key word out.That is, the filename of the file destination and the text close Keyword matching, or, the content of text of the file destination is matched with the text key word.
In the present invention, can efficient accurately all associated documents in locating file system, with most fast speed from drive Dynamic layer (i.e. file system filter driver) takes the information of most accurate file, meanwhile, support various ways locating file, it can also be with It is quickly positioned by content of text, the efficiency that the system of greatly improving uses.
As an alternative embodiment, the method also includes:
The file system filter driver is loaded into operating system by application program;
By the file system filter driver after load, the action event that the All Files occur is monitored;
The action event is pulled back into the file system filter driver, and passing through the file system filter driver will The action event feeds back to the application program;
By the application program, file corresponding with the action event in local file index is carried out more Newly.
It, can be by application program by the file system filter when loading for the first time in the optional embodiment Drive load is into operating system, specifically, application program can load the file system filter driver (i.e. win kernel mould Block), after allowing the file system filter driver to enter in the working space of operating system, just become one of operating system Point, one piece of memory is shared with the operating system, belongs to a process.After the file system filter driver work, the text Part system filtration drive can directly be communicated with application program.And then pass through the file system mistake after load The action event that the All Files occur is monitored in filter driving, such as: document creation event, file deletion event and file Modification event etc..It, can be by the action event when file system filter driver after load listens to these action events It pulls back to the file system filter driver, and by the file system filter driver is fed back to the action event described Application program;Finally, again by the application program, to file corresponding with the action event in local file index It is updated.
Wherein, the life cycle of the application program, the life cycle of the file system filter driver and the behaviour The life cycle three for making system is consistent.
As an alternative embodiment, the action event is document creation event, it is described to apply journey by described Sequence is updated to file corresponding with the action event in local file index and includes:
By the application program, judge whether corresponding first file of the document creation event is text file;
If corresponding first file of the document creation event is text file, updates and be directed in the local file index The filename and content of text of first file;Or,
If corresponding first file of the document creation event is non-document file, needle in the local file index is updated To the filename of first file.
In the optional embodiment, when the action event that the file system filter driver listens to is document creation When event, show there is user to create new file, this document creation event can pull back in the file system filter driver, institute It states file system filter driver to need this document creation event feeding back to the application program, specifically, the content of feedback can To include but is not limited to the time of document creation, file full path diameter, file name, file size, file attribute (it is readable, writeable, It hides).
Further, application program also needs to judge whether corresponding first file of the document creation event is text text Part, specifically, can be according to file suffixes name, file size and the file memory format of first file, described in judgement Whether the first file is text file, and specific descriptions are referred to described above, and details are not described herein.If the document creation Corresponding first file of event is text file, can update the file that first file is directed in the local file index Name and content of text;Or, if corresponding first file of the document creation event is non-document file, it is only necessary to described in update The filename of first file is directed in local file index.
As an alternative embodiment, the action event is file deletion event, it is described to apply journey by described Sequence is updated to file corresponding with the action event in local file index and includes:
By the application program, corresponding second text of file deletion event described in the local file index is deleted Part.
In the optional embodiment, when the action event that the file system filter driver listens to is file deletion When event, showing there is user to delete some file, this document deletion event can pull back in the file system filter driver, The file system filter driver needs this document deletion event feeding back to the application program, specifically, the content of feedback Can include but is not limited to file deletion time, file full path diameter, file name, file size, file attribute (it is readable, can It writes, hide).
After being deleted due to file, what this document was just not present, either text file or non-document file all do not need Filename or content of text are updated, thus, when listening to the action event is file deletion event, it is only necessary to pass through institute Application program is stated, corresponding second file of file deletion event described in the local file index is deleted.
As an alternative embodiment, the action event is file modification event, it is described to apply journey by described Sequence is updated to file corresponding with the action event in local file index and includes:
By the application program, judge whether the corresponding third file of the file modification event is text file;
If the corresponding third file of the file modification event is text file, updates and be directed in the local file index The filename and content of text of the third file;Or,
If the corresponding third file of the file modification event is non-document file, needle in the local file index is updated To the filename of the third file.
In the optional embodiment, when the action event that the file system filter driver listens to is file modification When event, showing there is user to have modified some file, this document modification event can pull back in the file system filter driver, The file system filter driver needs this document modification event feeding back to the application program, specifically, the content of feedback It can include but is not limited to the time that file is finally modified, file full path diameter, file name, file size, file attribute (can It reads, is writeable, hiding).
Further, application program also needs to judge whether the corresponding third file of the file modification event is text text Part, specifically, can be according to file suffixes name, file size and the file memory format of the third file, described in judgement Whether third file is text file, and specific descriptions are referred to described above, and details are not described herein.If the file modification The corresponding third file of event is text file, can update the file that the third file is directed in the local file index Name and content of text;Or, if the corresponding third file of the file modification event is non-document file, it is only necessary to described in update The filename of the third file is directed in local file index.
S13, electronic equipment export the storage address of the file destination.
Wherein, after searching file destination, that is, the position where file destination has been determined, it can be to described in user's output The storage address of file destination.
Wherein, the file destination is one or more.
In the method flow described in Fig. 1, the file search request for carrying text key word can receive, further Ground scans in the local file index based on file system filter driver according to the text key word, obtains target File, wherein the filename of the file destination is matched with the text key word, or, the content of text of the file destination It is matched with the text key word, finally, exporting the storage address of the file destination.As it can be seen that being based on file system in the present invention The local file index of system filtration drive can not only scan for the filename of file, can also be to the content of text of file It scans for, so as to improve the search efficiency of file.
The above is only a specific embodiment of the invention, but scope of protection of the present invention is not limited thereto, for For those skilled in the art, without departing from the concept of the premise of the invention, improvement, but these can also be made It all belongs to the scope of protection of the present invention.
Fig. 2 is referred to, Fig. 2 is a kind of functional block diagram of the preferred embodiment of file search device disclosed by the invention.
In some embodiments, the file search device is run in electronic equipment.The file search device can be with Including multiple functional modules as composed by program code segments.The program code of each program segment in the file search device It can store in memory, and as performed by least one processor, to execute in file search method described in Fig. 1 Part or all of step.
In the present embodiment, function of the file search device according to performed by it can be divided into multiple function moulds Block.The functional module may include: receiving module 201, search module 202 and output module 203.The so-called module of the present invention Refer to it is a kind of performed by least one processor and can complete the series of computation machine program segment of fixed function, Storage is in memory.In some embodiments, it will be described in detail in subsequent embodiment about the function of each module.
Receiving module 201, for receiving the file search request for carrying text key word;
In the embodiment of the present invention, when user requires to look up some file, user can input in application layer and carry text The file search of this keyword is requested.
Wherein, the text key word can be all or part of keyword in file name, alternatively, the text closes Keyword can be the Partial key word in the content of text that file includes.
As an alternative embodiment, the file search device further include:
Read module, before the file search request for carrying text key word in the receiving module 201 reception, Read the All Files in current file system;
Judgment module, for being directed to each file, according to file suffixes name, file size and the text of the file Part storage format judges whether the file is text file;
Creation module, if being text file, filename and content of text based on the file, wound for the file Build text file index;
The creation module, based on the filename of the file, creates non-if being also used to the file is non-document file Text file index;
The creation module is also used to be indexed according to the text file and the non-document file indexes, creates institute State local file index.
In the optional embodiment, with NTFS (New Technology File System, new technology file system System) for, most of windows is such file system.A table MTF (Master File can be safeguarded in NTFS Table, main file table), all files and file name are stored in the MTF table, are just passed through when starting for the first time The content for reading the MTF table gets all file name and path, further, carries out screening to the All Files, with Distinguishing which file is text file, which file is non-document file, and creates local file index.If subsequent user behaviour Make file, local file can be indexed and be modified.
In general, the file suffixes name of text file can include but is not limited to doc, txt, json, the text of non-document file Part suffix name can include but is not limited to mp4, avi, mpg, mlv, and memory shared by text file is than memory shared by non-document file Want small, in addition, in order to avoid huge non-document file is modified as text file by malice, it is also necessary to reflect to text file Not.
Wherein, each different types of file, storage on computers can exist with different structures, these are various to have The structure of rule is described as file memory format, such as: the exe of windows platform, dll, sys file are referred to as PE file, And possessing oneself distinctive format, for example the first two byte of file is 4D5A, this is the mark of PE file, for another example MP4 lattice The file of formula, the content of 4-7 byte are exactly 66 74 79 70.It therefore, can be with root when identifying to text file Judged according to the file memory format of file in a computer,
Specifically, it is directed to each file, it can be according to file suffixes name, file size and the file of the file Storage format judges whether the file is text file, if the file suffixes name of the file belongs to the text of text file Part suffix name, and the file size of the file is no more than preset text file size (such as 10M), and the text of the file Part storage format is the file memory format of text file, then can determine that the file is text file, whereas if described It is more than preset text that the file suffixes name of file, which is not belonging to the file suffixes name of text file or the file size of the file, The file memory format of file size (such as 10M) or the file is the file memory format of non-document file, as long as above-mentioned Any one of three conditions or any two or three establishments can then determine that the file is non-document file.
After distinguishing text file and non-document file, for text file, it can be based on filename and content of text, Text file index is created, for non-document file, filename can be based on, creation non-document file indexes, and then according to institute State text file index and non-document file index, creation local file index.
Local file index based on aforesaid way creation can be with when the text key word of input is matched with filename Matched text file or non-document file are searched out to come, it, can be with when the text key word of input is matched with content of text Matched text file is searched out to come.
Search module 202 is used for according to the text key word, in the local file rope based on file system filter driver It is scanned in drawing, obtains file destination, wherein the filename of the file destination is matched with the text key word, or, institute The content of text for stating file destination is matched with the text key word;
The present invention is based on the file system filter driver MiniFilter of windows, and the file for including is indexed to local file Action event monitored.It is inserted into a MiniFilter module in the bottom of operating system, then the creation of file, deleting The action message removed, modify and check before operating successfully can choose interception by the MiniFilter modular filtration, user Or it lets pass, while also available to information such as the complete trails of file, title, content and attributes.
Since local file index is based on file system filter driver, no matter any behaviour be to file by previous user Making (creation, delete, modification) can be monitored by file system filter driver, and then modify local file index, in real time more New local file index.When subsequent user input text key word is searched, electronic equipment can be from filename and text Two aspects of this content are searched, to search out filename and the matched file destination of the text key word, alternatively, search Content of text and the matched file destination of the text key word out.That is, the filename of the file destination and the text close Keyword matching, or, the content of text of the file destination is matched with the text key word.
In the present invention, can efficient accurately all associated documents in locating file system, with most fast speed from drive Dynamic layer (i.e. file system filter driver) takes the information of most accurate file, meanwhile, support various ways locating file, it can also be with It is quickly positioned by content of text, the efficiency that the system of greatly improving uses.
As an alternative embodiment, the file search device further include:
Loading module, for the file system filter driver to be loaded into operating system by application program;
Module is monitored, for monitoring what the All Files occurred by the file system filter driver after load Action event;
Feedback module is adjusted back, for the action event to be pulled back to the file system filter driver, and by described The action event is fed back to the application program by file system filter driver;
Update module is used for through the application program, to corresponding with the action event in local file index File be updated.
It, can be by application program by the file system filter when loading for the first time in the optional embodiment Drive load is into operating system, specifically, application program can load the file system filter driver (i.e. win kernel mould Block), after allowing the file system filter driver to enter in the working space of operating system, just become one of operating system Point, one piece of memory is shared with the operating system, belongs to a process.After the file system filter driver work, the text Part system filtration drive can directly be communicated with application program.And then pass through the file system mistake after load The action event that the All Files occur is monitored in filter driving, such as: document creation event, file deletion event and file Modification event etc..It, can be by the action event when file system filter driver after load listens to these action events It pulls back to the file system filter driver, and by the file system filter driver is fed back to the action event described Application program;Finally, again by the application program, to file corresponding with the action event in local file index It is updated.
Wherein, the life cycle of the application program, the life cycle of the file system filter driver and the behaviour The life cycle three for making system is consistent.
As an alternative embodiment, the action event is document creation event, the update module passes through institute Application program is stated, file corresponding with the action event in local file index is updated and includes:
By the application program, judge whether corresponding first file of the document creation event is text file;
If corresponding first file of the document creation event is text file, updates and be directed in the local file index The filename and content of text of first file;Or,
If corresponding first file of the document creation event is non-document file, needle in the local file index is updated To the filename of first file.
In the optional embodiment, when the action event that the file system filter driver listens to is document creation When event, show there is user to create new file, this document creation event can pull back in the file system filter driver, institute It states file system filter driver to need this document creation event feeding back to the application program, specifically, the content of feedback can To include but is not limited to the time of document creation, file full path diameter, file name, file size, file attribute (it is readable, writeable, It hides).
Further, application program also needs to judge whether corresponding first file of the document creation event is text text Part, specifically, can be according to file suffixes name, file size and the file memory format of first file, described in judgement Whether the first file is text file, and specific descriptions are referred to described above, and details are not described herein.If the document creation Corresponding first file of event is text file, can update the file that first file is directed in the local file index Name and content of text;Or, if corresponding first file of the document creation event is non-document file, it is only necessary to described in update The filename of first file is directed in local file index.
As an alternative embodiment, the action event is file deletion event, the update module passes through institute Application program is stated, file corresponding with the action event in local file index is updated and includes:
By the application program, corresponding second text of file deletion event described in the local file index is deleted Part.
In the optional embodiment, when the action event that the file system filter driver listens to is file deletion When event, showing there is user to delete some file, this document deletion event can pull back in the file system filter driver, The file system filter driver needs this document deletion event feeding back to the application program, specifically, the content of feedback Can include but is not limited to file deletion time, file full path diameter, file name, file size, file attribute (it is readable, can It writes, hide).
After being deleted due to file, what this document was just not present, either text file or non-document file all do not need Filename or content of text are updated, thus, when listening to the action event is file deletion event, it is only necessary to pass through institute Application program is stated, corresponding second file of file deletion event described in the local file index is deleted.
As an alternative embodiment, the action event is file modification event, the update module passes through institute Application program is stated, file corresponding with the action event in local file index is updated and includes:
By the application program, judge whether the corresponding third file of the file modification event is text file;
If the corresponding third file of the file modification event is text file, updates and be directed in the local file index The filename and content of text of the third file;Or,
If the corresponding third file of the file modification event is non-document file, needle in the local file index is updated To the filename of the third file.
In the optional embodiment, when the action event that the file system filter driver listens to is file modification When event, showing there is user to have modified some file, this document modification event can pull back in the file system filter driver, The file system filter driver needs this document modification event feeding back to the application program, specifically, the content of feedback It can include but is not limited to the time that file is finally modified, file full path diameter, file name, file size, file attribute (can It reads, is writeable, hiding).
Further, application program also needs to judge whether the corresponding third file of the file modification event is text text Part, specifically, can be according to file suffixes name, file size and the file memory format of the third file, described in judgement Whether third file is text file, and specific descriptions are referred to described above, and details are not described herein.If the file modification The corresponding third file of event is text file, can update the file that the third file is directed in the local file index Name and content of text;Or, if the corresponding third file of the file modification event is non-document file, it is only necessary to described in update The filename of the third file is directed in local file index.
Output module 203, for exporting the storage address of the file destination.
Wherein, after searching file destination, that is, the position where file destination has been determined, it can be to described in user's output The storage address of file destination.
Wherein, the file destination is one or more.
In the file search device described in Fig. 2, the file search request for carrying text key word can receive, into One step, according to the text key word, scans for, obtain in the local file index based on file system filter driver File destination, wherein the filename of the file destination is matched with the text key word, or, the text of the file destination Content is matched with the text key word, finally, exporting the storage address of the file destination.As it can be seen that in the present invention, based on text The local file index of part system filtration drive can not only scan for the filename of file, can also be to the text of file Content scans for, so as to improve the search efficiency of file.
As shown in figure 3, Fig. 3 is the structural representation of the electronic equipment for the preferred embodiment that the present invention realizes file search method Figure.The electronic equipment 3 includes memory 31, at least one processor 32, is stored in the memory 31 and can be described The computer program 33 and at least one communication bus 34 run at least one processor 32.
It will be understood by those skilled in the art that schematic diagram shown in Fig. 3 is only the example of electronic equipment 3, do not constitute Restriction to electronic equipment 3 may include perhaps combining certain components or different than illustrating more or fewer components Component, such as the electronic equipment 3 can also include input-output equipment, network access equipment etc..
The electronic equipment 3 further include but be not limited to any one can be with user by keyboard, mouse, remote controler, touch The modes such as plate or voice-operated device carry out the electronic product of human-computer interaction, for example, personal computer, tablet computer, smart phone, a Personal digital assistant (Personal Digital Assistant, PDA), game machine, Interactive Internet TV (Internet Protocol Television, IPTV), intellectual wearable device etc..Network locating for the electronic equipment 3 includes but not It is limited to internet, wide area network, Metropolitan Area Network (MAN), local area network, Virtual Private Network (Virtual Private Network, VPN) etc..
At least one described processor 32 can be central processing unit (Central Processing Unit, CPU), It can also be other general processors, digital signal processor (Digital Signal Processor, DSP), dedicated integrated Circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field- Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic, Discrete hardware components etc..The processor 32 can be microprocessor or the processor 32 is also possible to any conventional processor Deng the processor 32 is the control centre of the electronic equipment 3, utilizes various interfaces and the entire electronic equipment 3 of connection Various pieces.
The memory 31 can be used for storing the computer program 33 and/or module/unit, and the processor 32 passes through Operation executes the computer program and/or module/unit being stored in the memory 31, and calls and be stored in memory Data in 31 realize the various functions of the electronic equipment 3.The memory 31 can mainly include storing program area and storage Data field, wherein storing program area can application program needed for storage program area, at least one function (for example sound plays Function, image player function etc.) etc.;Storage data area, which can be stored, uses created data (such as sound according to electronic equipment 3 Frequency evidence, phone directory etc.) etc..In addition, memory 31 may include high-speed random access memory, it can also include non-volatile Memory, such as hard disk, memory, plug-in type hard disk, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card, flash card (Flash Card), at least one disk memory, flush memory device or other Volatile solid-state part.
In conjunction with Fig. 1, the memory 31 in the electronic equipment 3 stores multiple instruction to realize a kind of file search side The multiple instruction can be performed to realize in method, the processor 32:
Receive the file search request for carrying text key word;
According to the text key word, scans for, obtain in the local file index based on file system filter driver Obtain file destination, wherein the filename of the file destination is matched with the text key word, or, the text of the file destination This content is matched with the text key word;
Export the storage address of the file destination.
In a kind of optional embodiment, before the reception carries the file search request of text key word, institute Stating processor 32 can be performed the multiple instruction to realize:
Read the All Files in current file system;
Sentenced for each file according to file suffixes name, file size and the file memory format of the file Whether the file that breaks is text file;
If the file is text file, filename and content of text based on the file create text file rope Draw;
If the file is non-document file, based on the filename of the file, non-document file index is created;
According to text file index and non-document file index, the local file index is created.
In a kind of optional embodiment, the multiple instruction is can be performed to realize in the processor 32:
The file system filter driver is loaded into operating system by application program;
By the file system filter driver after load, the action event that the All Files occur is monitored;
The action event is pulled back into the file system filter driver, and passing through the file system filter driver will The action event feeds back to the application program;
By the application program, file corresponding with the action event in local file index is carried out more Newly.
In a kind of optional embodiment, the action event is document creation event, described to apply journey by described Sequence is updated to file corresponding with the action event in local file index and includes:
By the application program, judge whether corresponding first file of the document creation event is text file;
If corresponding first file of the document creation event is text file, updates and be directed in the local file index The filename and content of text of first file;Or,
If corresponding first file of the document creation event is non-document file, needle in the local file index is updated To the filename of first file.
In a kind of optional embodiment, the action event is file deletion event, described to apply journey by described Sequence is updated to file corresponding with the action event in local file index and includes:
By the application program, corresponding second text of file deletion event described in the local file index is deleted Part.
In a kind of optional embodiment, the action event is file modification event, described to apply journey by described Sequence is updated to file corresponding with the action event in local file index and includes:
By the application program, judge whether the corresponding third file of the file modification event is text file;
If the corresponding third file of the file modification event is text file, updates and be directed in the local file index The filename and content of text of the third file;Or,
If the corresponding third file of the file modification event is non-document file, needle in the local file index is updated To the filename of the third file.
In a kind of optional embodiment, the life cycle of the application program, the file system filter driver The life cycle three of life cycle and the operating system is consistent.
Specifically, the processor 32 can refer to the concrete methods of realizing of above-metioned instruction related in Fig. 1 corresponding embodiment The description of step, this will not be repeated here.
In the electronic equipment 3 described in Fig. 3, the file search request for carrying text key word can receive, into one Step ground scans in the local file index based on file system filter driver according to the text key word, obtains mesh Mark file, wherein the filename of the file destination is matched with the text key word, or, in the text of the file destination Appearance is matched with the text key word, finally, exporting the storage address of the file destination.As it can be seen that being based on file in the present invention The local file index of system filtration drive can not only scan for the filename of file, can also be in the text of file Appearance scans for, so as to improve the search efficiency of file.
If the integrated module/unit of the electronic equipment 3 is realized in the form of SFU software functional unit and as independent Product when selling or using, can store in a computer readable storage medium.Based on this understanding, the present invention is real All or part of the process in existing above-described embodiment method, can also instruct relevant hardware come complete by computer program At the computer program can be stored in a computer readable storage medium, which is being executed by processor When, it can be achieved that the step of above-mentioned each embodiment of the method.Wherein, the computer program includes computer program code, described Computer program code can be source code form, object identification code form, executable file or certain intermediate forms etc..The meter Calculation machine readable medium may include: can carry the computer program code any entity or device, recording medium, USB flash disk, Mobile hard disk, magnetic disk, CD, computer storage, read-only memory (ROM, Read-Only Memory), random access memory Device (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It needs to illustrate It is that the content that the computer-readable medium includes can be fitted according to the requirement made laws in jurisdiction with patent practice When increase and decrease, such as in certain jurisdictions, according to legislation and patent practice, computer-readable medium does not include electric carrier wave letter Number and telecommunication signal.
In several embodiments provided by the present invention, it should be understood that disclosed system, device and method can be with It realizes by another way.For example, the apparatus embodiments described above are merely exemplary, for example, the module It divides, only a kind of logical function partition, there may be another division manner in actual implementation.
The module as illustrated by the separation member may or may not be physically separated, aobvious as module The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.Some or all of the modules therein can be selected to realize the mesh of this embodiment scheme according to the actual needs 's.
It, can also be in addition, each functional module in each embodiment of the present invention can integrate in one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list Member both can take the form of hardware realization, can also realize in the form of hardware adds software function module.
It is obvious to a person skilled in the art that invention is not limited to the details of the above exemplary embodiments, Er Qie In the case where without departing substantially from spirit or essential attributes of the invention, the present invention can be realized in other specific forms.Therefore, no matter From the point of view of which point, the present embodiments are to be considered as illustrative and not restrictive, and the scope of the present invention is by appended power Benefit requires rather than above description limits, it is intended that all by what is fallen within the meaning and scope of the equivalent elements of the claims Variation is included in the present invention.Any attached associated diagram label in claim should not be considered as right involved in limitation to want It asks.Furthermore, it is to be understood that one word of " comprising " does not exclude other units or steps, odd number is not excluded for plural number.It is stated in system claims Multiple units or device can also be implemented through software or hardware by a unit or device.Second equal words are used to table Show title, and does not indicate any particular order.
Finally it should be noted that the above examples are only used to illustrate the technical scheme of the present invention and are not limiting, although reference Preferred embodiment describes the invention in detail, those skilled in the art should understand that, it can be to of the invention Technical solution is modified or equivalent replacement, without departing from the spirit and scope of the technical solution of the present invention.

Claims (10)

1. a kind of file search method, which is characterized in that the described method includes:
Receive the file search request for carrying text key word;
According to the text key word, is scanned in the local file index based on file system filter driver, obtain mesh Mark file, wherein the filename of the file destination is matched with the text key word, or, in the text of the file destination Appearance is matched with the text key word;
Export the storage address of the file destination.
2. the method according to claim 1, wherein the file search that the reception carries text key word is asked Before asking, the method also includes:
Read the file in current file system;
Institute is judged according to file suffixes name, file size and the file memory format of the file for each file State whether file is text file;
If the file is text file, filename and content of text based on the file create text file index, or Person, based on the filename of the file, creates non-document file index if the file is non-document file;
According to text file index and non-document file index, the local file index is created.
3. according to the method described in claim 2, it is characterized in that, the method also includes:
The file system filter driver is loaded into operating system by application program;
By the file system filter driver after load, the action event that the All Files occur is monitored;
The action event is pulled back into the file system filter driver, and will be described by the file system filter driver Action event feeds back to the application program;
By the application program, file corresponding with the action event in local file index is updated.
4. according to the method described in claim 3, it is characterized in that, the action event be document creation event, it is described to pass through The application program is updated to file corresponding with the action event in local file index and includes:
By the application program, judge whether corresponding first file of the document creation event is text file;
If corresponding first file of the document creation event is text file, update in the local file index for described The filename and content of text of first file;Or,
If corresponding first file of the document creation event is non-document file, update in the local file index for institute State the filename of the first file.
5. according to the method described in claim 3, it is characterized in that, the action event be file deletion event, it is described to pass through The application program is updated to file corresponding with the action event in local file index and includes:
By the application program, corresponding second file of file deletion event described in the local file index is deleted.
6. according to the method described in claim 3, it is characterized in that, the action event be file modification event, it is described to pass through The application program is updated to file corresponding with the action event in local file index and includes:
By the application program, judge whether the corresponding third file of the file modification event is text file;
If the corresponding third file of the file modification event is text file, update in the local file index for described The filename and content of text of third file;Or,
If the corresponding third file of the file modification event is non-document file, update in the local file index for institute State the filename of third file.
7. method according to any one of claim 3 to 6, which is characterized in that the life cycle of the application program, institute The life cycle three of the life cycle and the operating system of stating file system filter driver is consistent.
8. a kind of file search device, which is characterized in that the file search device includes:
Receiving module, for receiving the file search request for carrying text key word;
Search module, for according to the text key word, in the local file index based on file system filter driver into Row search, obtains file destination, wherein the filename of the file destination is matched with the text key word, or, the target The content of text of file is matched with the text key word;
Output module, for exporting the storage address of the file destination.
9. a kind of electronic equipment, which is characterized in that the electronic equipment includes processor and memory, and the processor is for holding The computer program stored in line storage is to realize file search method as claimed in any of claims 1 to 7 in one of claims.
10. a kind of computer readable storage medium, which is characterized in that the computer-readable recording medium storage has at least one Instruction, at least one described instruction realize file search as claimed in any of claims 1 to 7 in one of claims when being executed by processor Method.
CN201910431477.8A 2019-05-22 2019-05-22 File search method, device, electronic equipment and storage medium Pending CN110147350A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910431477.8A CN110147350A (en) 2019-05-22 2019-05-22 File search method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910431477.8A CN110147350A (en) 2019-05-22 2019-05-22 File search method, device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN110147350A true CN110147350A (en) 2019-08-20

Family

ID=67592768

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910431477.8A Pending CN110147350A (en) 2019-05-22 2019-05-22 File search method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110147350A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113793609A (en) * 2021-09-07 2021-12-14 米茂(上海)数字技术有限公司 File uploading method based on voice recognition
CN113900995A (en) * 2020-06-22 2022-01-07 江苏税软软件科技有限公司 Method for intelligently searching files for tax affairs
WO2022022466A1 (en) * 2020-07-31 2022-02-03 华为技术有限公司 Method and apparatus for determining file storage position, and terminal

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1808426A (en) * 2005-01-17 2006-07-26 马岩 Universal file search system and method
CN101799741A (en) * 2009-02-09 2010-08-11 联想(北京)有限公司 Storage data reading device and method
CN102968501A (en) * 2012-12-07 2013-03-13 福建亿榕信息技术有限公司 Universal full-text search method
US20150254350A1 (en) * 2014-03-04 2015-09-10 Qbase, LLC Method for entity enrichment of digital content to enable advanced search functionality in content management systems
CN106407450A (en) * 2016-09-30 2017-02-15 网易(杭州)网络有限公司 File searching method and apparatus

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1808426A (en) * 2005-01-17 2006-07-26 马岩 Universal file search system and method
CN101799741A (en) * 2009-02-09 2010-08-11 联想(北京)有限公司 Storage data reading device and method
CN102968501A (en) * 2012-12-07 2013-03-13 福建亿榕信息技术有限公司 Universal full-text search method
US20150254350A1 (en) * 2014-03-04 2015-09-10 Qbase, LLC Method for entity enrichment of digital content to enable advanced search functionality in content management systems
CN106407450A (en) * 2016-09-30 2017-02-15 网易(杭州)网络有限公司 File searching method and apparatus

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
DOCFETCHER: "DocFetcher", 《HTTP://WEB-OLD.ARCHIVE.ORG/WEB/20180310044614/HTTP://DOCFETCHER.SOURCEFORGE.NET/EN/INDEX.HTML》 *
孙莹莹 等: "基于微过滤驱动的文件监控系统", 《计算机应用》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113900995A (en) * 2020-06-22 2022-01-07 江苏税软软件科技有限公司 Method for intelligently searching files for tax affairs
WO2022022466A1 (en) * 2020-07-31 2022-02-03 华为技术有限公司 Method and apparatus for determining file storage position, and terminal
CN113793609A (en) * 2021-09-07 2021-12-14 米茂(上海)数字技术有限公司 File uploading method based on voice recognition

Similar Documents

Publication Publication Date Title
CN109254733B (en) Method, device and system for storing data
EP2820539B1 (en) Distribution of application files
CN105677250B (en) The update method and updating device of object data in object storage system
US10678857B2 (en) Managing a distributed knowledge graph
CN110147350A (en) File search method, device, electronic equipment and storage medium
CN111767268B (en) Database table partitioning method and device, electronic equipment and storage medium
CN102142014B (en) System and method for export and import of metadata located in metadata registries
CN106970958B (en) A kind of inquiry of stream file and storage method and device
JP2021518021A (en) Data processing methods, equipment and computer readable storage media
CN106682186A (en) File access control list (ACL) management method and related device and system
CN110019080A (en) Data access method and device
CN110347651A (en) Method of data synchronization, device, equipment and storage medium based on cloud storage
EP3959603A1 (en) Data caching, dynamic code generation, and data visualization technology
CN111008521A (en) Method and device for generating wide table and computer storage medium
CN111917834A (en) Data synchronization method and device, storage medium and computer equipment
CN113282555A (en) Data processing method, device, equipment and storage medium
CN111736950A (en) Accelerator resource adding method of virtual machine and related device
CN113141369B (en) Artificial intelligence-based firewall policy management method and related equipment
KR20210023636A (en) Method and system for long-term relevant document clustering
CN112559913B (en) Data processing method, device, computing equipment and readable storage medium
CN109522282A (en) Picture management method, device, computer installation and storage medium
CN115134383B (en) Dynamic configuration method, system, equipment and medium for cloud task on Internet of vehicles data
CN114969165B (en) Data query request processing method, device, equipment and storage medium
CN112559603B (en) Feature extraction method, device, equipment and computer-readable storage medium
CN109558403A (en) Data aggregation method and device, computer installation and computer readable storage medium

Legal Events

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

Application publication date: 20190820