Movatterモバイル変換


[0]ホーム

URL:


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
CN110147350ACN201910431477.8ACN201910431477ACN110147350ACN 110147350 ACN110147350 ACN 110147350ACN 201910431477 ACN201910431477 ACN 201910431477ACN 110147350 ACN110147350 ACN 110147350A
Authority
CN
China
Prior art keywords
file
text
index
event
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 Technologies Co Ltd
Original Assignee
Shenzhen Onething Technologies 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 Technologies Co LtdfiledCriticalShenzhen Onething Technologies Co Ltd
Priority to CN201910431477.8ApriorityCriticalpatent/CN110147350A/en
Publication of CN110147350ApublicationCriticalpatent/CN110147350A/en
Pendinglegal-statusCriticalCurrent

Links

Classifications

Landscapes

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

Translated fromChinese
文件查找方法、装置、电子设备及存储介质File search method, device, electronic device and storage medium

技术领域technical field

本发明涉及智能终端技术领域,尤其涉及一种文件查找方法、装置、电子设备及存储介质。The present invention relates to the technical field of intelligent terminals, in particular to a file search method, device, electronic equipment and storage medium.

背景技术Background technique

在办公系统中(比如windows系统),通常需要快速查找某个目标文件,但是windows系统自带的查找效率极低,目前采用的解决方案通常是采用软件everything来快速搜索文件名。In an office system (such as a windows system), it is usually necessary to quickly search for a certain target file, but the search efficiency of the windows system is extremely low. The current solution is usually to use the software everything to quickly search for the file name.

然而,实践中发现,用户经常忘记存储的文件名,而仅仅只记得文件里的一部分文本内容,而基于软件everything的查找方式可能查找不到用户需要的文件,查找效率一般。However, in practice, it is found that users often forget the stored file name, but only remember a part of the text content in the file, and the search method based on the software everything may not be able to find the file that the user needs, and the search efficiency is average.

发明内容Contents of the invention

鉴于以上内容,有必要提供一种文件查找方法、装置、电子设备及存储介质,能够提高文件的查找效率。In view of the above, it is necessary to provide a file search method, device, electronic equipment and storage medium, which can improve file search efficiency.

本发明的第一方面提供一种文件查找方法,所述方法包括:A first aspect of the present invention provides a file search method, the method comprising:

接收携带有文本关键词的文件查找请求;Receive a file search request carrying text keywords;

根据所述文本关键词,在基于文件系统过滤驱动的本地文件索引中进行搜索,获得目标文件,其中,所述目标文件的文件名与所述文本关键词匹配,或,所述目标文件的文本内容与所述文本关键词匹配;According to the text keyword, search in the local file index based on the file system filter driver to obtain the target file, wherein the file name of the target file matches the text keyword, or the text of the target file The content matches said text keywords;

输出所述目标文件的存储地址。Output the storage address of the target file.

在一种可能的实现方式中,所述接收携带有文本关键词的文件查找请求之前,所述方法还包括:In a possible implementation manner, before receiving the file search request carrying text keywords, the method further includes:

读取当前文件系统中的文件;Read a file in the current file system;

针对每个所述文件,根据所述文件的文件后缀名、文件大小以及文件存储格式,判断所述文件是否为文本文件;For each of the files, determine whether the file is a text file according to the file suffix name, file size and file storage format of the file;

若所述文件为文本文件,基于所述文件的文件名以及文本内容,创建文本文件索引,或者,若所述文件为非文本文件,基于所述文件的文件名,创建非文本文件索引;If the file is a text file, create a text file index based on the file name and text content of the file, or, if the file is a non-text file, create a non-text file index based on the file name of the file;

根据所述文本文件索引以及所述非文本文件索引,创建所述本地文件索引。The local file index is created according to the text file index and the non-text file index.

在一种可能的实现方式中,所述方法还包括:In a possible implementation, the method further includes:

通过应用程序将所述文件系统过滤驱动加载到操作系统中;Loading the file system filter driver into the operating system through an application program;

通过加载后的所述文件系统过滤驱动,监听所述所有文件发生的操作事件;Listening to operation events of all files through the loaded file system filter driver;

将所述操作事件回调至所述文件系统过滤驱动,并通过所述文件系统过滤驱动将所述操作事件反馈至所述应用程序;Calling back the operation event to the file system filter driver, and feeding back the operation event to the application through the file system filter driver;

通过所述应用程序,对所述本地文件索引中与所述操作事件对应的文件进行更新。The file corresponding to the operation event in the local file index is updated through the application program.

在一种可能的实现方式中,所述操作事件为文件创建事件,所述通过所述应用程序,对所述本地文件索引中与所述操作事件对应的文件进行更新包括:In a possible implementation manner, the operation event is a file creation event, and updating the file corresponding to the operation event in the local file index through the application program includes:

通过所述应用程序,判断所述文件创建事件对应的第一文件是否为文本文件;Through the application program, it is judged whether the first file corresponding to the file creation event is a text file;

若所述文件创建事件对应的第一文件为文本文件,更新所述本地文件索引中针对所述第一文件的文件名以及文本内容;或,If the first file corresponding to the file creation event is a text file, update the file name and text content of the first file in the local file index; or,

若所述文件创建事件对应的第一文件为非文本文件,更新所述本地文件索引中针对所述第一文件的文件名。If the first file corresponding to the file creation event is a non-text file, update the file name of the first file in the local file index.

在一种可能的实现方式中,所述操作事件为文件删除事件,所述通过所述应用程序,对所述本地文件索引中与所述操作事件对应的文件进行更新包括:In a possible implementation manner, the operation event is a file deletion event, and updating the file corresponding to the operation event in the local file index through the application program includes:

通过所述应用程序,删除所述本地文件索引中所述文件删除事件对应的第二文件。Through the application program, delete the second file corresponding to the file deletion event in the local file index.

在一种可能的实现方式中,所述操作事件为文件修改事件,所述通过所述应用程序,对所述本地文件索引中与所述操作事件对应的文件进行更新包括:In a possible implementation manner, the operation event is a file modification event, and updating the file corresponding to the operation event in the local file index through the application program includes:

通过所述应用程序,判断所述文件修改事件对应的第三文件是否为文本文件;Through the application program, it is judged whether the third file corresponding to the file modification event is a text file;

若所述文件修改事件对应的第三文件为文本文件,更新所述本地文件索引中针对所述第三文件的文件名以及文本内容;或,If the third file corresponding to the file modification event is a text file, update the file name and text content of the third file in the local file index; or,

若所述文件修改事件对应的第三文件为非文本文件,更新所述本地文件索引中针对所述第三文件的文件名。If the third file corresponding to the file modification event is a non-text file, update the file name of the third file in the local file index.

在一种可能的实现方式中,所述应用程序的生命周期、所述文件系统过滤驱动的生命周期以及所述操作系统的生命周期三者保持一致。In a possible implementation manner, the life cycle of the application program, the life cycle of the file system filter driver, and the life cycle of the operating system are consistent.

本发明的第二方面提供一种文件查找装置,所述装置包括:A second aspect of the present invention provides a file search device, the device comprising:

接收模块,用于接收携带有文本关键词的文件查找请求;A receiving module, configured to receive a file search request carrying text keywords;

搜索模块,用于根据所述文本关键词,在基于文件系统过滤驱动的本地文件索引中进行搜索,获得目标文件,其中,所述目标文件的文件名与所述文本关键词匹配,或,所述目标文件的文本内容与所述文本关键词匹配;The search module is configured to search the local file index based on the file system filter driver according to the text keyword to obtain the target file, wherein the file name of the target file matches the text keyword, or, the The text content of the target file is matched with the text keyword;

输出模块,用于输出所述目标文件的存储地址。An output module, configured to output the storage address of the target file.

本发明的第三方面提供一种电子设备,所述电子设备包括处理器和存储器,所述处理器用于执行所述存储器中存储的计算机程序时实现所述的文件查找方法。A third aspect of the present invention provides an electronic device, the electronic device includes a processor and a memory, and the processor is configured to implement the file search method when executing a computer program stored in the memory.

本发明的第四方面提供一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现所述的文件查找方法。A fourth aspect of the present invention provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and the computer program implements the file search method when executed by a processor.

由以上技术方案,本发明中,可以接收携带有文本关键词的文件查找请求,进一步地,根据所述文本关键词,在基于文件系统过滤驱动的本地文件索引中进行搜索,获得目标文件,其中,所述目标文件的文件名与所述文本关键词匹配,或,所述目标文件的文本内容与所述文本关键词匹配,最后,输出所述目标文件的存储地址。可见,本发明中,基于文件系统过滤驱动的本地文件索引不仅可以对文件的文件名进行搜索,还可以对文件的文本内容进行搜索,从而能够提高文件的查找效率。Based on the above technical solution, in the present invention, a file search request carrying a text keyword can be received, and further, according to the text keyword, a search is performed in the local file index based on the file system filter driver to obtain the target file, wherein , the file name of the target file is matched with the text keyword, or the text content of the target file is matched with the text keyword, and finally, the storage address of the target file is output. It can be seen that in the present invention, the local file index based on the file system filter driver can not only search the file name of the file, but also search the text content of the file, thereby improving the efficiency of file search.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only It is an embodiment of the present invention, and those skilled in the art can also obtain other drawings according to the provided drawings without creative work.

图1是本发明公开的一种文件查找方法的较佳实施例的流程图。Fig. 1 is a flowchart of a preferred embodiment of a file search method disclosed in the present invention.

图2是本发明公开的一种文件查找装置的较佳实施例的功能模块图。Fig. 2 is a functional block diagram of a preferred embodiment of a file search device disclosed in the present invention.

图3是本发明实现文件查找方法的较佳实施例的电子设备的结构示意图。Fig. 3 is a schematic structural diagram of an electronic device implementing a preferred embodiment of a file search method according to the present invention.

具体实施方式Detailed ways

为了能够更清楚地理解本发明的上述目的、特征和优点,下面结合附图和具体实施例对本发明进行详细描述。需要说明的是,在不冲突的情况下,本发明的实施例及实施例中的特征可以相互组合。In order to more clearly understand the above objects, features and advantages of the present invention, the present invention will be described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that, in the case of no conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other.

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

除非另有定义,本文所使用的所有的技术和科学术语与属于本发明的技术领域的技术人员通常理解的含义相同。本文中在本发明的说明书中所使用的术语只是为了描述具体的实施例的目的,不是旨在于限制本发明。Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the technical field of the invention. The terms used herein in the description of the present invention are for the purpose of describing specific embodiments only, and are not intended to limit the present invention.

为使本发明的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本发明作进一步详细的说明。In order to make the above objects, features and advantages of the present invention more comprehensible, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.

其中,所述电子设备包括一种能够按照事先设定或存储的指令,自动进行数值计算和/或信息处理的电子设备,其硬件包括但不限于微处理器、专用集成电路(ASIC)、可编程门阵列(FPGA)、数字处理器(DSP)、嵌入式设备等。所述电子设备还可包括网络设备和/或用户设备。其中,所述网络设备包括但不限于单个网络服务器、多个网络服务器组成的服务器组或基于云计算(Cloud Computing)的由大量主机或网络服务器构成的云,其中,云计算是分布式计算的一种,由一群松散耦合的计算机集组成的一个超级虚拟计算机。所述用户设备包括但不限于任何一种可与用户通过键盘、鼠标、遥控器、触摸板或声控设备等方式进行人机交互的电子产品,例如,个人计算机、平板电脑、智能手机、个人数字助理PDA、游戏机、交互式网络电视IPTV、智能式穿戴式设备等。其中,所述用户设备及网络设备所处的网络包括但不限于互联网、广域网、城域网、局域网、虚拟专用网络VPN等。Wherein, the electronic equipment includes an electronic equipment that can automatically perform numerical calculation and/or information processing according to preset or stored instructions, and its hardware includes but is not limited to microprocessors, application-specific integrated circuits (ASICs), programmable Programmable gate array (FPGA), digital processor (DSP), embedded devices, etc. The electronic equipment may also include network equipment and/or user equipment. Wherein, the network device includes but is not limited to a single network server, a server group composed of multiple network servers, or a cloud based on cloud computing (Cloud Computing) composed of a large number of hosts or network servers, wherein cloud computing is distributed computing A super virtual computer consisting of a group of loosely coupled computer sets. The user equipment includes but is not limited to any electronic product that can interact with the user through keyboards, mice, remote controls, touch pads, or voice-activated devices, such as personal computers, tablet computers, smart phones, personal digital Assistant PDA, game console, interactive Internet TV IPTV, smart wearable devices, etc. Wherein, the network where the user equipment and the network equipment are located includes, but is not limited to, the Internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (VPN), and the like.

请参见图1,图1是本发明公开的一种文件查找方法的较佳实施例的流程图。其中,根据不同的需求,该流程图中步骤的顺序可以改变,某些步骤可以省略。Please refer to FIG. 1 . FIG. 1 is a flowchart of a preferred embodiment of a file search method disclosed in the present invention. Wherein, according to different requirements, the order of the steps in the flow chart can be changed, and some steps can be omitted.

S11、电子设备接收携带有文本关键词的文件查找请求。S11. The electronic device receives a file search request carrying text keywords.

本发明实施例中,当用户需要查找某个文件时,用户可以在应用层输入携带有文本关键词的文件查找请求。In the embodiment of the present invention, when a user needs to search for a certain file, the user may input a file search request carrying text keywords at the application layer.

其中,所述文本关键词可以为文件名称中的全部或部分关键词,或者,所述文本关键词可以为文件包括的文本内容中的部分关键词。Wherein, the text keywords may be all or part of the keywords in the file name, or, the text keywords may be part of the keywords in the text content included in the file.

作为一种可选的实施方式,步骤S11所述接收携带有文本关键词的文件查找请求之前,所述方法还包括:As an optional implementation manner, before receiving the file search request carrying text keywords in step S11, the method further includes:

读取当前文件系统中的所有文件;Read all files in the current file system;

针对每个所述文件,根据所述文件的文件后缀名、文件大小以及文件存储格式,判断所述文件是否为文本文件;For each of the files, determine whether the file is a text file according to the file suffix name, file size and file storage format of the file;

若所述文件为文本文件,基于所述文件的文件名以及文本内容,创建文本文件索引;If the file is a text file, based on the file name and text content of the file, create a text file index;

若所述文件为非文本文件,基于所述文件的文件名,创建非文本文件索引;If the file is a non-text file, based on the file name of the file, create a non-text file index;

根据所述文本文件索引以及所述非文本文件索引,创建所述本地文件索引。The local file index is created according to the text file index and the non-text file index.

在该可选的实施方式中,以NTFS(New Technology File System,新技术文件系统)为例,大部分windows都是这样的文件系统。NTFS里会维护一张表MTF(Master FileTable,主文件表),所有的文件夹和文件名称都被存储在该MTF表中,在首次启动时就通过读取该MTF表的内容,获取到所有的文件名称和路径,进一步地,对该所有文件进行筛查,以区分哪些文件是文本文件,哪些文件是非文本文件,并创建本地文件索引。后续如果用户操作文件,可以对本地文件索引进行修改。In this optional implementation manner, NTFS (New Technology File System, new technology file system) is taken as an example, and most windows are such file systems. A table MTF (Master FileTable, master file table) is maintained in NTFS, and all folders and file names are stored in the MTF table, and all files are obtained by reading the contents of the MTF table when starting for the first time. Further, all files are screened to distinguish which files are text files and which files are non-text files, and create a local file index. If the user operates the file later, the local file index can be modified.

通常,文本文件的文件后缀名可以包括但不限于doc、txt、json,非文本文件的文件后缀名可以包括但不限于mp4、avi、mpg、mlv,文本文件所占内存比非文本文件所占内存要小,此外,为了避免恶意将庞大的非文本文件修改成文本文件,还需要对文本文件进行鉴别。Usually, the file suffixes of text files can include but not limited to doc, txt, json, the file suffixes of non-text files can include but not limited to mp4, avi, mpg, mlv, and the memory occupied by text files is higher than that of non-text files The memory should be small. In addition, in order to avoid maliciously modifying huge non-text files into text files, it is also necessary to identify the text files.

其中,每个不同类型的文件,在计算机上的存储会以不同的结构存在,这些各种有规律的结构被描述成文件存储格式,例如:Windows平台的exe,dll,sys文件统称为PE文件,并拥有自己特有的格式,比如文件的前两个字节为4D5A,这是PE文件的标志,再比如MP4格式的文件,第4-7字节的内容就是66 74 79 70。因此,在对文本文件进行鉴别时,还可以根据文件在计算机中的文件存储格式来进行判断,Among them, each different type of file will be stored in a different structure on the computer, and these various regular structures are described as a file storage format, for example: exe, dll, and sys files on the Windows platform are collectively called PE files , and has its own unique format. For example, the first two bytes of the file are 4D5A, which is the symbol of the PE file. For example, the file in MP4 format, the content of the 4th to 7th bytes is 66 74 79 70. Therefore, when identifying a text file, it can also be judged according to the file storage format of the file in the computer,

具体的,针对每个所述文件,可以根据所述文件的文件后缀名、文件大小以及文件存储格式,判断所述文件是否为文本文件,如果所述文件的文件后缀名属于文本文件的文件后缀名,且所述文件的文件大小不超过预设的文本文件大小(比如10M),且所述文件的文件存储格式为文本文件的文件存储格式,则可以确定所述文件为文本文件,反之,如果所述文件的文件后缀名不属于文本文件的文件后缀名,或所述文件的文件大小超过预设的文本文件大小(比如10M),或所述文件的文件存储格式为非文本文件的文件存储格式,只要上述三个条件中的任何一个或者任何两个或者三个成立,则可以确定所述文件为非文本文件。Specifically, for each of the files, it can be judged whether the file is a text file according to the file suffix name, file size and file storage format of the file, if the file suffix name of the file belongs to the file suffix of the text file name, and the file size of the file does not exceed the preset text file size (such as 10M), and the file storage format of the file is the file storage format of the text file, then it can be determined that the file is a text file, otherwise, If the file extension of the file does not belong to the file extension of the text file, or the file size of the file exceeds the preset text file size (such as 10M), or the file storage format of the file is a non-text file Storage format, as long as any one or any two or three of the above three conditions are satisfied, it can be determined that the file is a non-text file.

在区分文本文件和非文本文件后,针对文本文件,可以基于文件名以及文本内容,创建文本文件索引,针对非文本文件,可以基于文件名,创建非文本文件索引,进而根据所述文本文件索引以及所述非文本文件索引,创建本地文件索引。After distinguishing between text files and non-text files, for text files, a text file index can be created based on the file name and text content, and for non-text files, a non-text file index can be created based on the file name, and then according to the text file index As well as the non-text file index, a local file index is created.

基于上述方式创建的本地文件索引,当输入的文本关键词与文件名匹配时,可以将匹配的文本文件或非文本文件搜索出来,当输入的文本关键词与文本内容匹配时,可以将匹配的文本文件搜索出来。Based on the local file index created in the above way, when the input text keyword matches the file name, the matched text file or non-text file can be searched out; when the input text keyword matches the text content, the matched Text files are searched out.

S12、电子设备根据所述文本关键词,在基于文件系统过滤驱动的本地文件索引中进行搜索,获得目标文件。S12. The electronic device searches the local file index based on the filter driver of the file system according to the text keyword to obtain the target file.

本发明基于windows的文件系统过滤驱动MiniFilter对本地文件索引包括的文件的操作事件进行监听。在操作系统的底层插入一个MiniFilter模块,那么文件的创建、删除、修改以及查看操作成功前的动作消息会被该MiniFilter模块过滤,用户可以选择拦截或者放行,同时也可以获取到文件的全路径、名称、内容以及属性等信息。The present invention is based on the windows file system and drives the MiniFilter to monitor the operation events of the files included in the local file index. Insert a MiniFilter module at the bottom layer of the operating system, then the action messages before the file creation, deletion, modification, and viewing operations are successful will be filtered by the MiniFilter module, and the user can choose to intercept or release, and can also obtain the full path of the file, Information such as name, content, and attributes.

由于本地文件索引是基于文件系统过滤驱动的,无论之前的用户对文件做什么操作(创建、删除、修改)均可以被文件系统过滤驱动监听,进而修改本地文件索引,以实时更新本地文件索引。后续用户输入文本关键词进行查找时,电子设备就可以从文件名以及文本内容两个方面进行查找,以搜索出文件名与所述文本关键词匹配的目标文件,或者,搜索出文本内容与所述文本关键词匹配的目标文件。即,所述目标文件的文件名与所述文本关键词匹配,或,所述目标文件的文本内容与所述文本关键词匹配。Since the local file index is driven based on the file system filter, no matter what operations (create, delete, modify) the previous user does to the file, it can be monitored by the file system filter driver, and then the local file index can be modified to update the local file index in real time. When the user enters the text keyword to search, the electronic device can search from the two aspects of the file name and the text content, so as to search out the target file whose file name matches the text keyword, or search out the text content matching the text keyword. The target file matching the keyword in the above text. That is, the file name of the target file matches the text keyword, or the text content of the target file matches the text keyword.

本发明中,可以高效精准的查找文件系统中的所有相关文件,以最快的速度从驱动层(即文件系统过滤驱动)拿到最精准文件的信息,同时,支持多种方式查找文件,也可以通过文本内容进行快速定位,大大提高系统使用的效率。In the present invention, all related files in the file system can be searched efficiently and accurately, and the most accurate file information can be obtained from the driver layer (ie file system filter driver) at the fastest speed. Quick positioning can be performed through text content, which greatly improves the efficiency of system use.

作为一种可选的实施方式,所述方法还包括:As an optional implementation, the method also includes:

通过应用程序将所述文件系统过滤驱动加载到操作系统中;Loading the file system filter driver into the operating system through an application program;

通过加载后的所述文件系统过滤驱动,监听所述所有文件发生的操作事件;Listening to operation events of all files through the loaded file system filter driver;

将所述操作事件回调至所述文件系统过滤驱动,并通过所述文件系统过滤驱动将所述操作事件反馈至所述应用程序;Calling back the operation event to the file system filter driver, and feeding back the operation event to the application through the file system filter driver;

通过所述应用程序,对所述本地文件索引中与所述操作事件对应的文件进行更新。The file corresponding to the operation event in the local file index is updated through the application program.

在该可选的实施方式中,在首次加载时,可以通过应用程序将所述文件系统过滤驱动加载到操作系统中,具体的,应用程序可以加载所述文件系统过滤驱动(即win内核模块),让所述文件系统过滤驱动进入到操作系统的工作空间里后,就成为了操作系统的一部分,与所述操作系统共享一块内存,同属一个进程。所述文件系统过滤驱动工作后,所述文件系统过滤驱动就可以和应用程序直接进行通信。之后,再通过加载后的所述文件系统过滤驱动,监听所述所有文件发生的操作事件,比如:文件创建事件、文件删除事件以及文件修改事件等。当加载后的文件系统过滤驱动监听到这些操作事件时,可以将所述操作事件回调至所述文件系统过滤驱动,并通过所述文件系统过滤驱动将所述操作事件反馈至所述应用程序;最后,再通过所述应用程序,对所述本地文件索引中与所述操作事件对应的文件进行更新。In this optional embodiment, when loading for the first time, the file system filter driver can be loaded into the operating system through the application program, specifically, the application program can load the file system filter driver (ie win kernel module) After the file system filter driver enters the working space of the operating system, it becomes a part of the operating system, shares a piece of memory with the operating system, and belongs to the same process. After the file system filter driver works, the file system filter driver can directly communicate with the application program. After that, the loaded file system filter driver is used to monitor operation events of all files, such as file creation events, file deletion events, and file modification events. When the loaded file system filter driver listens to these operation events, it can call back the operation event to the file system filter driver, and feed back the operation event to the application through the file system filter driver; Finally, the file corresponding to the operation event in the local file index is updated through the application program.

其中,所述应用程序的生命周期、所述文件系统过滤驱动的生命周期以及所述操作系统的生命周期三者保持一致。Wherein, the life cycle of the application program, the life cycle of the file system filter driver and the life cycle of the operating system are consistent.

作为一种可选的实施方式,所述操作事件为文件创建事件,所述通过所述应用程序,对所述本地文件索引中与所述操作事件对应的文件进行更新包括:As an optional implementation manner, the operation event is a file creation event, and updating the file corresponding to the operation event in the local file index through the application program includes:

通过所述应用程序,判断所述文件创建事件对应的第一文件是否为文本文件;Through the application program, it is judged whether the first file corresponding to the file creation event is a text file;

若所述文件创建事件对应的第一文件为文本文件,更新所述本地文件索引中针对所述第一文件的文件名以及文本内容;或,If the first file corresponding to the file creation event is a text file, update the file name and text content of the first file in the local file index; or,

若所述文件创建事件对应的第一文件为非文本文件,更新所述本地文件索引中针对所述第一文件的文件名。If the first file corresponding to the file creation event is a non-text file, update the file name of the first file in the local file index.

在该可选的实施方式中,当所述文件系统过滤驱动监听到的操作事件为文件创建事件时,表明有用户创建了新文件,该文件创建事件会回调至所述文件系统过滤驱动中,所述文件系统过滤驱动需要将该文件创建事件反馈至所述应用程序,具体的,反馈的内容可以包括但不限于文件创建的时间,文件全路径、文件名称、文件大小、文件属性(可读、可写、隐藏)。In this optional implementation, when the operation event monitored by the file system filter driver is a file creation event, it indicates that a user has created a new file, and the file creation event will be called back to the file system filter driver, The file system filter driver needs to feed back the file creation event to the application program. Specifically, the content of the feedback may include but not limited to the time when the file was created, the full path of the file, the name of the file, the size of the file, and the attributes of the file (readable , writable, hidden).

进一步地,应用程序还需要判断所述文件创建事件对应的第一文件是否为文本文件,具体的,可以根据所述第一文件的文件后缀名、文件大小以及文件存储格式,判断所述第一文件是否为文本文件,具体描述可以参照上文所述的,在此不再赘述。若所述文件创建事件对应的第一文件为文本文件,可以更新所述本地文件索引中针对所述第一文件的文件名以及文本内容;或,若所述文件创建事件对应的第一文件为非文本文件,只需要更新所述本地文件索引中针对所述第一文件的文件名。Further, the application also needs to judge whether the first file corresponding to the file creation event is a text file. Specifically, the first file can be judged according to the file extension, file size, and file storage format of the first file. Whether the file is a text file, the specific description can refer to the above, and will not be repeated here. If the first file corresponding to the file creation event is a text file, the file name and text content of the first file in the local file index may be updated; or, if the first file corresponding to the file creation event is For non-text files, only the file name of the first file in the local file index needs to be updated.

作为一种可选的实施方式,所述操作事件为文件删除事件,所述通过所述应用程序,对所述本地文件索引中与所述操作事件对应的文件进行更新包括:As an optional implementation manner, the operation event is a file deletion event, and updating the file corresponding to the operation event in the local file index through the application program includes:

通过所述应用程序,删除所述本地文件索引中所述文件删除事件对应的第二文件。Through the application program, delete the second file corresponding to the file deletion event in the local file index.

在该可选的实施方式中,当所述文件系统过滤驱动监听到的操作事件为文件删除事件时,表明有用户删除了某个文件,该文件删除事件会回调至所述文件系统过滤驱动中,所述文件系统过滤驱动需要将该文件删除事件反馈至所述应用程序,具体的,反馈的内容可以包括但不限于文件删除的时间,文件全路径、文件名称、文件大小、文件属性(可读、可写、隐藏)。In this optional implementation, when the operation event monitored by the file system filter driver is a file deletion event, it indicates that a user has deleted a certain file, and the file deletion event will be called back to the file system filter driver , the file system filter driver needs to feed back the file deletion event to the application program. Specifically, the content of the feedback may include but not limited to the time of file deletion, the full path of the file, the file name, the file size, and the file attribute (optional) read, writable, hidden).

由于文件删除后,该文件就不存在的,无论是文本文件还是非文本文件,都不需要更新文件名或文本内容了,因而,在监听到所述操作事件为文件删除事件时,只需要通过所述应用程序,删除所述本地文件索引中所述文件删除事件对应的第二文件即可。Since the file does not exist after the file is deleted, no matter whether it is a text file or a non-text file, there is no need to update the file name or text content. Therefore, when the operation event is detected as a file deletion event, you only need to pass The application program only needs to delete the second file corresponding to the file deletion event in the local file index.

作为一种可选的实施方式,所述操作事件为文件修改事件,所述通过所述应用程序,对所述本地文件索引中与所述操作事件对应的文件进行更新包括:As an optional implementation manner, the operation event is a file modification event, and updating the file corresponding to the operation event in the local file index through the application program includes:

通过所述应用程序,判断所述文件修改事件对应的第三文件是否为文本文件;Through the application program, it is judged whether the third file corresponding to the file modification event is a text file;

若所述文件修改事件对应的第三文件为文本文件,更新所述本地文件索引中针对所述第三文件的文件名以及文本内容;或,If the third file corresponding to the file modification event is a text file, update the file name and text content of the third file in the local file index; or,

若所述文件修改事件对应的第三文件为非文本文件,更新所述本地文件索引中针对所述第三文件的文件名。If the third file corresponding to the file modification event is a non-text file, update the file name of the third file in the local file index.

在该可选的实施方式中,当所述文件系统过滤驱动监听到的操作事件为文件修改事件时,表明有用户修改了某个文件,该文件修改事件会回调至所述文件系统过滤驱动中,所述文件系统过滤驱动需要将该文件修改事件反馈至所述应用程序,具体的,反馈的内容可以包括但不限于文件最后修改的时间,文件全路径、文件名称、文件大小、文件属性(可读、可写、隐藏)。In this optional implementation, when the operation event monitored by the file system filter driver is a file modification event, it indicates that a user has modified a certain file, and the file modification event will be called back to the file system filter driver , the file system filter driver needs to feed back the file modification event to the application program. Specifically, the content of the feedback may include but not limited to the time when the file was last modified, the full path of the file, the file name, the file size, the file attribute ( readable, writable, hidden).

进一步地,应用程序还需要判断所述文件修改事件对应的第三文件是否为文本文件,具体的,可以根据所述第三文件的文件后缀名、文件大小以及文件存储格式,判断所述第三文件是否为文本文件,具体描述可以参照上文所述的,在此不再赘述。若所述文件修改事件对应的第三文件为文本文件,可以更新所述本地文件索引中针对所述第三文件的文件名以及文本内容;或,若所述文件修改事件对应的第三文件为非文本文件,只需要更新所述本地文件索引中针对所述第三文件的文件名。Further, the application also needs to judge whether the third file corresponding to the file modification event is a text file. Specifically, the third file can be judged according to the file extension, file size, and file storage format of the third file. Whether the file is a text file, the specific description can refer to the above, and will not be repeated here. If the third file corresponding to the file modification event is a text file, the file name and text content of the third file in the local file index may be updated; or, if the third file corresponding to the file modification event is For non-text files, only the file name of the third file in the local file index needs to be updated.

S13、电子设备输出所述目标文件的存储地址。S13. The electronic device outputs the storage address of the target file.

其中,在搜索到目标文件后,即确定了目标文件所在的位置,即可向用户输出所述目标文件的存储地址。Wherein, after the target file is searched, the location of the target file is determined, and the storage address of the target file can be output to the user.

其中,所述目标文件为一个或多个。Wherein, the target file is one or more.

在图1所描述的方法流程中,可以接收携带有文本关键词的文件查找请求,进一步地,根据所述文本关键词,在基于文件系统过滤驱动的本地文件索引中进行搜索,获得目标文件,其中,所述目标文件的文件名与所述文本关键词匹配,或,所述目标文件的文本内容与所述文本关键词匹配,最后,输出所述目标文件的存储地址。可见,本发明中,基于文件系统过滤驱动的本地文件索引不仅可以对文件的文件名进行搜索,还可以对文件的文本内容进行搜索,从而能够提高文件的查找效率。In the method flow described in FIG. 1, a file search request carrying a text keyword may be received, and further, according to the text keyword, a search is performed in a local file index based on a file system filter driver to obtain a target file, Wherein, the file name of the target file is matched with the text keyword, or the text content of the target file is matched with the text keyword, and finally, the storage address of the target file is output. It can be seen that in the present invention, the local file index based on the file system filter driver can not only search the file name of the file, but also search the text content of the file, thereby improving the efficiency of file search.

以上所述,仅是本发明的具体实施方式,但本发明的保护范围并不局限于此,对于本领域的普通技术人员来说,在不脱离本发明创造构思的前提下,还可以做出改进,但这些均属于本发明的保护范围。The above is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. For those of ordinary skill in the art, without departing from the inventive concept of the present invention, it is also possible to make Improvements, but these all belong to the protection scope of the present invention.

请参见图2,图2是本发明公开的一种文件查找装置的较佳实施例的功能模块图。Please refer to FIG. 2 . FIG. 2 is a functional block diagram of a preferred embodiment of a file search device disclosed in the present invention.

在一些实施例中,所述文件查找装置运行于电子设备中。所述文件查找装置可以包括多个由程序代码段所组成的功能模块。所述文件查找装置中的各个程序段的程序代码可以存储于存储器中,并由至少一个处理器所执行,以执行图1所描述的文件查找方法中的部分或全部步骤。In some embodiments, the file search device runs in an electronic device. The file searching device may include a plurality of functional modules composed of program code segments. The program codes of each program segment in the file search device may be stored in a memory, and executed by at least one processor to perform some or all of the steps in the file search method described in FIG. 1 .

本实施例中,所述文件查找装置根据其所执行的功能,可以被划分为多个功能模块。所述功能模块可以包括:接收模块201、搜索模块202及输出模块203。本发明所称的模块是指一种能够被至少一个处理器所执行并且能够完成固定功能的一系列计算机程序段,其存储在存储器中。在一些实施例中,关于各模块的功能将在后续的实施例中详述。In this embodiment, the file search device can be divided into multiple functional modules according to the functions it performs. The functional modules may include: a receiving module 201 , a searching module 202 and an output module 203 . The module referred to in the present invention refers to a series of computer program segments that can be executed by at least one processor and can complete fixed functions, and are stored in memory. In some embodiments, the functions of each module will be described in detail in subsequent embodiments.

接收模块201,用于接收携带有文本关键词的文件查找请求;Receiving module 201, is used for receiving the file search request that carries text keyword;

本发明实施例中,当用户需要查找某个文件时,用户可以在应用层输入携带有文本关键词的文件查找请求。In the embodiment of the present invention, when a user needs to search for a certain file, the user may input a file search request carrying text keywords at the application layer.

其中,所述文本关键词可以为文件名称中的全部或部分关键词,或者,所述文本关键词可以为文件包括的文本内容中的部分关键词。Wherein, the text keywords may be all or part of the keywords in the file name, or, the text keywords may be part of the keywords in the text content included in the file.

作为一种可选的实施方式,所述文件查找装置还包括:As an optional implementation manner, the file search device further includes:

读取模块,用于在所述接收模块201接收携带有文本关键词的文件查找请求之前,读取当前文件系统中的所有文件;A reading module, configured to read all files in the current file system before the receiving module 201 receives a file search request carrying text keywords;

判断模块,用于针对每个所述文件,根据所述文件的文件后缀名、文件大小以及文件存储格式,判断所述文件是否为文本文件;Judging module, for each said file, according to the file suffix name, file size and file storage format of said file, judge whether said file is a text file;

创建模块,用于若所述文件为文本文件,基于所述文件的文件名以及文本内容,创建文本文件索引;Creating a module for creating a text file index based on the file name and text content of the file if the file is a text file;

所述创建模块,还用于若所述文件为非文本文件,基于所述文件的文件名,创建非文本文件索引;The creation module is also used to create a non-text file index based on the file name of the file if the file is a non-text file;

所述创建模块,还用于根据所述文本文件索引以及所述非文本文件索引,创建所述本地文件索引。The creating module is further configured to create the local file index according to the text file index and the non-text file index.

在该可选的实施方式中,以NTFS(New Technology File System,新技术文件系统)为例,大部分windows都是这样的文件系统。NTFS里会维护一张表MTF(Master FileTable,主文件表),所有的文件夹和文件名称都被存储在该MTF表中,在首次启动时就通过读取该MTF表的内容,获取到所有的文件名称和路径,进一步地,对该所有文件进行筛查,以区分哪些文件是文本文件,哪些文件是非文本文件,并创建本地文件索引。后续如果用户操作文件,可以对本地文件索引进行修改。In this optional implementation manner, NTFS (New Technology File System, new technology file system) is taken as an example, and most windows are such file systems. A table MTF (Master FileTable, master file table) is maintained in NTFS, and all folders and file names are stored in the MTF table, and all files are obtained by reading the contents of the MTF table when starting for the first time. Further, all files are screened to distinguish which files are text files and which files are non-text files, and create a local file index. If the user operates the file later, the local file index can be modified.

通常,文本文件的文件后缀名可以包括但不限于doc、txt、json,非文本文件的文件后缀名可以包括但不限于mp4、avi、mpg、mlv,文本文件所占内存比非文本文件所占内存要小,此外,为了避免恶意将庞大的非文本文件修改成文本文件,还需要对文本文件进行鉴别。Usually, the file suffixes of text files can include but not limited to doc, txt, json, the file suffixes of non-text files can include but not limited to mp4, avi, mpg, mlv, and the memory occupied by text files is higher than that of non-text files The memory should be small. In addition, in order to avoid maliciously modifying huge non-text files into text files, it is also necessary to identify the text files.

其中,每个不同类型的文件,在计算机上的存储会以不同的结构存在,这些各种有规律的结构被描述成文件存储格式,例如:Windows平台的exe,dll,sys文件统称为PE文件,并拥有自己特有的格式,比如文件的前两个字节为4D5A,这是PE文件的标志,再比如MP4格式的文件,第4-7字节的内容就是66 74 79 70。因此,在对文本文件进行鉴别时,还可以根据文件在计算机中的文件存储格式来进行判断,Among them, each different type of file will be stored in a different structure on the computer, and these various regular structures are described as a file storage format, for example: exe, dll, and sys files on the Windows platform are collectively called PE files , and has its own unique format. For example, the first two bytes of the file are 4D5A, which is the symbol of the PE file. For example, the file in MP4 format, the content of the 4th to 7th bytes is 66 74 79 70. Therefore, when identifying a text file, it can also be judged according to the file storage format of the file in the computer,

具体的,针对每个所述文件,可以根据所述文件的文件后缀名、文件大小以及文件存储格式,判断所述文件是否为文本文件,如果所述文件的文件后缀名属于文本文件的文件后缀名,且所述文件的文件大小不超过预设的文本文件大小(比如10M),且所述文件的文件存储格式为文本文件的文件存储格式,则可以确定所述文件为文本文件,反之,如果所述文件的文件后缀名不属于文本文件的文件后缀名,或所述文件的文件大小超过预设的文本文件大小(比如10M),或所述文件的文件存储格式为非文本文件的文件存储格式,只要上述三个条件中的任何一个或者任何两个或者三个成立,则可以确定所述文件为非文本文件。Specifically, for each of the files, it can be judged whether the file is a text file according to the file suffix name, file size and file storage format of the file, if the file suffix name of the file belongs to the file suffix of the text file name, and the file size of the file does not exceed the preset text file size (such as 10M), and the file storage format of the file is the file storage format of the text file, then it can be determined that the file is a text file, otherwise, If the file extension of the file does not belong to the file extension of the text file, or the file size of the file exceeds the preset text file size (such as 10M), or the file storage format of the file is a non-text file Storage format, as long as any one or any two or three of the above three conditions are satisfied, it can be determined that the file is a non-text file.

在区分文本文件和非文本文件后,针对文本文件,可以基于文件名以及文本内容,创建文本文件索引,针对非文本文件,可以基于文件名,创建非文本文件索引,进而根据所述文本文件索引以及所述非文本文件索引,创建本地文件索引。After distinguishing between text files and non-text files, for text files, a text file index can be created based on the file name and text content, and for non-text files, a non-text file index can be created based on the file name, and then according to the text file index As well as the non-text file index, a local file index is created.

基于上述方式创建的本地文件索引,当输入的文本关键词与文件名匹配时,可以将匹配的文本文件或非文本文件搜索出来,当输入的文本关键词与文本内容匹配时,可以将匹配的文本文件搜索出来。Based on the local file index created in the above way, when the input text keyword matches the file name, the matched text file or non-text file can be searched out; when the input text keyword matches the text content, the matched Text files are searched out.

搜索模块202,用于根据所述文本关键词,在基于文件系统过滤驱动的本地文件索引中进行搜索,获得目标文件,其中,所述目标文件的文件名与所述文本关键词匹配,或,所述目标文件的文本内容与所述文本关键词匹配;The search module 202 is configured to search the local file index based on the file system filter driver according to the text keyword to obtain the target file, wherein the file name of the target file matches the text keyword, or, The text content of the target file matches the text keywords;

本发明基于windows的文件系统过滤驱动MiniFilter对本地文件索引包括的文件的操作事件进行监听。在操作系统的底层插入一个MiniFilter模块,那么文件的创建、删除、修改以及查看操作成功前的动作消息会被该MiniFilter模块过滤,用户可以选择拦截或者放行,同时也可以获取到文件的全路径、名称、内容以及属性等信息。The present invention is based on the windows file system and drives the MiniFilter to monitor the operation events of the files included in the local file index. Insert a MiniFilter module at the bottom layer of the operating system, then the action messages before the file creation, deletion, modification, and viewing operations are successful will be filtered by the MiniFilter module, and the user can choose to intercept or release, and can also obtain the full path of the file, Information such as name, content, and attributes.

由于本地文件索引是基于文件系统过滤驱动的,无论之前的用户对文件做什么操作(创建、删除、修改)均可以被文件系统过滤驱动监听,进而修改本地文件索引,以实时更新本地文件索引。后续用户输入文本关键词进行查找时,电子设备就可以从文件名以及文本内容两个方面进行查找,以搜索出文件名与所述文本关键词匹配的目标文件,或者,搜索出文本内容与所述文本关键词匹配的目标文件。即,所述目标文件的文件名与所述文本关键词匹配,或,所述目标文件的文本内容与所述文本关键词匹配。Since the local file index is driven based on the file system filter, no matter what operations (create, delete, modify) the previous user does to the file, it can be monitored by the file system filter driver, and then the local file index can be modified to update the local file index in real time. When the user enters the text keyword to search, the electronic device can search from the two aspects of the file name and the text content, so as to search out the target file whose file name matches the text keyword, or search out the text content matching the text keyword. The target file matching the keyword in the above text. That is, the file name of the target file matches the text keyword, or the text content of the target file matches the text keyword.

本发明中,可以高效精准的查找文件系统中的所有相关文件,以最快的速度从驱动层(即文件系统过滤驱动)拿到最精准文件的信息,同时,支持多种方式查找文件,也可以通过文本内容进行快速定位,大大提高系统使用的效率。In the present invention, all related files in the file system can be searched efficiently and accurately, and the most accurate file information can be obtained from the driver layer (ie file system filter driver) at the fastest speed. Quick positioning can be performed through text content, which greatly improves the efficiency of system use.

作为一种可选的实施方式,所述文件查找装置还包括:As an optional implementation manner, the file search device further includes:

加载模块,用于通过应用程序将所述文件系统过滤驱动加载到操作系统中;A loading module, configured to load the file system filter driver into the operating system through an application program;

监听模块,用于通过加载后的所述文件系统过滤驱动,监听所述所有文件发生的操作事件;A monitoring module, configured to monitor the operation events of all the files through the loaded file system filter driver;

回调反馈模块,用于将所述操作事件回调至所述文件系统过滤驱动,并通过所述文件系统过滤驱动将所述操作事件反馈至所述应用程序;A callback feedback module, configured to call back the operation event to the file system filter driver, and feed back the operation event to the application through the file system filter driver;

更新模块,用于通过所述应用程序,对所述本地文件索引中与所述操作事件对应的文件进行更新。An update module, configured to update the file corresponding to the operation event in the local file index through the application program.

在该可选的实施方式中,在首次加载时,可以通过应用程序将所述文件系统过滤驱动加载到操作系统中,具体的,应用程序可以加载所述文件系统过滤驱动(即win内核模块),让所述文件系统过滤驱动进入到操作系统的工作空间里后,就成为了操作系统的一部分,与所述操作系统共享一块内存,同属一个进程。所述文件系统过滤驱动工作后,所述文件系统过滤驱动就可以和应用程序直接进行通信。之后,再通过加载后的所述文件系统过滤驱动,监听所述所有文件发生的操作事件,比如:文件创建事件、文件删除事件以及文件修改事件等。当加载后的文件系统过滤驱动监听到这些操作事件时,可以将所述操作事件回调至所述文件系统过滤驱动,并通过所述文件系统过滤驱动将所述操作事件反馈至所述应用程序;最后,再通过所述应用程序,对所述本地文件索引中与所述操作事件对应的文件进行更新。In this optional embodiment, when loading for the first time, the file system filter driver can be loaded into the operating system through the application program, specifically, the application program can load the file system filter driver (ie win kernel module) After the file system filter driver enters the working space of the operating system, it becomes a part of the operating system, shares a piece of memory with the operating system, and belongs to the same process. After the file system filter driver works, the file system filter driver can directly communicate with the application program. After that, the loaded file system filter driver is used to monitor operation events of all files, such as file creation events, file deletion events, and file modification events. When the loaded file system filter driver listens to these operation events, it can call back the operation event to the file system filter driver, and feed back the operation event to the application through the file system filter driver; Finally, the file corresponding to the operation event in the local file index is updated through the application program.

其中,所述应用程序的生命周期、所述文件系统过滤驱动的生命周期以及所述操作系统的生命周期三者保持一致。Wherein, the life cycle of the application program, the life cycle of the file system filter driver and the life cycle of the operating system are consistent.

作为一种可选的实施方式,所述操作事件为文件创建事件,所述更新模块通过所述应用程序,对所述本地文件索引中与所述操作事件对应的文件进行更新包括:As an optional implementation manner, the operation event is a file creation event, and the updating module, through the application program, updating the file corresponding to the operation event in the local file index includes:

通过所述应用程序,判断所述文件创建事件对应的第一文件是否为文本文件;Through the application program, it is judged whether the first file corresponding to the file creation event is a text file;

若所述文件创建事件对应的第一文件为文本文件,更新所述本地文件索引中针对所述第一文件的文件名以及文本内容;或,If the first file corresponding to the file creation event is a text file, update the file name and text content of the first file in the local file index; or,

若所述文件创建事件对应的第一文件为非文本文件,更新所述本地文件索引中针对所述第一文件的文件名。If the first file corresponding to the file creation event is a non-text file, update the file name of the first file in the local file index.

在该可选的实施方式中,当所述文件系统过滤驱动监听到的操作事件为文件创建事件时,表明有用户创建了新文件,该文件创建事件会回调至所述文件系统过滤驱动中,所述文件系统过滤驱动需要将该文件创建事件反馈至所述应用程序,具体的,反馈的内容可以包括但不限于文件创建的时间,文件全路径、文件名称、文件大小、文件属性(可读、可写、隐藏)。In this optional implementation, when the operation event monitored by the file system filter driver is a file creation event, it indicates that a user has created a new file, and the file creation event will be called back to the file system filter driver, The file system filter driver needs to feed back the file creation event to the application program. Specifically, the content of the feedback may include but not limited to the time when the file was created, the full path of the file, the name of the file, the size of the file, and the attributes of the file (readable , writable, hidden).

进一步地,应用程序还需要判断所述文件创建事件对应的第一文件是否为文本文件,具体的,可以根据所述第一文件的文件后缀名、文件大小以及文件存储格式,判断所述第一文件是否为文本文件,具体描述可以参照上文所述的,在此不再赘述。若所述文件创建事件对应的第一文件为文本文件,可以更新所述本地文件索引中针对所述第一文件的文件名以及文本内容;或,若所述文件创建事件对应的第一文件为非文本文件,只需要更新所述本地文件索引中针对所述第一文件的文件名。Further, the application also needs to judge whether the first file corresponding to the file creation event is a text file. Specifically, the first file can be judged according to the file extension, file size, and file storage format of the first file. Whether the file is a text file, the specific description can refer to the above, and will not be repeated here. If the first file corresponding to the file creation event is a text file, the file name and text content of the first file in the local file index may be updated; or, if the first file corresponding to the file creation event is For non-text files, only the file name of the first file in the local file index needs to be updated.

作为一种可选的实施方式,所述操作事件为文件删除事件,所述更新模块通过所述应用程序,对所述本地文件索引中与所述操作事件对应的文件进行更新包括:As an optional implementation manner, the operation event is a file deletion event, and the updating module, through the application program, updating the file corresponding to the operation event in the local file index includes:

通过所述应用程序,删除所述本地文件索引中所述文件删除事件对应的第二文件。Through the application program, delete the second file corresponding to the file deletion event in the local file index.

在该可选的实施方式中,当所述文件系统过滤驱动监听到的操作事件为文件删除事件时,表明有用户删除了某个文件,该文件删除事件会回调至所述文件系统过滤驱动中,所述文件系统过滤驱动需要将该文件删除事件反馈至所述应用程序,具体的,反馈的内容可以包括但不限于文件删除的时间,文件全路径、文件名称、文件大小、文件属性(可读、可写、隐藏)。In this optional implementation, when the operation event monitored by the file system filter driver is a file deletion event, it indicates that a user has deleted a certain file, and the file deletion event will be called back to the file system filter driver , the file system filter driver needs to feed back the file deletion event to the application program. Specifically, the content of the feedback may include but not limited to the time of file deletion, the full path of the file, the file name, the file size, and the file attribute (optional) read, writable, hidden).

由于文件删除后,该文件就不存在的,无论是文本文件还是非文本文件,都不需要更新文件名或文本内容了,因而,在监听到所述操作事件为文件删除事件时,只需要通过所述应用程序,删除所述本地文件索引中所述文件删除事件对应的第二文件即可。Since the file does not exist after the file is deleted, no matter whether it is a text file or a non-text file, there is no need to update the file name or text content. Therefore, when the operation event is detected as a file deletion event, you only need to pass The application program only needs to delete the second file corresponding to the file deletion event in the local file index.

作为一种可选的实施方式,所述操作事件为文件修改事件,所述更新模块通过所述应用程序,对所述本地文件索引中与所述操作事件对应的文件进行更新包括:As an optional implementation manner, the operation event is a file modification event, and the updating module, through the application program, updating the file corresponding to the operation event in the local file index includes:

通过所述应用程序,判断所述文件修改事件对应的第三文件是否为文本文件;Through the application program, it is judged whether the third file corresponding to the file modification event is a text file;

若所述文件修改事件对应的第三文件为文本文件,更新所述本地文件索引中针对所述第三文件的文件名以及文本内容;或,If the third file corresponding to the file modification event is a text file, update the file name and text content of the third file in the local file index; or,

若所述文件修改事件对应的第三文件为非文本文件,更新所述本地文件索引中针对所述第三文件的文件名。If the third file corresponding to the file modification event is a non-text file, update the file name of the third file in the local file index.

在该可选的实施方式中,当所述文件系统过滤驱动监听到的操作事件为文件修改事件时,表明有用户修改了某个文件,该文件修改事件会回调至所述文件系统过滤驱动中,所述文件系统过滤驱动需要将该文件修改事件反馈至所述应用程序,具体的,反馈的内容可以包括但不限于文件最后修改的时间,文件全路径、文件名称、文件大小、文件属性(可读、可写、隐藏)。In this optional implementation, when the operation event monitored by the file system filter driver is a file modification event, it indicates that a user has modified a certain file, and the file modification event will be called back to the file system filter driver , the file system filter driver needs to feed back the file modification event to the application program. Specifically, the content of the feedback may include but not limited to the time when the file was last modified, the full path of the file, the file name, the file size, the file attribute ( readable, writable, hidden).

进一步地,应用程序还需要判断所述文件修改事件对应的第三文件是否为文本文件,具体的,可以根据所述第三文件的文件后缀名、文件大小以及文件存储格式,判断所述第三文件是否为文本文件,具体描述可以参照上文所述的,在此不再赘述。若所述文件修改事件对应的第三文件为文本文件,可以更新所述本地文件索引中针对所述第三文件的文件名以及文本内容;或,若所述文件修改事件对应的第三文件为非文本文件,只需要更新所述本地文件索引中针对所述第三文件的文件名。Further, the application also needs to judge whether the third file corresponding to the file modification event is a text file. Specifically, the third file can be judged according to the file extension, file size, and file storage format of the third file. Whether the file is a text file, the specific description can refer to the above, and will not be repeated here. If the third file corresponding to the file modification event is a text file, the file name and text content of the third file in the local file index may be updated; or, if the third file corresponding to the file modification event is For non-text files, only the file name of the third file in the local file index needs to be updated.

输出模块203,用于输出所述目标文件的存储地址。An output module 203, configured to output the storage address of the target file.

其中,在搜索到目标文件后,即确定了目标文件所在的位置,即可向用户输出所述目标文件的存储地址。Wherein, after the target file is searched, the location of the target file is determined, and the storage address of the target file can be output to the user.

其中,所述目标文件为一个或多个。Wherein, the target file is one or more.

在图2所描述的文件查找装置中,可以接收携带有文本关键词的文件查找请求,进一步地,根据所述文本关键词,在基于文件系统过滤驱动的本地文件索引中进行搜索,获得目标文件,其中,所述目标文件的文件名与所述文本关键词匹配,或,所述目标文件的文本内容与所述文本关键词匹配,最后,输出所述目标文件的存储地址。可见,本发明中,基于文件系统过滤驱动的本地文件索引不仅可以对文件的文件名进行搜索,还可以对文件的文本内容进行搜索,从而能够提高文件的查找效率。In the file search device described in Figure 2, a file search request carrying text keywords can be received, and further, according to the text keywords, a search is performed in the local file index based on file system filter driver to obtain the target file , wherein, the file name of the target file matches the text keyword, or the text content of the target file matches the text keyword, and finally, the storage address of the target file is output. It can be seen that in the present invention, the local file index based on the file system filter driver can not only search the file name of the file, but also search the text content of the file, thereby improving the efficiency of file search.

如图3所示,图3是本发明实现文件查找方法的较佳实施例的电子设备的结构示意图。所述电子设备3包括存储器31、至少一个处理器32、存储在所述存储器31中并可在所述至少一个处理器32上运行的计算机程序33及至少一条通讯总线34。As shown in FIG. 3 , FIG. 3 is a schematic structural diagram of an electronic device implementing a preferred embodiment of a file search method in the present invention. The electronic device 3 includes a memory 31 , at least one processor 32 , a computer program 33 stored in the memory 31 and executable on the at least one processor 32 , and at least one communication bus 34 .

本领域技术人员可以理解,图3所示的示意图仅仅是电子设备3的示例,并不构成对电子设备3的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述电子设备3还可以包括输入输出设备、网络接入设备等。Those skilled in the art can understand that the schematic diagram shown in FIG. 3 is only an example of the electronic device 3, and does not constitute a limitation on the electronic device 3, and may include more or less components than those shown in the figure, or combine certain components, Or different components, for example, the electronic device 3 may also include input and output devices, network access devices, and the like.

所述电子设备3还包括但不限于任何一种可与用户通过键盘、鼠标、遥控器、触摸板或声控设备等方式进行人机交互的电子产品,例如,个人计算机、平板电脑、智能手机、个人数字助理(Personal Digital Assistant,PDA)、游戏机、交互式网络电视(InternetProtocol Television,IPTV)、智能式穿戴式设备等。所述电子设备3所处的网络包括但不限于互联网、广域网、城域网、局域网、虚拟专用网络(Virtual Private Network,VPN)等。The electronic device 3 also includes but is not limited to any electronic product that can interact with the user through keyboards, mice, remote controls, touch pads or voice-activated devices, such as personal computers, tablet computers, smart phones, Personal digital assistant (Personal Digital Assistant, PDA), game console, interactive Internet TV (Internet Protocol Television, IPTV), smart wearable devices, etc. The network where the electronic device 3 is located includes, but is not limited to, the Internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (Virtual Private Network, VPN) and the like.

所述至少一个处理器32可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。该处理器32可以是微处理器或者该处理器32也可以是任何常规的处理器等,所述处理器32是所述电子设备3的控制中心,利用各种接口和线路连接整个电子设备3的各个部分。The at least one processor 32 may be a central processing unit (Central Processing Unit, CPU), and may also be other general-purpose processors, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC ), off-the-shelf programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. This processor 32 can be microprocessor or this processor 32 also can be any conventional processor etc., described processor 32 is the control center of described electronic device 3, utilizes various interfaces and lines to connect whole electronic device 3 various parts of .

所述存储器31可用于存储所述计算机程序33和/或模块/单元,所述处理器32通过运行或执行存储在所述存储器31内的计算机程序和/或模块/单元,以及调用存储在存储器31内的数据,实现所述电子设备3的各种功能。所述存储器31可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据电子设备3的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器31可以包括高速随机存取存储器,还可以包括非易失性存储器,例如硬盘、内存、插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)、至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The memory 31 can be used to store the computer program 33 and/or module/unit, and the processor 32 runs or executes the computer program and/or module/unit stored in the memory 31, and calls the computer program stored in the memory 31 to realize various functions of the electronic device 3. The memory 31 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application program required by a function (such as a sound playback function, an image playback function, etc.); Data created in accordance with the use of the electronic device 3 (such as audio data, phonebook, etc.) and the like are stored. In addition, memory 31 can include high-speed random access memory, and can also include non-volatile memory, such as hard disk, internal memory, plug-in hard disk, smart memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card, flash memory card (Flash Card), at least one magnetic disk storage device, flash memory device, or other volatile solid state storage devices.

结合图1,所述电子设备3中的所述存储器31存储多个指令以实现一种文件查找方法,所述处理器32可执行所述多个指令从而实现:1, the memory 31 in the electronic device 3 stores multiple instructions to implement a file search method, and the processor 32 can execute the multiple instructions to achieve:

接收携带有文本关键词的文件查找请求;Receive a file search request carrying text keywords;

根据所述文本关键词,在基于文件系统过滤驱动的本地文件索引中进行搜索,获得目标文件,其中,所述目标文件的文件名与所述文本关键词匹配,或,所述目标文件的文本内容与所述文本关键词匹配;According to the text keyword, search in the local file index based on the file system filter driver to obtain the target file, wherein the file name of the target file matches the text keyword, or the text of the target file The content matches said text keywords;

输出所述目标文件的存储地址。Output the storage address of the target file.

在一种可选的实施方式中,所述接收携带有文本关键词的文件查找请求之前,所述处理器32可执行所述多个指令从而实现:In an optional implementation manner, before receiving the file search request carrying text keywords, the processor 32 may execute the multiple instructions so as to realize:

读取当前文件系统中的所有文件;Read all files in the current file system;

针对每个所述文件,根据所述文件的文件后缀名、文件大小以及文件存储格式,判断所述文件是否为文本文件;For each of the files, determine whether the file is a text file according to the file suffix name, file size and file storage format of the file;

若所述文件为文本文件,基于所述文件的文件名以及文本内容,创建文本文件索引;If the file is a text file, based on the file name and text content of the file, create a text file index;

若所述文件为非文本文件,基于所述文件的文件名,创建非文本文件索引;If the file is a non-text file, based on the file name of the file, create a non-text file index;

根据所述文本文件索引以及所述非文本文件索引,创建所述本地文件索引。The local file index is created according to the text file index and the non-text file index.

在一种可选的实施方式中,所述处理器32可执行所述多个指令从而实现:In an optional implementation manner, the processor 32 may execute the multiple instructions to implement:

通过应用程序将所述文件系统过滤驱动加载到操作系统中;Loading the file system filter driver into the operating system through an application program;

通过加载后的所述文件系统过滤驱动,监听所述所有文件发生的操作事件;Listening to operation events of all files through the loaded file system filter driver;

将所述操作事件回调至所述文件系统过滤驱动,并通过所述文件系统过滤驱动将所述操作事件反馈至所述应用程序;Calling back the operation event to the file system filter driver, and feeding back the operation event to the application through the file system filter driver;

通过所述应用程序,对所述本地文件索引中与所述操作事件对应的文件进行更新。The file corresponding to the operation event in the local file index is updated through the application program.

在一种可选的实施方式中,所述操作事件为文件创建事件,所述通过所述应用程序,对所述本地文件索引中与所述操作事件对应的文件进行更新包括:In an optional implementation manner, the operation event is a file creation event, and updating the file corresponding to the operation event in the local file index through the application program includes:

通过所述应用程序,判断所述文件创建事件对应的第一文件是否为文本文件;Through the application program, it is judged whether the first file corresponding to the file creation event is a text file;

若所述文件创建事件对应的第一文件为文本文件,更新所述本地文件索引中针对所述第一文件的文件名以及文本内容;或,If the first file corresponding to the file creation event is a text file, update the file name and text content of the first file in the local file index; or,

若所述文件创建事件对应的第一文件为非文本文件,更新所述本地文件索引中针对所述第一文件的文件名。If the first file corresponding to the file creation event is a non-text file, update the file name of the first file in the local file index.

在一种可选的实施方式中,所述操作事件为文件删除事件,所述通过所述应用程序,对所述本地文件索引中与所述操作事件对应的文件进行更新包括:In an optional implementation manner, the operation event is a file deletion event, and updating the file corresponding to the operation event in the local file index through the application program includes:

通过所述应用程序,删除所述本地文件索引中所述文件删除事件对应的第二文件。Through the application program, delete the second file corresponding to the file deletion event in the local file index.

在一种可选的实施方式中,所述操作事件为文件修改事件,所述通过所述应用程序,对所述本地文件索引中与所述操作事件对应的文件进行更新包括:In an optional implementation manner, the operation event is a file modification event, and updating the file corresponding to the operation event in the local file index through the application program includes:

通过所述应用程序,判断所述文件修改事件对应的第三文件是否为文本文件;Through the application program, it is judged whether the third file corresponding to the file modification event is a text file;

若所述文件修改事件对应的第三文件为文本文件,更新所述本地文件索引中针对所述第三文件的文件名以及文本内容;或,If the third file corresponding to the file modification event is a text file, update the file name and text content of the third file in the local file index; or,

若所述文件修改事件对应的第三文件为非文本文件,更新所述本地文件索引中针对所述第三文件的文件名。If the third file corresponding to the file modification event is a non-text file, update the file name of the third file in the local file index.

在一种可选的实施方式中,所述应用程序的生命周期、所述文件系统过滤驱动的生命周期以及所述操作系统的生命周期三者保持一致。In an optional implementation manner, the life cycle of the application program, the life cycle of the file system filter driver, and the life cycle of the operating system are consistent.

具体地,所述处理器32对上述指令的具体实现方法可参考图1对应实施例中相关步骤的描述,在此不赘述。Specifically, for the specific implementation method of the above instruction by the processor 32, reference may be made to the description of the relevant steps in the embodiment corresponding to FIG. 1 , which will not be repeated here.

在图3所描述的电子设备3中,可以接收携带有文本关键词的文件查找请求,进一步地,根据所述文本关键词,在基于文件系统过滤驱动的本地文件索引中进行搜索,获得目标文件,其中,所述目标文件的文件名与所述文本关键词匹配,或,所述目标文件的文本内容与所述文本关键词匹配,最后,输出所述目标文件的存储地址。可见,本发明中,基于文件系统过滤驱动的本地文件索引不仅可以对文件的文件名进行搜索,还可以对文件的文本内容进行搜索,从而能够提高文件的查找效率。In the electronic device 3 described in FIG. 3 , a file search request carrying a text keyword can be received, and further, according to the text keyword, a search is performed in the local file index based on the file system filter driver to obtain the target file , wherein, the file name of the target file matches the text keyword, or the text content of the target file matches the text keyword, and finally, the storage address of the target file is output. It can be seen that in the present invention, the local file index based on the file system filter driver can not only search the file name of the file, but also search the text content of the file, thereby improving the efficiency of file search.

所述电子设备3集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明实现上述实施例方法中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,所述计算机可读介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读介质不包括电载波信号和电信信号。If the integrated modules/units of the electronic device 3 are realized in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the present invention realizes all or part of the processes in the methods of the above embodiments, and can also be completed by instructing related hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer When the program is executed by the processor, the steps in the above-mentioned various method embodiments can be realized. Wherein, the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM, Read-Only Memory) , Random Access Memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, computer-readable media Excludes electrical carrier signals and telecommunication signals.

在本发明所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.

所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

另外,在本发明各个实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能模块的形式实现。In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, or each unit may physically exist separately, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware, or in the form of hardware plus software function modules.

对于本领域技术人员而言,显然本发明不限于上述示范性实施例的细节,而且在不背离本发明的精神或基本特征的情况下,能够以其他的具体形式实现本发明。因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本发明的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本发明内。不应将权利要求中的任何附关联图标记视为限制所涉及的权利要求。此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。系统权利要求中陈述的多个单元或装置也可以由一个单元或装置通过软件或者硬件来实现。第二等词语用来表示名称,而并不表示任何特定的顺序。It will be apparent to those skilled in the art that the invention is not limited to the details of the above-described exemplary embodiments, but that the invention can be embodied in other specific forms without departing from the spirit or essential characteristics of the invention. Accordingly, the embodiments should be regarded in all points of view as exemplary and not restrictive, the scope of the invention being defined by the appended claims rather than the foregoing description, and it is therefore intended that the scope of the invention be defined by the appended claims rather than by the foregoing description. All changes within the meaning and range of equivalents of the elements are embraced in the present invention. Any reference sign in a claim should not be construed as limiting the claim concerned. In addition, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or devices stated in the system claims may also be realized by one unit or device through software or hardware. Secondary terms are used to denote names without implying any particular order.

最后应说明的是,以上实施例仅用以说明本发明的技术方案而非限制,尽管参照较佳实施例对本发明进行了详细说明,本领域的普通技术人员应当理解,可以对本发明的技术方案进行修改或等同替换,而不脱离本发明技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention without limitation. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be Modifications or equivalent replacements can be made without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

Translated fromChinese
1.一种文件查找方法,其特征在于,所述方法包括:1. A file search method, characterized in that the method comprises:接收携带有文本关键词的文件查找请求;Receive a file search request carrying text keywords;根据所述文本关键词,在基于文件系统过滤驱动的本地文件索引中进行搜索,获得目标文件,其中,所述目标文件的文件名与所述文本关键词匹配,或,所述目标文件的文本内容与所述文本关键词匹配;According to the text keyword, search in the local file index based on the file system filter driver to obtain the target file, wherein the file name of the target file matches the text keyword, or the text of the target file The content matches said text keywords;输出所述目标文件的存储地址。Output the storage address of the target file.2.根据权利要求1所述的方法,其特征在于,所述接收携带有文本关键词的文件查找请求之前,所述方法还包括:2. The method according to claim 1, wherein, before receiving the file search request carrying text keywords, the method further comprises:读取当前文件系统中的文件;Read a file in the current file system;针对每个所述文件,根据所述文件的文件后缀名、文件大小以及文件存储格式,判断所述文件是否为文本文件;For each of the files, determine whether the file is a text file according to the file suffix name, file size and file storage format of the file;若所述文件为文本文件,基于所述文件的文件名以及文本内容,创建文本文件索引,或者,若所述文件为非文本文件,基于所述文件的文件名,创建非文本文件索引;If the file is a text file, create a text file index based on the file name and text content of the file, or, if the file is a non-text file, create a non-text file index based on the file name of the file;根据所述文本文件索引以及所述非文本文件索引,创建所述本地文件索引。The local file index is created according to the text file index and the non-text file index.3.根据权利要求2所述的方法,其特征在于,所述方法还包括:3. The method according to claim 2, wherein the method further comprises:通过应用程序将所述文件系统过滤驱动加载到操作系统中;Loading the file system filter driver into the operating system through an application program;通过加载后的所述文件系统过滤驱动,监听所述所有文件发生的操作事件;Listening to operation events of all files through the loaded file system filter driver;将所述操作事件回调至所述文件系统过滤驱动,并通过所述文件系统过滤驱动将所述操作事件反馈至所述应用程序;Calling back the operation event to the file system filter driver, and feeding back the operation event to the application through the file system filter driver;通过所述应用程序,对所述本地文件索引中与所述操作事件对应的文件进行更新。The file corresponding to the operation event in the local file index is updated through the application program.4.根据权利要求3所述的方法,其特征在于,所述操作事件为文件创建事件,所述通过所述应用程序,对所述本地文件索引中与所述操作事件对应的文件进行更新包括:4. The method according to claim 3, wherein the operation event is a file creation event, and updating the file corresponding to the operation event in the local file index through the application program comprises :通过所述应用程序,判断所述文件创建事件对应的第一文件是否为文本文件;Through the application program, it is judged whether the first file corresponding to the file creation event is a text file;若所述文件创建事件对应的第一文件为文本文件,更新所述本地文件索引中针对所述第一文件的文件名以及文本内容;或,If the first file corresponding to the file creation event is a text file, update the file name and text content of the first file in the local file index; or,若所述文件创建事件对应的第一文件为非文本文件,更新所述本地文件索引中针对所述第一文件的文件名。If the first file corresponding to the file creation event is a non-text file, update the file name of the first file in the local file index.5.根据权利要求3所述的方法,其特征在于,所述操作事件为文件删除事件,所述通过所述应用程序,对所述本地文件索引中与所述操作事件对应的文件进行更新包括:5. The method according to claim 3, wherein the operation event is a file deletion event, and updating the file corresponding to the operation event in the local file index through the application program comprises :通过所述应用程序,删除所述本地文件索引中所述文件删除事件对应的第二文件。Through the application program, delete the second file corresponding to the file deletion event in the local file index.6.根据权利要求3所述的方法,其特征在于,所述操作事件为文件修改事件,所述通过所述应用程序,对所述本地文件索引中与所述操作事件对应的文件进行更新包括:6. The method according to claim 3, wherein the operation event is a file modification event, and updating the file corresponding to the operation event in the local file index through the application program comprises :通过所述应用程序,判断所述文件修改事件对应的第三文件是否为文本文件;Through the application program, it is judged whether the third file corresponding to the file modification event is a text file;若所述文件修改事件对应的第三文件为文本文件,更新所述本地文件索引中针对所述第三文件的文件名以及文本内容;或,If the third file corresponding to the file modification event is a text file, update the file name and text content of the third file in the local file index; or,若所述文件修改事件对应的第三文件为非文本文件,更新所述本地文件索引中针对所述第三文件的文件名。If the third file corresponding to the file modification event is a non-text file, update the file name of the third file in the local file index.7.根据权利要求3至6中任一项所述的方法,其特征在于,所述应用程序的生命周期、所述文件系统过滤驱动的生命周期以及所述操作系统的生命周期三者保持一致。7. The method according to any one of claims 3 to 6, wherein the life cycle of the application program, the life cycle of the file system filter driver and the life cycle of the operating system are consistent .8.一种文件查找装置,其特征在于,所述文件查找装置包括:8. A file search device, characterized in that the file search device comprises:接收模块,用于接收携带有文本关键词的文件查找请求;A receiving module, configured to receive a file search request carrying text keywords;搜索模块,用于根据所述文本关键词,在基于文件系统过滤驱动的本地文件索引中进行搜索,获得目标文件,其中,所述目标文件的文件名与所述文本关键词匹配,或,所述目标文件的文本内容与所述文本关键词匹配;The search module is configured to search the local file index based on the file system filter driver according to the text keyword to obtain the target file, wherein the file name of the target file matches the text keyword, or, the The text content of the target file is matched with the text keyword;输出模块,用于输出所述目标文件的存储地址。An output module, configured to output the storage address of the target file.9.一种电子设备,其特征在于,所述电子设备包括处理器和存储器,所述处理器用于执行存储器中存储的计算机程序以实现如权利要求1至7中任意一项所述的文件查找方法。9. An electronic device, characterized in that the electronic device comprises a processor and a memory, and the processor is used to execute a computer program stored in the memory to realize the file search according to any one of claims 1 to 7 method.10.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有至少一个指令,所述至少一个指令被处理器执行时实现如权利要求1至7中任意一项所述的文件查找方法。10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores at least one instruction, and when the at least one instruction is executed by a processor, it realizes any one of claims 1 to 7. file lookup method.
CN201910431477.8A2019-05-222019-05-22File search method, device, electronic equipment and storage mediumPendingCN110147350A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201910431477.8ACN110147350A (en)2019-05-222019-05-22File search method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201910431477.8ACN110147350A (en)2019-05-222019-05-22File search method, device, electronic equipment and storage medium

Publications (1)

Publication NumberPublication Date
CN110147350Atrue CN110147350A (en)2019-08-20

Family

ID=67592768

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201910431477.8APendingCN110147350A (en)2019-05-222019-05-22File search method, device, electronic equipment and storage medium

Country Status (1)

CountryLink
CN (1)CN110147350A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN113793609A (en)*2021-09-072021-12-14米茂(上海)数字技术有限公司File uploading method based on voice recognition
CN113900995A (en)*2020-06-222022-01-07江苏税软软件科技有限公司 A Tax Intelligence Method for Searching Documents
WO2022022466A1 (en)*2020-07-312022-02-03华为技术有限公司Method and apparatus for determining file storage position, and terminal
CN114139132A (en)*2021-12-062022-03-04中国民航信息网络股份有限公司 A software verification method and device
CN116561071A (en)*2023-04-282023-08-08中国工商银行股份有限公司File searching method and device, storage medium and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN1808426A (en)*2005-01-172006-07-26马岩Universal file search system and method
CN101799741A (en)*2009-02-092010-08-11联想(北京)有限公司Storage data reading device and method
CN102968501A (en)*2012-12-072013-03-13福建亿榕信息技术有限公司 A General Full-text Search Method
US20150254350A1 (en)*2014-03-042015-09-10Qbase, LLCMethod for entity enrichment of digital content to enable advanced search functionality in content management systems
CN106407450A (en)*2016-09-302017-02-15网易(杭州)网络有限公司File searching method and apparatus

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN1808426A (en)*2005-01-172006-07-26马岩Universal file search system and method
CN101799741A (en)*2009-02-092010-08-11联想(北京)有限公司Storage data reading device and method
CN102968501A (en)*2012-12-072013-03-13福建亿榕信息技术有限公司 A General Full-text Search Method
US20150254350A1 (en)*2014-03-042015-09-10Qbase, LLCMethod for entity enrichment of digital content to enable advanced search functionality in content management systems
CN106407450A (en)*2016-09-302017-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 (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN113900995A (en)*2020-06-222022-01-07江苏税软软件科技有限公司 A Tax Intelligence Method for Searching Documents
WO2022022466A1 (en)*2020-07-312022-02-03华为技术有限公司Method and apparatus for determining file storage position, and terminal
US12222897B2 (en)2020-07-312025-02-11Huawei Technologies Co., Ltd.File storage location determining method and apparatus, and terminal
CN113793609A (en)*2021-09-072021-12-14米茂(上海)数字技术有限公司File uploading method based on voice recognition
CN114139132A (en)*2021-12-062022-03-04中国民航信息网络股份有限公司 A software verification method and device
CN116561071A (en)*2023-04-282023-08-08中国工商银行股份有限公司File searching method and device, storage medium and electronic equipment

Similar Documents

PublicationPublication DateTitle
CN110147350A (en)File search method, device, electronic equipment and storage medium
CN107704202B (en)Method and device for quickly reading and writing data
CN110110543A (en)Data processing method, device, server and storage medium
CN105550252B (en) A file positioning method, device and electronic equipment
CN107463693A (en)A kind of data processing method, device, terminal and computer-readable recording medium
AU2017216520A1 (en)Common data repository for improving transactional efficiencies of user interactions with a computing device
US20220083507A1 (en)Trust chain for official data and documents
WO2021174836A1 (en)Differential package generation method and apparatus, computer device, and storage medium
CN112131181B (en)Display method and device of storage path and electronic equipment
CN111651424B (en)Data processing method, device, data node and storage medium
US12386837B2 (en)Memory graph query engine with persisted storage
CN114461790A (en)Automatic news event theme generation method and device, electronic equipment and storage medium
CN107590248B (en)Search method, search device, search terminal and computer-readable storage medium
CN112559913A (en)Data processing method and device, computing equipment and readable storage medium
CN110209680A (en)Data-updating method, device and electronic device based on Hive external table
CN113760860A (en)Data reading method and device
US20210103577A1 (en)Reliable detection of deleted assets in data stores
WO2021092848A1 (en)Text classification for input method editor
CN112422668B (en)Storage method and device for network community, electronic equipment and readable medium
CN112507100B (en)Update processing method and device of question-answering system
CN112260935B (en) Message processing method, apparatus, electronic device and readable storage medium
CN115080646A (en)Data filtering method and device, computer equipment and storage medium
CN115080521A (en)Information display method and device, electronic equipment and storage medium
CN114564459A (en) Log file storage method, apparatus, device, and computer-readable storage medium
CN113703760A (en)Page jump control method and device

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
RJ01Rejection of invention patent application after publication

Application publication date:20190820

RJ01Rejection of invention patent application after publication

[8]ページ先頭

©2009-2025 Movatter.jp