Database AI question answering system and method based on large language model and retrieval enhancement
By adopting large language model and search enhancement technology in the database Q&A system, combined with distributed architecture and intelligent task scheduling, the existing system's performance bottlenecks and inefficient data retrieval in high concurrency scenarios are solved, and efficient and stable Q&A services are achieved.
Patent Information
- Application Number
- CN202510018065.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-06
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2045-01-06
AI Technical Summary
When facing large-scale concurrent requests, the response speed of existing database Q&A systems decreases, and service interruptions may occur. A single cache mechanism cannot effectively respond to the need for fast access to hot data, resulting in inefficient data retrieval.
Using a distributed architecture based on large language model and retrieval enhancement, the question-and-answer system is divided into multiple submodules, and the coordinated work between each module is achieved through an efficient task scheduling mechanism. The distributed cache management module optimizes data storage and access through the local cache layer and the distributed cache layer, combining data popularity evaluation algorithm. The task scheduling center adopts an intelligent task scheduling algorithm to reasonably allocate tasks based on system load, resource availability and task adaptation.
It improves the system's fault tolerance, scalability, stability and response speed in high concurrency scenarios, optimizes data retrieval efficiency, and improves the overall efficiency and user experience of Q&A services.
Smart Images

Figure CN119415543B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of database retrieval technology, and in particular to a database AI question-answering system and method based on a large language model and retrieval enhancement. Background Art
[0002] With the rapid development of the digital age, the amount of data generated in various industries and fields has exploded. People's demand for being able to quickly and accurately obtain the required information from massive data is becoming increasingly urgent. As an important information retrieval and interaction tool, the database question answering system has been widely used in many scenarios such as enterprise intelligent customer service, knowledge management, and online education. It aims to help users easily query various types of information in the database in a natural language way, thereby improving the efficiency and convenience of information acquisition.
[0003] However, the existing AI question-answering system adopts a centralized architecture, which often leads to a decrease in system response speed or even service interruption when facing large-scale concurrent requests. In addition, the single cache mechanism cannot effectively meet the needs of fast access to hot data, resulting in low data retrieval efficiency. In addition, in terms of task scheduling, the lack of intelligent task allocation and scheduling makes resource allocation unreasonable, the flow of tasks between modules is not smooth enough, and the processing process is cumbersome and inefficient. It cannot meet users' expectations for fast question-answering services, and it is difficult to adapt to the growing amount of data and complex and changing business needs.
[0004] In summary, the deficiencies in the architecture design and task scheduling of existing database question-and-answer systems have seriously restricted their performance improvement and the expansion of their application scope. Therefore, an innovative solution is urgently needed to break through these bottlenecks in order to achieve efficient, stable and intelligent database question-and-answer services to meet the growing market demand and users' expectations for high-quality information interaction. Summary of the invention
[0005] The purpose of the present invention is to make up for the shortcomings of the prior art and to provide a database AI question-answering system and method based on a large language model and retrieval enhancement. The system can divide the question-answering system into multiple sub-modules and realize the collaborative work between the modules through an efficient task scheduling mechanism. This distributed architecture not only improves the fault tolerance and scalability of the system, but also ensures the stability and response speed of the system in high-concurrency scenarios. In addition, through an intelligent task scheduling algorithm, the system can reasonably allocate resources, optimize the processing flow, and further improve the overall efficiency of the question-answering service and user experience.
[0006] In order to solve the above technical problems, the present invention provides the following technical solutions: on the one hand, a database AI question-answering system based on a large language model and retrieval enhancement, the components of which include: a front-end interaction module, a distributed cache management module, a task scheduling center, a large language model processing submodule, a retrieval enhancement submodule, an answer optimization submodule and a database management submodule;
[0007] The front-end interaction module is used to receive the user's natural language questions and send them to the distributed cache management module and the task scheduling center, and receive the answers returned by the distributed cache management module and the task scheduling center and display them to the user;
[0008] The distributed cache management module includes a local cache layer and a distributed cache layer. The local cache layer is used to cache the hotspot data of all distributed cache layers and store the hotspot data in the database. The distributed cache layer deploys a cache layer on each submodule and is responsible for storing frequently accessed hotspot data and query results.
[0009] The task scheduling center is used to monitor and coordinate the operation of each submodule, and uses an intelligent task scheduling algorithm to assign user questions to corresponding submodules according to the task type combined with system load, resource availability and task adaptability, and removes duplicates and sorts the processing results of the answer optimization submodule and feeds them back to the front-end interaction module. The intelligent task scheduling algorithm divides the questions into k types of tasks, and 1≤k≤m, m is the total number of task types, and calculates the task priority P according to the task type. i , assign it to the submodule with the highest priority for processing. The task priority , where L i is the current load factor of each submodule, R i The resource availability coefficient for each submodule is A ik The task adaptation coefficient for each submodule for different types of tasks;
[0010] The large language model processing submodule uses the large language model to perform semantic understanding and generate preliminary answers to the text data of the user's question, stores the results in the cache layer and feeds them back to the answer optimization submodule;
[0011] The search enhancement submodule combines the database to accurately search the structured data of the user's question, obtains supplementary information, stores the search results in the cache layer and feeds them back to the answer optimization submodule;
[0012] The answer optimization submodule comprehensively analyzes and optimizes the results of the large language model processing submodule and the retrieval enhancement submodule, generates a final answer, stores it in the cache layer, and feeds it back to the task scheduling center;
[0013] The database management submodule is responsible for managing and maintaining the system database and providing data support for the retrieval enhancement submodule.
[0014] Furthermore, the distributed cache management module uses a data heat evaluation algorithm based on access frequency to monitor the access heat of data in the cache in real time, and sorts and manages the data according to the heat value;
[0015] When a user asks a question, the distributed cache management module quickly searches the local cache layer. When a cache hit is found, the cache data is directly sorted and returned to the front-end interaction module for presentation.
[0016] When the cache is not hit, the problem is input to the task scheduling center for allocation.
[0017] Furthermore, the data heat evaluation algorithm performs the following operations every time interval T: D , recalculate the heat value of all data items in the cache, and sort the data according to the heat value. The data items with high heat value are preferentially retained in the local cache layer and the distributed cache layer. For the data items with low heat value, they are eliminated from the cache and stored in the database. The heat value calculation formula is: , where H D is the data heat value, V D is the total number of times the data item is accessed, T D is the time interval between the last access and the current time, S D is the survival time of the data item, used to normalize the time interval T D , is the heat decay factor, which determines the rate at which heat decays over time. When a user asks a question, the distributed cache management module quickly searches the local cache layer and finds the data based on its heat value H. D Sort, prioritize heat value H D High data items.
[0018] Furthermore, the local cache layer in the distributed cache management module adopts an adaptive cache elimination strategy. When the remaining storage space of the local cache layer is less than 10%, the data is eliminated in order of data heat value from low to high until 30% of the storage space is released for caching new high-heat data. At the same time, when the data item is at time T S1 If a data item has not been accessed and has a low heat value, it will be directly removed from the local cache layer so that the local cache layer always stores hot data.
[0019] A data consistency maintenance mechanism is established between the distributed cache layer and the database management submodule. When the data in the database is updated, inserted, or deleted, the database management submodule will send a corresponding cache update notification to the distributed cache layer. The distributed cache layer will update and delete the corresponding cache data based on the notification, so that the cache data is always consistent with the data in the database. During the task allocation process of the task scheduling center, each submodule can obtain accurate and consistent data, avoiding incorrect answers and additional query operations caused by inconsistent data, thereby improving the reliability and accuracy of the entire question-and-answer system, and also helping to improve the system's operating efficiency and stability.
[0020] Furthermore, the task scheduling center has a fault detection and automatic switching function, which periodically sends a detection signal to each submodule. S2 If no response signal is received from the sub-module, it is determined that the sub-module has failed. At this time, the task scheduling center transfers the task originally assigned to the sub-module to other remaining sub-modules. During the transfer process, the tasks are reallocated according to the load conditions and task adaptation coefficients of other remaining sub-modules to ensure the uninterrupted operation of the entire question-and-answer system. At the same time, the fault information is recorded for subsequent maintenance and analysis, thereby ensuring the high availability and stability of the system, reducing the impact of factor module failures on user experience, and maintaining the system's efficient service capabilities under various circumstances.
[0021] Furthermore, the current load condition of each submodule of the task scheduling center is represented by a load factor L i Indicates that the load factor L i The calculation method is: , where C ui Indicates the current CPU usage of the submodule to reflect the busyness of the current computing resources of the submodule. mi Indicates the maximum CPU usage threshold of the submodule, which is used to normalize the current CPU usage. i Indicates the current task queue length of the submodule, that is, the number of tasks waiting to be processed, Q max Indicates the maximum task queue length that has appeared in all submodules in the system, which is used to normalize the current task queue length, T i Indicates the submodule time interval T D The average task processing time within reflects the processing efficiency of the submodule, T avg It represents the average of the average task processing time of all sub-modules in the system, and is used to normalize the average task processing time of the sub-modules.
[0022] Furthermore, the resource availability of each submodule of the task scheduling center is expressed by the resource availability coefficient R i Indicates that the resource availability coefficient Ri The calculation method is: , where R ci Indicates the number of CPU cores currently available to the submodule, R ti Indicates the total number of CPU cores of the submodule, R mi Indicates the amount of memory currently available to the submodule, R ui Indicates the total amount of memory for the submodule.
[0023] Furthermore, the task adaptation coefficient of each submodule of the task scheduling center for different types of tasks is expressed as A ik Indicates that the task adaptation coefficient A ik The calculation method is: , where N ik is the total number of times the submodule processes the kth task, and the number of times the processing is successfully completed is S ik , the average response time for processing the k-type task is RT ik The average response time of all submodules processing the k-th task is The average resource utilization for processing this type of task is RU ik , is the maximum resource utilization of the submodule when processing tasks, and the resource utilization weight is W 1 , the response time weight is W 2 And W 1 +W 2 =1.
[0024] On the other hand, the database AI question answering method based on a large language model and retrieval enhancement is characterized in that the specific steps of the method are:
[0025] S100, the user inputs a natural language question through the front-end interaction module, and the front-end interaction module sends the question to the distributed cache management module and the task scheduling center;
[0026] S200: When the local cache layer of the distributed cache management module hits the problematic data, the cache data is directly sorted and presented to the user through the front-end interaction module;
[0027] S300, when the problem data is not hit, the task scheduling center receives the problem, calculates the priority of each submodule for the problem according to the task scheduling algorithm, and considers the influence of the data heat evaluation algorithm in the distributed cache management module on the task processing efficiency of each submodule, so as to determine the optimal submodule for problem allocation;
[0028] S400, the submodule assigned the task starts to process the question. When it is a large language model processing submodule, it uses the large language model to semantically understand the user's question and generate a preliminary answer, and stores the result and feeds it back to the answer optimization submodule; when it is a retrieval enhancement submodule, it combines the structured data and text data in the database to accurately retrieve the preliminary answer, obtain supplementary information, and feed the retrieval result back to the answer optimization submodule;
[0029] S500: the answer optimization submodule comprehensively analyzes and optimizes the results of the large language model processing submodule and the retrieval enhancement submodule, generates a final answer and feeds it back to the task scheduling center;
[0030] S600: The task scheduling center returns the final answer to the front-end interaction module, and the front-end interaction module displays the answer to the user.
[0031] Compared with the prior art, the database AI question-answering system and method based on a large language model and retrieval enhancement has the following beneficial effects:
[0032] 1. The distributed architecture of the present invention divides the question-and-answer system into multiple sub-modules with clear functions. Each sub-module is independent of each other but works in collaboration. Through an efficient task scheduling mechanism, the system can monitor the load and resource status of each sub-module in real time, and accurately allocate tasks according to intelligent algorithms. In large-scale concurrent request scenarios, it effectively avoids single point failures and resource waste, ensuring the stable operation of the system. At the same time, the distributed cache management module further optimizes data storage and access, reduces repeated data queries and transmissions, improves overall performance, and provides a strong guarantee for the business continuity of the enterprise.
[0033] 2. The present invention is based on a large language model and retrieval enhancement technology, combined with efficient task scheduling, and can provide users with more accurate, comprehensive and easy-to-understand answers. The task scheduling center reasonably allocates tasks according to the question type and the task adaptation coefficient of the sub-module, so that each sub-module can give full play to its advantages and improve the quality and accuracy of the answer. At the same time, through the allocation and dynamic adjustment of resources, the system can reasonably allocate CPU and memory resources according to task requirements, avoid excessive occupation and idleness of resources, improve resource utilization, reduce the enterprise's hardware costs and energy consumption, and bring users a smoother and more efficient question-and-answer experience.
[0034] Other advantages, objectives and features of the present invention will be set forth in part in the following description and, in part, will be apparent to those skilled in the art based on an examination of the following or may be taught from the practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0036] Figure 1 This is an operational flow chart of the database AI question answering system based on a large language model and retrieval enhancement;
[0037] Figure 2 The figure is a flowchart of the database AI question answering method based on large language model and retrieval enhancement. DETAILED DESCRIPTION
[0038] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the specific implementation mode, structure, characteristics and effects of the present invention are described in detail below in combination with the accompanying drawings and preferred embodiments.
[0039] Embodiment 1
[0040] This embodiment describes in detail the specific implementation process of the database AI question-answering system based on a large language model and retrieval enhancement. The system includes a front-end interaction module, a distributed cache management module, a task scheduling center, a large language model processing sub-module, a retrieval enhancement sub-module, an answer optimization sub-module and a database management sub-module. Through the collaborative work between the modules and the intelligent task scheduling algorithm and cache management mechanism, an efficient and stable question-answering service is achieved, and the system's fault tolerance, scalability and performance in high concurrency scenarios are improved.
[0041] First, in this embodiment, the front-end interaction module serves as the interface between the user and the system and is responsible for receiving natural language questions input by the user. After the user inputs the question, the front-end interaction module will send the question to the distributed cache management module and the task scheduling center at the same time, wait to receive the answer returned from the distributed cache management module and the task scheduling center, and display the answer to the user.
[0042] The distributed cache management module consists of a local cache layer and a distributed cache layer. The local cache layer is used to cache the hot data of all distributed cache layers and store the hot data in the database. An adaptive cache elimination strategy is adopted. When the remaining storage space of the local cache layer is less than 10% of the set threshold, the data is eliminated in order from low to high data heat value until 30% of the storage space is released for caching new high-heat data. At the same time, when the data item is stored for a period of time T S1If a cached data is not accessed and has a low heat value, it will be directly removed from the local cache layer to ensure that the local cache layer always stores hot data. The heat value is obtained by using a data heat evaluation algorithm based on access frequency to monitor the access heat of the data in the cache in real time. The heat value H D The calculation formula is: , where V D is the total number of times the data item is accessed, T D is the time interval between the last access and the current time, S D is the survival time of the data item, used to normalize the time interval T D , is the heat decay factor, which determines the rate at which the heat decays over time; the distributed cache layer deploys a cache layer on each sub-module, which is responsible for storing frequently accessed hot data and query results. It establishes a data consistency maintenance mechanism with the database management sub-module. When the data in the database is updated, inserted or deleted, the database management sub-module will send a corresponding cache update notification to the distributed cache layer. The distributed cache layer will update or delete the corresponding cache data in time according to the notification to ensure that the cache data is always consistent with the data in the database. In the process of assigning tasks by the task scheduling center, each sub-module can obtain accurate and consistent data, avoiding wrong answers and additional query operations caused by inconsistent data, thereby improving the reliability and accuracy of the entire question-and-answer system, and also helping to improve the operating efficiency and stability of the system.
[0043] The task scheduling center is responsible for monitoring and coordinating the operation of each submodule, and uses an intelligent task scheduling algorithm to assign user questions to corresponding submodules according to the task type combined with system load, resource availability and task adaptability, and removes duplicates and sorts the processing results of the answer optimization submodule and feeds them back to the front-end interaction module. The intelligent task scheduling algorithm divides questions into k types of tasks, and 1≤k≤m, m is the total number of task types, and calculates the task priority P according to the task type i , assign it to the submodule with the highest priority for processing, task priority , where the current load condition of each submodule is represented by the load factor L i Indicates and , here C ui Indicates the current CPU usage of the submodule, reflecting the busyness of the current computing resources of the submodule. mi Indicates the maximum CPU usage threshold of the submodule, which is used to normalize the current CPU usage. i Indicates the current task queue length of the submodule, that is, the number of tasks waiting to be processed, Q max Indicates the maximum task queue length that has appeared in all submodules in the system, which is used to normalize the current task queue length, Ti Indicates that the submodule is in the time interval T D The average task processing time within reflects the processing efficiency of the submodule, T avg It represents the average of the average task processing time of all submodules in the system, which is used to normalize the average task processing time of submodules. The resource availability of each submodule is expressed by the resource availability coefficient R i Indicates and , where R ci Indicates the number of CPU cores currently available to the submodule, R ti Indicates the total number of CPU cores of the submodule, R mi Indicates the amount of memory currently available to the submodule, R ui A represents the total amount of memory of the submodule, and the task adaptation coefficient of each submodule for different types of tasks is represented by A ik Indicates and , where N ik is the total number of times the submodule processes the kth task, and the number of times the processing is successfully completed is S ik , the average response time for processing the k-type task is RT ik , the average response time of all submodules processing the k-th task is The average resource utilization for processing this type of task is RU ik , is the maximum resource utilization of the submodule when processing tasks, and the resource utilization weight is W 1 , the response time weight is W 2 And W 1 +W 2 =1. In addition, the task scheduling center has the function of fault detection and automatic switching, and regularly sends detection signals to each submodule. S2 If no response signal is received from the sub-module, the sub-module is determined to be faulty. At this time, the task scheduling center transfers the task originally assigned to the sub-module to other remaining sub-modules. During the transfer process, the tasks are reallocated according to the load conditions and task adaptation coefficients of other remaining sub-modules to ensure the uninterrupted operation of the entire question-answering system. At the same time, the fault information is recorded for subsequent maintenance and analysis, thereby ensuring the high availability and stability of the system, reducing the impact of factor module failures on user experience, and maintaining the system's efficient service capabilities under various circumstances.
[0044] The large language model processing submodule uses a large language model to perform semantic understanding and generate preliminary answers to the text data of user questions. This submodule has powerful natural language processing capabilities and can parse the complex semantic structures in user questions, identify key information and intent, and process questions in various fields and topics through pre-trained language model parameters and algorithms. In terms of semantic understanding, the large language model processing submodule can accurately identify the entities, relationships, and semantic roles in user questions. In terms of preliminary answer generation, it can provide a set of answer candidates with certain rationality and relevance. Even for complex and ambiguous questions, it can provide directions and explanations through its learning and understanding of large amounts of text data, thereby improving the system's adaptability and ability to answer different types of questions.
[0045] The retrieval enhancement submodule combines with the database to accurately retrieve the structured data of user questions and obtain supplementary information. It can build efficient retrieval queries based on the key information of the question, quickly search the structured data in the database, and use relevant retrieval algorithms and indexing technologies to improve the accuracy and efficiency of retrieval. In terms of data retrieval accuracy, the retrieval enhancement submodule can accurately locate the structured data related to the question through an in-depth understanding of the database structure and content. In terms of retrieval efficiency, it can quickly locate the required data in a large-scale database, shortening the retrieval time, enabling the system to quickly respond to user questions under high concurrent requests, and improving the overall performance and response speed of the system.
[0046] The answer optimization submodule comprehensively analyzes and optimizes the results of the large language model processing submodule and the retrieval enhancement submodule to generate the final answer. It integrates the results from different submodules, removes redundant information, and adjusts the structure and expression of the answer to make it clearer, more concise, and easier to read. At the same time, it will screen and sort the answers to ensure that the best answers that best meet the needs of users are presented. In terms of information integration, the answer optimization submodule can organically combine the relatively broad preliminary answers generated by the large language model and the detailed structured data obtained by retrieval enhancement to form a complete and comprehensive answer. In terms of answer quality improvement, by removing redundant information and adjusting the expression, the answer is made more refined and easy to understand, and complex technical terms and lengthy sentences are simplified to improve the efficiency of users' understanding of the answer. At the same time, screening and sorting according to quality assessment standards ensure the accuracy and authority of the final answer and improve the user experience.
[0047] The database management submodule is responsible for managing and maintaining the system database, providing data support for the retrieval enhancement submodule, and ensuring the security of data in various situations through regular backup and recovery mechanisms. During the database update process, it follows the principle of data consistency to ensure data integrity and avoid system failures and wrong answers caused by data errors or loss.
[0048] like Figure 1 As shown, the problem handling process of the system provided in this embodiment when in use is as follows:
[0049] User question input and cache search: Users input natural language questions through the front-end interaction module, and the questions are first sent to the distributed cache management module and task scheduling center;
[0050] The distributed cache management module performs a quick search in the local cache layer based on the data heat value H D Sorting, prioritize data items with high heat values;
[0051] Processing based on cache hits: If the local cache layer of the distributed cache management module hits the question-related data, the cache data is directly sorted and presented to the user through the front-end interaction module, and the question is stored in the database management submodule, and the entire question-answering process ends;
[0052] Cache miss-based processing: If the cache is missed, the problem will be handled by the task scheduling center;
[0053] The task scheduling center calculates the priority P of each submodule for the problem according to the task scheduling algorithm. i ,During the calculation process, the impact of the data heat evaluation algorithm in the ,distributed cache management module on the task processing efficiency of each ,submodule will be considered.,For example, if a sub-module frequently obtains data from the cache, its task ,processing efficiency will be improved, which will be reflected in the load coefficient, and ,will affect the priority of task allocation;
[0054] The task scheduling center calculates the priority P i , assign the problem to the submodule with the highest priority for processing;
[0055] If the submodule assigned the task is the large language model processing submodule, the large language model is used to perform semantic understanding of the user's question and generate preliminary answers, and the results are stored in the cache layer and fed back to the answer optimization submodule;
[0056] If the submodule assigned the task is the retrieval enhancement submodule, it will conduct an accurate retrieval of the structured data of the user's question in combination with the database to obtain supplementary information, store the retrieval results in the cache layer and feed them back to the answer optimization submodule;
[0057] Answer optimization and feedback: The answer optimization submodule comprehensively analyzes and optimizes the results of the large language model processing submodule and the retrieval enhancement submodule, generates the final answer, stores it in the cache layer, and feeds it back to the task scheduling center;
[0058] The task scheduling center returns the final answer to the front-end interaction module, and the front-end interaction module displays the answer to the user.
[0059] This embodiment describes in detail the working principle and process of the database AI question-answering system based on a large language model and retrieval enhancement. Through the cache mechanism of the distributed cache management module and the intelligent task scheduling algorithm of the task scheduling center, the system can efficiently handle user questions. Each submodule performs its own duties and works together to ensure the stability and efficiency of the system under large-scale concurrent requests, providing users with accurate and fast question-answering services. At the same time, the system's distributed architecture and fault detection and automatic switching functions improve the system's fault tolerance and scalability, enabling it to adapt to complex and changing business needs.
[0060] Embodiment 2
[0061] like Figure 2 As shown, this embodiment elaborates on the specific application process of the database AI question-answering method based on a large language model and retrieval enhancement in the enterprise intelligent customer service scenario, and demonstrates how this method can efficiently handle customer questions and provide accurate answers.
[0062] First, S100, the enterprise customer inputs a natural language question through the front-end interaction module of the enterprise customer service interface, such as "The mobile phone I bought has a freezing problem, what should I do?" After the front-end interaction module receives the question, it sends it to the distributed cache management module and the task scheduling center at the same time.
[0063] Then, S200, the local cache layer in the distributed cache management module first performs a quick search. The local cache layer uses the data heat evaluation algorithm based on access frequency described in Example 1 to sort and search according to the data heat value. After searching, it is found that this problem is not stored in the local cache layer, and the task is sent to the task scheduling center.
[0064] Subsequently, S300, the task scheduling center calculates the priority of each sub-module for the problem according to the task scheduling algorithm as described in Example 1. For this "mobile phone crash" problem, after calculation and analysis by the task scheduling center, the task adaptation coefficient of the retrieval enhancement sub-module is higher. Since it is necessary to retrieve relevant information from the product database and after-sales service database, the task scheduling center assigns the problem to the retrieval enhancement sub-module.
[0065] Next, S400, after receiving the task, the retrieval enhancement submodule performs precise retrieval in combination with the structured data in the database. For the problem of mobile phone crash, relevant data is searched from the product database (including information such as mobile phone model, configuration, function, etc.) and the after-sales service database (including information such as solutions to common problems and repair guides). The retrieval enhancement submodule accurately locates the structured data related to the problem, retrieves the possible causes of the mobile phone crash and the corresponding solution steps. For example, software conflict may cause crash, and the solution is to restart the phone and close unnecessary background programs; insufficient memory may also cause crash, and the solution is to clean up the phone memory or uninstall unnecessary applications, etc., and store the search results in the cache layer and feed them back to the answer optimization submodule; at the same time, the large language model processing submodule will also perform semantic understanding and generate preliminary answers to the question, use its own large language model to parse the complex semantic structure in the question, identify key information and intent, and provide some ideas for the problem of mobile phone crash from the perspective of general electronic product maintenance knowledge, such as emphasizing that the crash may be caused by hardware or software failure, and it may be necessary to check the heat dissipation and battery health of the mobile phone, etc., and store the results in the cache layer and feed them back to the answer optimization submodule.
[0066] Secondly, after receiving the results of the large language model processing submodule and the retrieval enhancement submodule, S500, the answer optimization submodule performs comprehensive analysis and optimization processing. For example, it combines the hardware and software speculations about the cause of the freeze with specific solution steps, removes redundant information, and adjusts the structure and expression of the answer to make it clearer, concise, and easy to read. For example, it simplifies complex technical terms and lengthy sentences. The final answer generated is: "Your phone may freeze due to software conflicts or insufficient memory. You can try restarting your phone and closing unnecessary background programs. If the problem persists, please contact our after-sales service center and we will provide you with further assistance." The final answer is stored in the cache layer and fed back to the task scheduling center.
[0067] Finally, after receiving the final answer from the answer optimization submodule, S600, the task scheduling center returns it to the front-end interaction module, and the front-end interaction module displays the answer to the user, completing the entire question-answering process.
[0068] In summary, this embodiment describes in detail the application of the database AI question-answering method based on a large language model and retrieval enhancement in the enterprise intelligent customer service scenario. The question-answering method provided in this embodiment can handle customer questions efficiently and accurately, providing the enterprise with an effective intelligent customer service solution, thereby improving customer satisfaction and the service quality of the enterprise.
[0069] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technical personnel in this field can make some changes or modify the technical contents disclosed above into equivalent embodiments without departing from the scope of the technical solution of the present invention. However, any brief modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention are still within the scope of the technical solution of the present invention.
Claims
1. A database AI question-answering system based on a large language model and retrieval enhancement, characterized by: The components of the system include: front-end interaction module, distributed cache management module, task scheduling center, large language model processing submodule, retrieval enhancement submodule, answer optimization submodule and database management submodule; The front-end interaction module is used to receive the user's natural language questions and send them to the distributed cache management module and the task scheduling center, and receive the answers returned by the distributed cache management module and the task scheduling center and display them to the user; The distributed cache management module includes a local cache layer and a distributed cache layer. The local cache layer is used to cache the hotspot data of all distributed cache layers and store the hotspot data in the database. The distributed cache layer deploys a cache layer on each submodule and is responsible for storing frequently accessed hotspot data and query results. The task scheduling center is used to monitor and coordinate the operation of each submodule, and uses an intelligent task scheduling algorithm to assign user questions to corresponding submodules according to the task type combined with system load, resource availability and task adaptability, and removes duplicates and sorts the processing results of the answer optimization submodule and feeds them back to the front-end interaction module. The intelligent task scheduling algorithm divides the questions into k types of tasks, and 1≤k≤m, m is the total number of task types, and calculates the task priority P according to the task type. i , assign it to the submodule with the highest priority for processing. The task priority , where L i is the current load factor of each submodule, R i The resource availability coefficient for each submodule is A ik The task adaptation coefficient for each submodule for different types of tasks; The large language model processing submodule uses the large language model to perform semantic understanding and generate preliminary answers to the text data of the user's question, stores the results in the cache layer and feeds them back to the answer optimization submodule; The search enhancement submodule combines the database to accurately search the structured data of the user's question, obtains supplementary information, stores the search results in the cache layer and feeds them back to the answer optimization submodule; The answer optimization submodule comprehensively analyzes and optimizes the results of the large language model processing submodule and the retrieval enhancement submodule, generates a final answer, stores it in the cache layer, and feeds it back to the task scheduling center; The database management submodule is responsible for managing and maintaining the system database and providing data support for the retrieval enhancement submodule.
2. The database AI question answering system based on large language model and retrieval enhancement according to claim 1 is characterized in that: The distributed cache management module uses a data heat evaluation algorithm based on access frequency to monitor the access heat of data in the cache in real time, and sorts and manages the data according to the heat value; When a user asks a question, the distributed cache management module quickly searches the local cache layer. When a cache hit is found, the cache data is directly sorted and returned to the front-end interaction module for presentation. When the cache is not hit, the problem is input to the task scheduling center for allocation.
3. The database AI question answering system based on large language model and retrieval enhancement according to claim 2 is characterized in that: The data heat evaluation algorithm is performed every time interval T D , recalculate the heat value of all data items in the cache, and sort the data according to the heat value. The data items with high heat value are preferentially retained in the local cache layer and the distributed cache layer. For the data items with low heat value, they are eliminated from the cache and stored in the database. The heat value calculation formula is: , where H D is the data heat value, V D is the total number of times the data item is accessed, T D is the time interval between the last access and the current time, S D is the survival time of the data item, used to normalize the time interval T D , is the heat decay factor, which determines the rate at which heat decays over time. When a user asks a question, the distributed cache management module quickly searches the local cache layer and finds the data based on its heat value H. D Sort, prioritize heat value H D High data items.
4. The database AI question answering system based on large language model and retrieval enhancement according to claim 1 is characterized in that: The local cache layer in the distributed cache management module adopts an adaptive cache elimination strategy. When the remaining storage space of the local cache layer is less than 10%, the data is eliminated in order of data heat value from low to high until 30% of the storage space is released for caching new high-heat data. At the same time, when the data item is S1 If a data item has not been accessed and has a low heat value, it will be directly removed from the local cache layer so that the local cache layer always stores hot data. A data consistency maintenance mechanism is established between the distributed cache layer and the database management submodule. When the data in the database is updated, inserted, or deleted, the database management submodule will send a corresponding cache update notification to the distributed cache layer. The distributed cache layer will update and delete the corresponding cache data based on the notification, so that the cache data is always consistent with the data in the database.
5. The database AI question answering system based on large language model and retrieval enhancement according to claim 1 is characterized in that: The task scheduling center has a fault detection and automatic switching function, which periodically sends a detection signal to each submodule. S2 If no response signal is received from the sub-module, it is determined that the sub-module has failed. At this time, the task scheduling center transfers the task originally assigned to the sub-module to other remaining sub-modules. During the transfer process, the tasks are reallocated according to the load conditions and task adaptation coefficients of the other remaining sub-modules to ensure the uninterrupted operation of the entire question-and-answer system, while recording the fault information.
6. The database AI question answering system based on large language model and retrieval enhancement according to claim 1 is characterized in that: The current load condition of each submodule in the task scheduling center is expressed by the load coefficient L i Indicates that the load factor L i The calculation method is: , where C ui Indicates the current CPU usage of the submodule to reflect the busyness of the current computing resources of the submodule. mi Indicates the maximum CPU usage threshold of the submodule, which is used to normalize the current CPU usage. i Indicates the current task queue length of the submodule, that is, the number of tasks waiting to be processed, Q max Indicates the maximum task queue length that has appeared in all submodules in the system, which is used to normalize the current task queue length, T i Indicates the submodule time interval T D The average task processing time within reflects the processing efficiency of the submodule, T avg It represents the average of the average task processing time of all sub-modules in the system, and is used to normalize the average task processing time of the sub-modules.
7. The database AI question answering system based on large language model and retrieval enhancement according to claim 1 is characterized in that: The resource availability of each submodule of the task scheduling center is expressed by the resource availability coefficient R i Indicates that the resource availability coefficient R i The calculation method is: , where R ci Indicates the number of CPU cores currently available to the submodule, R ti Indicates the total number of CPU cores of the submodule, R mi Indicates the amount of memory currently available to the submodule, R ui Indicates the total amount of memory for the submodule.
8. The database AI question answering system based on large language model and retrieval enhancement according to claim 1 is characterized in that: The task adaptation coefficient of each submodule of the task scheduling center for different types of tasks is expressed as A ik Indicates that the task adaptation coefficient A ik The calculation method is: , where N ik is the total number of times the submodule processes the kth task, and the number of times the processing is successfully completed is S ik , the average response time for processing the k-type task is RT ik , the average response time of all submodules processing the k-th task is The average resource utilization for processing this type of task is RU ik, It is the maximum resource utilization of the submodule when processing tasks. The resource utilization weight is W1, the response time weight is W2, and W1+W2=1.
9. The database AI question-answering method based on a large language model and retrieval enhancement is applicable to the database AI question-answering system based on a large language model and retrieval enhancement according to any one of claims 1 to 8, characterized in that: The specific steps of this method are: S100, the user inputs a natural language question through the front-end interaction module, and the front-end interaction module sends the question to the distributed cache management module and the task scheduling center; S200: When the local cache layer of the distributed cache management module hits the problematic data, the cache data is directly sorted and presented to the user through the front-end interaction module; S300, when the problem data is not hit, the task scheduling center receives the problem, calculates the priority of each submodule for the problem according to the task scheduling algorithm, and considers the influence of the data heat evaluation algorithm in the distributed cache management module on the task processing efficiency of each submodule, so as to determine the optimal submodule for problem allocation; S400, the submodule assigned the task starts processing the question. When it is a large language model processing submodule, the large language model is used to perform semantic understanding of the user's question and generate a preliminary answer, and the result is stored and fed back to the answer optimization submodule; When it is a retrieval enhancement submodule, it combines the structured data and text data in the database to accurately search for the preliminary answer, obtain supplementary information, and feed back the search results to the answer optimization submodule; S500: the answer optimization submodule comprehensively analyzes and optimizes the results of the large language model processing submodule and the retrieval enhancement submodule, generates a final answer and feeds it back to the task scheduling center; S600: The task scheduling center returns the final answer to the front-end interaction module, and the front-end interaction module displays the answer to the user.
Citation Information
Patent Citations
Four-layer structure data acquisition method and device based on distributed system
CN111694865A
Intelligent adaptive retrieval enhancement system and method and storage medium
CN118210983A
Cited By
Question number question and answer processing method based on AI large model
CN121210064A