A data query method and system

By clustering and sorting the query results, displaying the literature abstracts in the target category, the problem that users need to read a large number of documents one by one is solved, and the query efficiency and experience is improved.

CN119271856BActive Publication Date: 2025-03-25CHINA AUTOMOBILE INTELLECTUAL PROPERTY (GUANGZHOU) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411822840.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-12
Publication Date
2025-03-25
Estimated Expiration
2044-12-12

AI Technical Summary

Technical Problem

When querying documents, users need to read a large number of related documents one by one, which makes it time-consuming and labor-intensive, and it is difficult to query documents that meet their needs in a timely manner, reducing the user's query experience.

Method used

By clustering the query results on the server side, L literature categories are generated, and the categories are sorted according to the TF-IDF scores of the query words, the first and second target categories are determined, and the literature abstracts in these categories are displayed separately, reducing the number of documents that users need to read.

Benefits of technology

Through clustering and sorting, the number of documents that users need to read is significantly reduced, the efficiency and experience of users querying documents is improved, and users can find documents that meet their needs more quickly.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119271856B_ABST
    Figure CN119271856B_ABST
Patent Text Reader

Abstract

The present application discloses a data query method and system, which relates to the field of computer technology. The method includes: clustering multiple document results obtained by a query statement to obtain L document categories, determining the first N document categories as the first target category according to the number of documents in the document category, segmenting the query statement to obtain multiple query terms, determining the TF‑IDF average score corresponding to each document category in the remaining document categories based on the TF‑IDF scores of the multiple query terms in each document, determining the first M document categories in descending order of the TF‑IDF average score as the second target category, sending the document data of the first target category and the second target category to the terminal, and the terminal displays the document data to the user. The method can improve the user query experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a data query method and system. Background Art

[0002] With the development of computer technology, various documents are converted into electronic versions for archiving. For example, a large number of documents are converted into electronic versions and stored in a database. When these documents need to be read, the specified documents can be searched from the database.

[0003] In the process of searching for documents, the user can enter some keywords, and the processing device searches the database for documents associated with the keywords according to the keywords entered by the user, and displays the searched related documents to the user.

[0004] However, the processing device often displays a large number of related documents to the user, and the user needs to read each document one by one to determine whether the document meets the needs. This process is time-consuming and laborious, and it is difficult for the user to find the document that meets the needs in a timely manner, which reduces the user's query experience. Summary of the invention

[0005] The present application provides a data query method and system, which can improve the query experience.

[0006] In order to achieve the above objectives, this application adopts the following technical solutions:

[0007] In a first aspect, the present application provides a data query method, the method comprising:

[0008] The terminal obtains a query statement input by the user, generates a query request according to the query statement, and sends the query request to the server;

[0009] The server queries the document database according to the query statement carried in the query request to obtain multiple document results, clusters the multiple document results to obtain L document categories, determines the number of documents included in each document category, and sorts the document categories with the first N documents in descending order as the first target category;

[0010] The server performs word segmentation processing on the query statement carried in the query request to obtain multiple query words, calculates the word frequency-inverse document frequency TF-IDF score of each query word in the documents corresponding to the remaining document categories, determines the TF-IDF average score corresponding to each document category in the remaining document categories according to the TF-IDF score in the documents corresponding to the remaining document categories, and determines the document categories with the first M TF-IDF average scores sorted from large to small as the second target categories; wherein the remaining document categories are the categories in the L document categories except the first target category, M+N≤L;

[0011] The server returns each document category in the first target category and at least one piece of document data corresponding to each document category in the first target category to the terminal, and returns each document category in the second target category and at least one piece of document data corresponding to each document category in the second target category to the terminal, where the document data includes a document text and a document abstract;

[0012] The terminal displays each document category in the first target category and at least one document abstract corresponding to each document category in the first target category in a first area of the query result interface, and displays each document category in the second target category and at least one document abstract corresponding to each document category in the second target category in a second area of the query result interface.

[0013] In some possible implementation manners, the method further includes:

[0014] The terminal obtains a first preview operation triggered by the user for a first document corresponding to a first sub-target category in the first target category, and according to the first preview operation, displays the document text of the first document and the document abstracts of multiple documents belonging to the first sub-target category on a preview interface; or,

[0015] The terminal obtains a second preview operation triggered by the user for a second document corresponding to a second sub-target category in the second target category, and according to the second preview operation, displays the document text of the second document and the document abstracts of multiple documents belonging to the second sub-target category on a preview interface.

[0016] In some possible implementation manners, the query result interface further includes a next page control, M + N < L, and the method further includes:

[0017] The terminal obtains a first trigger operation of the user for the next page control, and according to the first trigger operation, sends a category acquisition request to the server;

[0018] The server determines P document categories from L - M - N document categories according to the category acquisition request, determines the P document categories as a third target category, and returns each document category in the third target category and at least one piece of document data corresponding to each document category in the third target category to the terminal;

[0019] The terminal displays each document category in the third target category and at least one document abstract corresponding to each document category in the third target category in the third area of ​​the query result interface, determines a first reduction number of the first target category and a second reduction number of the second target category according to the number of categories in the third target category, the sum of the first reduction number and the second reduction number being the number of categories in the third target category, determines first target remaining categories in the first target category and a first reduction ratio of the first area according to the first reduction number and the number of categories in the first target category, determines second target remaining categories in the second target category and a second reduction ratio of the second area according to the second reduction number and the number of categories in the second target category, reduces the first area according to the first reduction ratio, reduces the second area according to the second reduction ratio, displays at least one document abstract in the first target remaining category that has not been displayed in the reduced first area, and displays at least one document abstract in the second target remaining category that has not been displayed in the reduced second area, wherein the reduced sizes of the first area and the second area are the same as the size of the third area.

[0020] In some possible implementations, the method further includes:

[0021] The terminal obtains a third preview operation triggered for a third document corresponding to a third sub-target category in the third target category, and displays the document body of the third document and document abstracts of a plurality of documents belonging to the third sub-target category on a preview interface according to the third preview operation;

[0022] The terminal obtains a second trigger operation for the download control of the preview interface, and according to the second trigger operation, increases the first reduction number to a third reduction number, increases the second reduction number to a fourth reduction number, increases the number of categories of the third target category to the sum of the third reduction number and the fourth reduction number, and expands the size of the third area; displays each document category in the third target category and at least one document abstract that has not been displayed in each document category in the third target category in the expanded third area; determines the third target remaining category in the first target category and the third reduction ratio of the first area according to the third reduction number and the number of categories in the first target category, determines the fourth target remaining category in the second target category and the fourth reduction ratio of the second area according to the fourth reduction number and the number of categories in the second target category, reduces the first area according to the third reduction ratio, reduces the second area according to the fourth reduction ratio, displays at least one document abstract that has not been displayed in the third target remaining category in the reduced first area, and displays at least one document abstract that has not been displayed in the fourth target remaining category in the reduced second area.

[0023] In some possible implementations, the server searches a document database according to the query statement carried in the query request to obtain multiple document results, including:

[0024] The server performs semantic recognition on the query statement carried in the query request to obtain a semantic recognition result, and performs a query in a document database according to the semantic recognition result to obtain a first query result;

[0025] The server performs word segmentation processing on the query statement carried in the query request to obtain multiple query words, combines the multiple query words to obtain a first query formula, expands the first query formula to obtain a second query formula, the query coverage of the second query formula is greater than the query coverage of the first query formula, and searches the literature database according to the second query formula to obtain a second query result;

[0026] The server combines the first query result and the second query result to obtain multiple document results.

[0027] In a second aspect, the present application provides a data query system, the system comprising: a terminal and a server;

[0028] The terminal is used to obtain a query statement input by a user, generate a query request according to the query statement, and send the query request to a server;

[0029] The server is used to query a document database according to the query statement carried in the query request to obtain multiple document results, cluster the multiple document results to obtain L document categories, determine the number of documents included in each document category, sort the document categories with the top N document categories in descending order of the number of documents, and determine them as the first target category; perform word segmentation processing on the query statement carried in the query request to obtain multiple query words, calculate the term frequency-inverse document frequency TF-IDF score of each query word in the documents corresponding to the remaining document categories, and determine the number of documents in the remaining document categories according to the TF-IDF scores in the documents corresponding to the remaining document categories. The TF-IDF average score corresponding to each document category is used to determine the document categories with the first M document categories sorted from the largest to the smallest TF-IDF average score as the second target category; wherein the remaining document categories are the categories other than the first target category in the L document categories, M+N≤L; each document category in the first target category and at least one document data corresponding to each document category in the first target category are returned to the terminal, and each document category in the second target category and at least one document data corresponding to each document category in the second target category are returned to the terminal, wherein the document data includes the document body and the document abstract;

[0030] The terminal is used to display each document category in the first target category and at least one document abstract corresponding to each document category in the first target category in a first area of ​​the query result interface, and to display each document category in the second target category and at least one document abstract corresponding to each document category in the second target category in a second area of ​​the query result interface.

[0031] In some possible implementations, the terminal is further used to obtain a first preview operation triggered by a user for a first document corresponding to a first sub-target category in a first target category, and display the document text of the first document and document abstracts of multiple documents belonging to the first sub-target category on a preview interface according to the first preview operation; or to obtain a second preview operation triggered by a user for a second document corresponding to a second sub-target category in a second target category, and display the document text of the second document and document abstracts of multiple documents belonging to the second sub-target category on a preview interface according to the second preview operation.

[0032] In some possible implementations, the query result interface also includes a next page control, M+N <L;

[0033] The terminal is further used to obtain a first trigger operation of the user on the next page control, and send a category acquisition request to the server according to the first trigger operation;

[0034] The server is further configured to determine P document categories from the LMN document categories according to the category acquisition request, determine the P document categories as third target categories, and return each document category in the third target category and at least one document data corresponding to each document category in the third target category to the terminal;

[0035] The terminal is also used to display each document category in the third target category and at least one document abstract corresponding to each document category in the third target category in the third area of ​​the query result interface, determine a first reduction number of the first target category and a second reduction number of the second target category according to the number of categories in the third target category, the sum of the first reduction number and the second reduction number being the number of categories in the third target category, determine the first target remaining categories in the first target category and a first reduction ratio of the first area according to the first reduction number and the number of categories in the first target category, determine the second target remaining categories in the second target category and a second reduction ratio of the second area according to the second reduction number and the number of categories in the second target category, reduce the first area according to the first reduction ratio, reduce the second area according to the second reduction ratio, display at least one document abstract in the first target remaining categories that has not been displayed in the reduced first area, and display at least one document abstract in the second target remaining categories that has not been displayed in the reduced second area, wherein the reduced sizes of the first area and the second area are the same as the size of the third area.

[0036] In some possible implementations, the terminal is further used to obtain a third preview operation triggered for a third document corresponding to a third sub-target category in the third target category, and according to the third preview operation, display the document text of the third document and the document abstracts of multiple documents belonging to the third sub-target category on the preview interface; obtain a second trigger operation for a download control on the preview interface, and according to the second trigger operation, increase the first reduction quantity to a third reduction quantity, increase the second reduction quantity to a fourth reduction quantity, increase the category quantity of the third target category to the sum of the third reduction quantity and the fourth reduction quantity, and expand the size of the third area; display each document category in the third target category and the document abstracts corresponding to the third sub-target category in the expanded third area. at least one document abstract that has not been displayed in each document category in the three target categories; determining the third target remaining category in the first target category and the third reduction ratio of the first area based on the third reduction number and the number of categories in the first target category; determining the fourth target remaining category in the second target category and the fourth reduction ratio of the second area based on the fourth reduction number and the number of categories in the second target category; reducing the first area according to the third reduction ratio, reducing the second area according to the fourth reduction ratio, displaying at least one document abstract that has not been displayed in the third target remaining category in the reduced first area, and displaying at least one document abstract that has not been displayed in the fourth target remaining category in the reduced second area.

[0037] In some possible implementations, the server is specifically used to perform semantic recognition on the query statement carried in the query request to obtain a semantic recognition result, and query in a literature database based on the semantic recognition result to obtain a first query result; perform word segmentation processing on the query statement carried in the query request to obtain multiple query words, combine the multiple query words to obtain a first query formula, expand the first query formula to obtain a second query formula, the query coverage of the second query formula is larger than the query coverage of the first query formula, query in the literature database based on the second query formula to obtain a second query result; combine the first query result with the second query result to obtain multiple literature results.

[0038] In a third aspect, the present application provides a computing device, including a memory and a processor;

[0039] One or more computer programs are stored in the memory, and the one or more computer programs include instructions; when the instructions are executed by the processor, the computing device executes the method as described in any one of the first aspects.

[0040] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method as described in any one of the first aspects.

[0041] It can be seen from the above technical solution that the present application has at least the following beneficial effects:

[0042] The present application provides a data query method, which clusters the multiple document results after searching for multiple document results, and then displays the documents corresponding to different categories respectively, so that the user can first select a category and browse the documents in the category. By clustering, the number of documents that the user needs to browse is greatly reduced. Specifically, the terminal obtains the query statement input by the user, generates a query request according to the query statement, and sends the query request to the server. The server queries the document database according to the query statement carried in the query request to obtain multiple document results, clusters the multiple document results to obtain L document categories, determines the number of documents included in each document category, sorts the document data from large to small, and determines the first N document categories as the first target category. Then, the query statement is segmented to obtain multiple query words, and the word frequency-inverse document frequency TF-IDF score of each query word in the documents corresponding to the remaining document categories is calculated. According to the documents corresponding to the remaining document categories, the query word is clustered. TF-IDF scores in the documents, determine the TF-IDF average score corresponding to each document category in the remaining document categories, and determine the document categories with the first M TF-IDF average scores in descending order as the second target category; wherein the remaining document categories are the categories other than the first target category in the L document categories, M+N≤L; then, each document category in the first target category and at least one document data corresponding to each document category in the first target category are returned to the terminal, and each document category in the second target category and at least one document data corresponding to each document category in the second target category are returned to the terminal, and the document data include the document text and the document abstract. The terminal displays each document category in the first target category and at least one document abstract corresponding to each document category in the first target category in the first area of ​​the query interface, and displays each document category in the second target category and at least one document abstract corresponding to each document category in the second target category in the second area of ​​the query result interface. This method does not display the query results randomly and disorderly, but displays the query results separately in a classified manner. This can reduce a large amount of reading for users from the category dimension, making it easier for users to find documents that meet their needs more quickly and improve the user's query experience.

[0043] It should be understood that the description of technical features, technical solutions, beneficial effects or similar language in this application does not imply that all features and advantages can be realized in any single embodiment. On the contrary, it is understood that the description of features or beneficial effects means that specific technical features, technical solutions or beneficial effects are included in at least one embodiment. Therefore, the description of technical features, technical solutions or beneficial effects in this specification does not necessarily refer to the same embodiment. Furthermore, the technical features, technical solutions and beneficial effects described in the present embodiment can also be combined in any appropriate manner. Those skilled in the art will understand that the embodiment can be realized without one or more specific technical features, technical solutions or beneficial effects of a specific embodiment. In other embodiments, additional technical features and beneficial effects can also be identified in a specific embodiment that does not embody all embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 A flowchart of a data query method provided in an embodiment of the present application;

[0045] Figure 2 A schematic diagram of a query result interface provided in an embodiment of the present application;

[0046] Figure 3 A schematic diagram of a preview interface provided in an embodiment of the present application;

[0047] Figure 4 A schematic diagram of another query result interface provided in an embodiment of the present application;

[0048] Figure 5 A schematic diagram of a data query system provided in an embodiment of the present application;

[0049] Figure 6 A schematic diagram of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0050] The terms "first", "second", "third", etc. in the specification of this application and the accompanying drawings are used to distinguish different objects rather than to limit a specific order.

[0051] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0052] In order to make the technical solution of the present application clearer and easier to understand, the data query method provided by the embodiment of the present application is introduced below in conjunction with the accompanying drawings. Figure 1 As shown, the figure is a flow chart of a data query method provided by an embodiment of the present application, the method comprising:

[0053] S101. The terminal obtains a query statement input by a user, generates a query request according to the query statement, and sends the query request to a server.

[0054] A query statement may refer to a sentence input by a user, such as "automatically control the vehicle's driving speed based on the road conditions and obstacles in front of the vehicle". In some embodiments, the terminal may present a query input interface to the user, and the user may enter the query statement in the query input interface. After the terminal obtains the query statement input by the user, it may generate a query request based on the query statement, for example, by encapsulating the query statement to obtain a query request, and send the query request to the server.

[0055] S102. The server searches the document database according to the query statement carried in the query request to obtain multiple document results, clusters the multiple document results to obtain L document categories, determines the number of documents included in each document category, sorts the document categories with the first N documents in descending order, and determines them as the first target category.

[0056] In some embodiments, the server may perform semantic recognition on the query statement carried in the query request to obtain a semantic recognition result, and then perform a query in the document database based on the semantic recognition result to obtain a first query result. Exemplarily, the first query result obtained by the server in the document database based on the semantic recognition result includes 362 document results.

[0057] Then the server can also perform word segmentation processing on the query statement carried in the query request to obtain multiple query words, combine the multiple query words to obtain a first query formula, expand the first query formula to obtain a second query formula, wherein the query coverage of the second query formula is greater than the query coverage of the first query formula, and query the document database according to the second query formula to obtain a second query result. Exemplarily, the second query result obtained by the server based on the second query formula in the document database includes 275 document results.

[0058] The multiple query words include: "vehicle", "road condition", "front", "obstacle", "automatic", "control" and "driving speed". The server combines the multiple query words to obtain a first query formula. For example, the first query formula may be "vehicle and obstacle and control and driving speed", and the first query formula may also be "vehicle and road condition and control and driving speed". The first query formula may include multiple formulas. After obtaining the first query formula, the server may expand the first query formula to obtain a second query formula.

[0059] The expansion methods provided in the embodiments of the present application include three kinds. The first is to add parallel associated words. In the preset vocabulary, search for words associated with the query words in the first query formula. The associated words can be synonyms, near-synonyms, hypernyms or hyponyms, and then use the "or" relationship to perform parallel processing. Similar processing can be performed for each query word to obtain the second query formula, for example, "(vehicle or car or car) and (road condition or road section or situation)... and (driving speed or speed)". The second is to remove the query words with the "and" relationship in the first query formula. Taking the first query formula of "vehicle and obstacle and control and driving speed" as an example, the query word "control" in the first query formula can be removed to obtain the second query formula "vehicle and obstacle and driving speed". The third type is to add query words with the relationship of "and" to the first query formula. Taking the first query formula "vehicle and obstacle and control and driving speed" as an example, the query word "according to" can be added to the first query formula to obtain the second query formula "vehicle and obstacle and control and driving speed and according to".

[0060] After obtaining the first query result and the second query result, the server may combine the first query result and the second query result to obtain multiple document results.

[0061] After obtaining multiple document results, the server can cluster the multiple document results to obtain L document categories. For example, L=15, N=5, and the specific document categories can be category 1, category 2...category 15. The number of documents corresponding to each document category is shown in Table 1 below.

[0062] Table 1:

[0063]

[0064] It should be noted that Table 1 is merely exemplary.

[0065] From the data in Table 1, it can be seen that the server determines category 1, category 15, category 12, category 14 and category 3 as the first target category.

[0066] S103. The server performs word segmentation processing on the query statement carried in the query request to obtain multiple query words, calculates the TF-IDF score of each query word in the documents corresponding to the remaining document categories, determines the TD-IDF average score corresponding to each document category in the remaining document categories based on the TF-IDF scores in the documents corresponding to the remaining document categories, and determines the document categories with the top M TF-IDF average scores sorted from large to small as the second target categories.

[0067] Among them, TF-IDF is the full name of Term Frequency-Inverse Document Frequency in English, which is interpreted as term frequency-inverse document frequency in Chinese. It is used to evaluate the importance of a word to a document set or one of the documents in a corpus. The importance of a word increases in direct proportion to the number of times it appears in the document, but at the same time it decreases in inverse proportion to the frequency of its appearance in the corpus. The remaining document categories are the categories in the L document categories except the first target category, M+N≤L. For example, M=5, and multiple query terms include "vehicle", "road condition", "front", "obstacle", "automatic", "control" and "driving speed". Table 2 shows an example of TF-IDF scores in each document corresponding to a query term in the remaining document categories.

[0068] Table 2:

[0069]

[0070] It should be noted that Table 2 is merely exemplary.

[0071] As can be seen from Table 2, the TF-IDF score of document 1 is 0.3281, the TF-IDF score of document 2 is 0.3149, and so on. Based on Table 2, the TF-IDF scores of the corresponding documents in the remaining document categories can be obtained.

[0072] Taking category 13 as an example, category 13 includes document 1, document 2, document 3, document 200 and document 201, and it can be determined that the TF-IDF average score corresponding to category 13 is {(0.3281+0.3149+0.3608+0.3232+0.2478) / 5} = 0.31496. Based on a similar method, the server can calculate the TF-IDF average score of each category in the remaining document categories. Table 3 provides an example of the TF-IDF average score of each category in the remaining document categories.

[0073] Table 3:

[0074]

[0075] It should be noted that Table 3 is only exemplary.

[0076] It can be seen from Table 3 that the server determines category 8, category 6, category 5, category 9 and category 4 as the second target category.

[0077] S104. The server returns each document category in the first target category and at least one document data corresponding to each document category in the first target category to the terminal, and returns each document category in the second target category and at least one document data corresponding to each document category in the second target category to the terminal.

[0078] Literature data includes the main text and abstract.

[0079] The server returns each document category in the first target category and at least one document data corresponding to each document category in the first target category to the terminal, and returns each document category in the second target category and at least one document data corresponding to each document category in the second target category to the terminal, so as to facilitate the terminal to display this information.

[0080] S105. The terminal displays each document category in the first target category and at least one document abstract corresponding to each document category in the first target category in the first area of ​​the query result interface, and displays each document category in the second target category and at least one document abstract corresponding to each document category in the second target category in the second area of ​​the query result interface.

[0081] like Figure 2 As shown, the figure is a schematic diagram of a query result interface provided by an embodiment of the present application. The query result interface includes a first area 201, a second area 202 and a next page control 203, wherein the first area 201 is used to display each document category in the first target category and at least one document abstract corresponding to each document category in the first target category, and the second area 202 is used to display each document category in the second target category and at least one document abstract corresponding to each document category in the second target category.

[0082] It should be noted that the figure is only an example of display. In other embodiments, each category can display multiple document abstracts and is not limited to just one document abstract.

[0083] In some embodiments, the terminal obtains a first preview operation triggered by the user for a first document corresponding to a first sub - target category in a first target category. According to the first preview operation, the terminal displays the document text of the first document and the document abstracts of multiple documents belonging to the first sub - target category on the preview interface; or, the terminal obtains a second preview operation triggered by the user for a second document corresponding to a second sub - target category in a second target category. According to the second preview operation, the terminal displays the document text of the second document and the document abstracts of multiple documents belonging to the second sub - target category on the preview interface.

[0084] Among them, the first sub - target category can be any one of the above - mentioned category 1, category 15, category 12, category 14, and category 3. Taking the first sub - target category as category 1 as an example, the first document can be the document corresponding to document abstract 1 - 1, and the first preview operation can be an operation triggered for the first document, such as a click. Among them, the second sub - target category can be any one of the above - mentioned category 8, category 6, category 5, category 9, and category 4. Taking the second sub - target category as category 8 as an example, the second document can be the document corresponding to document abstract 8 - 1, and the second preview operation can be an operation triggered for the second document, such as a click.

[0085] For the sake of easy understanding, the following takes the terminal displaying the document text of the first document as an example for introduction. As Figure 3 shown, this figure is a schematic diagram of a preview interface provided by an embodiment of the present application. The preview interface includes: a text display area 301 and a recommendation area 302. Among them, the text display area 301 is used to display the document text, and the recommendation area 302 is used to display the document abstracts of multiple documents belonging to the first sub - target category, so as to facilitate the user to view other documents.

[0086] In some embodiments, M + N < L. For example, M = 5, N = 5, L = 15. The terminal obtains a first trigger operation of the user for the next - page control 203. According to this first trigger operation, the terminal sends a category acquisition request to the server. The server, according to this category acquisition request, determines P document categories from L - M - N document categories, determines these P document categories as the third target category, and returns each document category in the third target category and at least one document data corresponding to each document category in the third target category to the terminal.

[0087] Exemplarily, P = 2. The process by which the server selects P document categories can be similar to the process of selecting M document categories, which will not be elaborated here.

[0088] The terminal displays each document category in the third target category and at least one document abstract corresponding to each document category in the third target category in the third area of the query result interface. The process of the terminal displaying the third area is similar to the process of displaying the first area or the second area.

[0089] The terminal determines a first reduction number of the first target category and a second reduction number of the second target category according to the number of categories in the third target category, and the sum of the first reduction number and the second reduction number is the number of categories in the third target category.

[0090] Exemplarily, the terminal may first determine whether the number of categories in the third target category (i.e., P) is an odd number or an even number. If P is an even number, P is divided equally, and the first reduction number = the second reduction number = P / 2. If P is an odd number, the first reduction number = the second reduction number + 1, the first reduction number + the second reduction number = P, or, the first reduction number + 1 = the second reduction number, the first reduction number + the second reduction number = P.

[0091] The terminal determines the remaining first target categories in the first target category and the first reduction ratio of the first area based on the first reduction quantity and the number of categories in the first target category, and determines the remaining second target categories in the second target category and the second reduction ratio of the second area based on the second reduction quantity and the number of categories in the second target category.

[0092] Exemplarily, the terminal may subtract the first reduction number from the number of categories in the first target category (ie, N) to obtain the first target remaining categories, and the terminal may determine the first reduction ratio by the ratio of the first reduction number to N. The terminal determines the second target remaining categories and the second reduction ratio in a similar manner.

[0093] The terminal reduces the first area according to a first reduction ratio, reduces the second area according to a second reduction ratio, displays at least one document abstract that has not been displayed in the remaining categories of the first target in the reduced first area, and displays at least one document abstract that has not been displayed in the remaining categories of the second target in the reduced second area, wherein the reduced sizes of the first area and the second area are the same as the size of the third area.

[0094] like Figure 4 As shown, this figure is a schematic diagram of another query result interface provided by an embodiment of the present application. The query result interface includes a third area 403, a reduced first area 201, and a reduced second area 202. Figure 2 and Figure 4 , it can be seen that the size of the first and second regions reduced is the same as the size of the third region. Figure 4 The first reduction amount shown in = the second reduction amount = 1.

[0095] In some embodiments, the terminal obtains a third preview operation triggered for a third document corresponding to a third sub-target category in the third target category, and displays the document body of the third document and document abstracts of multiple documents belonging to the third sub-target category on the preview interface according to the third preview operation. The process of the terminal displaying the third document on the preview interface is similar to Figure 3 The examples shown are similar and are not repeated here.

[0096] In some embodiments, the preview interface includes a download control, which is used to download documents. If the terminal obtains a second trigger operation for the download control, it indicates that the document may meet the needs of the user, so more document categories that have not been displayed are displayed to avoid omission or letting the user miss some documents. According to the second trigger operation, the terminal can increase the first reduction number to a third reduction number, increase the second reduction number to a fourth reduction number, and increase the number of categories of the third target category to the sum of the third reduction number and the fourth reduction number. For example, the third reduction number=the fourth reduction number=2, so the number of categories of the third target category is 4.

[0097] The terminal can further expand the size of the third area, and then display each document category in the third target category and at least one document abstract that has not been displayed in each document category in the third target category in the expanded third area. After the user selects a category that has not been displayed, this method automatically increases the display weight (or proportion) of the category that has not been displayed, thereby avoiding the situation where important documents are not displayed to the user for reading due to display logic problems, thereby reducing the probability of the user missing or omitting important documents to a certain extent.

[0098] Next, the terminal determines the third target remaining categories in the first target category and the third reduction ratio of the first area based on the third reduction number and the number of categories in the first target category, determines the fourth target remaining categories in the second target category and the fourth reduction ratio of the second area based on the fourth reduction number and the number of categories in the second target category, reduces the first area according to the third reduction ratio, reduces the second area according to the fourth reduction ratio, displays at least one document abstract in the third target remaining category that has not been displayed in the reduced first area, and displays at least one document abstract in the fourth target remaining category that has not been displayed in the reduced second area. This process is similar to the above-mentioned embodiment and will not be repeated here.

[0099] Based on the above description, an embodiment of the present application provides a data query method, which improves the coverage of the query by expanding the query formula, so that more query results (document results) can be obtained; when the query results become more, it will increase the difficulty for users to select documents that meet their needs. This method clusters the query results and displays the query results by category, allowing users to browse under a specific category, thereby reducing the number of documents read by users, improving the efficiency of users' querying documents, and thus improving the query experience; further, the method also dynamically adjusts the category of documents and specific document summaries displayed to users according to the user's real-time feedback operations, thereby further enabling users to query documents that meet their needs more quickly.

[0100] Combination of the above Figures 1 to 4 The data query method provided in the embodiment of the present application is introduced in detail. The system and device provided in the embodiment of the present application will be introduced in conjunction with the accompanying drawings.

[0101] like Figure 5 As shown, this figure is a schematic diagram of a data query system provided by an embodiment of the present application, the system includes: a terminal 501 and a server 502;

[0102] The terminal 501 is used to obtain a query statement input by a user, generate a query request according to the query statement, and send the query request to the server 502;

[0103] The server 502 is used to query the document database according to the query statement carried in the query request to obtain multiple document results, cluster the multiple document results to obtain L document categories, determine the number of documents included in each document category, sort the document categories with the top N documents in descending order of the number of documents, and determine them as the first target category; perform word segmentation processing on the query statement carried in the query request to obtain multiple query words, calculate the term frequency-inverse document frequency TF-IDF score of each query word in the documents corresponding to the remaining document categories, and determine the number of documents in each remaining document category according to the TF-IDF scores in the documents corresponding to the remaining document categories. TF-IDF average scores corresponding to the document categories, and determining the document categories with the first M TF-IDF average scores sorted from large to small as the second target categories; wherein the remaining document categories are the categories other than the first target category in the L document categories, M+N≤L; returning each document category in the first target category and at least one document data corresponding to each document category in the first target category to the terminal 501, and returning each document category in the second target category and at least one document data corresponding to each document category in the second target category to the terminal 501, wherein the document data includes the document body and the document abstract;

[0104] The terminal 501 is used to display each document category in the first target category and at least one document abstract corresponding to each document category in the first target category in the first area of ​​the query result interface, and to display each document category in the second target category and at least one document abstract corresponding to each document category in the second target category in the second area of ​​the query result interface.

[0105] In some possible implementations, the terminal 501 is further used to obtain a first preview operation triggered by a user for a first document corresponding to a first sub-target category in a first target category, and display the document text of the first document and document abstracts of multiple documents belonging to the first sub-target category on a preview interface according to the first preview operation; or to obtain a second preview operation triggered by a user for a second document corresponding to a second sub-target category in a second target category, and display the document text of the second document and document abstracts of multiple documents belonging to the second sub-target category on a preview interface according to the second preview operation.

[0106] In some possible implementations, the query result interface also includes a next page control, M+N <L;

[0107] The terminal 501 is further used to obtain a first trigger operation of the user for the next page control, and send a category acquisition request to the server 502 according to the first trigger operation;

[0108] The server 502 is further configured to determine P document categories from the LMN document categories according to the category acquisition request, determine the P document categories as third target categories, and return each document category in the third target category and at least one document data corresponding to each document category in the third target category to the terminal 501;

[0109] The terminal 501 is further configured to display each document category in the third target category and at least one document abstract corresponding to each document category in the third target category in the third area of ​​the query result interface, determine a first reduction number of the first target category and a second reduction number of the second target category according to the number of categories in the third target category, the sum of the first reduction number and the second reduction number being the number of categories in the third target category, determine the first target remaining categories in the first target category and a first reduction ratio of the first area according to the first reduction number and the number of categories in the first target category, determine the second target remaining categories in the second target category and a second reduction ratio of the second area according to the second reduction number and the number of categories in the second target category, reduce the first area according to the first reduction ratio, reduce the second area according to the second reduction ratio, display at least one document abstract in the first target remaining categories that has not been displayed in the reduced first area, and display at least one document abstract in the second target remaining categories that has not been displayed in the reduced second area, wherein the reduced sizes of the first area and the second area are the same as the size of the third area.

[0110] In some possible implementations, the terminal 501 is further used to obtain a third preview operation triggered for a third document corresponding to a third sub-target category in the third target category, and display the document text of the third document and document abstracts of multiple documents belonging to the third sub-target category on the preview interface according to the third preview operation; obtain a second trigger operation for a download control on the preview interface, and according to the second trigger operation, increase the first reduction quantity to a third reduction quantity, increase the second reduction quantity to a fourth reduction quantity, increase the category quantity of the third target category to the sum of the third reduction quantity and the fourth reduction quantity, and expand the size of the third area; display each document category in the third target category in the expanded third area, and at least one document abstract that has not been displayed in each document category in the third target category; determining the third target remaining categories in the first target category and the third reduction ratio of the first area according to the third reduction number and the number of categories in the first target category, determining the fourth target remaining categories in the second target category and the fourth reduction ratio of the second area according to the fourth reduction number and the number of categories in the second target category, reducing the first area according to the third reduction ratio, reducing the second area according to the fourth reduction ratio, displaying at least one document abstract that has not been displayed in the third target remaining category in the reduced first area, and displaying at least one document abstract that has not been displayed in the fourth target remaining category in the reduced second area.

[0111] In some possible implementations, the server 502 is specifically used to perform semantic recognition on the query statement carried in the query request to obtain a semantic recognition result, and query in a literature database based on the semantic recognition result to obtain a first query result; perform word segmentation processing on the query statement carried in the query request to obtain multiple query words, combine the multiple query words to obtain a first query formula, expand the first query formula to obtain a second query formula, the query coverage of the second query formula is larger than the query coverage of the first query formula, query in the literature database based on the second query formula to obtain a second query result; combine the first query result with the second query result to obtain multiple literature results.

[0112] The data query system according to the embodiment of the present application may correspond to executing the method described in the embodiment of the present application, and the above-mentioned other operations and / or functions of each module / unit of the data query system are respectively to implement Figure 1 For the sake of brevity, the corresponding processes of each method in the illustrated embodiment are not described in detail here.

[0113] The embodiment of the present application also provides a computing device, which can be a terminal or a server.

[0114] like Figure 6 As shown, this figure is a schematic diagram of a computing device provided in an embodiment of the present application, and the computing device 600 includes a bus 601, a processor 602, a communication interface 603 and a memory 604. The processor 602, the memory 604 and the communication interface 603 communicate through the bus 601.

[0115] The bus 601 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0116] The processor 602 may be any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0117] The communication interface 603 is used for communicating with the outside.

[0118] The memory 604 may include a volatile memory, such as a random access memory (RAM). The memory 604 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).

[0119] The memory 604 stores executable codes, and the processor 602 executes the executable codes to perform the aforementioned data query method.

[0120] Specifically, in implementing Figure 5 In the case of the embodiment shown, and Figure 5 When each module or unit of the data query system described in the embodiment is implemented by software, the execution Figure 5 The software or program code required for the functions of each module / unit in the system may be partially or completely stored in the memory 604. The processor 602 executes the program code corresponding to each unit stored in the memory 604 to perform the aforementioned data query method.

[0121] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to execute the above-mentioned data query method.

[0122] The embodiment of the present application further provides a computer program product, which includes one or more computer instructions. When the computer instructions are loaded and executed on a computing device, the process or function described in the embodiment of the present application is generated in whole or in part.

[0123] The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer or data center to another website, computer or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means.

[0124] When the computer program product is executed by a computer, the computer executes any of the aforementioned data query methods. The computer program product may be a software installation package, and when any of the aforementioned data query methods is needed, the computer program product may be downloaded and executed on a computer.

[0125] The descriptions of the processes or structures corresponding to the above-mentioned figures have different emphases. For parts that are not described in detail in a certain process or structure, please refer to the relevant descriptions of other processes or structures.

[0126] The above description is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application.

Claims

1. A data query method, characterized in that: The method includes: The terminal obtains a query statement input by a user, generates a query request according to the query statement, and sends the query request to the server; The server queries in a literature database according to the query statement carried in the query request, obtains multiple literature results, clusters the multiple literature results to obtain L literature categories, determines the number of literatures included in each literature category, sorts the literature categories with the top N literature numbers from largest to smallest, and determines them as the first target categories; The server performs word segmentation processing on the query statement carried in the query request to obtain multiple query words, calculates the term frequency-inverse document frequency TF-IDF scores of each query word in the literatures corresponding to the remaining literature categories, determines the TF-IDF average score corresponding to each literature category in the remaining literature categories according to the TF-IDF scores in the literatures corresponding to the remaining literature categories, and determines the literature categories with the top M TF-IDF average scores sorted from largest to smallest as the second target categories; wherein, the remaining literature categories are the categories in the L literature categories except the first target categories, and M + N ≤ L; The server returns each literature category in the first target categories, and at least one piece of literature data corresponding to each literature category in the first target categories to the terminal, and returns each literature category in the second target categories, and at least one piece of literature data corresponding to each literature category in the second target categories to the terminal, and the literature data includes a literature text and a literature abstract; The terminal displays each literature category in the first target categories, and at least one literature abstract corresponding to each literature category in the first target categories in a first area of a query result interface, and displays each literature category in the second target categories, and at least one literature abstract corresponding to each literature category in the second target categories in a second area of the query result interface.

2. The method according to claim 1, characterized in that The method further includes: The terminal obtains a first preview operation triggered by the user for a first literature corresponding to a first sub-target category in the first target categories, and displays the literature text of the first literature and the literature abstracts of multiple literatures belonging to the first sub-target category on a preview interface according to the first preview operation; or, The terminal obtains a second preview operation triggered by the user for a second literature corresponding to a second sub-target category in the second target categories, and displays the literature text of the second literature and the literature abstracts of multiple literatures belonging to the second sub-target category on a preview interface according to the second preview operation.

3. The method according to claim 1, characterized in that The query result interface further includes a next page control, M + N < L, and the method further includes: The terminal obtains a first trigger operation by the user for the next page control, and sends a category acquisition request to the server according to the first trigger operation; The server determines P document categories from the LMN document categories according to the category acquisition request, determines the P document categories as third target categories, and returns each document category in the third target category and at least one document data corresponding to each document category in the third target category to the terminal; The terminal displays each document category in the third target category and at least one document abstract corresponding to each document category in the third target category in the third area of ​​the query result interface, determines a first reduction number of the first target category and a second reduction number of the second target category according to the number of categories in the third target category, the sum of the first reduction number and the second reduction number being the number of categories in the third target category, determines first target remaining categories in the first target category and a first reduction ratio of the first area according to the first reduction number and the number of categories in the first target category, determines second target remaining categories in the second target category and a second reduction ratio of the second area according to the second reduction number and the number of categories in the second target category, reduces the first area according to the first reduction ratio, reduces the second area according to the second reduction ratio, displays at least one document abstract in the first target remaining category that has not been displayed in the reduced first area, and displays at least one document abstract in the second target remaining category that has not been displayed in the reduced second area, wherein the reduced sizes of the first area and the second area are the same as the size of the third area.

4. The method according to claim 3, characterized in that The method further comprises: The terminal obtains a third preview operation triggered for a third document corresponding to a third sub-target category in the third target category, and displays the document body of the third document and document abstracts of a plurality of documents belonging to the third sub-target category on a preview interface according to the third preview operation; The terminal obtains a second trigger operation for the download control of the preview interface, and according to the second trigger operation, increases the first reduction number to a third reduction number, increases the second reduction number to a fourth reduction number, increases the number of categories of the third target category to the sum of the third reduction number and the fourth reduction number, and expands the size of the third area; displays each document category in the third target category and at least one document abstract that has not been displayed in each document category in the third target category in the expanded third area; determines the third target remaining category in the first target category and the third reduction ratio of the first area according to the third reduction number and the number of categories in the first target category, determines the fourth target remaining category in the second target category and the fourth reduction ratio of the second area according to the fourth reduction number and the number of categories in the second target category, reduces the first area according to the third reduction ratio, reduces the second area according to the fourth reduction ratio, displays at least one document abstract that has not been displayed in the third target remaining category in the reduced first area, and displays at least one document abstract that has not been displayed in the fourth target remaining category in the reduced second area.

5. The method according to claim 1, characterized in that The server searches the document database according to the query statement carried in the query request to obtain multiple document results, including: The server performs semantic recognition on the query statement carried in the query request to obtain a semantic recognition result, and performs a query in a document database according to the semantic recognition result to obtain a first query result; The server performs word segmentation processing on the query statement carried in the query request to obtain multiple query words, combines the multiple query words to obtain a first query formula, expands the first query formula to obtain a second query formula, the query coverage of the second query formula is greater than the query coverage of the first query formula, and searches the literature database according to the second query formula to obtain a second query result; The server combines the first query result and the second query result to obtain multiple document results.

6. A data query system, characterized in that: The system comprises: a terminal and a server; The terminal is used to obtain a query statement input by a user, generate a query request according to the query statement, and send the query request to a server; The server is used to query a document database according to the query statement carried in the query request to obtain multiple document results, cluster the multiple document results to obtain L document categories, determine the number of documents included in each document category, sort the document categories with the top N document categories in descending order of the number of documents, and determine them as the first target category; perform word segmentation processing on the query statement carried in the query request to obtain multiple query words, calculate the term frequency-inverse document frequency TF-IDF score of each query word in the documents corresponding to the remaining document categories, and determine the number of documents in the remaining document categories according to the TF-IDF scores in the documents corresponding to the remaining document categories. The TF-IDF average score corresponding to each document category is used to determine the document categories with the first M document categories sorted from the largest to the smallest TF-IDF average score as the second target category; wherein the remaining document categories are the categories other than the first target category in the L document categories, M+N≤L; each document category in the first target category and at least one document data corresponding to each document category in the first target category are returned to the terminal, and each document category in the second target category and at least one document data corresponding to each document category in the second target category are returned to the terminal, wherein the document data includes the document body and the document abstract; The terminal is used to display each document category in the first target category and at least one document abstract corresponding to each document category in the first target category in a first area of ​​the query result interface, and to display each document category in the second target category and at least one document abstract corresponding to each document category in the second target category in a second area of ​​the query result interface.

7. The system according to claim 6, characterized in that The terminal is further configured to obtain a first preview operation triggered by a user for a first document corresponding to a first sub-target category in a first target category, and display the document body of the first document and document abstracts of a plurality of documents belonging to the first sub-target category on a preview interface according to the first preview operation; Alternatively, a second preview operation triggered by the user for a second document corresponding to a second sub-target category in a second target category is obtained, and according to the second preview operation, the document text of the second document and document abstracts of multiple documents belonging to the second sub-target category are displayed on the preview interface.

8. The system according to claim 6, characterized in that The query result interface also includes a next page control, M+N <L; The terminal is further used to obtain a first trigger operation of the user on the next page control, and send a category acquisition request to the server according to the first trigger operation; The server is further configured to determine P document categories from the LMN document categories according to the category acquisition request, determine the P document categories as third target categories, and return each document category in the third target category and at least one document data corresponding to each document category in the third target category to the terminal; The terminal is also used to display each document category in the third target category and at least one document abstract corresponding to each document category in the third target category in the third area of ​​the query result interface, determine a first reduction number of the first target category and a second reduction number of the second target category according to the number of categories in the third target category, the sum of the first reduction number and the second reduction number being the number of categories in the third target category, determine the first target remaining categories in the first target category and a first reduction ratio of the first area according to the first reduction number and the number of categories in the first target category, determine the second target remaining categories in the second target category and a second reduction ratio of the second area according to the second reduction number and the number of categories in the second target category, reduce the first area according to the first reduction ratio, reduce the second area according to the second reduction ratio, display at least one document abstract in the first target remaining categories that has not been displayed in the reduced first area, and display at least one document abstract in the second target remaining categories that has not been displayed in the reduced second area, wherein the reduced sizes of the first area and the second area are the same as the size of the third area.

9. The system according to claim 8, characterized in that The terminal is further used to obtain a third preview operation triggered for a third document corresponding to a third sub-target category in the third target category, and according to the third preview operation, display the document body of the third document and the document abstracts of multiple documents belonging to the third sub-target category on the preview interface; obtain a second trigger operation for a download control on the preview interface, and according to the second trigger operation, increase the first reduction quantity to a third reduction quantity, increase the second reduction quantity to a fourth reduction quantity, increase the category quantity of the third target category to the sum of the third reduction quantity and the fourth reduction quantity, and expand the size of the third area; display each document category in the third target category and the document abstracts corresponding to the third sub-target category in the expanded third area. at least one document abstract that has not been displayed in each document category; determining the third target remaining category in the first target category and the third reduction ratio of the first area based on the third reduction number and the number of categories in the first target category; determining the fourth target remaining category in the second target category and the fourth reduction ratio of the second area based on the fourth reduction number and the number of categories in the second target category; reducing the first area according to the third reduction ratio, reducing the second area according to the fourth reduction ratio, displaying at least one document abstract that has not been displayed in the third target remaining category in the reduced first area, and displaying at least one document abstract that has not been displayed in the fourth target remaining category in the reduced second area.

10. The system according to claim 6, characterized in that The server is specifically configured to perform semantic recognition on the query statement carried in the query request to obtain a semantic recognition result, and perform a query in a document database according to the semantic recognition result to obtain a first query result; The query statement carried in the query request is segmented to obtain multiple query words, the multiple query words are combined to obtain a first query formula, the first query formula is expanded to obtain a second query formula, the query coverage of the second query formula is greater than the query coverage of the first query formula, and a query is performed in a literature database according to the second query formula to obtain a second query result; the first query result is combined with the second query result to obtain multiple literature results.

Citation Information

Patent Citations

  • Multilingual literature classification method and device and storage medium

    CN112612889A

  • Medical data information retrieval method based on co-occurrence analysis and spectral clustering

    CN114691826A