Detection enhancement method, device, equipment, medium and program product

By employing a distributed cluster architecture and various segmentation strategies, the scalability issue of intelligent document question answering in high-concurrency scenarios is resolved, ensuring effective document processing and preservation of contextual relationships in high-concurrency environments.

CN120892532APending Publication Date: 2025-11-04INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511125760.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-12
Publication Date
2025-11-04

AI Technical Summary

Technical Problem

Existing intelligent document question answering solutions lack scalability in high-concurrency scenarios, traditional image and text document parsing tools struggle to support high-performance processing, and general text segmentation strategies may lose contextual relationship information.

Method used

It adopts a distributed cluster architecture, including a document parsing cluster, a vector database cluster, and a query generation cluster. The document parsing cluster segments text into vector form using a preset text segmentation strategy, and then generates a query based on the query request as input for the large language model service.

Benefits of technology

It achieves scalability in high-concurrency scenarios, provides multiple segmentation strategies to adapt to different business needs, and ensures the preservation of context relationships.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120892532A_ABST
    Figure CN120892532A_ABST
Patent Text Reader

Abstract

The invention provides a retrieval enhancement method which can be applied to the technical field of big data and artificial intelligence. The method is applied to a distributed cluster, the distributed cluster comprises a document analysis cluster, a vector database cluster and a retrieval type generation cluster, and the method comprises the following steps: querying a preset knowledge base in the vector database cluster based on a received retrieval request from a user to obtain a query result, the preset knowledge base is established by cutting an image-text document on a document analysis cluster based on a preset text cutting strategy; and generating a retrieval formula based on the retrieval request and the query result in a retrieval formula generation cluster so as to use the retrieval formula as the input of a large language model service when the large language model service is called. The invention further provides a retrieval enhancement device and equipment, a storage medium and a program product.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of big data and artificial intelligence, in particular to a detection enhancement method, device, equipment, medium and program product. BACKGROUND

[0002] With the increasing demand of industry for document content retrieval of graphic-text documents, it is particularly important to build a full-link, end-to-end retrieval enhancement generation solution. The existing retrieval enhancement generation technical solutions are mostly based on graphic-text document analysis tools to analyze the original graphic-text documents, use general text segmentation strategies, index data in traditional full-text retrieval engines to build knowledge bases, and connect large language models to support intelligent document question answering.

[0003] The existing intelligent document question answering solutions lack scalability in high concurrency scenarios. SUMMARY

[0004] In view of the above problems, the present disclosure provides a retrieval enhancement method, device, equipment, medium and program product that improves scalability in high concurrency scenarios.

[0005] According to a first aspect of the present disclosure, a retrieval enhancement method is provided, which is applied to a distributed cluster including a document analysis cluster, a vector database cluster and a retrieval formula generation cluster. The method comprises: querying a preset knowledge base based on a received retrieval request from a user in the vector database cluster to obtain a query result, the preset knowledge base being established based on a preset text segmentation strategy for graphic-text documents in the document analysis cluster; and generating a retrieval formula based on the retrieval request and the query result in the retrieval formula generation cluster, so as to use the retrieval formula as an input of a large language model service when the large language model service is called.

[0006] According to an embodiment of the present disclosure, the method for establishing the preset knowledge base comprises: extracting a structured text paragraph in the graphic-text document in the document analysis cluster; segmenting the structured text paragraph in the document analysis cluster to obtain a document block that retains context relationships; and converting the document block into a vector form and storing it to the preset knowledge base in the document analysis cluster.

[0007] According to an embodiment of the present disclosure, the segmented structured text paragraph based on the preset text segmentation strategy to obtain a document block that retains context relationships comprises: segmenting the structured text paragraph based on a fixed length.

[0008] According to an embodiment of the present disclosure, the segmented structured text paragraph based on the preset text segmentation strategy to obtain a document block that retains context relationships further comprises: segmenting the structured text paragraph based on a hierarchical model.

[0009] According to an embodiment of the present disclosure, the converting the document blocks into vector forms and storing into the preset knowledge base in the document parsing cluster comprises: converting the document blocks into vector forms to obtain document block vectors; and adding metadata labels to the document block vectors and updating indexes.

[0010] According to an embodiment of the present disclosure, the query result comprises N document blocks, N being a positive integer, and the generating a retrieval formula based on the retrieval request and the query result in the retrieval formula generation cluster comprises: adjusting the N document blocks based on query complexity to obtain L document blocks, L being a positive integer smaller than N; and taking the L document blocks as the retrieval formula based on the retrieval request.

[0011] A second aspect of the present disclosure provides a retrieval enhancement device, the device being configured in a distributed cluster, the distributed cluster comprising: a document parsing cluster, a vector database cluster, and a retrieval formula generation cluster, the device comprising: a knowledge base query module configured to query a preset knowledge base based on a received retrieval request from a user in the vector database cluster to obtain a query result, the preset knowledge base being established based on a preset text block strategy on the document parsing cluster; and a retrieval formula generation module configured to generate a retrieval formula based on the retrieval request and the query result in the retrieval formula generation cluster, so as to use the retrieval formula as an input of a large language model service when the large language model service is called.

[0012] According to an embodiment of the present disclosure, the device further comprises a knowledge base establishment module configured to extract structured text paragraphs in the graphic-text document in the document parsing cluster; split the structured text paragraphs to obtain document blocks that retain context relationships in the document parsing cluster; and convert the document blocks into vector forms and store into the preset knowledge base in the document parsing cluster.

[0013] According to an embodiment of the present disclosure, the knowledge base establishment module is specifically configured to block the structured text paragraphs based on a fixed length.

[0014] According to an embodiment of the present disclosure, the knowledge base establishment module is specifically configured to block the structured text paragraphs based on a hierarchical model.

[0015] According to an embodiment of the present disclosure, the knowledge base establishment module is specifically configured to convert the document blocks into vector forms to obtain document block vectors; and add metadata labels to the document block vectors and update indexes.

[0016] According to an embodiment of the present disclosure, wherein the query result comprises N document blocks, N being a positive integer, the retrieval formula generation module is specifically configured to adjust the N document blocks based on query complexity to obtain L document blocks, L being a positive integer smaller than N; and the retrieval request and the obtained L document blocks are taken as the retrieval formula.

[0017] A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the method.

[0018] A fourth aspect of the present disclosure also provides a computer-readable storage medium having stored thereon a computer program or instructions, which, when executed by a processor, implement the steps of the method.

[0019] A fifth aspect of the present disclosure also provides a computer program product comprising a computer program or instructions, which, when executed by a processor, implement the steps of the method.

[0020] In an embodiment of the present disclosure, the technical problem of lack of scalability in high concurrency scenarios for the solution of intelligent document question answering is solved. In the embodiment of the present disclosure, a document parsing cluster, a vector database cluster and a retrieval formula generation cluster are set, and different processing logics are deployed in different clusters, the vector database cluster is queried for a picture-text document cut block to obtain a query result, and the retrieval formula generation cluster is combined with a retrieval request and the query result to generate a retrieval formula for inputting a large language model service. The embodiment of the present disclosure can achieve the following beneficial effects: 1. By setting the corresponding distributed cluster, it can be ensured that the retrieval enhancement method in the embodiment of the present disclosure can be applied in a high concurrency scenario; 2. The preset text cut block provides a variety of cut block strategies, allowing users to flexibly adjust according to business scenario requirements. BRIEF DESCRIPTION OF DRAWINGS

[0021] The above and other objects, features and advantages of the present disclosure will become more apparent from the following description of embodiments of the present disclosure taken in conjunction with the accompanying drawings, in which:

[0022] Figure 1 An application scenario diagram of a retrieval enhancement method, device, equipment, medium and program product according to an embodiment of the present disclosure is schematically shown;

[0023] Figure 2 A flowchart of a retrieval enhancement method according to an embodiment of the present disclosure is schematically shown;

[0024] Figure 3 A flowchart of a knowledge base establishment method is schematically shown;

[0025] Figure 4 A structural block diagram of a retrieval enhancement device according to an embodiment of the present disclosure is schematically shown; and

[0026] Figure 5 A block diagram of an electronic device suitable for implementing a retrieval enhancement method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0027] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it is to be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present disclosure. In the following detailed description of the embodiments of the present disclosure, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the present disclosure. However, it will be apparent to one skilled in the art that the embodiments of the present disclosure can be practiced without these specific details. In other instances, well-known structures and techniques have been omitted in order to avoid obscuring the concepts of the present disclosure.

[0028] The terms used herein are merely used to describe specific embodiments and are not intended to limit the present disclosure. The terms "include", "comprise" and the like used herein indicate the presence of the described features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0029] All terms used herein, including technical and scientific terms, have the same meanings as those generally understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having meanings consistent with the context of the specification, and should not be interpreted in an idealized or excessively formal manner.

[0030] In the case of using expressions similar to "at least one of A, B, and C, etc.", it should be generally interpreted as including one or more of the corresponding items (for example, "a system having at least one of A, B, and C" should include a system having A alone, a system having B alone, a system having C alone, a system having A and B together, a system having A and C together, a system having B and C together, and / or a system having A, B, and C together, etc.).

[0031] Before the present disclosure is disclosed in detail, key technical terms involved in the embodiments of the present disclosure are explained one by one as follows:

[0032] Document intelligence: a technology that combines artificial intelligence, machine learning, and natural language processing, aiming to automate the processing, analysis, and understanding of structured and unstructured content in documents. It can extract key information from various formats of documents (such as scans, images, tables, etc.) and convert it into actionable data, thereby improving business efficiency.

[0033] Retrieval-enhanced generation: an AI technology that combines information retrieval and text generation, aiming to improve the accuracy and timeliness of content generated by large language models. Its core idea is to retrieve relevant document fragments from external knowledge bases before generating answers, and then input the retrieved information along with the user's question into the generation model, thereby reducing model "illusion" (fabricating false information) and supplementing it with the latest or proprietary knowledge.

[0034] In existing technologies, proprietary tools are typically used to process text and image documents. However, these existing technologies have the following drawbacks:

[0035] 1. Difficulty in scaling document processing: Traditional image and text document parsing tools are unable to support high-performance, high-concurrency enterprise-level document processing scenarios. This results in traditional image and text document parsing being able to process only a small amount of data and being difficult to scale.

[0036] 2. General document segmentation strategies may lose contextual information: Using general fixed-length segmentation strategies makes it difficult to handle the internal page layout hierarchy of a document and to ensure that contextual relationships are not lost.

[0037] This disclosure provides a retrieval enhancement method applied to a distributed cluster, which includes a document parsing cluster, a vector database cluster, and a retrieval expression generation cluster. The method includes: querying a preset knowledge base in the vector database cluster based on a received retrieval request from a user to obtain query results; the preset knowledge base is established on the document parsing cluster based on a preset text segmentation strategy for segmenting text and image documents; and generating a retrieval expression in the retrieval expression generation cluster based on the retrieval request and the query results, so as to use the retrieval expression as input to the large language model service when calling the large language model service.

[0038] In the embodiments of this disclosure, the technical problem of the lack of scalability of intelligent document question answering solutions under high-concurrency scenarios is addressed. The embodiments of this disclosure establish a document parsing cluster, a vector database cluster, and a retrieval generation cluster, deploying different processing logic in different clusters. The vector database cluster queries text and image document segments to obtain query results, and then the retrieval generation cluster combines the retrieval request and query results to generate a retrieval expression for input into a large language model service. The embodiments of this disclosure achieve the following beneficial effects: 1. By setting up corresponding distributed clusters, the retrieval enhancement method in the embodiments of this disclosure can be applied to high-concurrency scenarios; 2. The preset text segments provide multiple segmentation strategies, allowing users to flexibly adjust according to business scenario requirements.

[0039] Figure 1 The diagram illustrates an application scenario of the retrieval enhancement method according to an embodiment of the present disclosure.

[0040] like Figure 1 As shown, application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 serves as a medium for providing a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.

[0041] Users can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 via the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).

[0042] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0043] Server 105 can be a server that provides various services, such as a backend management server that supports websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (this is just an example). The backend management server can analyze and process data such as received user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices.

[0044] It should be noted that the search enhancement method provided in this embodiment can generally be executed by server 105. Correspondingly, the search enhancement device provided in this embodiment can generally be located in server 105. The search enhancement method provided in this embodiment can also be executed by a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105. Correspondingly, the search enhancement device provided in this embodiment can also be located in a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105.

[0045] It should be understood that Figure 1The number of terminal devices, networks, and servers in the system is merely illustrative. Any number of terminal devices, networks, and servers can be provided according to implementation needs.

[0046] The following will be based on Figure 1 The scenario described above, by Figures 2-3 The retrieval enhancement method of the disclosed embodiment is described in detail.

[0047] Figure 2 A flowchart of a detection enhancement method according to an embodiment of the disclosure is illustratively shown.

[0048] As Figure 2 shown, the detection enhancement method of this embodiment includes operations S210-S220, which can be performed by the server 105. Among them, Figure 1 The server 105 in the system can be a distributed cluster, which can include a document parsing cluster, a vector database cluster, and a retrieval formula generation cluster,

[0049] In operation S210, based on the received retrieval request from the user, the preset knowledge base is queried in the vector database cluster to obtain a query result, the preset knowledge base being established based on a preset text chunking strategy on the document parsing cluster.

[0050] Among them, the retrieval request refers to the retrieval request from the user, which contains the prompt information (i.e., prompt) of the user, which can be used as, for example, the user interacts with the large language model service through the retrieval request, realizes data query or question answering with the large language model. Among them, the image-text document can include one or more of pictures, documents, and tables. Among them, the preset knowledge base refers to a pre-set database, which pre-stores various data blocks, which at least include text blocks obtained by text chunking processing on the image-text document, for example, by recognizing the image-text document through OCR, and then blocking the recognized text.

[0051] Among them, the preset text chunking strategy can be set according to business characteristics, for example, the text chunking can be distinguished according to paragraphs, for example, the text chunking can be distinguished according to sentence patterns, and for example, the text chunking can be distinguished according to chapters.

[0052] The following will disclose the establishment method of the knowledge base in detail, as shown below:

[0053] Figure 3 A flowchart of a knowledge base establishment method is illustratively shown.

[0054] As Figure 3 shown, the knowledge base establishment method of this embodiment includes operations S310-S330.

[0055] In operation S310, a structured text paragraph in the picture-text document is extracted in the document parsing cluster.

[0056] Specifically, the picture-text document is extracted according to a structured paragraph, and each paragraph in the picture-text document is extracted. It should be noted that one structured text paragraph is not only one paragraph, and one structured text paragraph can be structured data containing multiple paragraphs, for example, an article can also be called a structured text paragraph, which will not be described here.

[0057] In operation S320, the structured text paragraph is segmented in the document parsing cluster to obtain a document block that retains a context relationship.

[0058] Specifically, the structured text paragraph can be further segmented into different document blocks, and the context relationship needs to be retained.

[0059] According to an embodiment of the present disclosure, the structured text paragraph is segmented based on the preset text segmentation strategy to obtain a document block that retains a context relationship, including: segmenting the structured text paragraph based on a fixed length.

[0060] Specifically, the structured text paragraph can be segmented according to a fixed length, for example, the fixed character length is 20, and the text paragraph is segmented according to a fixed length of 20 characters to obtain multiple document blocks.

[0061] According to an embodiment of the present disclosure, the structured text paragraph is segmented based on the preset text segmentation strategy to obtain a document block that retains a context relationship, including: segmenting the structured text paragraph based on a fixed length.

[0062] Specifically, the structured text paragraph can also be segmented according to the relationship of the hierarchical model. The text paragraph block is identified, and a semantic tree is constructed, wherein the semantic tree includes a root node, a score node, and a leaf node, wherein the root node corresponds to a document title, the score node corresponds to a chapter title, and the leaf node corresponds to a paragraph / table. Different leaf nodes can be merged based on a preset business merging rule (such as merging chapter content and merging theme content) to obtain a semantic block.

[0063] In operation S330, the document block is converted into a vector form in the document parsing cluster and stored in the preset knowledge base.

[0064] Specifically, the document block is vectorized to obtain a vector form of the document block, and stored in the preset knowledge base.

[0065] According to an embodiment of the present disclosure, the converting the document blocks into vector forms and storing into the preset knowledge base in the document parsing cluster comprises: converting the document blocks into vector forms to obtain document block vectors; and adding metadata labels to the document block vectors and updating indexes.

[0066] Specifically, an external general text vector model engine is invoked to convert the document blocks into vector forms by using a general text vector model, and context relationships of words and sentences in the text blocks are converted into vector forms. Then, metadata binding is performed on the text blocks, and the metadata includes block types (such as text / table), document identifiers (such as page numbers), and domain-specific metadata (such as clauses in the financial industry). After the document block vectors are added, the indexes of the preset knowledge base are updated synchronously.

[0067] In operation S220, a retrieval formula is generated based on the retrieval request and the query result in the retrieval formula generation cluster, to be used as an input of the large language model service when the large language model service is invoked.

[0068] Specifically, the retrieval request of the user and the query result queried from the preset knowledge base are fused to generate a same retrieval formula, which can be used as an input of the large language model service to help the user obtain a reply of the large language model.

[0069] According to an embodiment of the present disclosure, the query result includes N document blocks, and N is a positive integer. The generating the retrieval formula based on the retrieval request and the query result in the retrieval formula generation cluster comprises: adjusting the N document blocks based on a query complexity to obtain L document blocks, and L is a positive integer smaller than N; and using the retrieval request and the obtained L document blocks as the retrieval formula.

[0070] Specifically, the query complexity specifies an upper limit of the number of document blocks that can be queried. In the case where the upper limit of the number of document blocks that can be queried is limited, L document blocks are selected from the N document blocks and combined with the retrieval request as the retrieval formula. The process of selecting the document blocks can be random selection or selection in a certain order according to a certain relevance.

[0071] In the embodiments of the present disclosure, the technical problem of the solution for example resolving intelligent document question answering lacks scalability in a high concurrency scenario. The embodiments of the present disclosure set up a document parsing cluster, a vector database cluster, and a retrieval formula generation cluster, deploy different processing logics in different clusters, query the graphic-text document cutouts in the vector database cluster to obtain query results, and then generate a retrieval formula for inputting a large language model service in the retrieval formula generation cluster in combination with the retrieval request and the query results. The embodiments of the present disclosure can achieve the following beneficial effects: 1. By setting up corresponding distributed clusters, it can be ensured that the retrieval enhancement method in the embodiments of the present disclosure can be applied in a high concurrency scenario; and 2. The preset text cutout provides a variety of cutout strategies, allowing users to flexibly adjust according to business scenario needs.

[0072] In the following, the full process of retrieval enhancement in the embodiments of the present disclosure will be illustrated, as shown below

[0073] Step S1, configure the directory where the document set is located, the document intelligent service endpoint and interface, the large language model service endpoint and interface, and other information.

[0074] Step S2, configure the document intelligent client using the document intelligent service endpoint and interface, and extract the text paragraphs and tables in the document by calling the graphic-text file parsing interface provided by the document intelligent client.

[0075] Step S3, specify a text cutout strategy, and cut out the text paragraphs and table data extracted in step S2. Generally, the document intelligent service provides a variety of configurable cutout strategies for users to choose from, including fixed-length-based cutout and hierarchical model-based semantic cutout, to meet the needs of different business scenarios.

[0076] Step S4, vectorize each text / table block generated in step S3 (usually using a text vector model and storing it in a vector database.

[0077] Step S5, configure the client using the large language model service endpoint and interface, and encapsulate an interface that supports receiving a user's natural language question as input and returning an answer generated by the large language model to support knowledge base document question answering. The interface is implemented by vectorizing the user's question (using the same vector model as in step S4) and finding the most similar text / table block in the vector database, using these blocks as the context of the large language model, and calling a specific prompt word.

[0078] Based on the above retrieval enhancement method, the present disclosure further provides a retrieval enhancement device. In the following Figure 4 The device will be described in detail.

[0079] Figure 4A structural block diagram of a retrieval enhancement device according to an embodiment of the present disclosure is shown schematically.

[0080] As shown in the figure, the retrieval enhancement device 400 of the embodiment includes a knowledge base query module 410 and a retrieval formula generation module 420. Figure 4

[0081] The knowledge base query module 410 is configured to query a preset knowledge base based on a received retrieval request from a user in a vector database cluster, to obtain a query result, the preset knowledge base being established based on a preset text chunking strategy on a document parsing cluster for a graphic-text document. In an embodiment, the knowledge base query module 410 can be configured to perform the operation S210 described above, and thus details are not repeated here.

[0082] The retrieval formula generation module 420 is configured to generate a retrieval formula based on the retrieval request and the query result in a retrieval formula generation cluster, to use the retrieval formula as an input of a large language model service when the large language model service is invoked. In an embodiment, the retrieval formula generation module 420 can be configured to perform the operation S220 described above, and thus details are not repeated here.

[0083] In an embodiment of the present disclosure, the technical problem of lack of scalability in a high concurrency scenario is solved for the solution of intelligent document question answering. In the embodiment of the present disclosure, a document parsing cluster, a vector database cluster and a retrieval formula generation cluster are set, and different processing logics are deployed in different clusters, the graphic-text document is queried in the vector database cluster to obtain a query result, and then the retrieval formula generation cluster is used to generate a retrieval formula for inputting a large language model service in combination with the retrieval request and the query result. The embodiment of the present disclosure can achieve the following beneficial effects: 1. By setting the corresponding distributed cluster, it can be ensured that the retrieval enhancement method in the embodiment of the present disclosure can be applied to a high concurrency scenario; 2. The preset text chunking provides a variety of chunking strategies, allowing users to flexibly adjust according to business scenario requirements.

[0084] According to an embodiment of the present disclosure, the device further includes a knowledge base establishment module configured to extract a structured text paragraph in the graphic-text document in a document parsing cluster; divide the structured text paragraph in the document parsing cluster to obtain a document block that retains a context relationship; and convert the document block into a vector form in the document parsing cluster and store it to the preset knowledge base.

[0085] According to an embodiment of the present disclosure, the knowledge base establishment module is specifically configured to chunk the structured text paragraph based on a fixed length.

[0086] According to an embodiment of the present disclosure, the knowledge base establishment module is specifically configured to chunk the structured text paragraph based on a hierarchical model. ​

[0087] According to an embodiment of the present disclosure, the knowledge base establishing module is specifically configured to convert the document blocks into vector forms to obtain document block vectors; and add metadata labels to the document block vectors and update indexes.

[0088] According to an embodiment of the present disclosure, the query result includes N document blocks, N is a positive integer, the retrieval formula generating module is specifically configured to adjust the N document blocks based on query complexity to obtain L document blocks, L is a positive integer smaller than N; and use the retrieval request and the obtained L document blocks as the retrieval formula.

[0089] According to an embodiment of the present disclosure, any of the plurality of modules in the knowledge base querying module 410 and the retrieval formula generating module 420 can be combined in one module, or any of the plurality of modules can be split into a plurality of modules. Alternatively, at least part of the function of one or more of the modules can be combined with at least part of the function of other modules, and implemented in one module. According to an embodiment of the present disclosure, at least one of the knowledge base querying module 410 and the retrieval formula generating module 420 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on chip, a system on board, a system on package, an application specific integrated circuit (ASIC), or any other reasonable manner of integrating or packaging a circuit, etc. hardware or firmware, or in any one of software, hardware and firmware or in any appropriate combination of any of them. Alternatively, at least one of the knowledge base querying module 410 and the retrieval formula generating module 420 can be at least partially implemented as a computer program module which can perform corresponding functions when the computer program module is run.

[0090] Figure 5 A block diagram of an electronic device suitable for implementing the retrieval enhancement method according to an embodiment of the present disclosure is schematically shown.

[0091] As shown in Figure 5 The electronic device 900 according to an embodiment of the present disclosure includes a processor 901 which can perform various appropriate actions and processes according to programs stored in a read only memory (ROM) 902 or loaded from a storage portion 908 into a random access memory (RAM) 903. The processor 901 can include, for example, a general purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special purpose microprocessor (such as an application specific integrated circuit (ASIC)), etc. The processor 901 can also include an on-board memory for cache use. The processor 901 can include a single processing unit or a plurality of processing units for performing different actions of the method processes according to an embodiment of the present disclosure.

[0092] In the RAM 903, various programs and data required for the operation of the electronic device 900 are stored. The processor 901, the ROM 902, and the RAM 903 are connected to each other via the bus 904. The processor 901 performs various operations of the method flow according to the embodiments of the present disclosure by executing the programs in the ROM 902 and / or the RAM 903. It should be noted that the programs can also be stored in one or more memories other than the ROM 902 and the RAM 903. The processor 901 can also perform various operations of the method flow according to the embodiments of the present disclosure by executing the programs stored in the one or more memories.

[0093] According to an embodiment of the present disclosure, the electronic device 900 can further include an input / output (I / O) interface 905, which is also connected to the bus 904. The electronic device 900 can further include one or more of the following components connected to the input / output (I / O) interface 905: an input part 906 including a keyboard, a mouse, and the like; an output part 907 including a cathode ray tube (CRT), a liquid crystal display (LCD), and the like, and a speaker, and the like; a storage part 908 including a hard disk, and the like; and a communication part 909 including a network interface card such as a LAN card, a modem, and the like. The communication part 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the input / output (I / O) interface 905 as necessary. A removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, and the like is mounted on the drive 910 as necessary, so that a computer program read therefrom is installed in the storage part 908 as necessary.

[0094] The present disclosure also provides a computer readable storage medium, which can be included in the device / apparatus / system described in the above embodiments; or can exist separately without being assembled into the device / apparatus / system. The above computer readable storage medium carries one or more programs, when the one or more programs are executed, the method according to the embodiments of the present disclosure is implemented.

[0095] According to an embodiment of the present disclosure, the computer readable storage medium can be a nonvolatile computer readable storage medium, for example, can include, but is not limited to, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any appropriate combination thereof. In the present disclosure, the computer readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device. For example, according to an embodiment of the present disclosure, the computer readable storage medium can include one or more memories, such as the ROM 902 and / or the RAM 903 described above, and / or one or more memory chips other than the ROM 902 and the RAM 903.

[0096] Embodiments of the present disclosure also include a computer program product that includes a computer program containing program codes for executing the methods shown in the flowcharts. When the computer program product is run in a computer system, the program codes are used to cause the computer system to implement the methods provided by the embodiments of the present disclosure.

[0097] The above-described functions defined in the system / device / module / unit of the embodiments of the present disclosure are performed when the computer program is executed by the processor 901. According to an embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by computer program modules.

[0098] In one embodiment, the computer program can rely on a tangible storage medium, such as an optical storage device, a magnetic storage device, etc. In another embodiment, the computer program can also be transmitted, distributed, and downloaded in the form of a signal on a network medium, and be downloaded and installed through the communication part 909, and / or be installed from the detachable medium 911. The program codes contained in the computer program can be transmitted by any appropriate network medium, including but not limited to wireless, wired, etc., or any appropriate combination thereof.

[0099] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 909, and / or be installed from the detachable medium 911. When the computer program is executed by the processor 901, the above-described functions defined in the system of the embodiments of the present disclosure are performed. According to an embodiment of the present disclosure, the system, device, apparatus, module, unit, etc. described above can be implemented by computer program modules.

[0100] According to embodiments of the present disclosure, program code of the computer programs provided by the embodiments of the present disclosure can be written in any combination of one or more programming languages, and specifically, these computer programs can be implemented using a high-level procedural and / or object-oriented programming language, and / or an assembly / machine language. The programming language includes, but is not limited to, a programming language such as Java, C++, Python, "C" language, or a similar programming language. The program code can be executed entirely on a user computing device, partially on a user device, partially on a remote computing device, or entirely on a remote computing device or server. In the case involving a remote computing device, the remote computing device can be connected to the user computing device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, connected to the Internet through an Internet service provider).

[0101] The flow diagrams and the block diagrams in the drawings are illustrations of possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flow diagrams or block diagrams can represent a module, a segment, or a portion of code, which comprises one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently or in the reverse order, depending on the functionality involved. It will also be noted that each block of the block diagrams and / or flow diagrams, and combinations thereof, can be implemented by special purpose hardware-based systems that perform the specified functions or operations, or combinations of special purpose hardware and computer instructions.

[0102] Those skilled in the art will understand that features recited in the various embodiments of the present disclosure can be combined and / or integrated in various combinations and / or permutations, even if such combinations and / or permutations are not expressly noted in the present disclosure. In particular, features recited in the various embodiments of the present disclosure can be combined and / or integrated in various combinations and / or permutations without departing from the spirit and teachings of the present disclosure. All such combinations and / or integrations are within the scope of the present disclosure.

[0103] The embodiments of the present disclosure are described above. However, these embodiments are merely for illustrative purposes, and are not intended to limit the scope of the present disclosure. Although each embodiment is described above separately, this does not mean that the measures in each embodiment cannot be used advantageously in combination. Those skilled in the art can make various substitutions and modifications without departing from the scope of the present disclosure, and these substitutions and modifications should all fall within the scope of the present disclosure.

Claims

1. A retrieval enhancement method, characterized in that, The method is applied to a distributed cluster, which includes a document parsing cluster, a vector database cluster, and a search query generation cluster. The method includes: In the vector database cluster, based on the received retrieval request from the user, a preset knowledge base is queried to obtain the query results. The preset knowledge base is established on the document parsing cluster based on a preset text segmentation strategy to segment text and image documents. In the retrieval generation cluster, a retrieval expression is generated based on the retrieval request and the query result, so that the retrieval expression can be used as the input of the large language model service when calling the large language model service.

2. The method according to claim 1, characterized in that, The method for establishing the preset knowledge base includes: Extract structured text paragraphs from the document parsing cluster; The structured text paragraphs are segmented in the document parsing cluster to obtain document blocks that preserve contextual relationships; and In the document parsing cluster, the document blocks are converted into vector form and stored in the preset knowledge base.

3. The method according to claim 2, characterized in that, The step of segmenting the structured text paragraphs based on the preset text segmentation strategy to obtain document blocks that preserve contextual relationships includes: The structured text paragraphs are cut into blocks based on a fixed length.

4. The method according to claim 3, characterized in that, The step of segmenting the structured text paragraphs based on the preset text segmentation strategy to obtain document blocks that preserve contextual relationships further includes: The structured text paragraphs are segmented based on a hierarchical model.

5. The method according to claim 2, characterized in that, The step of converting the document blocks into vector form and storing them in the preset knowledge base in the document parsing cluster includes: The document block is converted into a vector form to obtain the document block vector; Add metadata tags to the document block vectors and update the index.

6. The method according to claim 1, characterized in that, in, The query results include N document blocks, where N is a positive integer. The step of generating a search query based on the search request and the query results in the search query generation cluster includes: Adjusting the N document blocks based on query complexity yields L document blocks, where L is a positive integer less than N; and The search query is based on the search request and the L document blocks obtained.

7. A search enhancement device, characterized in that, The device is configured in a distributed cluster, which includes: a document parsing cluster, a vector database cluster, and a search query generation cluster. The device includes: The knowledge base query module is used to query a preset knowledge base in the vector database cluster based on the received retrieval request from the user, and obtain the query results. The preset knowledge base is established on the document parsing cluster based on a preset text segmentation strategy to segment text and image documents. The retrieval expression generation module is used to generate a retrieval expression based on the retrieval request and the query result in the retrieval expression generation cluster, so as to use the retrieval expression as the input of the large language model service when calling the large language model service.

8. An electronic device, comprising: One or more processors; Memory, used to store one or more computer programs. The characteristic feature is that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program or instructions stored thereon, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 6.