A file search method and computing device
By executing a file search method in the operating system of the computing device, the problem of inaccurate search results when files are modified or added is solved, and more accurate and efficient file search results are achieved.
Patent Information
- Application Number
- CN202110896464.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-05
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2041-08-05
AI Technical Summary
When existing file search methods are modified or added, the search results are inaccurate and the search efficiency is inefficient.
By executing a file search method in an operating system of a computing device, the method includes receiving a search request, obtaining search information, searching for relevant indexes, determining whether the file modification time has changed, updating the index list, and performing operations again based on the updated index list. Search, and ultimately return the final search results.
Ensuring that the returned search results are more accurate and reliable, improve the accuracy of file search, and improve the efficiency of the update index list and further search.
Smart Images

Figure CN113535642B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a file search method and a computing device. Background Art
[0002] File manager is one of the essential applications of computer operating system, and file search is a function that users often use in file manager. The implementation of full-text search is to read the file content in advance, create an index based on the read file content, and when the user searches for keywords, search the index based on the keywords and return the search results.
[0003] At present, the Lucene search framework is generally used to build indexes. The search process is mainly divided into the following steps: 1. The user enters the query statement; 2. The query statement is subjected to lexical analysis, syntax analysis, and language processing; 3. The index is searched to obtain documents that conform to the syntax tree; 4. The results are sorted according to the relevance of the obtained documents and the query statement. Based on the above search process, when the file is modified or there is a new file, the search results are inaccurate.
[0004] In addition, existing search engines include Solr, ElasticSearch, Deepin anything, etc. Deepinanything is a memory search engine based on the UOS kernel. Solr and ElasticSearch are search engines written in Java and based on the Lucene library. On the MIPS platform, the operation efficiency of the JAVA virtual machine is not high. In addition, Solr builds indexes in real time, which sometimes causes IO blocking, resulting in low efficiency. Moreover, when the data continues to increase, the search efficiency will decrease.
[0005] Based on this, a file search method is needed to solve the problems of inaccurate search results and low search efficiency in the above technical solutions. Summary of the invention
[0006] To this end, the present invention provides a file search method to try to solve or at least alleviate the above problems.
[0007] According to one aspect of the present invention, a file search method is provided, which is executed in an operating system of a computing device, and the method includes: receiving a search request for a file from a client, and obtaining search information from the search request; searching for one or more associated first indexes from an index list based on the search information; determining whether the modification time of the file corresponding to each first index has changed; for each first index, if the modification time of the file corresponding to the first index has not changed, using the first index as the first search result; if the modification time of the file corresponding to the first index has changed, updating the index list based on the file with the changed modification time, and searching for one or more associated second indexes from the updated index list based on the search information, using the one or more second indexes as the second search result; and obtaining a final search result based on the first search result and the second search result, and returning the final search result to the client.
[0008] Optionally, in the file search method according to the present invention, the step of returning the final search result to the client includes: obtaining a union of the first search result and the second search result as the final search result; and returning the file corresponding to each index in the final search result to the client.
[0009] Optionally, in the file search method according to the present invention, the step of returning the final search result to the client includes: returning the file corresponding to each first index in the first search result to the client; removing the second index that is repeated with the first search result from the second search result, and returning the files corresponding to one or more second indexes after deduplication to the client.
[0010] Optionally, in the file search method according to the present invention, the step of returning the final search results to the client includes: determining a description document of one or more files associated with each index in the final search results based on the index list, the description document including description information of the files; returning the description information of the files corresponding to each index in the final search results to the client, so that the description information of the files corresponding to each index is displayed on the client.
[0011] Optionally, in the file search method according to the present invention, the step of determining whether the modification time of the file corresponding to each first index has changed further includes: if the modification time of the file corresponding to each first index has not changed, returning the first search result to the client.
[0012] Optionally, in the file search method according to the present invention, the index list is an inverted index list, the inverted index list includes multiple indexes, and the index is a vocabulary unit; wherein each index is associated with a description document of one or more files, and the description document includes one or more description information of file name, file path, modification time, and file content.
[0013] Optionally, in the file search method according to the present invention, before receiving a search request for a file from a client, the steps include: obtaining multiple files; creating a corresponding description document based on each file, the description document including one or more fields, wherein each field includes the path of the file, the modification time and the file content corresponding to the field; and creating an index list based on the description documents corresponding to the multiple files.
[0014] Optionally, in the file search method according to the present invention, the step of creating an index list based on the description documents corresponding to multiple files includes: extracting multiple vocabulary units based on the file content of the domains in the multiple description documents, and creating a corresponding index based on each vocabulary unit to generate an inverted index list.
[0015] Optionally, in the file search method according to the present invention, the step of updating the index list based on files whose modification time has changed includes: obtaining a modified file corresponding to the first index from a computing device; updating a corresponding description document based on the modified file; and updating the index list based on the updated description document.
[0016] Optionally, in the file search method according to the present invention, if the modification time of the file corresponding to the first index changes, it also includes the steps of: traversing each file to determine whether the modification time of each file has changed; if the modification time of the file has changed, determining that the file has been modified, and obtaining the modified file; and updating the corresponding description document based on the modified file, and updating the index list based on the updated description document.
[0017] Optionally, the file search method according to the present invention also includes the steps of: determining whether there are new files; if there are new files, obtaining the new files, creating a new description document based on the new files, and updating the index list based on the new description document.
[0018] Optionally, in the file search method according to the present invention, before creating a corresponding description document based on each file, it also includes the steps of: obtaining multiple files; determining the file type of each file, and calling a parser corresponding to the file type to parse the file to generate a string content.
[0019] Optionally, in the file search method according to the present invention, the step of determining the file type of each file includes: determining whether the file type is specified for each file, and if the file type is specified, determining the file type to be the specified file type; if the file type is not specified, determining the file type based on the extension of the file; if the file type cannot be determined based on the file extension, determining the file type based on the file content.
[0020] According to one aspect of the present invention, a computing device is provided, comprising: at least one processor; and a memory storing program instructions, wherein the program instructions are configured to be suitable for execution by the at least one processor, and the program instructions include instructions for executing the file search method as described above.
[0021] According to one aspect of the present invention, a readable storage medium storing program instructions is provided. When the program instructions are read and executed by a computing device, the computing device executes the method described above.
[0022] According to the technical solution of the present invention, a file search method is provided. After the first search index is performed according to the user's search information, by judging whether the modification time of the file corresponding to each first index in the first search result has changed, when the modification time has changed, the index list is updated according to the file after the modification time has changed, and the index search is performed again, and finally the final search result is returned to the user by combining the two search results. In this way, it can ensure that the final search result returned to the user is more accurate and reliable, and the accuracy of the file search is improved. Moreover, based on the first index in the first search result, the file whose modification time has changed is checked in a targeted manner, which is conducive to improving the efficiency of updating the index list and further searching for files. It can be seen that according to the technical solution of the present invention, not only the accuracy of the search results can be ensured, but also the search efficiency is high. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] To achieve the above and related purposes, certain illustrative aspects are described herein in conjunction with the following description and accompanying drawings, which indicate various ways in which the principles disclosed herein can be practiced, and all aspects and their equivalents are intended to fall within the scope of the claimed subject matter. The above and other purposes, features and advantages of the present disclosure will become more apparent by reading the following detailed description in conjunction with the accompanying drawings. Throughout the present disclosure, the same reference numerals generally refer to the same parts or elements.
[0024] Figure 1 A schematic diagram of a computing device 100 according to one embodiment of the present invention is shown;
[0025] Figure 2 A flowchart of a file search method 200 according to an embodiment of the present invention is shown;
[0026] Figure 3 An interactive schematic diagram showing a file search method according to an embodiment of the present invention; and
[0027] Figure 4 A schematic diagram of a description document according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0028] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0029] Figure 1 A schematic diagram of a computing device 100 according to one embodiment of the present invention is shown.
[0030] like Figure 1 As shown, in a basic configuration 102, computing device 100 typically includes system memory 106 and one or more processors 104. A memory bus 108 may be used for communication between processor 104 and system memory 106.
[0031] Depending on the desired configuration, the processor 104 may be any type of processing, including but not limited to: a microprocessor (UP), a microcontroller (UC), a digital information processor (DSP), or any combination thereof. The processor 104 may include one or more levels of cache, such as a primary cache 110 and a secondary cache 112, a processor core 114, and registers 116. An example processor core 114 may include an arithmetic logic unit (ALU), a floating point unit (FPU), a digital signal processing core (DSP core), or any combination thereof. An example memory controller 118 may be used with the processor 104, or in some implementations, the memory controller 118 may be an internal part of the processor 104.
[0032] Depending on the desired configuration, system memory 106 may be any type of memory, including but not limited to: volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.), or any combination thereof. System memory 106 may include an operating system 120, one or more applications 122, and program data 124. In some implementations, application 122 may be arranged to execute instructions on the operating system by one or more processors 104 using program data 124.
[0033] The computing device 100 may also include a storage interface bus 134. The storage interface bus 134 enables communication from storage devices 132 (e.g., removable storage 136 and non-removable storage 138) to the basic configuration 102 via the bus / interface controller 130. At least a portion of the operating system 120, the application 122, and the data 124 may be stored on the removable storage 136 and / or the non-removable storage 138, and when the computing device 100 is powered on or the application 122 is to be executed, it is loaded into the system memory 106 via the storage interface bus 134 and executed by one or more processors 104.
[0034] The computing device 100 may also include an interface bus 140 that facilitates communication from various interface devices (e.g., output devices 142, peripheral interfaces 144, and communication devices 146) to the basic configuration 102 via the bus / interface controller 130. Example output devices 142 include a graphics processing unit 148 and an audio processing unit 150. They can be configured to facilitate communication with various external devices such as a display or speakers via one or more A / V ports 152. Example peripheral interfaces 144 may include a serial interface controller 154 and a parallel interface controller 156, which may be configured to facilitate communication with external devices such as input devices (e.g., keyboards, mice, pens, voice input devices, touch input devices) or other peripherals (e.g., printers, scanners, etc.) via one or more I / O ports 158. Example communication devices 146 may include a network controller 160, which may be arranged to facilitate communication with one or more other computing devices 162 via a network communication link via one or more communication ports 164.
[0035] A network communication link can be an example of a communication medium. Communication media can generally be embodied as computer-readable instructions, data structures, program modules in a modulated data signal such as a carrier wave or other transmission mechanism, and can include any information delivery medium. A "modulated data signal" can be a signal in which one or more of its data sets or its changes can be performed in the signal in a manner that encodes information. As non-limiting examples, communication media can include wired media such as a wired network or a dedicated line network, and various wireless media such as sound, radio frequency (RF), microwave, infrared (IR) or other wireless media. The term computer-readable medium used herein can include both storage media and communication media.
[0036] The computing device 100 can be implemented as a personal computer including a desktop computer and a notebook computer configuration. Of course, the computing device 100 can also be implemented as a part of a small-sized portable (or mobile) electronic device, which can be a cellular phone, a digital camera, a personal digital assistant (PDA), a personal media player device, a wireless network browsing device, a personal head-mounted device, an application-specific device, or a hybrid device that can include any of the above functions. It can even be implemented as a server, such as a file server, a database server, an application server, and a WEB server. The embodiments of the present invention are not limited to this.
[0037] In an embodiment according to the present invention, the operating system of the computing device 100 is configured to execute the file search method 200 according to the present invention. The operating system of the computing device 100 includes a plurality of program instructions for executing the file search method 200 according to the present invention, so that the file search method 200 of the present invention can be executed in the operating system of the computing device 100.
[0038] In the embodiment according to the present invention, the operating system may be implemented as a Linux operating system, for example, but the present invention is not limited to a specific type of operating system.
[0039] According to one embodiment, the operating system of the computing device 100 includes one or more applications, and the one or more applications can be configured to execute the file search method 200 of the present invention. The one or more applications include, for example, a file manager, so that the file search method 200 of the present invention can be executed in the file manager. However, it should be noted that the application that executes the file search method 200 of the present invention is not limited to the file manager.
[0040] Figure 2 The flowchart of the file search method 200 according to one embodiment of the present invention is shown. The file search method 200 can be executed in an operating system of a computing device (such as the aforementioned computing device 100). The operating system can be implemented as a Linux operating system, for example, but the present invention is not limited thereto.
[0041] It should be noted that the computing device 100 includes a data storage device, and the data storage device can store various files. Here, the present invention does not limit the specific type of the file.
[0042] like Figure 2 As shown, the method 200 starts at step S210 .
[0043] In step S210, a search request for a file from a user at a client is received, and search information input by the user is obtained from the search request. Here, the search request includes the search information input by the user, and the search information is, for example, a keyword input by the user.
[0044] In one embodiment, the system desktop of the computing device 100 is suitable for presenting a file search interface, so that the user can communicate with the operating system on the client side based on the file search interface. Specifically, the user can request to search for files in the file search interface. For example, the user can enter corresponding search information (keywords) in the search box on the file search interface, and send a search request for files to the operating system of the computing device based on the search information. Subsequently, the operating system can obtain the search information entered by the user in response to the user's search request.
[0045] Figure 3 FIG. 2 shows an interactive schematic diagram of a file search method according to an embodiment of the present invention. Figure 3 As shown, the user can enter a corresponding search keyword in the file search interface so that the operating system can search for associated indexes based on the keyword.
[0046] It should also be noted that based on the search request sent by the user in the file search interface, a search scope for files can also be determined so as to search for files based on the corresponding search scope. Here, the search scope can include one or more file directories.
[0047] Then, in step S220, one or more associated indexes are searched from the current index list based on the search information, where the one or more indexes associated with the search information found based on the current index list are used as first indexes. That is, one or more associated first indexes are searched and obtained from the current index list based on the search information (keyword).
[0048] It should be noted that the index list includes multiple indexes, and each index can be associated with one or more files. In the operating system, a description document corresponding to each file can be pre-established, and the description document corresponding to the file can be associated with the corresponding index, so that each index in the index list can be associated with the description document of one or more files. Here, the description document corresponding to the file includes one or more description information corresponding to the file.
[0049] In one embodiment, the index may be a vocabulary unit pre-established based on the file content, and the description document corresponding to the file may include one or more description information of the file name, file path, modification time, and file content. Thus, the one or more indexes found based on the search information are the one or more vocabulary units associated with the search information, wherein the description document of one or more files associated with each index (vocabulary unit) may be determined.
[0050] Then, in step S230, it is determined whether the modification time of the file corresponding to each first index has changed. Figure 3. It should be noted that, based on the index list, one or more description documents corresponding to each first index can be determined, so that the modification time of the file in the description document can be determined. By determining the actual modification time of the file corresponding to the description document (i.e., the corresponding file stored in the data storage device of the computing device), judging whether the modification time in the description document corresponding to the file is consistent with the actual modification time of the corresponding file, it can be determined whether the modification time of the file corresponding to the first index has changed, and thus it can also be determined whether the file has been modified.
[0051] In step S240, for each first index, if it is determined that the modification time of the file corresponding to the first index has not changed, the first index is used as the first search result. Here, the first search result may include one or more first indexes. It can be understood that if the modification time of the file corresponding to one or more first indexes has not changed, the one or more first indexes are used as the first search result. In other words, the first search result is obtained by filtering the modification time of all the first indexes obtained in step S220, and the modification time of the file corresponding to each first index included in the first search result has not changed.
[0052] In step S250, for each first index, if it is determined that the modification time of the file corresponding to the first index has changed, it can be determined that the file corresponding to the first index has been modified, then one or more modified files corresponding to the first index (i.e., one or more files with changed modification time) are obtained, and the index list is updated based on the one or more files with changed modification time. Subsequently, based on the search information (keyword), one or more associated indexes (second indexes) are searched from the updated index list, and the one or more second indexes associated with the search information found from the updated index list are used as the second search results.
[0053] Finally, in step S260, a final search result is obtained based on the first search result and the second search result, and the final search result is returned to the client.
[0054] It should be noted that one or more second indexes in the second search result and one or more first indexes in the first search result may have one or more duplicate indexes. Based on this, one or more first indexes in the first search result and one or more second indexes in the second search result may be taken as a union, and the union of the first search result and the second search result may be obtained as the final search result. In other words, the final search result includes each first index in the first search result, and includes the second index in the second search result after removing the indexes that are duplicated with the first search result.
[0055] According to the method 200 of the present invention, after the first search index is performed according to the user's search information, by determining whether the modification time of the file corresponding to each first index in the first search result has changed, when the modification time has changed, the index list is updated according to the file after the modification time has changed, and the index search is performed again, and finally the final search result is returned to the user by combining the two search results. In this way, it can ensure that the final search result returned to the user is more accurate and reliable, and the accuracy of the file search is improved. Moreover, based on the first index in the first search result, the file whose modification time has changed is checked in a targeted manner, which is conducive to improving the efficiency of updating the index list and further searching for files.
[0056] In one embodiment, the final search results are returned to the client, and the file corresponding to each index in the final search results may be returned to the client, so that the user can view each file associated with the search information.
[0057] In one implementation, Figure 3 As shown, when returning the final result to the client, the file corresponding to each first index in the first search result may be returned to the client, and after removing the indexes that are repeated with the first search result from the second search result, the files corresponding to one or more second indexes after deduplication may be returned to the client. That is, while returning the first search result to the client, the index list may be updated based on one or more files whose modification time has changed, and then, based on the search information (keywords), the associated one or more second indexes may be searched from the updated index list as the second search result, and, after removing the second indexes that are repeated with the first search result from the second search result, the one or more second indexes after deduplication may be returned to the client.
[0058] In one embodiment, when the final search results are returned to the client, a description document of one or more files associated with each index in the final search results can be determined based on the index list, and the description information of the file can be obtained based on the description document. Subsequently, the description information of the file corresponding to each index in the final search results can be returned to the client. In this way, the description information of the file corresponding to each index in the final search results can be displayed on the file search interface of the client, so that the user can view the description information of each file associated with the search information. In addition, the user can obtain the file based on the file path corresponding to the file.
[0059] It should also be noted that if the modification time of the file corresponding to each first index has not changed, the first search result is directly returned to the client. Here, that is, the file corresponding to each first index in the first search result is returned to the client so that the user can view each file associated with the search information. In one implementation, the description information (description information in the description document) of the file corresponding to each first index in the first search result can be returned to the client.
[0060] According to one embodiment, before receiving a search request for a file from a client, an index list is first created. Specifically, multiple files stored in a data storage device of a computing device are obtained, and then corresponding description documents are created based on each file, that is, description documents corresponding to each file are created, and the description documents include description information corresponding to the file.
[0061] Figure 4 FIG. 4 is a schematic diagram showing a description document according to an embodiment of the present invention. Figure 4 As shown, each description document may include one or more fields, and each field includes the path of the corresponding file (absolute file path), modification time, and the file content corresponding to the field.
[0062] Subsequently, an index list is created based on the multiple description documents corresponding to the multiple files. Here, one or more vocabulary units can be generated by analyzing and processing the file content in each domain of each description document, for example, by extracting words from the file content, converting letters to lowercase, removing punctuation marks, removing common words, etc. In this way, multiple vocabulary units can be finally extracted from the file content of multiple domains in multiple description documents. Furthermore, a corresponding index is created based on each vocabulary unit, that is, an index corresponding to each vocabulary unit is established respectively. Finally, an inverted index list is generated based on multiple indexes. Here, the inverted index list can include multiple indexes, each index is respectively associated with a description document corresponding to one or more files. Among them, the description document can include one or more description information of the file name, file path, modification time, and file content.
[0063] In one implementation, each description document includes a description document identifier uniquely corresponding thereto. The inverted index list includes multiple indexes and one or more description document identifiers associated with each index. In this way, the description document identifier associated with each index can be determined based on the inverted index list, the corresponding description document can be determined based on the description document identifier, and the description information in the corresponding description document can be obtained.
[0064] It should also be noted that a document library can be constructed based on the pre-established description documents corresponding to each file, and an inverted index structure can be constructed based on the association relationship between each index in the inverted index list and the corresponding description document in the document library. Based on this inverted index structure, after obtaining the search information input by the user, one or more indexes associated with the search information can be searched in the inverted index list according to the search information input by the user, and based on each searched index, the description document of one or more files corresponding to the index can be determined, the description information in the description document can be obtained, and the corresponding file can be obtained based on the file path in the description information.
[0065] In one embodiment, after acquiring each file stored in the data storage device of the computing device, the file needs to be parsed according to the file type to generate a string content, and then a description document corresponding to the file is created according to the string content.
[0066] Specifically, the file type of each file is determined. Here, first, it is determined whether each file specifies a file type. If the file type is specified, the file type is determined to be the specified file type. If the file type is not specified, the file type is determined according to the file extension (suffix). After the file type is determined, a parser corresponding to the file type can be called to parse the file to generate a string content.
[0067] If the file type cannot be determined based on the file extension, or if a format error occurs when calling the parser to parse the file, the file type is determined based on the file content by detecting the file content, and then the parser corresponding to the determined file type is called, and the file is parsed based on the parser to obtain the corresponding string content.
[0068] In one implementation, the file search method 200 of the present invention can be implemented based on the full-text search engine framework LucenePlusPlus. LucenePlusPlus is a full-text search engine framework implemented in C++ based on the Lucene open source library. Based on this search engine framework, not only can full-text retrieval and search be achieved, the search efficiency is high, and it is compatible with a variety of different hardware platforms, solving the problem that the Java virtual machine cannot run perfectly on ARM and MIPS.
[0069] In one implementation, the file types may include DOC, DOCX, XLS, XLSX, PPT, PPTX, RTF, TXT, ZIP, WPS, DOT, ODT, ODS, ODP, HTML, XML, etc. It can be seen that the present invention adds support for WPS file types. However, it should be noted that the present invention is not limited to the file types listed above. By calling the parser corresponding to the file type to parse the file, the file content can be converted into a string, such as a QString string. Based on the QString string, an index can be established in the C++ version of the Lucene library LucenePlusPlus.
[0070] According to one embodiment, if the modification time of the file corresponding to the first index is changed in step S250, updating the index list based on the file with the changed modification time can be performed according to the following method: obtaining the modified file corresponding to the first index from the data storage device of the computing device based on the corresponding file path, and updating the description document corresponding to the file based on the modified file. Here, each field in the updated description document includes the path of the modified file (absolute file path), the modification time and the file content corresponding to the field. Subsequently, the index list is updated based on the updated description document.
[0071] According to another embodiment, if the modification time of the file corresponding to the first index changes, the index list can also be updated by executing the following method: traverse each file stored in the data storage device of the computing device to determine whether the modification time of each file has changed. Specifically, by determining the modification time in the description document corresponding to each file and determining the actual modification time of the file corresponding to the description document, it is determined whether the modification time in the description document is consistent with the actual modification time of the corresponding file stored in the computing device, thereby determining whether the modification time of the file has changed. If they are inconsistent, it is determined that the modification time of the file has changed; if they are consistent, it is determined that the modification time of the file has not changed.
[0072] If the modification time of the file changes, it is determined that the file is modified, and the modified file is obtained. Subsequently, the corresponding description document is updated based on the modified file, and the index list is updated based on the updated description document.
[0073] In addition, in one embodiment, when traversing each file, it is also determined whether there is a new file. If there is a new file, the new file is obtained, a new description document corresponding to the new file is created based on the new file, and the index list is updated based on the new description document.
[0074] It should be noted that in another embodiment, by traversing all files stored in the computing device, the modification time of each file is checked to see if it has changed, and the index list is updated based on the checked modified files. In this way, the target index associated with the search information can be searched more accurately and comprehensively based on the updated index list.
[0075] In one implementation, the parsers corresponding to each type of file include:
[0076] parseRTF[PlainTextExtractor::Implementation]
[0077] parseODFOOXML[PlainTextExtractor::Implementation]
[0078] parseXLS[PlainTextExtractor::Implementation]
[0079] parseDOC[PlainTextExtractor::Implementation]
[0080] parsePPT[PlainTextExtractor::Implementation]
[0081] parseHTML[PlainTextExtractor::Implementation]
[0082] parseIWork[PlainTextExtractor::Implementation]
[0083] parseXLSB[PlainTextExtractor::Implementation]
[0084] parsePDF[PlainTextExtractor::Implementation]
[0085] parseTXT[PlainTextExtractor::Implementation]
[0086] parseEML[PlainTextExtractor::Implementation]
[0087] parseODFXML[PlainTextExtractor::Implementation]
[0088] parseRTFMetadata[PlainTextExtractor::Implementation]
[0089] parseODFOOXMLMetadata[PlainTextExtractor::Implementation]
[0090] parseXLSMetadata[PlainTextExtractor::Implementation]
[0091] parseDOCMetadata[PlainTextExtractor::Implementation]
[0092] parsePPTMetadata[PlainTextExtractor::Implementation]
[0093] parseHTMLMetadata[PlainTextExtractor::Implementation]
[0094] parseIWorkMetadata[PlainTextExtractor::Implementation]
[0095] parseXLSBMetadata[PlainTextExtractor::Implementation]
[0096] parsePDFMetadata[PlainTextExtractor::Implementation]
[0097] parseEMLMetadata[PlainTextExtractor::Implementation]
[0098] parseODFXMLMetadata[PlainTextExtractor::Implementation]
[0099] In addition, the parsers corresponding to the WPS file types are as follows:
[0100] parseWPS[PlainTextExtractor::Implementation]
[0101] parseWPT[PlainTextExtractor::Implementation]
[0102] parseET[PlainTextExtractor::Implementation]
[0103] parseETT[PlainTextExtractor::Implementation]
[0104] parseDPS[PlainTextExtractor::Implementation]
[0105] parseDPT[PlainTextExtractor::Implementation]
[0106] According to the above-mentioned parsers corresponding to various types of files, it is possible to parse various types of files, thereby achieving full-text retrieval of various types of files including WPS file types.
[0107] According to the file search method of the present invention, after the first search index is searched according to the user's search information, by judging whether the modification time of the file corresponding to each first index in the first search result has changed, when the modification time has changed, the index list is updated according to the file after the modification time has changed, and the index search is performed again, and finally the final search result is returned to the user by combining the two search results. In this way, it can ensure that the final search result returned to the user is more accurate and reliable, and the accuracy of the file search is improved. Moreover, based on the first index in the first search result, the file whose modification time has changed is checked in a targeted manner, which is conducive to improving the efficiency of updating the index list and further searching for files. It can be seen that the technical solution of the present invention can not only ensure the accuracy of the search results, but also have high search efficiency.
[0108] A9. A method as described in any one of A6-A8, wherein the step of updating the index list based on files whose modification time has changed comprises: obtaining a modified file corresponding to the first index from a computing device; updating a corresponding description document based on the modified file; and updating the index list based on the updated description document.
[0109] A10. A method as described in any one of A6-A9, wherein, if the modification time of the file corresponding to the first index changes, it also includes the steps of: traversing each file to determine whether the modification time of each file has changed; if the modification time of the file has changed, determining that the file has been modified, and obtaining the modified file; and updating the corresponding description document based on the modified file, and updating the index list based on the updated description document.
[0110] A11. The method as described in A10 further includes the steps of: determining whether there is a new file; if there is a new file, obtaining the new file, creating a new description document based on the new file, and updating the index list based on the new description document.
[0111] A12. The method as described in A7, wherein before creating a corresponding description document based on each file, it also includes the steps of: obtaining multiple files; determining the file type of each file, and calling a parser corresponding to the file type to parse the file to generate a string content.
[0112] A13. A method as described in A12, wherein the step of determining the file type of each file includes: determining whether a file type is specified for each file, and if so, determining the file type to be the specified file type; if the file type is not specified, determining the file type based on the file extension; if the file type cannot be determined based on the file extension, determining the file type based on the file content.
[0113] The various techniques described herein may be implemented in combination with hardware or software, or a combination thereof. Thus, the method and apparatus of the present invention, or some aspects or parts of the method and apparatus of the present invention may be in the form of program codes (i.e., instructions) embedded in a tangible medium, such as a removable hard disk, a USB flash drive, a floppy disk, a CD-ROM, or any other machine-readable storage medium, wherein when the program is loaded into a machine such as a computer and executed by the machine, the machine becomes a device for practicing the present invention.
[0114] In the case where the program code is executed on a programmable computer, the computing device generally includes a processor, a storage medium readable by the processor (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device. The memory is configured to store the program code; the processor is configured to execute the multilingual junk text recognition method of the present invention according to the instructions in the program code stored in the memory.
[0115] By way of example and not limitation, readable media include readable storage media and communication media. Readable storage media stores information such as computer readable instructions, data structures, program modules or other data. Communication media generally embody computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and include any information transfer medium. Any combination of the above is also included within the scope of readable media.
[0116] In the description provided herein, algorithms and displays are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the examples of the present invention. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages can be utilized to implement the content of the present invention described herein, and the above description of specific languages is for the purpose of disclosing the best mode of the present invention.
[0117] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0118] Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, the various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the following intention: that the claimed invention requires more features than the features explicitly recited in each claim. More specifically, as reflected in the claims below, inventive aspects lie in less than all the features of the individual embodiments disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present invention.
[0119] Those skilled in the art will appreciate that the modules or units or components of the devices in the examples disclosed herein may be arranged in the devices described in the embodiment, or alternatively may be located in one or more devices different from the devices in the examples. The modules in the foregoing examples may be combined into one module or may be divided into multiple submodules.
[0120] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0121] In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present invention and form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.
[0122] In addition, some of the embodiments are described herein as methods or combinations of method elements that can be implemented by a processor of a computer system or by other devices that perform the functions. Therefore, a processor with necessary instructions for implementing the method or method elements forms a device for implementing the method or method elements. In addition, the elements described herein of the device embodiments are examples of devices for implementing the functions performed by the elements for the purpose of implementing the invention.
[0123] As used herein, unless otherwise specified, the use of ordinal numbers "first," "second," "third," etc. to describe common objects merely indicates that different instances of similar objects are involved, and is not intended to imply that the objects so described must have a given order in time, space, order, or in any other manner.
[0124] Although the present invention has been described according to a limited number of embodiments, it will be apparent to those skilled in the art, with the benefit of the above description, that other embodiments may be envisioned within the scope of the invention thus described. In addition, it should be noted that the language used in this specification is selected primarily for readability and teaching purposes, rather than for explaining or defining the subject matter of the present invention. Therefore, many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the appended claims. The disclosure of the present invention is illustrative, not restrictive, with respect to the scope of the present invention, which is defined by the appended claims.
Claims
1. A file search method, executed in an operating system of a computing device, the method comprising: Receiving a search request for a file from a client, and obtaining search information from the search request; Based on the search information, searching for one or more associated first indexes from an index list, wherein the index list is an inverted index list, the inverted index list includes multiple indexes, and the index is a vocabulary unit, wherein each index is respectively associated with a description document of one or more files, and the description document includes one or more description information of the file name, file path, modification time, and file content; Determine whether the modification time of the file corresponding to each first index has changed; For each first index, if the modification time of the file corresponding to the first index has not changed, taking the first index as the first search result; If the modification time of the file corresponding to the first index is changed, the index list is updated based on the file with the changed modification time, and one or more associated second indexes are searched from the updated index list based on the search information, and the one or more second indexes are used as second search results, wherein updating the index list based on the file with the changed modification time includes: acquiring a modified file corresponding to the first index from a computing device, updating a corresponding description document based on the modified file, and updating the index list based on the updated description document; Obtaining a final search result based on the first search result and the second search result, and returning the final search result to the client, includes: obtaining a union of the first search result and the second search result as the final search result, and returning a file corresponding to each index in the final search result to the client.
2. The method of claim 1, wherein: The step of returning the final search result to the client comprises: Returning the file corresponding to each first index in the first search result to the client; The second indexes that are duplicated with the first search results are removed from the second search results, and the files corresponding to the one or more second indexes after deduplication are returned to the client.
3. The method of claim 1, wherein: The step of returning the final search result to the client comprises: Determine, based on the index list, a description document of one or more files associated with each index in the final search result, wherein the description document includes description information of the file; The description information of the file corresponding to each index in the final search result is returned to the client, so that the description information of the file corresponding to each index is displayed on the client.
4. The method according to any one of claims 1 to 3, wherein: The step of determining whether the modification time of the file corresponding to each first index has changed also includes: If the modification time of the files corresponding to each first index has not changed, the first search result is returned to the client.
5. The method according to any one of claims 1 to 3, wherein: Before receiving a client's request for searching a file, the process includes the following steps: Get multiple files; Creating a corresponding description document based on each file, the description document comprising one or more fields, wherein each field comprises a path of the file, a modification time, and a file content corresponding to the field; Create an index list based on the description documents corresponding to multiple files.
6. The method of claim 5, wherein: The steps of creating an index list based on the description documents corresponding to the multiple files include: A plurality of vocabulary units are extracted based on the file contents of the domains in the plurality of description documents, and a corresponding index is created based on each vocabulary unit so as to generate an inverted index list.
7. The method according to any one of claims 1 to 3, wherein: If the modification time of the file corresponding to the first index changes, the method further includes the steps of: Traverse each file and determine whether the modification time of each file has changed; If the modification time of the file changes, it is determined that the file is modified, and the modified file is obtained; as well as The corresponding description document is updated based on the modified file, and the index list is updated based on the updated description document.
8. The method of claim 7, wherein: Also includes the steps: Determine whether there is a new file; If there is a newly added file, the newly added file is obtained, a new description document is created based on the newly added file, and the index list is updated based on the new description document.
9. The method of claim 5, wherein: Before creating the corresponding description document based on each file, the following steps are also included: Get multiple files; The file type of each file is determined, and a parser corresponding to the file type is called to parse the file to generate a string content.
10. The method of claim 9, wherein: The steps to determine the file type of each file include: Determine whether a file type is specified for each file, and if a file type is specified, determine that the file type is the specified file type; If the file type is not specified, the file type is determined based on the file's extension; If the file type cannot be determined based on the file extension, the file type is determined based on the file content.
11. A computing device comprising: at least one processor; as well as A memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, and the program instructions include instructions for executing the method according to any one of claims 1 to 10.
12. A readable storage medium storing program instructions, when the program instructions are read and executed by a computing device, the computing device executes the method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Lucene-based desktop searching system and method
CN102819592A