Document searching method and device

By acquiring the document directory structure and using an artificial intelligence model to locate target directory items, combined with search strategies based on semantic similarity and string matching, the problem of low efficiency in long document search is solved, achieving efficient and accurate document search.

CN121880482APending Publication Date: 2026-04-17ZHUHAI KINGSOFT OFFICE SOFTWARE +2
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHUHAI KINGSOFT OFFICE SOFTWARE
Filing Date
2025-12-04
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing document search technologies are inefficient and computationally expensive in long documents, making it difficult to meet the needs of real-time interaction.

Method used

By obtaining the document's directory structure information, we use artificial intelligence models to analyze the correlation between search characters and directory items, locate the target directory items and their page number ranges, and search within that range. We then combine semantic similarity matching and string matching to optimize the search strategy.

Benefits of technology

It significantly improves the efficiency of long document search, enhances the accuracy and relevance of search results, and achieves synergistic optimization of search quality and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121880482A_ABST
    Figure CN121880482A_ABST
Patent Text Reader

Abstract

The invention relates to a document search method and device. The method comprises the following steps: obtaining search characters and a to-be-searched document; obtaining directory structure information of the document; inputting the search character and the directory structure information into an artificial intelligence model, and outputting a target directory entry associated with the search character through the artificial intelligence model; and searching the search character in the document content in the page number range corresponding to the target directory entry to obtain a search result. Therefore, the searching efficiency of the long document is remarkably improved, and meanwhile, the accuracy of the searching result is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computers, and more particularly to a document search method and apparatus. Background Technology

[0002] In the fields of document processing and information retrieval, keyword matching-based search technology has been widely applied. To improve the semantic understanding capabilities of searches, the industry has successively introduced semantic matching methods based on natural language processing technology. These methods map text into vector representations in a high-dimensional space and evaluate semantic relevance based on vector distance, thereby identifying content similar to the search terms to a certain extent.

[0003] However, existing semantic search solutions still face many challenges in practical deployment: when faced with lengthy or complex technical documents, reports and other materials, performing semantic analysis and matching on the entire text will result in huge computational overhead, leading to response delays and making it difficult to meet the needs of real-time interaction. Summary of the Invention

[0004] This application provides a document search method and apparatus to solve the technical problems of insufficient flexibility and low efficiency in searching long documents in practical applications of existing document search technologies.

[0005] Firstly, this application provides a document search method, the method comprising: Retrieve the search characters and the document to be searched; Obtain the directory structure information of the document; The search characters and the directory structure information are input into the artificial intelligence model, and the target directory item associated with the search characters is output by the artificial intelligence model. The search character is searched within the document content of the page range corresponding to the target directory item to obtain the search results.

[0006] In one possible implementation, after searching for the search character within the document content of the page number range corresponding to the target directory item and obtaining the search results, the method further includes: Define the page number range corresponding to the target directory item as the first search range, and define the part of the document other than the first search range as the second search range; Within the document content of the second search scope, a supplementary search is performed based on the search results.

[0007] In one possible implementation, the supplementary search based on the search results within the document content of the second search scope includes: Within the document content of the second search scope, at least one matching item is searched for that is identical to the content of the matching item in the search results using string matching.

[0008] In one possible implementation, before obtaining the directory structure information of the document, the method further includes: Determine the number of pages in the document; If the number of pages exceeds a set threshold, the steps of obtaining the document's directory structure information and subsequent steps are executed.

[0009] In one possible implementation, the method further includes: If the number of pages is less than or equal to the set threshold, the search character is searched in the entire document content to obtain the search results.

[0010] In one possible implementation, searching for the search characters includes: By using semantic similarity matching, at least one match that is semantically similar to the search characters is searched.

[0011] In one possible implementation, the step of searching for the search characters to obtain search results further includes: Search for at least one match that is identical to the search characters using string matching.

[0012] In one possible implementation, searching for at least one match that is semantically similar to the search characters using a semantic similarity matching method includes: The document content within the current search scope is segmented into words to obtain a set of segmentation units; The search character and each word segmentation unit in the word segmentation unit set are respectively converted into word vectors; Determine the similarity between the word vector of the search character and the word vector of each of the word segmentation units; Based on the similarity, at least one match that is semantically similar to the search character is determined from the set of word segmentation units.

[0013] In one possible implementation, the step of segmenting the document content within the current search scope to obtain multiple segmentation units includes: The document content within the current search range is segmented into words to obtain an initial set of segmentation units; The initial word segmentation units in the initial word segmentation unit set are standardized. Based on a pre-defined stop word list, stop words are filtered out from the initial set of segmented units after standardization, forming the final set of segmented units.

[0014] In one possible implementation, the method further includes: The search results are displayed visually on the front-end interface.

[0015] In one possible implementation, after obtaining the search characters, the method further includes: Obtain user historical behavior data; The search characters and the user's historical behavior data are input into the intent analysis model, and the intent analysis model outputs the optimized search characters. Replace the original search characters with the optimized search characters and proceed with the next steps.

[0016] In one possible implementation, after searching for the search character within the document content of the page range corresponding to the target directory entry and obtaining the search results, the method further includes: In response to determining that the search results do not meet the preset conditions, an extended search strategy is executed to obtain extended search results; The implementation of the extended search strategy includes at least one of the following methods: Trigger an online search and expand the page range corresponding to the target directory item to the pages before and after it to form an expanded search range.

[0017] Secondly, this application provides a document search device, the device comprising: The acquisition module is used to acquire the search characters and the document to be searched; The parsing module is used to obtain the directory structure information of the document; The model prediction module is used to input the search characters and the directory structure information into the artificial intelligence model, and output the target directory item associated with the search characters through the artificial intelligence model. The search module is used to search for the search characters in the document content within the page number range corresponding to the target directory item, and obtain the search results.

[0018] In one possible implementation, the search module is further configured to: In the document content within the page number range corresponding to the target directory item, the search character is searched, and after obtaining the search results, the page number range corresponding to the target directory item is defined as the first search range, and the part of the document other than the first search range is defined as the second search range. Within the document content of the second search scope, a supplementary search is performed based on the search results.

[0019] In one possible implementation, the search module performs supplementary searches within the document content of the second search scope, based on the search results, including: Within the document content of the second search scope, at least one matching item is searched for that is identical to the content of the matching item in the search results using string matching.

[0020] In one possible implementation, the device further includes: The page number determination module is used to determine the number of pages of the document before obtaining the directory structure information of the document; If the number of pages exceeds a set threshold, the steps of obtaining the document's directory structure information and subsequent steps are executed.

[0021] In one possible implementation, the search module is further configured to: If the number of pages is less than or equal to the set threshold, the search character is searched in the entire document content to obtain the search results.

[0022] In one possible implementation, the search module searches for the search characters, including: By using semantic similarity matching, at least one match that is semantically similar to the search characters is searched.

[0023] In one possible implementation, the search module searches for the search characters to obtain search results, and further includes: Search for at least one match that is identical to the search characters using string matching.

[0024] In one possible implementation, the search module searches for at least one match that is semantically similar to the search characters using a semantic similarity matching method, including: The document content within the current search scope is segmented into words to obtain a set of segmentation units; The search character and each word segmentation unit in the word segmentation unit set are respectively converted into word vectors; Determine the similarity between the word vector of the search character and the word vector of each of the word segmentation units; Based on the similarity, at least one match that is semantically similar to the search character is determined from the set of word segmentation units.

[0025] In one possible implementation, the search module performs word segmentation on the document content within the current search range to obtain multiple word segmentation units, including: The document content within the current search range is segmented into words to obtain an initial set of segmentation units; The initial word segmentation units in the initial word segmentation unit set are standardized. Based on a pre-defined stop word list, stop words are filtered out from the initial set of segmented units after standardization, forming the final set of segmented units.

[0026] In one possible implementation, the device further includes: The display module is used to visually display the search results on the front-end interface.

[0027] In one possible implementation, the device further includes: The search term optimization module is used to obtain user historical behavior data after obtaining search characters; The search characters and the user's historical behavior data are input into the intent analysis model, and the intent analysis model outputs the optimized search characters. Replace the original search characters with the optimized search characters and proceed with the next steps.

[0028] In one possible implementation, the device further includes: An extended search module is used to search for the search characters in the document content within the page number range corresponding to the target directory item. After obtaining the search results, in response to determining that the search results do not meet the preset conditions, an extended search strategy is executed to obtain extended search results. The implementation of the extended search strategy includes at least one of the following methods: Trigger an online search and expand the page range corresponding to the target directory item to the pages before and after it to form an expanded search range.

[0029] Thirdly, this application provides an electronic device, comprising: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; and at least one memory connected to the at least one bus, wherein the processor is configured to: Retrieve the search characters and the document to be searched; Obtain the directory structure information of the document; The search characters and the directory structure information are input into the artificial intelligence model, and the target directory item associated with the search characters is output by the artificial intelligence model. The search character is searched within the document content of the page range corresponding to the target directory item to obtain the search results.

[0030] Fourthly, this application also provides a computer storage medium storing computer-executable instructions for executing the document search method described in any of the preceding claims of this application.

[0031] Compared with the prior art, the technical solution provided in this application has the following advantages: The method provided in this application obtains search characters and the document to be searched, and obtains the document's directory structure information; it inputs the search characters and directory structure information into an artificial intelligence model, and outputs the target directory item associated with the search characters through the artificial intelligence model; it searches for the search characters in the document content within the page number range corresponding to the target directory item, and obtains the search results. This provides an intelligent search and navigation mechanism based on the document's logical structure, which combines document directory structure information with the semantic understanding ability of an artificial intelligence model. This mechanism first parses the document to obtain directory structure information, including the correspondence between directory items and page number ranges, and then uses an artificial intelligence model to perform semantic association analysis on the search characters and directory items, accurately locates the target directory item and its corresponding page number range, and finally performs the search operation only within the relevant document content. This search method fundamentally changes the traditional full-text traversal search model. While ensuring search accuracy, it concentrates computing resources on the document area most likely to contain the target content, which significantly improves the search efficiency of long documents. At the same time, the local search guided by the directory effectively avoids interference from irrelevant areas, which not only improves the accuracy of search results, but also ensures the targeting of the search process, and achieves synergistic optimization of search quality and efficiency. Attached Figure Description

[0032] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0033] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0034] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.

[0035] Figure 1 A flowchart illustrating an embodiment of a document search method provided in this application; Figure 2A flowchart illustrating an embodiment of another document search method provided in this application; Figure 3 A flowchart illustrating an embodiment of another document search method provided in this application; Figure 4 A block diagram illustrating an embodiment of a document search device provided in this application; Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0036] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0037] The following disclosure provides numerous different embodiments or examples for implementing various structures of this application. To simplify the disclosure, specific examples of components and arrangements are described below. These are merely examples and are not intended to limit the scope of this application. Furthermore, reference numerals and / or letters may be repeated in different examples. Such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.

[0038] To address the technical problems of insufficient flexibility and low efficiency in searching long documents in existing document search technologies, this application provides a document search method and apparatus that fundamentally changes the traditional full-text traversal search mode. While ensuring search accuracy, it concentrates computing resources on the document area most likely to contain the target content, significantly improving the search efficiency of long documents. At the same time, it effectively avoids interference from irrelevant areas, improving the accuracy of search results and ensuring the targeting of the search process, thus achieving synergistic optimization of search quality and efficiency.

[0039] Figure 1 This is a flowchart illustrating an embodiment of a document search method provided in this application. Figure 1 As shown, the method includes the following steps: Step 101: Obtain the search characters and the document to be searched.

[0040] Step 101 is the initialization phase of a search process. The search term refers to the target content the user wishes to find, which can be one or more words, phrases, or statements.

[0041] As an optional implementation, the user can input search characters through the interactive interface provided by the execution subject of this application embodiment and specify the document to be searched for loading. The document to be searched can be a formatted document (such as a document in .pdf, .ofd, etc.) or a streaming document (such as a document in .doc, .docx, etc.).

[0042] Furthermore, the document to be searched can come from the local file library of the executing entity in this application embodiment, or it can come from the network. When the document to be searched is located on the network, the user can enter the URL (Uniform Resource Locator) address of the document in the interactive interface, and the executing entity in this application embodiment will automatically access and download the corresponding document. Of course, if authentication is required, the executing entity in this application embodiment can further provide an authentication interface to support access to and retrieval of protected resources.

[0043] Step 102: Obtain the document's directory structure information.

[0044] Step 102 aims to parse the document to be searched and obtain its directory structure information. This directory structure information includes the correspondence between directory items and page number ranges. Directory items represent headings at different levels within the document, and page number ranges define the document area covered by each directory item. A page number range can be a clearly defined interval consisting of a starting page number and an ending page number, such as "pages 5 to 10". In practice, the page number range may only record the starting page number. In this case, the ending page number of the preceding directory item can be inferred from the starting page numbers of two adjacent directory items. For example, if the directory structure information contains two directory items, "Part 1: 1" and "Part 2: 5," and their corresponding starting page numbers, then the page number range corresponding to "Part 1" can be determined to be "from page 1 to page 4," thus achieving an accurate association between directory items and the actual content area of ​​the document.

[0045] In one embodiment, a specific directory recognition algorithm is used to detect whether a directory area exists in the document. If it exists, the directory entries (i.e., directory items) and their corresponding page ranges are extracted from the directory area. If no directory area exists, a full document parsing process can be initiated to reconstruct the document's outline structure by analyzing heading styles, font sizes, and layout features, ultimately forming a complete directory item-page number mapping set to obtain the document's directory structure information.

[0046] For example, a specific directory recognition algorithm includes the following steps: First, by comprehensively analyzing inline attributes (such as font, font size, and style) and interline layout features (such as alignment and spacing), all candidate text line intervals in the document that may belong to the directory are identified; then, based on preset merging rules (such as continuity, hierarchical consistency, etc.), these candidate intervals are logically merged to construct a complete and structured directory area. This application does not limit the specific implementation of the directory recognition algorithm.

[0047] Step 103: Input the search characters and directory structure information into the artificial intelligence model, and output the target directory items associated with the search characters through the artificial intelligence model.

[0048] Step 104: Search for the search characters in the document content within the page number range corresponding to the target directory item to obtain the search results.

[0049] For ease of understanding, steps 103 and 104 will be explained uniformly below: As can be seen from the descriptions of steps 103 and 104, in this embodiment of the application, by introducing the semantic understanding and contextual reasoning capabilities of an artificial intelligence model, the traditional full-text page-by-page traversal search method is transformed into a targeted local range search, thereby greatly improving search efficiency.

[0050] Specifically, in step 103, a structured prompt instruction is constructed based on the search characters entered by the user and the directory structure information of the document to be searched. For example, a prompt instruction with the following content is generated: You will receive a keyword and a list of table of contents. Each item in the table of contents corresponds to a section of text. Determine in which section of text the keyword is most likely to appear and output the name of that section. Output only the name of the section, without any further explanation. The result is displayed as... <item> ...< / item> Keywords: anchor; Table of Contents: [Contents].

[0051] The aforementioned prompts, user-inputted search characters, and the directory structure information of the document to be searched are input into the artificial intelligence model. Utilizing powerful semantic understanding and contextual reasoning capabilities, the model analyzes the semantic relationships between the search characters and the content represented by each directory item, thereby determining and returning one or more target directory items most likely containing the target content (i.e., the search characters). The artificial intelligence model may be, for example, a large language model; this embodiment of the application does not impose limitations on this.

[0052] In step 104, based on the target directory item determined in step 103, the corresponding page number range is located, and then the text content within that range is parsed for target search to obtain search results. The search results include at least one of the following: matching item content: the text content found within the document content of the search range; location information: the specific location of the matching item in the document, such as its page number and coordinates within that page, used for precise positioning and highlighting on the front-end interface; contextual preview: providing the surrounding text content of the first occurrence of the matching item, allowing users to quickly understand the context of the matching item, etc., which are not limited in this embodiment. This information collectively constitutes the complete search results, ensuring both the accuracy of the search results and providing rich contextual information, effectively improving the user's search experience and information acquisition efficiency.

[0053] It is evident that the coordinated execution of steps 103 and 104 achieves a shift from "global blind search" to "local precise search," significantly improving search efficiency and accuracy.

[0054] In one embodiment, the specific implementation of searching for search characters and obtaining search results includes: searching for at least one matching item that is semantically similar to the search characters through a semantic similarity matching method.

[0055] The matching item can be one or more words, phrases, or sentences.

[0056] In this embodiment, by using semantic similarity matching, at least one matching item with semantic similarity to the search characters is searched. This effectively solves linguistic phenomena such as polysemy and synonym substitution, significantly improving the recall rate and intelligence of the search. For example, when a user enters "artificial intelligence," documents containing related concepts such as "AI" and "machine learning" can be found. Accordingly, in some embodiments, this method is mainly applicable to scenarios where users want to find content by concepts, synonyms, or related expressions.

[0057] In one embodiment, searching for at least one match that is semantically similar to the search character by semantic similarity matching includes: performing word segmentation on the document content within the current search range to obtain a set of word segmentation units; converting the search character and each word segmentation unit in the word segmentation unit set into word vectors respectively; determining the similarity between the word vector of the search character and the word vectors of each word segmentation unit; and determining at least one match that is semantically similar to the search character from the set of word segmentation units based on the similarity.

[0058] Among them, word segmentation is performed on the document content within the current search range to obtain multiple word segmentation units, including: performing word segmentation on the document content within the current search range to obtain an initial set of word segmentation units; performing standardization processing on the initial word segmentation units in the initial set of word segmentation units; and based on a preset stop word list, filtering out stop words from the initial set of word segmentation units after standardization processing to form a final set of word segmentation units.

[0059] This embodiment details the specific implementation process of searching for content semantically similar to the search characters in a document through semantic similarity matching. This method realizes a complete intelligent search from text preprocessing to semantic matching through multi-level natural language processing technologies. Specifically: First, word segmentation is performed on the document content within the current search range. This process includes three key steps: 1. Initial word segmentation: Using a word segmentation algorithm based on linguistic rules and dictionary matching, the continuous text within the search range is segmented into meaningful word segmentation units to form an initial set of word segmentation units.

[0060] 2. Standardization processing: Perform standardization processing on the initial word segmentation units in the initial set of word segmentation units.

[0061] Among them, the standardization processing for English words includes word form reduction and standard conversion. For example, for words ending with "ing" and having a length exceeding 4, remove the "ing" suffix (e.g., "searching" is converted to "search"); for words ending with "ies", replace them with "y" (e.g., "universities" is converted to "university"); perform word form reduction based on a preset word type table (e.g., restore "went" to "go").

[0062] In Chinese text processing, standardization processing is equally crucial. Its main goal is to eliminate ambiguities and inconsistencies in the text and provide a clean and standardized data basis for subsequent semantic analysis. The standardization processing of Chinese word segmentation units can include the following aspects: Simplified and traditional Chinese unification: Convert traditional Chinese vocabulary to the corresponding simplified Chinese form to ensure the consistency of text representation. For example, standardize "計算機" to "计算机". [[ID=第十九]]

[0063] Variant character unification: Convert variant characters or alternative forms to the standard glyph. For example, unify "爲" to "为", and unify "羣" to "群".

[0064] Half-width / full-width unification of numbers and English symbols: Convert full-width numbers, letters, and punctuation marks to half-width forms. For example, convert "2023" to "2023", and convert "AI" to "AI".

[0065] Punctuation standardization: Remove or unify punctuation marks that do not contribute to the semantic meaning (such as the comma "、", book title marks "《》", etc.) to reduce feature noise. For example, when processing "Deep Learning", the book title marks can be removed, and the core words "deep learning" can be retained.

[0066] By introducing the aforementioned standardized processing flow for Chinese, the system can more effectively standardize Chinese text, improve the quality of subsequent word vector representation and the accuracy of semantic matching, thereby enhancing the applicability and robustness of intelligent search methods in Chinese document environments.

[0067] 3. Stop word filtering: A dual mechanism is used to construct the stop word list, including stop words automatically identified based on document frequency statistics (words appearing more than 30%-50% of the time) and manually defined rule-based stop words (such as "certainly", "of", "place", "a", "the", etc.). The standardized word segmentation units are filtered through the stop word list to remove words without actual semantic value, forming the final set of word segmentation units.

[0068] After text preprocessing is completed, the core stage of semantic matching begins, which includes the following steps: Word vector conversion: Using word embedding models such as word2vec, the search characters and all words in the final set of word segmentation units are converted into feature vector representations in a high-dimensional space.

[0069] Similarity calculation: The distance between the search character vector and each word segmentation unit vector is calculated using a metric algorithm (such as L2 distance or cosine similarity) to quantify the degree of semantic association between them.

[0070] Results filtering: Based on the preset similarity threshold (e.g., 0.4) and the quantity threshold K (usually set to 5), the top K words that are closest to the search characters from all word segmentation units are selected as the final matching items.

[0071] Through this refined processing flow, the system can effectively identify all important words in a document that are semantically related to the search characters, even if these words differ from the original search characters in their literal expression. For example, when a user searches for "university," the system can simultaneously identify document content containing related words such as "universities" and "college," significantly improving search recall and semantic understanding capabilities.

[0072] In another embodiment, the specific implementation of searching for search characters and obtaining search results includes: searching for at least one matching item that is the same as the search characters by means of string matching.

[0073] In this embodiment, a character-by-character comparison is performed within a specified search range to find matches that are exactly the same as the search characters. While this method is simple and direct, it ensures the accuracy of the search results, making it particularly suitable for scenarios requiring precise matching, such as searching for technical terms, fixed collocations, or specific names. For example, when searching for "convolutional neural network," only text locations containing the complete term will be returned, and individual words like "convolution" or "neural network" will not be matched.

[0074] In another embodiment, the specific implementation of searching for search characters and obtaining search results includes: searching for at least one match that is semantically similar to the search characters by semantic similarity matching, and searching for at least one match that is identical to the search characters by string matching.

[0075] Based on the two embodiments described above, this embodiment provides a hybrid search mechanism: semantic similarity matching is used to obtain semantically similar matching items to the search characters, while string matching is used to obtain literal matching items that are exactly the same as the search characters. Finally, the two types of results are deduplicated and integrated.

[0076] This implementation combines the advantages of the first two methods, ensuring both the completeness of search results and the accurate capture of key information. For example, when searching for "deep learning," the system will not only return exact matches containing "deep learning," but also semantic matches involving related concepts such as "deep neural network" and "DNN," providing users with more comprehensive and diverse search results to meet search needs at different levels and for different purposes.

[0077] The technical solution provided in this application involves obtaining search characters and the document to be searched, as well as the document's directory structure information. The search characters and directory structure information are input into an artificial intelligence model, which outputs the target directory item associated with the search characters. The search is then performed on the document content within the page range corresponding to the target directory item to obtain search results. This provides an intelligent search and navigation mechanism based on the document's logical structure, combining document directory structure information with the semantic understanding capabilities of an artificial intelligence model. This mechanism first parses the document to obtain directory structure information, including the correspondence between directory items and page ranges. Then, it uses an artificial intelligence model to perform semantic association analysis on the search characters and directory items, accurately locating the target directory item and its corresponding page range. Finally, it performs the search operation only within the relevant document content. This search method fundamentally changes the traditional full-text traversal search model. While ensuring search accuracy, it concentrates computational resources on the document area most likely to contain the target content, significantly improving the search efficiency for long documents. Simultaneously, the local search guided by the directory effectively avoids interference from irrelevant areas, improving the accuracy of search results and ensuring the targeting of the search process, achieving synergistic optimization of search quality and efficiency.

[0078] Figure 2 A flowchart illustrating an embodiment of another document search method provided in this application. Figure 2 The process shown is in Figure 1 Based on the illustrated process, the following steps are included: Step 201: Obtain the search characters and the document to be searched.

[0079] exist Figure 1 Based on the process shown, as an optional embodiment, after obtaining the search characters, user historical behavior data is obtained; the search characters and user historical behavior data are input into the intent analysis model, and the intent analysis model outputs optimized search characters; the optimized search characters are used to replace the original search characters, and subsequent steps are executed.

[0080] User historical behavior data includes, but is not limited to, at least one of the following: historical search records (search requests initiated by the user in the past), document browsing records (e.g., document pages and chapters that the user has viewed or spent a long time on), and click behavior data (e.g., items that the user prioritized clicking or ignored in past search results).

[0081] This embodiment is in Figure 1Building upon the illustrated process, a preprocessing step is introduced: search intent analysis and query optimization based on user historical behavior. This step initiates after the user enters their initial search characters but before executing the core search process, aiming to address the poor search results caused by inaccurate, incomplete, or ambiguous query terms in traditional searches. Specifically, it acquires the user's historical behavior data, which collectively constitutes a profile of the user's interests and true intent. Subsequently, the original "search characters" and the aforementioned "user historical behavior data" are input into a pre-trained intent analysis model. This model can be an artificial intelligence model based on a deep learning architecture (such as Transformer), possessing powerful contextual semantic understanding and reasoning capabilities. Its core task is query reconstruction and expansion. For example, the model comprehensively analyzes the deep correlation between the current search characters and the user's historical behavior. For instance, it identifies commonly used abbreviations, determines the more likely meaning of the current search term in a specific context (e.g., if a user enters "apple," combined with their history of browsing mostly technical documents, their intent can be determined to be "Apple Inc." rather than fruit), and even supplements relevant synonyms or hyponyms based on the user's long-term areas of interest. Finally, the intent analysis model outputs an optimized search character. This optimized search character may be a precise word that has undergone error correction and disambiguation, or it may be an expanded query phrase that incorporates related concepts. This optimized search character will then replace the user's original search character, and subsequent steps will continue.

[0082] This implementation upgrades the search process from "passive response" to "active understanding." By incorporating dynamic contextual information—user's historical behavior—into the search chain, it can more accurately capture the user's true search intent, thus correcting the search direction from the very first step. This not only significantly improves the accuracy and relevance of subsequent directory locating and content searching but also greatly personalizes the search experience, allowing users to initiate queries in a more natural and casual manner. The intelligent model in the system's backend takes on the responsibility of intent parsing and query optimization, ultimately achieving the intelligent search goal of "what you think is what you get."

[0083] Step 202: Obtain the document's directory structure information.

[0084] Step 203: Input the search characters and directory structure information into the artificial intelligence model, and output the target directory items associated with the search characters through the artificial intelligence model.

[0085] Step 204: Search for the search characters in the document content within the page number range corresponding to the target directory item to obtain the search results.

[0086] For a detailed description of steps 201-204, please refer to the relevant descriptions in the above embodiments, which will not be repeated here.

[0087] Step 205: Define the page range corresponding to the target directory item as the first search range, define the part of the document other than the first search range as the second search range, and perform a supplementary search based on the search results in the document content within the second search range.

[0088] Step 205 is a supplementary search mechanism executed after the targeted search based on the artificial intelligence model is completed. This step defines the portion of the document other than the first search scope (the page number range corresponding to the target directory item) as the second search scope. Within the document content of the second search scope, a supplementary search is performed based on the search results, achieving comprehensive coverage of the document search and ensuring the completeness of the search results.

[0089] In one embodiment, within the document content of the second search scope, a supplementary search is performed based on the search results, including: within the document content of the second search scope, based on the search results, searching for at least one matching item whose content is the same as the matching item in the search results by means of string matching.

[0090] Specifically, step 205 first defines the search scope: the page range corresponding to the target directory item determined in step 203 is defined as the "first search scope," and all other parts of the document outside this scope are defined as the "second search scope." Based on this, a supplementary search process is initiated within the second search scope. It should be noted that this supplementary search is not a simple repetition of the original search, but rather an expanded search based on the search results obtained in step 204. That is, the matches found in step 204 are used as new search objects, and a string matching method is used within the second search scope to find the locations of these search objects in other areas of the document.

[0091] This design effectively combines "intelligent positioning" with "comprehensive coverage": it leverages the semantic understanding capabilities of artificial intelligence models to quickly locate core, relevant areas, while supplementary searches ensure that relevant content, though not in the target directory area, appears in other parts of the document. For example, when searching for "artificial intelligence," the system may find relevant content in the "Technical Background" section, and through supplementary searches, it may also find the term in other sections such as "Application Examples" and "Future Outlook," thus providing users with more complete search results.

[0092] One additional point to note: Since string matching methods are characterized by low computational complexity and low resource consumption, performing such searches within the second search scope will not significantly impact overall search efficiency. Furthermore, considering that the content in the second search scope, as determined by the AI ​​model, has a low direct correlation with the search characters, and that the core relevant content has already been effectively captured through semantic matching within the first search scope, it is generally unnecessary to repeat the computationally intensive semantic similarity matching method within this scope. Of course, in practical applications, if users have extremely high requirements for search result recall, semantic similarity matching can be enabled within the second search scope according to configuration to provide more comprehensive search result coverage; this application embodiment does not impose any limitations on this.

[0093] Figure 2 The process shown is in Figure 1 Building upon the illustrated process, a supplementary search mechanism in step 205 further enhances the completeness of search results while maintaining the efficiency of intelligent search. This supplementary step utilizes the semantic matching results identified in the first stage, effectively capturing the literal appearance of target words in other areas of the document by performing low-computational-cost string matching in non-critical areas. This design avoids repeating resource-intensive semantic analysis in secondary areas while ensuring that no potentially relevant content is overlooked, achieving an optimal balance between search efficiency and coverage.

[0094] Figure 3 A flowchart illustrating an embodiment of another document search method provided in this application. Figure 3 The process shown is in Figure 1 Based on the illustrated process, the following steps are included: Step 301: Obtain the search characters and the document to be searched.

[0095] Step 302: Determine the number of pages in the document to be searched; if the number of pages is greater than the set threshold, proceed to step 303; if the number of pages is less than or equal to the set threshold, proceed to step 307.

[0096] Step 303: Obtain the document's directory structure information.

[0097] Step 304: Input the search characters and directory structure information into the artificial intelligence model, and output the target directory items associated with the search characters through the artificial intelligence model.

[0098] Step 305: Search for the search characters in the document content within the page number range corresponding to the target directory item to obtain the search results.

[0099] Step 306: Define the page range corresponding to the target directory item as the first search range, define the part of the document other than the first search range as the second search range, and perform supplementary searches based on the search results in the document content within the second search range; end the process.

[0100] Step 307: Search for the search characters in the entire document content to obtain the search results.

[0101] For ease of understanding, steps 301-307 are explained uniformly below: As can be seen from the description of steps 301-307, the embodiments of this application provide an adaptive search method based on document size, which automatically selects the optimal search path by intelligently determining the number of document pages, balancing search efficiency and result completeness. Specifically: First, in step 302, the document size is determined by comparing the number of document pages with a preset threshold (e.g., 10 pages) to decide the subsequent execution path. When the number of document pages exceeds the threshold, the "intelligent targeted search" mode is entered, including step 303 parsing the document structure and extracting directory structure information; step 304 using the semantic understanding capability of the artificial intelligence model to analyze the correlation between search characters and directory items to obtain the target directory items associated with the search characters; step 305 searching within the range corresponding to the target directory items recommended by the artificial intelligence model; and step 306 performing a supplementary search, performing string matching based on the obtained matching items within the second search range to ensure that relevant content in other areas of the document is not missed.

[0102] When the number of document pages is small (less than or equal to the threshold), step 307 is executed directly, employing a full-document search strategy. This design is based on the following considerations: for shorter documents, the computational cost of performing a full-text search is relatively controllable, while the benefits of analysis through artificial intelligence models are relatively limited.

[0103] Through this conditional search mechanism, this embodiment can automatically select the optimal search strategy for document scenarios of different sizes: for large-scale documents, it fully leverages the intelligent navigation advantages of the artificial intelligence model to significantly improve search efficiency; for small-scale documents, it employs direct and effective full-text search to ensure the simplicity of the search process. This adaptability allows this method to flexibly respond to various practical application scenarios, optimizing system resource utilization while ensuring search quality.

[0104] In step 307, the search for the search characters in the entire document content to obtain the search results can be implemented in the following three ways: by semantic similarity matching, searching for at least one match that is semantically similar to the search characters; by string matching, searching for at least one match that is identical to the search characters.

[0105] In step 307, when the number of document pages is small, the search for the search characters is performed in the entire content of the document. The search results can be obtained through the following three exemplary implementation methods: The first implementation uses semantic similarity matching, searching for at least one match that is semantically similar to the search characters.

[0106] The second implementation uses string matching, which searches for at least one match that is identical to the search characters through precise literal comparison.

[0107] The third approach combines the first two methods, performing both semantic similarity matching and exact string matching. Finally, the two types of results are deduplicated and integrated to form a complete search result set. This hybrid strategy ensures both high search recall and accurate capture of key information, providing users with the most comprehensive search experience.

[0108] Figure 3 The process shown is in Figure 1 Based on the illustrated process, an adaptive document size judgment mechanism is introduced to achieve intelligent selection of search strategies, significantly improving the applicability and resource utilization efficiency of the solution in different application scenarios. This process automatically selects the optimal search path based on the document size by setting a document page number judgment node in step 302: for large-scale documents, a strategy combining intelligent navigation based on an artificial intelligence model and supplementary search is adopted, greatly improving search efficiency while ensuring the completeness of search results; for small-scale documents, a full-text search strategy is directly adopted to avoid unnecessary consumption of computational resources. This conditional routing design allows the system to automatically adjust its processing logic according to the actual document characteristics, fully leveraging the advantages of artificial intelligence models in large document processing while ensuring the simplicity and efficiency of small document searches, effectively balancing search quality and system performance, and enhancing the adaptability and practicality of the solution in real-world application environments.

[0109] In one embodiment, after executing steps 104, 204, or 307, in response to determining that the search results do not meet the preset conditions, an extended search strategy is executed to obtain extended search results; wherein, executing the extended search strategy includes at least one of the following methods: triggering a network search, or extending the page range corresponding to the target directory item to its preceding and following pages to form an expanded search range.

[0110] In the technical solution provided in this embodiment, after completing the search process and obtaining preliminary search results, the process does not end immediately. Instead, a closed-loop mechanism of intelligent evaluation and dynamic expansion is introduced. The core of this mechanism is that the system first evaluates the preliminary search results to determine whether they meet preset conditions. Here, "preset conditions" are configurable, multi-dimensional evaluation criteria, which exemplarily include the following indicators: Quantitative metrics: For example, whether the total number of matches found is less than a preset minimum (e.g., less than 3 results). This directly indicates a lack of information within the current search scope.

[0111] Quality metrics: For example, all candidate words found through semantic similarity matching had semantic vector similarity scores below a confidence threshold (e.g., 0.4) with the original search characters. This indicates that even if some results were found, their relevance was generally low, failing to effectively meet user needs.

[0112] Diversity metrics: For example, all results are highly concentrated in a small section of the document, lacking content diversity.

[0113] If the system determines that the current result does not meet the above preset conditions, it means that the initial search may have failed or yielded unsatisfactory results. In this case, an extended search strategy can be automatically triggered, aiming to compensate for the shortcomings of the initial search through various means to obtain extended search results. The extended search strategy can include the following two methods: 1. Triggering Internet Search: This method expands the breadth of data sources. When it's determined that the information within a document is insufficient to answer a user's query, it can proactively connect to the internet and send the search terms to external search engines or specific knowledge bases. For example, if a user searches for "latest breakthrough in quantum computing" in an internal product report, the report itself may not cover this dynamic information. An internet search can then retrieve the latest technology news or academic articles from external sources, greatly enriching the timeliness and comprehensiveness of the search results.

[0114] 2. Expanding the page range corresponding to the target table of contents item to the pages before and after it: This expansion is based on the depth of document mining. This strategy is based on the reasonable assumption that content related to a certain topic is likely not only concentrated in the pages initially identified by the model, but may also permeate adjacent chapters or pages. For example, if the initial judgment is that the search term "security protocol" appears in "Chapter 3 System Design" (pages 10-15), but the result is not ideal, the system can automatically expand the search scope to pages 8-17. This method can intelligently broaden the search boundaries and capture marginally related content that may have been overlooked by the initial model prediction, while continuously parsing the entire document.

[0115] In summary, the above embodiments can significantly improve the success rate of search tasks and user experience satisfaction, ensuring that users are not frustrated by unsuccessful initial searches.

[0116] Furthermore, in practical applications, the extended search strategy can also be actively triggered by the user, and this application embodiment does not impose any restrictions on this.

[0117] Finally, this application also provides the following embodiments: The search results are displayed visually on the front-end interface.

[0118] This embodiment aims to provide an interactive visualization solution for search results, transforming search results into intuitive, organized, and interactive front-end interface elements, achieving a seamless transition from machine-readable data to user-friendly display.

[0119] One optional implementation involves first sorting all matched items in ascending order based on the semantic distance between their word vectors and the original search characters, ensuring that the results with the highest semantic relevance are presented first. The front-end interface initially displays only the top three matched items, along with a "Refresh" pagination control button. Each matched item includes a contextual fragment of its first appearance, providing users with key background information. When a user hovers their mouse over a matched item, a floating window is triggered, dynamically loading and rendering the complete document page where the matched item first appears, and automatically highlighting target words for precise contextual positioning. If the user is not satisfied with the currently displayed results, they can click the "Refresh" button to browse the next three matched items in sequence. Once all results have been displayed, the system automatically disables the button, providing clear feedback on the user's interaction status. This design cleverly balances interface simplicity with information capacity, allowing users to quickly locate the most relevant results and explore more content as needed.

[0120] To better understand the technical solutions provided in the embodiments of this application, the overall search process of this application will be systematically explained below, taking a document in .pdf format as an example: Prerequisites: The user enters the search term (denoted as anchor) and specifies the PDF document to be searched.

[0121] Step 1: Document parsing and table of contents extraction Parse the first 10 pages of the document, extracting all text elements (TextObjects) to determine if a table of contents page and section exist. Since the table of contents is typically located on the first few pages, extracting it doesn't require parsing the entire document, effectively avoiding wasted computational resources, especially with large documents. It's important to understand that 10 is just an example threshold; in practice, it can be adjusted based on specific circumstances.

[0122] If a table of contents exists in the document, store the contents of the table of contents and their corresponding page numbers in the Contents collection as key-value pairs of <title, page number>; if a table of contents does not exist, parse the entire document, extract all heading structures in the document, and construct the Contents collection.

[0123] Step 2: Obtaining Matching Item Set 1 Differentiated processing is adopted based on the number of document pages: When the number of document pages is less than or equal to 10 (this is just an example and can be flexibly set according to the actual situation), the entire document is parsed to obtain all TextObjects, a bidirectional mapping table between Unicode and TextObject (Ucode2Text) is established, and then the set of matching items is directly obtained by using a semantic similarity matching method based on word vector embedding.

[0124] When the document has more than 10 pages, a structured prompt (containing the search character anchor and directory structure information Contents) is constructed and input into an artificial intelligence model to obtain the target directory item where the search character is most likely to appear. Then, the document content within the page range corresponding to the target directory item is parsed (e.g., from the starting page number of the target directory item to the starting page number of the next directory item), and a set of matching items is obtained within this limited area using a semantic similarity matching method based on word vector embedding.

[0125] Step 3: Obtaining Matching Item Set 2 Parse the entire document to obtain all TextObjects and their corresponding Unicode text. Use exact string matching to find all matches that are exactly the same as the anchor and record their corresponding TextObjects to obtain match set 2.

[0126] Step 4: Result Synthesis and Return Merge all TextObjects in Match Set 1 and Match Set 2, and return their Unicode text, page number, and page coordinates to the front end. The front end interface synchronously displays the search characters, semantically similar, and literally identical matches, and highlights the matching positions in the document rendering view.

[0127] Step 5: Expand the search (optional) The top K matches (ranked by similarity to the search character) obtained from match set 1 are used as new search characters. The full-text exact match process in step 3 is re-executed to obtain all occurrences of these matches in the entire search range, further improving the coverage and completeness of search results.

[0128] Through the above process, this solution achieves an organic combination of precise positioning and comprehensive coverage. It effectively improves search efficiency through intelligent navigation mechanisms and ensures the integrity of search results through multi-strategy integration.

[0129] See Figure 4 This is a block diagram illustrating an embodiment of a document search device provided in this application. Figure 4 As shown, the device includes: The acquisition module 41 is used to acquire the search characters and the document to be searched; Parsing module 42 is used to obtain the directory structure information of the document; Model prediction module 43 is used to input the search character and the directory structure information into the artificial intelligence model, and output the target directory item associated with the search character through the artificial intelligence model; The search module 44 is used to search for the search characters in the document content within the page number range corresponding to the target directory item, and obtain the search results.

[0130] In one possible implementation, the search module 44 is further configured to: In the document content within the page number range corresponding to the target directory item, the search character is searched, and after obtaining the search results, the page number range corresponding to the target directory item is defined as the first search range, and the part of the document other than the first search range is defined as the second search range. Within the document content of the second search scope, a supplementary search is performed based on the search results.

[0131] In one possible implementation, the search module 44 performs supplementary searches within the document content of the second search scope, based on the search results, including: Within the document content of the second search scope, at least one matching item is searched for that is identical to the content of the matching item in the search results using string matching.

[0132] In one possible implementation, the device further includes: The page number determination module is used to determine the number of pages of the document before obtaining the directory structure information of the document; If the number of pages exceeds a set threshold, the steps of obtaining the document's directory structure information and subsequent steps are executed.

[0133] In one possible implementation, the search module 44 is further configured to: If the number of pages is less than or equal to the set threshold, the search character is searched in the entire document content to obtain the search results.

[0134] In one possible implementation, the search module 44 searches for the search characters, including: By using semantic similarity matching, at least one match that is semantically similar to the search characters is searched.

[0135] In one possible implementation, the search module 44 searches for the search characters to obtain search results, and further includes: Search for at least one match that is identical to the search characters using string matching.

[0136] In one possible implementation, the search module 44 searches for at least one match that is semantically similar to the search characters using a semantic similarity matching method, including: The document content within the current search scope is segmented into words to obtain a set of segmentation units; The search character and each word segmentation unit in the word segmentation unit set are respectively converted into word vectors; Determine the similarity between the word vector of the search character and the word vector of each of the word segmentation units; Based on the similarity, at least one match that is semantically similar to the search character is determined from the set of word segmentation units.

[0137] In one possible implementation, the search module 44 performs word segmentation on the document content within the current search range to obtain multiple word segmentation units, including: The document content within the current search range is segmented into words to obtain an initial set of segmentation units; The initial word segmentation units in the initial word segmentation unit set are standardized. Based on a pre-defined stop word list, stop words are filtered out from the initial set of segmented units after standardization, forming the final set of segmented units.

[0138] In one possible implementation, the device further includes: The display module is used to visually display the search results on the front-end interface.

[0139] In one possible implementation, the device further includes: The search term optimization module is used to obtain user historical behavior data after obtaining search characters; The search characters and the user's historical behavior data are input into the intent analysis model, and the intent analysis model outputs the optimized search characters. Replace the original search characters with the optimized search characters and proceed with the next steps.

[0140] In one possible implementation, the device further includes: An extended search module is used to search for the search characters in the document content within the page number range corresponding to the target directory item. After obtaining the search results, in response to determining that the search results do not meet the preset conditions, an extended search strategy is executed to obtain extended search results. The implementation of the extended search strategy includes at least one of the following methods: Trigger an online search and expand the page range corresponding to the target directory item to the pages before and after it to form an expanded search range.

[0141] like Figure 5 As shown in the figure, this application provides an electronic device, including a processor 111, a communication interface 112, a memory 113, and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114. Memory 113 is used to store computer programs; In one embodiment of this application, when the processor 111 executes a program stored in the memory 113, it implements the document search method provided in any of the foregoing method embodiments, including: Retrieve the search characters and the document to be searched; Obtain the directory structure information of the document; The search characters and the directory structure information are input into the artificial intelligence model, and the target directory item associated with the search characters is output by the artificial intelligence model. The search character is searched within the document content of the page range corresponding to the target directory item to obtain the search results.

[0142] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the document search method provided in any of the foregoing method embodiments.

[0143] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0144] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software plus a general-purpose hardware platform, or of course, using hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0145] It should be understood that the terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “described” as used herein may also include the plural forms. The terms “comprising,” “including,” “containing,” and “having” are inclusive and therefore indicate the presence of the stated features, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, elements, components, and / or combinations thereof. The method steps, processes, and operations described herein are not construed as requiring them to be performed in a particular order described or illustrated unless the order of performance is explicitly indicated. It should also be understood that additional or alternative steps may be used.

[0146] The above description is merely a specific embodiment of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A document search method characterized by, The method includes: Retrieve the search characters and the document to be searched; Obtain the directory structure information of the document; The search characters and the directory structure information are input into the artificial intelligence model, and the target directory item associated with the search characters is output by the artificial intelligence model. The search character is searched within the document content of the page range corresponding to the target directory item to obtain the search results.

2. The method of claim 1, wherein, After searching for the search characters within the document content of the page number range corresponding to the target directory item and obtaining the search results, the method further includes: Define the page number range corresponding to the target directory item as the first search range, and define the part of the document other than the first search range as the second search range; Within the document content of the second search scope, a supplementary search is performed based on the search results.

3. The method of claim 2, wherein, The supplementary search based on the search results within the document content of the second search scope includes: Within the document content of the second search scope, at least one matching item is searched for that is identical to the content of the matching item in the search results using string matching.

4. The method of claim 1, wherein, Before obtaining the directory structure information of the document, the method further includes: Determine the number of pages in the document; If the number of pages exceeds a set threshold, the steps of obtaining the document's directory structure information and subsequent steps are executed. If the number of pages is less than or equal to the set threshold, the search character is searched in the entire document content to obtain the search results.

5. The method according to claim 1 or 4, characterized in that, The search for the search characters includes: By using semantic similarity matching, at least one match that is semantically similar to the search characters is searched.

6. The method according to claim 5, characterized in that, The step of searching for at least one match that is semantically similar to the search characters using a semantic similarity matching method includes: The document content within the current search scope is segmented into words to obtain a set of segmentation units; The search character and each word segmentation unit in the word segmentation unit set are respectively converted into word vectors; Determine the similarity between the word vector of the search character and the word vector of each of the word segmentation units; Based on the similarity, at least one match that is semantically similar to the search character is determined from the set of word segmentation units.

7. The method according to claim 6, characterized in that, The process of segmenting the document content within the current search range yields multiple segmentation units, including: The document content within the current search range is segmented into words to obtain an initial set of segmentation units; The initial word segmentation units in the initial word segmentation unit set are standardized. Based on a pre-defined stop word list, stop words are filtered out from the initial set of segmented units after standardization, forming the final set of segmented units.

8. The method according to claim 1, characterized in that, After obtaining the search characters, the process also includes: Obtain user historical behavior data; The search characters and the user's historical behavior data are input into the intent analysis model, and the intent analysis model outputs the optimized search characters. Replace the original search characters with the optimized search characters and proceed with the next steps.

9. The method according to claim 1, characterized in that, After searching for the search characters within the document content of the page range corresponding to the target directory entry and obtaining the search results, the process further includes: In response to determining that the search results do not meet the preset conditions, an extended search strategy is executed to obtain extended search results; The implementation of the extended search strategy includes at least one of the following methods: Trigger an online search and expand the page range corresponding to the target directory item to the pages before and after it to form an expanded search range.

10. A document search device, characterized in that, The device includes: The acquisition module is used to acquire the search characters and the document to be searched; The parsing module is used to obtain the directory structure information of the document; The model prediction module is used to input the search characters and the directory structure information into the artificial intelligence model, and output the target directory item associated with the search characters through the artificial intelligence model. The search module is used to search for the search characters in the document content within the page number range corresponding to the target directory item, and obtain the search results.