Multi-vector library parallel retrieval method and device based on retrieval enhancement
By adopting multi-vector library parallel search method and search term enhancement technology in the field of scientific and technological intelligence, the problem of unsatisfactory search results of single vector library is solved, and more efficient and accurate information retrieval is achieved.
Patent Information
- Application Number
- CN202510075057.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-17
- Publication Date
- 2025-05-13
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the field of scientific and technological intelligence, due to the wide distribution of data content and large amount of data, the search results of the single vector library are not ideal, resulting in insufficient accuracy of information retrieval.
The parallel search method of multi-vector library based on search enhancement is adopted. The query input is input in the local knowledge base for parallel search of multiple vector libraries to obtain the initial search results, and these results are combined with the original query as enhanced search terms, and input a large language model to obtain the final search results.
Through parallel search of local knowledge base and enhanced search terms, the accuracy and speed of information retrieval is improved, and targeted search information can be screened out more accurately.
Smart Images

Figure CN119988430A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of retrieval technology, and in particular to a multi-vector library parallel retrieval method and device based on retrieval enhancement. Background Art
[0002] In the process of implementing the big language model in the field of scientific and technological intelligence, since scientific and technological intelligence data collects incremental data based on the source of information every day; at the same time, the amount of historical data is huge; the data content is widely distributed, such as strategic policy-related: popular science, policies and regulations, scientific and technological strategy, etc.; there are also science and technology-related, such as: biomedicine and health, new energy, financial technology, intelligent transportation, transuranium nuclides, etc.; if these different categories of text information are placed in a vector library, the vector space will be very large, resulting in unsatisfactory retrieval results. Therefore, there is an urgent need for a method to improve the accuracy of retrieving scientific and technological intelligence information. Summary of the invention
[0003] The purpose of this application is to provide a multi-vector library parallel retrieval method and device based on retrieval enhancement, which can improve the accuracy of information retrieval.
[0004] To achieve the above objectives, this application provides the following solutions:
[0005] In a first aspect, the present application provides a multi-vector library parallel retrieval method based on retrieval enhancement, comprising:
[0006] Inputting the query into the local knowledge base and performing parallel retrieval of multiple vector libraries to obtain a first set number of retrieval results; the local knowledge base includes a second set number of vector libraries, each of which includes documents in a preset field;
[0007] The first set number of search results are used as enhanced search terms, the query input is combined with the enhanced search terms, and the combined content is used as input of a large language model to obtain a final search result.
[0008] Optionally, the query is input into the local knowledge base to perform parallel retrieval of multiple vector libraries to obtain a first set number of retrieval results, specifically including:
[0009] A thread is applied for the search program of each vector library for the query input, and the second set number of threads are used as parallel programs to obtain the first set number of search results.
[0010] Optionally, applying for a thread for the search program in each vector library for the query input, using the second set number of threads as a parallel program to obtain the first set number of search results, specifically includes:
[0011] Applying a thread for searching the query input in each vector library, using the second set number of threads as a parallel program, and obtaining the first third set number of search segments with a high degree of matching with the query input from each vector library;
[0012] The first set number of search segments with the highest matching degree with the query input among the obtained multiple search segments are used as the first set number of search results.
[0013] Optionally, obtaining the first third set number of search segments with high matching degree with the query input from each vector library specifically includes:
[0014] Traversing the local knowledge base, and determining in turn whether each vector library is loaded into the local memory;
[0015] If the currently traversed vector library is loaded into the local memory, the query input is searched in the currently traversed vector library to obtain the first third set number of search segments with high matching degree with the query input;
[0016] If the currently traversed vector library is not loaded into the local memory, a memory block is allocated for the currently traversed vector library according to the size of the currently traversed vector library, the currently traversed vector library is loaded into the memory block, and the query input is searched in the currently traversed vector library to obtain the first third set number of search fragments with a high matching degree with the query input.
[0017] Optionally, the first set number and the third set number are both 10.
[0018] Optionally, the query input is searched in the currently traversed vector library to obtain a third set number of search segments with a high degree of matching with the query input;
[0019] The Euclidean distance between the query input and each segment in the currently traversed vector library is calculated, and the first third set number of segments with the smallest Euclidean distance are used as the first third set number of search segments with the highest matching degree with the query input.
[0020] Optionally, the large language model is ChatGPT.
[0021] Optionally, taking the first set number of search segments with high matching degree with the query input among the obtained multiple search segments as the first set number of search results specifically includes:
[0022] Repetitive segments are removed from the multiple search segments to obtain multiple search segments after repeated processing;
[0023] The first set number of search segments having the highest matching degree with the query input among the multiple search segments after repeated processing are used as the first set number of search results.
[0024] In a second aspect, the present application provides a multi-vector library parallel retrieval device based on retrieval enhancement, the multi-vector library parallel retrieval device based on retrieval enhancement comprises:
[0025] A local search module, used for inputting a query into a local knowledge base to perform parallel search of multiple vector libraries to obtain a first set number of search results; the local knowledge base includes a second set number of vector libraries, each vector library includes a document in a preset field;
[0026] The enhanced search module is used to use the first set number of search results as enhanced search terms, combine the query input with the enhanced search terms, and use the combined content as input of the large language model to obtain the final search results.
[0027] Optionally, the multi-vector library parallel retrieval system based on retrieval enhancement further includes: an input module, used to obtain a query input from a user.
[0028] According to the specific embodiments provided in this application, this application discloses the following technical effects:
[0029] The present application provides a multi-vector library parallel retrieval method and device based on retrieval enhancement, wherein a query is input into a local knowledge base for parallel retrieval of multiple vector libraries, the query input is combined with the enhanced retrieval term, and the combined content is used as the input of a large language model to obtain a final retrieval result, thereby achieving retrieval term enhancement in the local knowledge base before retrieval through the large language model, which helps to screen out more targeted and comprehensive retrieval information, thereby improving the accuracy of information retrieval. In addition, the present application improves the retrieval speed through parallel retrieval of multiple vector libraries. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0031] Figure 1 A schematic diagram of a process flow of a multi-vector library parallel search method based on search enhancement provided in one embodiment of the present application;
[0032] Figure 2A detailed flowchart of a multi-vector library parallel retrieval method based on retrieval enhancement provided in one embodiment of the present application. DETAILED DESCRIPTION
[0033] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0034] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0035] This application provides a multi-vector library parallel retrieval method based on retrieval enhancement, such as Figure 1 and Figure 2 As shown, the multi-vector library parallel retrieval method based on retrieval enhancement includes the following steps.
[0036] Step 101: Input a query into a local knowledge base and perform parallel retrieval of multiple vector libraries to obtain a first set number of retrieval results; the local knowledge base includes a second set number of vector libraries, each of which includes a document in a preset field.
[0037] Step 102: Using the first set number of search results as enhanced search terms, combining the query input with the enhanced search terms, and using the combined content as input of a large language model to obtain a final search result.
[0038] The combination of the query input and the enhanced search term specifically includes connecting the query input and the enhanced search term.
[0039] The present application performs parallel retrieval of multiple vector libraries using query input in a local knowledge base, combines the query input with enhanced search terms, and uses the combined content as input to a large language model to obtain final retrieval results. This enables search term enhancement in a local knowledge base before searching using a large language model, which helps to screen out more targeted and comprehensive search information, thereby improving the accuracy of information retrieval. In addition, the present application improves the retrieval speed by performing parallel retrieval of multiple vector libraries.
[0040] This application is applied to the field of scientific and technological intelligence retrieval, and the large language model is used to help users screen information in the field of scientific and technological intelligence. In this application, the local knowledge base is equivalent to an external knowledge base, which is a unique data storage and management tool. Its main function is to provide knowledge information in real time to expand or limit the knowledge scope of the language model. Unlike the basic model, the external knowledge base does not rely on language data training, but works by organizing and storing structured and unstructured knowledge. The external knowledge base can provide more comprehensive and accurate knowledge support to enhance the capabilities of the language model. The external knowledge base provides a method of retrieval enhancement for the large language model. Compared with the knowledge base without an external knowledge base, the retrieval results of the knowledge base of external scientific and technological intelligence can be used as an enhanced search term, combined with the original search term and input into the large model of scientific and technological intelligence. Finally, according to the user's search needs, more accurate results related to scientific and technological intelligence can be obtained.
[0041] In an exemplary embodiment, the second set number of vector libraries is specifically 18 vector libraries, and the 18 vector libraries correspond to 18 preset fields, and the 18 preset fields are science and technology strategy, science and technology preface, biomedicine and health, new generation information technology, advanced manufacturing, new materials, new energy, financial technology, smart society, smart transportation, environmental protection, infectious diseases, cultural tourism, beauty trends, innovation ecology, popularization of science, transuranium nuclides, and policies and regulations.
[0042] The local knowledge base is represented as: [VS1, VS2, VS3, ...VSn], where VSi is the i-th vector library, 1≤i≤n, and n is the number of vector libraries, that is, n is the second set number. The local knowledge base is stored on the local hard disk. Each vector library has an independent folder locally. When a vector library is retrieved, the corresponding vector library file is loaded.
[0043] In an exemplary embodiment, step 101 specifically includes: applying for a thread for the search program of each vector library for the query input, and using the second set number of threads as parallel programs to obtain the first set number of search results.
[0044] In an exemplary embodiment, applying for a thread in the search program of each vector library for the query input, using the second set number of threads as a parallel program, and obtaining a first set number of search results, specifically includes: applying for a thread in the search of each vector library for the query input, using the second set number of threads as a parallel program, and obtaining the first third set number of search fragments with a high degree of match with the query input from each vector library.
[0045] The first set number of search segments with the highest matching degree with the query input among the obtained multiple search segments are used as the first set number of search results.
[0046] In an exemplary embodiment, obtaining the first third set number of search fragments with a high degree of matching with the query input from each vector library specifically includes: traversing the local knowledge base and determining in turn whether each vector library is loaded into the local memory.
[0047] If the currently traversed vector library is loaded into the local memory, the query input is searched in the currently traversed vector library to obtain the first third set number of search segments with a high degree of matching with the query input.
[0048] If the currently traversed vector library is not loaded into the local memory, a memory block is allocated for the currently traversed vector library according to the size of the currently traversed vector library, the currently traversed vector library is loaded into the memory block, and the query input is searched in the currently traversed vector library to obtain the first third set number of search fragments with a high matching degree with the query input.
[0049] In the specific implementation process, if the search is frequent, the knowledge base files on the local hard disk are repeatedly loaded, which consumes a lot of CPU and time. Here, n memories [M1, M2, M3, ... Mn] are applied, where Mi is the i-th memory, and the knowledge base hard disk files will be uniformly loaded into the memory. When each vector library is searched for the first time, the vector library files stored locally will be loaded into the memory, which can greatly improve the efficiency of the search process.
[0050] In an exemplary embodiment, the first set number and the third set number are both 10.
[0051] In an exemplary embodiment, the query input is searched in the currently traversed vector library to obtain the first third set number of search segments with a high degree of matching with the query input.
[0052] The Euclidean distance between the query input and each segment in the currently traversed vector library is calculated, and the first third set number of segments with the smallest Euclidean distance are used as the first third set number of search segments with the highest matching degree with the query input.
[0053] In an exemplary embodiment, the large language model is ChatGPT.
[0054] In an exemplary embodiment, the first first set number of search fragments with high matching degree with the query input among the obtained multiple search fragments are used as the first set number of search results, which specifically includes: removing repeated fragments from the multiple search fragments to obtain multiple search fragments after repeated processing.
[0055] The first set number of search segments having the highest matching degree with the query input among the multiple search segments after repeated processing are used as the first set number of search results.
[0056] The role of the big speech model in this application for the science and technology intelligence platform: Science and technology intelligence can provide key information about technology development trends, market dynamics, competitor situations, etc. for decision makers such as governments and enterprises, helping them make more scientific and reasonable decisions, etc. The science and technology intelligence platform collects incremental data based on the source of information on a regular basis every day; and the amount of historical data is huge, but decision makers have higher and higher requirements for timely, fast and accurate information acquisition. Based on the big language model of science and technology intelligence, it aims to help users screen information in the field of science and technology intelligence in a targeted manner, further improve the efficiency of obtaining science and technology intelligence information, and improve the accuracy of retrieving science and technology intelligence information, and finally provide decision makers with fast, effective, reasonable and accurate decision-making solutions.
[0057] Based on the same inventive concept, the embodiment of the present application also provides a multi-vector library parallel retrieval device based on retrieval enhancement for implementing the multi-vector library parallel retrieval method based on retrieval enhancement involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more embodiments of the multi-vector library parallel retrieval device based on retrieval enhancement provided below can refer to the limitations of the multi-vector library parallel retrieval method based on retrieval enhancement above, and will not be repeated here.
[0058] In an exemplary embodiment, the present application provides a multi-vector library parallel retrieval device based on retrieval enhancement, which includes the following modules.
[0059] The local search module is used to input the query into the local knowledge base and perform parallel search of multiple vector libraries to obtain a first set number of search results; the local knowledge base includes a second set number of vector libraries, each vector library includes a document in a preset field.
[0060] The enhanced search module is used to use the first set number of search results as enhanced search terms, combine the query input with the enhanced search terms, and use the combined content as input of the large language model to obtain the final search results.
[0061] In an exemplary embodiment, the multi-vector library parallel retrieval system based on retrieval enhancement further includes: an input module, which is used to obtain a query input from a user.
[0062] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0063] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.
Claims
1. A multi-vector library parallel retrieval method based on retrieval enhancement, characterized in that: The multi-vector library parallel retrieval method based on retrieval enhancement includes: Inputting the query into the local knowledge base and performing parallel retrieval of multiple vector libraries to obtain a first set number of retrieval results; the local knowledge base includes a second set number of vector libraries, each of which includes documents in a preset field; The first set number of search results are used as enhanced search terms, the query input is combined with the enhanced search terms, and the combined content is used as input of a large language model to obtain a final search result.
2. The multi-vector library parallel retrieval method based on retrieval enhancement according to claim 1 is characterized in that: Input the query into the local knowledge base to perform parallel search of multiple vector libraries to obtain a first set number of search results, specifically including: A thread is applied for the search program of each vector library for the query input, and the second set number of threads are used as parallel programs to obtain the first set number of search results.
3. The multi-vector library parallel retrieval method based on retrieval enhancement according to claim 2 is characterized in that: Applying a thread for the search program of each vector library for the query input, using the second set number of threads as a parallel program to obtain the first set number of search results, specifically includes: Applying a thread for searching the query input in each vector library, using the second set number of threads as a parallel program, and obtaining the first third set number of search segments with a high degree of matching with the query input from each vector library; The first set number of search segments with the highest matching degree with the query input among the obtained multiple search segments are used as the first set number of search results.
4. The multi-vector library parallel retrieval method based on retrieval enhancement according to claim 3 is characterized in that: Obtaining the first third set number of search segments with high matching degree with the query input from each vector library, specifically including: Traversing the local knowledge base, and determining in turn whether each vector library is loaded into the local memory; If the currently traversed vector library is loaded into the local memory, the query input is searched in the currently traversed vector library to obtain the first third set number of search segments with high matching degree with the query input; If the currently traversed vector library is not loaded into the local memory, a memory block is allocated for the currently traversed vector library according to the size of the currently traversed vector library, the currently traversed vector library is loaded into the memory block, and the query input is searched in the currently traversed vector library to obtain the first third set number of search fragments with a high matching degree with the query input.
5. The multi-vector library parallel retrieval method based on retrieval enhancement according to claim 3 is characterized in that: The first set number and the third set number are both 10.
6. The multi-vector library parallel retrieval method based on retrieval enhancement according to claim 4 is characterized in that: Searching the query input in the currently traversed vector library to obtain a third set number of search segments with a high degree of matching with the query input; The Euclidean distance between the query input and each segment in the currently traversed vector library is calculated, and the first third set number of segments with the smallest Euclidean distance are used as the first third set number of search segments with the highest matching degree with the query input.
7. The multi-vector library parallel retrieval method based on retrieval enhancement according to claim 1 is characterized in that: The large language model is ChatGPT.
8. The multi-vector library parallel retrieval method based on retrieval enhancement according to claim 1 is characterized in that: The first set number of search segments with high matching degree with the query input among the obtained multiple search segments are used as the first set number of search results, specifically including: Repetitive segments are removed from the multiple search segments to obtain multiple search segments after repeated processing; The first set number of search segments having the highest matching degree with the query input among the multiple search segments after repeated processing are used as the first set number of search results.
9. A multi-vector library parallel retrieval device based on retrieval enhancement, characterized in that: The multi-vector library parallel retrieval device based on retrieval enhancement comprises: A local search module, used for inputting a query into a local knowledge base to perform parallel search of multiple vector libraries to obtain a first set number of search results; the local knowledge base includes a second set number of vector libraries, each vector library includes a document in a preset field; The enhanced search module is used to use the first set number of search results as enhanced search terms, combine the query input with the enhanced search terms, and use the combined content as input of the large language model to obtain the final search results.
10. The multi-vector library parallel retrieval device based on retrieval enhancement according to claim 9, characterized in that: The multi-vector library parallel retrieval system based on retrieval enhancement also includes: The input module is used to obtain the user's query input.
Citation Information
Patent Citations
Intelligent English learning system based on knowledge base
CN117116104A
Large model retrieval enhancement generation method and device
CN118467688A
Vector retrieval method and device, electronic equipment and storage medium
CN119003829A
Question and answer processing method and device, electronic equipment and computer readable medium
CN119226457A
Cited By
Library table parallel retrieval method and system for large language model SQL (Structured Query Language) generation and medium
CN121597729A