Keyword search method, display method, and related device
By displaying document summary tree data in the browser and utilizing inverted index technology, efficient keyword retrieval in documents is achieved in the browser, solving the problem of poor retrieval performance when the browser displays document summary, and improving retrieval efficiency and location speed.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- MASHANG CONSUMER FINANCE CO LTD
- Filing Date
- 2022-09-16
- Publication Date
- 2026-05-01
AI Technical Summary
Existing browsers struggle to effectively retrieve specific keywords when only displaying a document's summary, resulting in poor search performance, especially with high latency during the search process when the number of documents and the amount of content data are large.
By displaying the summary tree data of the target text on the client side, after the user enters a search request, the server performs a search for the target keywords in the target text, generates and returns the search results, and the client displays the text information in the summary tree data. The inverted index method shortens the search time.
It improves the efficiency and effectiveness of keyword retrieval, expands the application scenarios of keyword retrieval, saves client-side resource consumption, and quickly locates target keywords in large-scale documents.
Smart Images

Figure CN116127004B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, specifically to a keyword retrieval method, display method, and related equipment. Background Technology
[0002] Currently, some browsers typically have search functions, allowing users to retrieve relevant keywords within a document when it is displayed. However, when the browser only displays a summary of the document, the built-in search function often struggles to find specific keywords because the full document is not shown. Therefore, existing search methods suffer from poor search performance. Summary of the Invention
[0003] This disclosure provides a keyword retrieval method, display method, and related equipment, which can improve retrieval results.
[0004] In a first aspect, embodiments of this disclosure provide a keyword retrieval method applied to a server, the keyword retrieval method comprising:
[0005] Receive a retrieval request sent by the client. The retrieval request is used to indicate the target keywords to be retrieved in the target text. The retrieval request is sent by the client based on the summary tree data of the target text displayed in the browser. The summary tree data is used to reflect the headings at all levels of the target text and the hierarchical relationship information of the headings at all levels.
[0006] In response to a search request, the target text is retrieved and the target keywords are searched within the target text to obtain search results. The search results include text information of the text containing the target keywords in the target text.
[0007] The search results are sent to the client so that the client can display text information in the summary tree data.
[0008] Secondly, this disclosure provides a keyword display method applied to a client, the method comprising:
[0009] Displays the summary tree data of the target text; the summary tree data is used to reflect the headings at each level of the target text, and the hierarchical relationship between the headings at each level;
[0010] In response to a search request generated for the summary tree data, a search request is sent to the server. The search request instructs the server to respond to the search request, obtain the target text, perform a search for the target keywords in the target text to obtain search results, and return the search results.
[0011] Receive the search results returned by the server. The search results include text information containing the target keywords in the target text.
[0012] Display text information in the summary tree data.
[0013] Thirdly, embodiments of this disclosure provide a keyword retrieval device, including:
[0014] The receiving unit is used to receive a retrieval request sent by the client. The retrieval request is used to indicate the target keywords to be retrieved in the target text. The retrieval request is sent by the client based on the summary tree data of the target text displayed in the browser. The summary tree data is used to reflect the headings at all levels of the target text and the hierarchical relationship information of the headings at all levels.
[0015] The retrieval unit is used to respond to a retrieval request, obtain the target text, and perform a target keyword search on the target text to obtain retrieval results. The retrieval results include text information of the text containing the target keywords in the target text.
[0016] The sending unit is used to send the search results to the client so that the client can display text information in the summary tree data.
[0017] Fourthly, embodiments of this disclosure provide a keyword display device, including:
[0018] The display unit is used to display the summary tree data of the target text; the summary tree data is used to reflect the headings at all levels of the target text, as well as the hierarchical relationship between the headings at all levels;
[0019] The sending unit is used to send a retrieval request to the server in response to a retrieval request generated for the summary tree data; the retrieval request is used to instruct the server to respond to the retrieval request, obtain the target text, perform a target keyword search in the target text to obtain the retrieval results, and return the retrieval results;
[0020] The receiving unit is used to receive the search results returned by the server. The search results include text information containing the target keywords in the target text.
[0021] The display unit is also used to display text information in the summary tree data.
[0022] Fifthly, embodiments of this disclosure also provide a server, including a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the method steps of the first aspect described above.
[0023] In a sixth aspect, embodiments of this disclosure also provide a terminal device, including a processor, a memory set, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the method steps as described in the second aspect above.
[0024] In a seventh aspect, embodiments of this disclosure also provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method steps of the first or second aspect described above.
[0025] In this embodiment, the client displays a summary tree of the target text in a browser. This summary tree reflects the headings at each level of the target text and their hierarchical relationships. When a user wants to search for target keywords in the target text, they can enter a search request on the client, which carries the target keywords. After receiving the search request, the server first locates the target text on the server and performs a target keyword search within it, obtaining search results. The search results include text information of the target text containing the keywords. Then, the server sends the search results to the client, which displays the text information in the summary tree data.
[0026] As can be seen, in this embodiment, the client only needs to display the summary tree data of the target text, without displaying the entire text content, to achieve keyword retrieval in the target text. Then, after obtaining the search results, the client displays the text information from the search results in the summary tree data. This retrieval method not only improves the efficiency of keyword retrieval but also expands the application scenarios of keyword retrieval. Attached Figure Description
[0027] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings used in the description of the embodiments of this disclosure will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0028] Figure 1 This is one of the flowcharts of a keyword retrieval method provided in this disclosure embodiment;
[0029] Figure 2 This is a schematic diagram of the data structure of the summary tree in an embodiment of this disclosure;
[0030] Figure 3 This is a schematic diagram of the data structure of the second structured data in an embodiment of this disclosure;
[0031] Figure 4 This is the second flowchart of a keyword retrieval method provided in this embodiment of the disclosure;
[0032] Figure 5 This is the third flowchart of a keyword retrieval method provided in this embodiment of the disclosure;
[0033] Figure 6This is the fourth flowchart of a keyword retrieval method provided in this embodiment of the disclosure;
[0034] Figure 7 This is a flowchart of a keyword display method provided in an embodiment of this disclosure;
[0035] Figure 8 This is a schematic diagram of the keyword retrieval device provided in an embodiment of this disclosure;
[0036] Figure 9 This is a schematic diagram of the keyword display device provided in an embodiment of this disclosure;
[0037] Figure 10 This is a schematic diagram of the server structure provided in an embodiment of this disclosure;
[0038] Figure 11 This is a schematic diagram of the structure of the terminal device provided in the embodiments of this disclosure. Detailed Implementation
[0039] The technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this disclosure. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0040] As described in the background section, existing browser-based search methods typically only allow retrieval when the full text is displayed. Furthermore, when the number of documents and the amount of content data are large, the retrieval process often experiences high latency. Therefore, existing search methods suffer from poor search performance.
[0041] Based on this, the present disclosure provides a retrieval method that can meet the retrieval needs of technical scenarios such as resource integration platforms with a large number of documents and content data, and the retrieval time is short, which improves the retrieval effect to a certain extent.
[0042] Please see Figure 1 , Figure 1 This is a flowchart illustrating the retrieval method provided in an embodiment of the present disclosure. The retrieval method includes the following steps:
[0043] Step 101: Receive a search request sent by the client. The search request is used to indicate the target keywords to be searched in the target text. The search request is sent by the client based on the summary tree data of the target text displayed in the browser. The summary tree data is used to reflect the headings at all levels of the target text and the hierarchical relationship information of the headings at all levels.
[0044] The target text mentioned above can be a large document, such as text from a resource integration platform. When the client's browser displays the full content of the target text, the large amount of content makes it difficult for the user to find the information they need. Therefore, the target text can be displayed in the client as a summary tree, showing the headings at each level and the hierarchical relationships between them, allowing users to quickly understand the summary and content distribution of the target text.
[0045] Optionally, to conserve client-side resources, the summary tree data can be generated by the server based on the target text and transmitted to the client. The client does not need to store the entire target text, only the summary tree data. Users can use this summary tree data to identify titles of interest and input a view operation. After responding to the user's view operation, the client retrieves part or all of the content under the corresponding title through interaction with the server. In this way, the client does not need to display the entire target text to enable users to view and browse the target text. This method not only saves client-side resources but also allows users to accurately locate the content of interest through the titles in the summary tree data, avoiding searching through a large amount of text content one by one, thus improving the efficiency of information retrieval from the target text to a certain extent.
[0046] The aforementioned summary tree data can be a partial summary of the target text. Specifically, the summary tree data can include the headings at each level of the target text, and the hierarchical relationship information of each heading level. For example, the summary tree data can be the table of contents of the target text, which includes the headings at each level of the target text; or, the summary tree data can include the table of contents of the target text, and several text entries below each heading in the table of contents, so as to reflect the summary content of the target text. In one embodiment of this disclosure, the summary tree data can adopt the following... Figure 2 The form shown is used to represent this.
[0047] The search request mentioned above can be a search request entered by the user through the browser on the client. For example, the user can enter the target keyword in the search box of the browser and click search to generate a search request in the client.
[0048] Step 102: In response to the search request, obtain the target text and perform a search for the target keyword in the target text to obtain the search results. The search results include text information of the text containing the target keyword in the target text.
[0049] Specifically, after receiving a search request, the server can first obtain the complete content of the target text. Then, in response to the search request, it retrieves the target keywords from the target text and obtains the text information containing the target keywords. This text information may include the text content containing the target keywords within the target text, and may also include the location information of the target keywords within the target text. Since the summary tree data displayed by the client may not include the complete body content of the target text, i.e., the summary tree data may not include the aforementioned "text content containing the target keywords," in this embodiment of the disclosure, the "text content of the paragraph containing the target keywords" can be sent to the client for display, thereby facilitating the presentation of the text content containing the target keywords to the user and enabling the user to obtain the information they need from the text content.
[0050] Optionally, the server includes a retrieval module and a positioning module; the retrieval request includes target keywords and text identifier information of the target text; in response to the retrieval request, the server obtains the target text and performs a search within the target text to obtain retrieval results, including: obtaining the target text based on the text identifier information through the positioning module and sending the target text to the retrieval module; performing a search within the target text based on the target keywords through the retrieval module to obtain a structured dataset, the structured dataset including multiple first structured data corresponding to the target keywords; each first structured data including the target keyword and the first position information of the target keyword in the target text; and performing a search and recombination process on the structured dataset through the positioning module to generate retrieval results.
[0051] The aforementioned first location information may include the location information of the title to which the text content belongs. Figure 2 In the summary tree shown, each node represents a title, heading, paragraph, or content, and each node corresponds to a number. Assuming each node is assigned a number in a certain order, the numbering for each node would be as follows: Figure 2 The number corresponding to each node in the summary tree is shown. For example, the node corresponding to the title is numbered 1. For example, the first position information can be represented as: target:[{title:“1,2,5,9,14”}], where each number in title represents the number of each node in the summary tree. Suppose that in a summary tree, 1 represents the title, 2 represents the first-level heading, 5 represents the second-level heading under the first-level heading corresponding to 2, and so on, so that the final leaf node can be found in the summary tree, that is, the specific position of the target keyword in the target text.
[0052] Specifically, when displaying text content in the summary tree data, the text content can be displayed under its corresponding title based on the first position information. Furthermore, the search results may also include: tagging information, which is used to highlight target keywords when displaying text content on the client side. This allows users to quickly locate target keywords by highlighting them in the browser. The highlighting of target keywords can be of various types, such as bolding or highlighting.
[0053] In this embodiment, since the search results also include: first location information indicating the position of the text content in the target text, and tagging information, that is, the position of the text content in the probability tree data can be marked by the tagging information, users can quickly locate the search results in the summary tree data, which is beneficial to improving the display effect of the search results.
[0054] Optionally, the structured dataset is retrieved and reorganized using the localization module to generate retrieval results, including:
[0055] The first position information of the target keyword in the target text of each first structured data is parsed and processed to obtain the position index and text content corresponding to the target keyword in each first structured data in the structured dataset; wherein, the position index of the target keyword in each first structured data corresponds to the target-level title in the summary tree data; the text content of the target keyword in each first structured data refers to the text content corresponding to the position index of the target keyword in each first structured data.
[0056] Replace the first position information of the target keyword in each first structured data with the position index and text content corresponding to the target keyword in the corresponding first structured data to generate the second structured data corresponding to each first structured data;
[0057] Search results are generated based on the second structured data corresponding to each first structured data.
[0058] The location index corresponding to the target keyword indicates its specific position within the text content. The aforementioned target-level heading can refer to the heading of the lowest level to which the target keyword belongs in the summary tree data. For example, please refer to... Figure 2When the target keyword is content in paragraph 16, its corresponding target-level heading is level n heading 10. Accordingly, the position index of the target keyword is the position index within the text content under the target-level heading; that is, the position index indicates the specific location of the target keyword within the text content under the target-level heading. In other words, the target-level heading indicates the lowest level of heading to which the target keyword belongs; therefore, the target-level heading can initially indicate the position of the target keyword in the summary tree data. The position index, on the other hand, indicates the specific location of the target keyword within the text content under the target-level heading; therefore, the position index can indicate the detailed location of the target keyword. Thus, by combining the target-level heading corresponding to the target keyword and the index position, the detailed location of the target keyword can be located. That is, the correspondence between the position index of the target keyword in the first structured data and the target-level heading in the summary tree data means that the target-level heading and the position index respectively indicate the initial and detailed positions of the same target keyword. Thus, through two steps of location, the position of the target keyword in the summary tree data can be determined.
[0059] Specifically, since the target keyword may appear multiple times in the target text, in this embodiment of the disclosure, a first structured data can be generated based on each target keyword in the target text. The first structured data can be represented as: {keyword:“”,target:[{title:“”,position:[startIndex:“”,endIndex:“”]}]}. Here, keyword:“” represents the target keyword; target:[{title:“”}] represents the first position information; title represents the target-level title corresponding to the target keyword; and position:[startIndex:“”,endIndex:“”] represents the index position of the target keyword in the text content. Specifically, startIndex:“” represents the starting position of the target keyword in the text content, and endIndex:“” represents the ending position of the target keyword in the text content.
[0060] Understandably, the text content of the paragraph to which the target keyword belongs can be obtained from the target text based on the first position information in each piece of structured data, in order to generate search results. Thus, several pieces of text content can be obtained from the target text based on the structured dataset, meaning the search results can simultaneously include several pieces of text content.
[0061] In one embodiment of this disclosure, the second structured data can be schematically represented as {keyword:“”,target:[title:{index:“”,content:“”},position:[startIndex:“”,endIndex:“”]]}. Wherein, keyword is the target keyword; target is the location of the target keyword in the document; target-title is the specific position index and text content of the target keyword in the document; target-title-index is the specific position index of the target keyword in the document, corresponding to the index number on the summary tree; target-title-content is the text content of the paragraph containing the target keyword, i.e., the content under the paragraph corresponding to a certain level of heading on the summary tree; target-position is the specific position of the target keyword in the title-content content; the same keyword may appear multiple times in the same content, and is also displayed in array form; target-position-startIndex is the starting position of the target keyword in the title-content content; target-position-endIndex is the ending position of the target keyword in the title-content content. For ease of understanding, the second structured data can also be represented as... Figure 3 The data structure shown.
[0062] In one embodiment of this disclosure, the plurality of first structured data corresponds one-to-one with a plurality of second structured data, and the step of generating search results based on the second structured data corresponding to each first structured data includes:
[0063] Target structured data is generated based on multiple second-level structured data.
[0064] Search results are generated based on the target structured data.
[0065] Specifically, since each first structured data corresponds to one second structured data, and there are multiple first structured data sets obtained, there are also multiple second structured data sets obtained. These multiple second structured data sets contain identical content such as target keywords and target text. Therefore, the multiple second structured data sets can be constructed to merge the identical content to obtain the target structured data. That is, in the target structured data, the identical content in the multiple second structured data sets is merged, so that the identical content in the multiple second structured data sets appears only once in the target structured data. For example, if multiple second structured data sets all include the same "target keyword," then the "target keyword" only needs to appear once in the target structured data. This simplifies the multiple second structured data sets. Then, search results are generated based on the target structured data.
[0066] In one embodiment of this disclosure, taking "knowledge platform" as an example, the target structured data generated during the retrieval process in the target text can be represented as: {keyword: "knowledge platform", target: [title: {index: "1", content: "knowledge platform"}, position: [startIndex: "1", endIndex: "4"], title: {index: "2", content: "Overview of knowledge platform"}, position: [startIndex: "1", endIndex: "4"], title: {index: "5", content:“Application Scenarios of Knowledge Platform”}, position:[startIndex:“1”,endIndex:“4”], title:{index:“9”,content:“Main Applications of Knowledge Platform…”}, position:[startIndex:“1”,endIndex:“4”]], title:{index:“14”,content:“Main Applications of Knowledge Platform…”}, position:[startIndex:“1”,endIndex:“4”,startIndex:“10”,endIndex:“13”]}.
[0067] The aforementioned retrieval of target text based on target keywords can be performed using various methods in related technologies. In one embodiment of this disclosure, a structured dataset is obtained by retrieving target text using an inverted index based on target keywords. Thus, by employing an inverted index for retrieval, which "finds the question by content," compared to a forward index (i.e., finding content by question), the time required for the retrieval process is shortened, thereby improving retrieval speed.
[0068] In this embodiment, by generating second structured data, the specific location of each target keyword in the target text can be quickly located based on the second structured data, and search results can be generated based on the second structured data.
[0069] Optionally, the first structured data also includes second location information, which indicates the position of the target keyword in the text content; search results are generated based on the second structured data corresponding to each piece of first structured data, including:
[0070] Based on the second location information, tag information corresponding to each second structured data is added to the second structured data to obtain the retrieval results.
[0071] Step 103: Send the search results to the client so that the client can display text information in the summary tree data.
[0072] Understandably, since the summary tree data contains the headings at all levels of the target text, as well as the hierarchical relationship information of the headings, the retrieved text content containing the target keywords can be displayed below the heading to which the text content belongs. This helps users quickly locate the position of the text content in the target text, and further facilitates users to quickly locate other content under the heading to which the text content belongs, thereby further improving the search results.
[0073] As mentioned above, when displaying the summary tree data, the client may have already obtained and stored the full text content of the target text. At this time, when the server returns the search results, the client displays the text information in the search results in the summary tree data, including: the client parses the search results to obtain the text information of the text containing the target key in the search structure, where the text information includes the position index and text content; the client finds the target-level heading to which the text content belongs in the full text content stored locally through the position index; and displays the text content located at the position index under the target-level heading.
[0074] In another embodiment, if the client does not store the full text content, it can interact with the server to retrieve the text content and display it along with target keywords under the appropriate target-level heading. This way, the client only displays the text content the user needs, saving client resources.
[0075] In this implementation, the client displays a summary tree of the target text in the browser. This summary tree reflects the headings at each level of the target text and their hierarchical relationships. When a user wants to search for target keywords in the target text, they can enter a search request on the client, which includes the target keywords. After receiving the search request, the server first locates the target text on the server and performs a keyword search within it, obtaining search results. These results include the text content of the target text containing the keywords. The server then sends the search results to the client, which displays the text content in the summary tree.
[0076] As can be seen, in this embodiment, the client only needs to display the summary tree data of the target text, without displaying the entire text content, to achieve keyword retrieval in the target text. Then, after obtaining the search results, the client displays the text content of the search results in the summary tree data. This retrieval method not only improves the effectiveness of keyword retrieval but also expands the application scenarios of keyword retrieval.
[0077] Please see Figure 7 This is a flowchart illustrating a display method provided in one embodiment of the present disclosure. The display method is applied to a client and includes the following steps:
[0078] Step 701: Display the summary tree data of the target text; the summary tree data is used to reflect the headings at all levels of the target text, as well as the hierarchical relationship between the headings at all levels;
[0079] Optional, for a detailed description of the target text and summary tree data, please refer to the foregoing. Figure 1 Step S101 in the embodiment will not be repeated here.
[0080] Step 702: In response to the retrieval request generated for the summary tree data, a retrieval request is sent to the server; the retrieval request is used to instruct the server to respond to the retrieval request, obtain the target text, perform a target keyword search in the target text to obtain the retrieval results, and return the retrieval results;
[0081] As an optional implementation, a search box can be displayed simultaneously with the summary tree data of the target text. When the user enters the target keyword in the search box and triggers a search operation, the client generates a search request for the summary tree data. The search box can correspond to a search option; when this search option is triggered, it confirms that a search operation exists. Alternatively, it can be confirmed that a search operation exists when the user enters a voice command to initiate a search.
[0082] For an explanation of how the server performs a search for target keywords based on a search request to obtain search results, please refer to the aforementioned methods. Figure 1 The description of step S102 in the embodiment will not be repeated here.
[0083] Step 703: Receive the search results returned by the server. The search results include text information containing the target keywords in the target text.
[0084] Step 704: Display text information in the summary tree data.
[0085] Optionally, the text information includes text information containing target keywords within the target text and the position index of the text information within the target text. The text information is displayed in the summary tree data, including:
[0086] Based on the location index, locate the target-level heading to which the text content belongs in the summary tree data;
[0087] It expands and displays the text content located at the position index under the target-level heading, and displays the target keywords included in the text content according to the preset display method.
[0088] In this implementation, the target-level heading to which the location index belongs is located in the summary tree data, and the text information located at the location index is expanded and displayed under the target-level heading. The target keywords included in the text content are also displayed according to a preset display method. This allows users to quickly locate search results in the summary tree data, which helps to improve the display effect of search results.
[0089] Optionally, target keywords included in the text content are displayed according to a preset display method, including:
[0090] If the amount of text content exceeds the quantity threshold or the size of the text content exceeds the preset value, the target keywords included in the text content will be displayed in a progressive manner and according to the preset display method. The progressive manner means that a part of the text content or the target keywords included in the text content will be displayed, and when a switching display instruction is received, the remaining undisplayed text content or the target keywords in the text content will be displayed.
[0091] This implementation uses a progressive highlighting method. Specifically, after the web front-end system sends the search results to the client, the client can display the complete content of the search results and highlight the first target keyword in the search results. When the user inputs "show next," the next target keyword is highlighted, thus facilitating the user's viewing of target keywords at various locations.
[0092] Please see Figures 4 to 6 This disclosure provides a retrieval system in one embodiment, which includes the aforementioned server and client. In the server, the retrieval module can also be referred to as the retrieval system, and the positioning module can also be referred to as the positioning system. Specifically, the server may include a web front-end system, a retrieval system, and a positioning system. The specific flow of the retrieval method is as follows:
[0093] The client displays summary tree data of the target text; the summary tree data is used to reflect the headings at each level of the target text, and the hierarchical relationship of the headings at each level;
[0094] In response to a retrieval request generated for the summary tree data, the client sends the retrieval request to the web front-end system through the browser. The web front-end system then sends the retrieval request to the retrieval system. The retrieval system first retrieves the target text from the preset storage space based on the text identification information, and then performs a retrieval in the target text through the inverted index, and outputs a structured dataset.
[0095] The retrieval system sends the structured dataset to the positioning system. The positioning system first parses the text content corresponding to each piece of the first structured data based on the first structured data, and then reassembles the data based on the parsing results and the structured dataset to obtain the second structured data.
[0096] The positioning system sends the second structured data to the web front-end system. Based on the second location information within the second structured data, the web front-end system determines the specific location of each target keyword within its text content and sets marker information for the target keywords in each text content based on this second location information. This allows the browser to highlight the target keywords when displaying the text content. After processing the second structured data, the web front-end system obtains the search results and sends them to the browser for display.
[0097] Specifically, since the web front-end system does not include the complete content of the target text, if the retrieval system directly transmits the structured dataset obtained after retrieval to the web front-end system, the web front-end system needs to interact with the positioning system every time it retrieves the text content corresponding to the first structured data. This means that several interactions with the positioning system are required to reconstruct the retrieval results, leading to increased retrieval time. Therefore, in this embodiment, the second structured data is obtained by reconstructing the data in the positioning system and then sent to the web front-end system for display. This helps to shorten the retrieval time and improve the retrieval response speed.
[0098] In addition, please see Figures 4 to 6 When the aforementioned web front-end system sends the search results to the browser for display, it can employ a progressive highlighting method. Specifically, after the web front-end system returns the search results to the client, the client can display the complete content of the search results and highlight the first target keyword in the search results. When the user inputs "show next," the next target keyword is highlighted, thus facilitating the user's viewing of target keywords at various points.
[0099] Specifically, in one embodiment of this disclosure, taking the search result {keyword:“”,target:[title:{index:“”,content:“”},position:[startIndex:“”,endIndex:“”]]} as an example, the process of displaying the search results on the client will be further explained. Here, `keyword` refers to the target keyword; `target` refers to the location of the target keyword in the document; `target-title` refers to the specific position index and text content of the target keyword in the document; `target-title-index` refers to the specific position index of the target keyword in the document, corresponding to the index number on the summary tree; `target-title-content` refers to the text content of the paragraph containing the target keyword, i.e., the content under the paragraph corresponding to a certain level of heading on the summary tree; `target-position` refers to the specific position of the target keyword in the title content (the same keyword may appear multiple times in the same content), also displayed in array form; `target-position-startIndex` is the starting position of the target keyword in the title content; `target-position-endIndex` is the ending position of the target keyword in the title content. The specific steps include:
[0100] Step 1: Using the `target-title-index` in the data format `{keyword:“”,target:[title:{index:“”,content:“”},position:[startIndex:“”,endIndex:“”]]}` as the anchor point, locate the position of the document displayed in the browser through the overview tree of the target text. Since users can choose whether to expand the text content under a certain level of heading in the overview tree data, when expanded, all content under that level of heading is displayed; when not expanded, all content under that level of heading is hidden. If the text content of a certain level of heading corresponding to the current `target-title-index` is not expanded, the text content of that level of heading can be expanded in the overview tree data first, so that the above search structure can be displayed subsequently in the expanded text content.
[0101] Step 2: After completing the anchor content positioning and display, the target keyword positioning data in position is used to complete the positioning and highlighting in the current anchor content. The position of the last text content displayed in step 1 is located by using position-startIndex and position-endIndex. After finding the corresponding position, the style of the position area is modified to make it highlight.
[0102] Step 3: Repeat steps 1 and 2 until all search results have been processed. However, if the document is too large or the amount of search result data is too much, the web front-end system will use a progressive processing method to complete the location and highlighting. The so-called progressive method means that a batch of data is pre-processed for location and highlighting. Among them, data not displayed in the search results can be selected by the user for location and highlighting, or the system can use an asynchronous method for location and highlighting.
[0103] Please see Figure 8 This disclosure also provides a keyword retrieval device 800, which includes:
[0104] The receiving unit 801 is used to receive a retrieval request sent by the client. The retrieval request is used to indicate the target keywords to be retrieved in the target text. The retrieval request is sent by the client based on the summary tree data of the target text displayed in the browser. The summary tree data is used to reflect the headings at all levels of the target text and the hierarchical relationship information of the headings at all levels.
[0105] The retrieval unit 802 is used to respond to a retrieval request, obtain the target text, and perform a target keyword retrieval in the target text to obtain retrieval results. The retrieval results include text information of the text containing the target keywords in the target text.
[0106] The sending unit 803 is used to send the search results to the client so that the client can display text information in the summary tree data.
[0107] Optionally, the server includes a retrieval module and a location module; the retrieval request includes text identifier information of target keywords and target text; when the retrieval unit 802 responds to the retrieval request, obtains the target text, performs a target keyword retrieval in the target text to obtain retrieval results, and the retrieval results include text information of text containing target keywords in the target text, the following steps are performed:
[0108] The positioning module obtains the target text based on the text identification information and sends the target text to the retrieval module.
[0109] The retrieval module retrieves a structured dataset from the target text based on the target keywords. The structured dataset includes multiple first structured data corresponding to the target keywords. Each first structured data includes the target keyword and the first position information of the target keyword in the target text.
[0110] The structured dataset is retrieved and reorganized using the location module to generate search results.
[0111] Optionally, when the retrieval unit 802 performs retrieval and reorganization processing on the structured dataset through the positioning module to generate the retrieval results, it performs the following steps: parses the first position information of the target keyword in the target text of each first structured data, and obtains the position index corresponding to the target keyword in each first structured data and the text content corresponding to the target keyword in each first structured data; wherein, the position index corresponding to the target keyword in each first structured data corresponds to the target-level title in the summary tree data; the text content corresponding to the target keyword in each first structured data refers to the text content corresponding to the position index corresponding to the target keyword in each first structured data;
[0112] Replace the first position information of the target keyword in each first structured data with the position index and text content corresponding to the target keyword in the corresponding first structured data to generate the second structured data corresponding to each first structured data; generate search results based on the second structured data corresponding to each first structured data.
[0113] Optionally, when the retrieval unit 802 obtains a structured dataset by performing a retrieval in the target text based on the target keywords through the retrieval module, it performs the following steps: performing a retrieval in the target text using an inverted index method based on the target keywords through the retrieval module to obtain a structured dataset.
[0114] The keyword retrieval device 800 provided in this embodiment can realize the various processes in the above-described keyword retrieval method embodiments, and will not be repeated here to avoid repetition.
[0115] Please see Figure 9 This disclosure also provides a keyword display device 900, which includes:
[0116] Display unit 901 is used to display the summary tree data of the target text; the summary tree data is used to reflect the headings at all levels of the target text, as well as the hierarchical relationship of the headings at all levels;
[0117] Sending unit 902 is used to send a search request to the server in response to a search request generated for the summary tree data; the search request is used to instruct the server to respond to the search request, obtain the target text, perform a search for the target keywords in the target text to obtain search results, and return the search results;
[0118] The receiving unit 903 is used to receive the search results returned by the server. The search results include text information containing the target keywords in the target text.
[0119] The display unit 901 is also used to display text information in the summary tree data.
[0120] Optionally, the text information includes text content containing target keywords in the target text and the position information of the text content in the target text. When the display unit 901 displays the text information in the summary tree data, it performs the following steps: locating the target-level title to which the position information belongs in the summary tree data; expanding and displaying the text information located at the position information under the target-level title; and displaying the target keywords included in the text information according to a preset display method.
[0121] Optionally, when displaying the target keywords included in the text content according to a preset display method, display unit 901 performs the following steps:
[0122] If the amount of text content exceeds a quantity threshold or the size of the text content exceeds a preset value, the target keywords included in the text content are displayed in a progressive manner and according to a preset display method. The progressive manner means displaying a part of the text content or the target keywords included in the text content, and when a switching display instruction is received, displaying the remaining undisplayed content or the target keywords in the text content.
[0123] The keyword display device 900 provided in this embodiment can implement the various processes in the above-described keyword display method embodiments. To avoid repetition, it will not be described again here.
[0124] See Figure 10 , Figure 10 This is a structural diagram of server 1000 provided in another embodiment of this disclosure, as follows: Figure 10 As shown, server 1000 includes: processor 1001, memory 1002, and computer program stored in memory 1002 and executable on the processor. The various components of server 1000 are coupled together via bus interface 1003. When the computer program is executed by processor 1001, it performs the following steps:
[0125] Receive a retrieval request sent by the client. The retrieval request is used to indicate the target keywords to be retrieved in the target text. The retrieval request is sent by the client based on the summary tree data of the target text displayed in the browser. The summary tree data is used to reflect the headings at all levels of the target text and the hierarchical relationship information of the headings at all levels.
[0126] In response to a search request, the target text is retrieved and the target keywords are searched within the target text to obtain search results. The search results include text information of the text containing the target keywords in the target text.
[0127] The search results are sent to the client so that the client can display text information in the summary tree data.
[0128] Optionally, the server includes a retrieval module and a location module; the retrieval request includes target keywords and text identifier information of the target text, and when the processor 1001 responds to the retrieval request, obtains the target text, and performs a retrieval search within the target text to obtain the retrieval results, it executes the following steps:
[0129] The positioning module obtains the target text based on the text identification information and sends the target text to the retrieval module.
[0130] The retrieval module retrieves a structured dataset from the target text based on the target keywords. The structured dataset includes multiple first structured data corresponding to the target keywords. Each first structured data includes the target keyword and the first position information of the target keyword in the target text.
[0131] The structured dataset is retrieved and reorganized using the location module to generate search results.
[0132] Optionally, when the processor 1001 performs retrieval and reorganization processing on the structured dataset through the positioning module to generate retrieval results, it executes the following steps:
[0133] The first position information of the target keyword in the target text of each first structured data is parsed and processed to obtain the position index and text content corresponding to the target keyword in each first structured data. The position index of the target keyword in each first structured data corresponds to the target-level title in the summary tree data. The text content of the target keyword in each first structured data refers to the text content corresponding to the position index of the target keyword in each first structured data.
[0134] Replace the first position information of the target keyword in each first structured data with the position index and text content corresponding to the target keyword in the corresponding first structured data to generate the second structured data corresponding to each first structured data;
[0135] Search results are generated based on the second structured data corresponding to each first structured data.
[0136] Optionally, when the processor 1001 obtains a structured dataset by performing a retrieval in the target text based on the target keywords through the retrieval module, it performs the following steps:
[0137] The retrieval module uses an inverted index based on target keywords to search the target text and obtain a structured dataset.
[0138] In this embodiment, the client displays a summary tree of the target text in a browser. This summary tree reflects the headings at each level of the target text and their hierarchical relationships. When a user wants to search for target keywords in the target text, they can enter a search request on the client, which carries the target keywords. After receiving the search request, the server first locates the target text on the server and performs a target keyword search within it, obtaining search results. The search results include text information of the target text containing the keywords. Then, the server sends the search results to the client, which displays the text information in the summary tree data.
[0139] As can be seen, in this embodiment, the client only needs to display the summary tree data of the target text, without displaying the entire text content, to achieve keyword retrieval in the target text. Then, after obtaining the search results, the client displays the text information from the search results in the summary tree data. This retrieval method not only improves the effectiveness of keyword retrieval but also expands the application scenarios of keyword retrieval.
[0140] See Figure 11 , Figure 11 This is a structural diagram of a terminal device 1100 provided in another embodiment of this disclosure, as shown below. Figure 11 As shown, the terminal device 1100 includes a processor 1101, a memory 1102, and a computer program stored in the memory 1102 and executable on the processor. The various components of the terminal device 1100 are coupled together via a bus interface 1103. When the computer program is executed by the processor 1101, it performs the following steps:
[0141] Displays the summary tree data of the target text; the summary tree data is used to reflect the headings at each level of the target text, and the hierarchical relationship between the headings at each level;
[0142] In response to a search request generated for the summary tree data, a search request is sent to the server. The search request instructs the server to respond to the search request, obtain the target text, perform a search for the target keywords in the target text to obtain search results, and return the search results.
[0143] Receive the search results returned by the server. The search results include text information of texts containing the target keywords in the target text.
[0144] Text information is displayed in the summary tree.
[0145] Optionally, the text information includes text content containing target keywords in the target text and the position index of the text content in the target text. When the processor 1101 displays the text information in the summary tree data, it performs the following steps:
[0146] Locate the target-level heading to which the text content belongs in the summary tree data based on the location index;
[0147] Expand the text content located at the position index under the target-level heading, and display the target keywords included in the text content according to the preset display method.
[0148] Optionally, when the processor 1101 displays the target keywords included in the text content according to a preset display method, it performs the following steps:
[0149] If the amount of text content exceeds the quantity threshold or the size of the text content exceeds the preset value, the target keywords included in the text content will be displayed in a progressive manner and according to the preset display method. The progressive manner means that a part of the text content or the target keywords included in the text content will be displayed, and when a switching display instruction is received, the remaining undisplayed text content or the target keywords in the text content will be displayed.
[0150] In this embodiment, the client displays a summary tree of the target text in a browser. This summary tree reflects the headings at each level of the target text and their hierarchical relationships. When a user wants to search for target keywords in the target text, they can enter a search request on the client, which carries the target keywords. After receiving the search request, the server first locates the target text on the server and performs a target keyword search within it, obtaining search results. The search results include text information of the target text containing the keywords. Then, the server sends the search results to the client, which displays the text information in the summary tree data.
[0151] As can be seen, in this embodiment, the client only needs to display the summary tree data of the target text, without displaying the entire text content, to achieve keyword retrieval in the target text. Then, after obtaining the search results, the client displays the text information from the search results in the summary tree data. This retrieval method not only improves the effectiveness of keyword retrieval but also expands the application scenarios of keyword retrieval.
[0152] This disclosure also provides a terminal device, including a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the various processes of the above method embodiments and achieves the same technical effects. To avoid repetition, it will not be described again here.
[0153] This disclosure also provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the various processes of the above-described method embodiments and achieves the same technical effects. To avoid repetition, further details are omitted here. The computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0154] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0155] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause an electronic device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this disclosure.
[0156] The embodiments of this disclosure have been described above with reference to the accompanying drawings. However, this disclosure is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this disclosure without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this disclosure.
Claims
1. A keyword retrieval method, applied on a server-side, characterized in that, The method includes: The system receives a search request sent by a client. The search request is used to instruct the search to retrieve target keywords and text identification information of the target text. The search request is sent by the client when the browser displays the summary tree data of the target text but the complete content of the target text is not loaded. The summary tree data is used to reflect the headings at each level of the target text and the hierarchical relationship information of the headings at each level. In response to the retrieval request, the target text is retrieved from the full text of the target text stored on the server according to the text identifier information of the target text, and the target keyword is retrieved in the target text to obtain the retrieval result. The retrieval result includes the text information of the text containing the target keyword in the target text. The text information includes the text content of the target text containing the target keyword and the position information of the target keyword in the target text. The search results are sent to the client so that the client can locate the target-level title to which the text content belongs in the summary tree data based on the location information, and expand and display the text information under the target-level title.
2. The method according to claim 1, characterized in that, The server includes a retrieval module and a location module; the retrieval request includes the target keywords and text identifier information of the target text; the step of responding to the retrieval request, obtaining the target text, and performing a search within the target text to obtain retrieval results includes: The positioning module obtains the target text based on the text identification information and sends the target text to the retrieval module. The retrieval module retrieves a structured dataset from the target text based on the target keyword. The structured dataset includes multiple first structured data corresponding to the target keyword. Each first structured data includes the target keyword and the first position information of the target keyword in the target text. The location module performs retrieval and reorganization processing on the structured dataset to generate the retrieval results.
3. The method according to claim 2, characterized in that, The step of retrieving and reorganizing the structured dataset through the positioning module to generate the retrieval results includes: The first position information of the target keyword in each first structured data in the target text is parsed to obtain the position index and text content corresponding to the target keyword in each first structured data; wherein, the position index corresponding to the target keyword in each first structured data corresponds to the target-level title in the summary tree data; the text content corresponding to the target keyword in each first structured data refers to the text content corresponding to the position index of the target keyword in each first structured data. The first position information of the target keyword in each first structured data is replaced with the position index and text content corresponding to the target keyword in the corresponding first structured data to generate the second structured data corresponding to each first structured data. The search results are generated based on the second structured data corresponding to each of the first structured data.
4. The method according to claim 3, characterized in that, The process of obtaining a structured dataset by searching the target text based on the target keywords using the retrieval module includes: The retrieval module uses an inverted index based on the target keywords to search the target text and obtain a structured dataset.
5. A keyword display method, applied to a client, characterized in that, The method includes: Displays the summary tree data of the target text; the summary tree data is used to reflect the headings at each level of the target text, and the hierarchical relationship of the headings at each level; When the browser displays a summary tree of the target text but the full content of the target text is not loaded, in response to a search request generated for the summary tree data, a search request is sent to the server. The search request instructs the server to search for target keywords and text identifier information of the target text in the target text, retrieve the target text from the full text of the target text stored on the server based on the text identifier information of the target text, perform a search for target keywords in the target text to obtain search results, and return the search results. The system receives the search results returned by the server. The search results include text information of the text containing the target keyword in the target text. The text information includes the text content of the target text containing the target keyword and the position information of the target keyword in the target text. Based on the location information, locate the target-level heading to which the text content belongs in the summary tree data, and expand and display the text information under the target-level heading in the summary tree data.
6. The method according to claim 5, characterized in that, The location information includes the position index of the text content within the target text. The step of locating the target-level heading to which the text content belongs in the summary tree data based on the location information, and expanding and displaying the text information under the target-level heading in the summary tree data, includes: Based on the location index, the target-level heading to which the text content belongs is located in the summary tree data; The text content located at the location index is expanded and displayed under the target-level heading, and the target keywords included in the text content are displayed according to a preset display method.
7. The method according to claim 6, characterized in that, The step of displaying the target keywords included in the text content according to a preset display method includes: If the amount of text content exceeds a quantity threshold or the size of the text content exceeds a preset value, the target keywords included in the text content are displayed in a progressive manner and according to a preset display method. The progressive manner means displaying a part of the text content or the target keywords included in the text content, and when a switching display instruction is received, displaying the remaining undisplayed content or the target keywords in the text content.
8. A keyword retrieval device, characterized in that, include: The receiving unit is used to receive a retrieval request sent by a client. The retrieval request is used to indicate the target keywords to be retrieved in the target text and the text identification information of the target text. The retrieval request is sent by the client when the browser displays the summary tree data of the target text and the complete content of the target text is not loaded. The summary tree data is used to reflect the various levels of headings of the target text and the hierarchical relationship information of the various levels of headings. The retrieval unit is configured to respond to the retrieval request by retrieving the target text from the full text of the target text stored on the server according to the text identifier information of the target text and performing the target keyword retrieval in the target text to obtain retrieval results. The retrieval results include text information of the text containing the target keyword in the target text. The text information includes the text content of the target text containing the target keyword and the position information of the target keyword in the target text. The sending unit is used to send the search results to the client, so that the client can locate the target-level title to which the text content belongs in the summary tree data based on the location information, and expand and display the text information under the target-level title.
9. A keyword display device, characterized in that, include: The display unit is used to display the summary tree data of the target text; The summary tree data is used to reflect the headings at each level of the target text, as well as the hierarchical relationship of the headings at each level; The sending unit is configured to, in response to a retrieval request generated for the summary tree data, send a retrieval request to the server when the browser displays the summary tree data of the target text but the complete content of the target text is not loaded; the retrieval request is configured to instruct the server to retrieve target keywords and text identifier information of the target text in the target text, retrieve the target text from the full text of the target text stored on the server according to the text identifier information of the target text, perform target keyword retrieval in the target text to obtain retrieval results, and return the retrieval results; The receiving unit is configured to receive the search results returned by the server. The search results include text information containing the target keyword in the target text. The text information includes the text content containing the target keyword in the target text and the position information of the target keyword in the target text. The display unit is further configured to locate the target-level title to which the text content belongs in the summary tree data based on the location information, and expand and display the text information under the target-level title in the summary tree data.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 4; or, when executed by a processor, the computer program implements the method as described in any one of claims 5 to 7.
Citation Information
Patent Citations
Method and device for displaying retrieval information in hypermedia system
JP1999149479A
Method and system for structured document retrieval, retrieving device, and computer-readable recording medium where structured document retrieving program is recorded
JP2000200286A
Structured document retrieving device and structured document retrieving method
JP2007213158A