Conversation processing method, server, terminal device, storage medium and program product

By pre-recalling heterogeneous knowledge data in parallel and filtering out suitable target knowledge data, and generating response results using a large language model, the problems of response delay and inaccuracy of intelligent chatbots are solved, and efficient and accurate question-and-answer services are achieved.

CN121935338APending Publication Date: 2026-04-28ALIBABA CLOUD COMPUTING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ALIBABA CLOUD COMPUTING CO LTD
Filing Date
2024-10-25
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Existing intelligent chatbots suffer from high response latency when processing heterogeneous knowledge data, and excessive calls to large language models lead to increased costs and inaccurate answers.

Method used

Multiple knowledge retrieval components are used to pre-recall heterogeneous knowledge data in parallel, and a response result is generated by calling a large language model in one go, thereby filtering out target knowledge data that matches the query message.

Benefits of technology

It reduces the number of calls to the large language model, improves the accuracy and efficiency of responses, reduces inaccuracies caused by knowledge structure classification errors, and increases the speed of dialogue response.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121935338A_ABST
    Figure CN121935338A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a dialogue processing method, a server, terminal equipment, a storage medium and a program product. In the dialogue processing method, before a large language model is called to answer a target inquiry message, a plurality of knowledge retrieval components corresponding to different knowledge structures can be utilized to perform pre-recall of heterogeneous knowledge and unified screening of the heterogeneous knowledge; therefore, it is ensured that the knowledge data provided for the large language model is reliable data recalled from the heterogeneous knowledge data, and the large language model does not need to execute the structure classification operation of the knowledge data. On one hand, the risk of inaccurate answering caused by the fact that the big language model classifies the knowledge structures wrongly is reduced, and the accuracy of the answering result output by the big language model can be improved. And on the other hand, the knowledge pre-recall operation is executed before the large language model is called, the large language model does not need to be hierarchically called for multiple times, the dialogue response efficiency is improved, and the calling cost of the large language model and the end-to-end response delay are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a dialogue processing method, server, terminal device, storage medium, and program product. Background Technology

[0002] Intelligent chatbots are human-computer dialogue products based on natural language processing and dialogue management technologies. They can engage in dialogue based on the service type configured by the user and knowledge data of different structures. In the field of artificial intelligence, integrating and utilizing heterogeneous knowledge is a challenge. Considering the differences in processing schemes for knowledge data with different structures, some intelligent chatbots employ a central control mode to provide question-and-answer services. In this mode, the intelligent chatbot can utilize a central control engine and multiple dialogue engines corresponding to different knowledge structures. In this implementation, the central control engine and dialogue engines need to call the large language model multiple times to answer user questions, resulting in high response latency. Therefore, a new solution is needed. Summary of the Invention

[0003] This application provides a dialogue processing method, server, terminal device, storage medium, and program product to reduce response latency in intelligent question answering based on heterogeneous knowledge data.

[0004] This application provides a dialogue processing method applied to a single intelligent agent, comprising: responding to an inquiry request and obtaining a target inquiry message; utilizing multiple knowledge retrieval components corresponding to different knowledge structures to perform knowledge pre-recall based on the target inquiry message, thereby obtaining multiple candidate heterogeneous knowledge data; filtering out target knowledge data that matches the target inquiry message from the multiple candidate heterogeneous knowledge data; and generating a response result corresponding to the target inquiry message by calling a large language model once, based on the target inquiry message and the target knowledge data.

[0005] Optionally, multiple knowledge retrieval components corresponding to different knowledge structures are used to perform knowledge pre-recall based on the target query message to obtain multiple candidate heterogeneous knowledge data. This includes: using multiple knowledge retrieval components corresponding to different knowledge structures, performing knowledge retrieval in parallel on the knowledge bases corresponding to each of the multiple knowledge retrieval components based on the target query message, so as to pre-recall the multiple candidate heterogeneous knowledge data.

[0006] Optionally, multiple knowledge retrieval components corresponding to different knowledge structures are used to perform knowledge retrieval in parallel on the knowledge bases corresponding to each of the multiple knowledge retrieval components based on the target query message. This includes performing at least two of the following operations in parallel: using a text retrieval component to perform text knowledge retrieval based on the target query message to obtain candidate text knowledge data; using a data table retrieval component to perform data table knowledge retrieval based on the target query message to obtain candidate data table knowledge data; and using a chart retrieval component to perform chart retrieval based on the target query message to obtain candidate chart knowledge data.

[0007] Optionally, multiple knowledge retrieval components corresponding to different knowledge structures are used to perform knowledge pre-recall based on the target query message, including: querying the historical question-and-answer set to determine whether there is a target question-and-answer pair matching the target query message in the historical question-and-answer set; if there is no target question-and-answer pair matching the target query message in the historical question-and-answer set, then multiple knowledge retrieval components corresponding to different knowledge structures are used to perform knowledge retrieval based on the target query message to pre-recall the multiple heterogeneous knowledge data.

[0008] Optionally, selecting target knowledge data that matches the target query message from the candidate heterogeneous knowledge data includes: obtaining knowledge tags for each of the candidate heterogeneous knowledge data based on the association information between the candidate heterogeneous knowledge data and the target query message in at least one dimension; and determining the target knowledge data that matches the target query message from the candidate heterogeneous knowledge data based on the knowledge tags for each of the candidate heterogeneous knowledge data.

[0009] Optionally, based on the target query message and the target knowledge data, a response result corresponding to the target query message is generated by calling a large language model once, including: retrieving a contextual learning dataset based on the target heterogeneous knowledge data to obtain target contextual learning data adapted to the target knowledge data; the contextual learning dataset is obtained based on reasoning examples configured by the user for specific knowledge data; generating prompt words based on the target query message, the target contextual learning data, and the target knowledge data; and calling the large language model once based on the prompt words to generate a response result corresponding to the target query message.

[0010] Optionally, after generating the response result corresponding to the target query message by calling the large language model once, the method further includes: calling a parsing tool to parse the response result and obtain a parsing result; if the parsing result indicates that the response result does not meet the set quality conditions, then re-execute the operation of using the multiple knowledge retrieval components to perform knowledge pre-recall based on the target query message, the operation of filtering multiple heterogeneous knowledge candidates for pre-recall, and the operation of calling the large language model once based on the filtered target knowledge data that matches the target query message and the target query message.

[0011] This application also provides a dialogue processing method, including: responding to a user's question operation and obtaining a target query message; sending a query request to a server based on the target query message, so that the server obtains a response result corresponding to the target query message using the method provided in this application; receiving the response result returned by the server and outputting the response result to the user.

[0012] Optionally, after outputting the response result, the method further includes: responding to a correction operation on the response result, displaying a correction configuration interface corresponding to the response result, the correction configuration interface including multiple correction configuration items; obtaining a reasoning example of specific knowledge data based on the user's configuration operation on the multiple correction configuration items, the specific knowledge data being retrieved based on the target message; and sending the reasoning example of the specific knowledge data as contextual learning data of the specific knowledge data to the server, so that the server guides the large language model's reasoning process for the specific knowledge data based on the contextual learning data.

[0013] Optionally, the plurality of correction configuration items include: a flowchart configuration item and at least one reasoning process configuration item, wherein the at least one reasoning process configuration item includes at least one of: a process branch configuration item, a jump node configuration item, a model thinking configuration item, and a model action configuration item; obtaining reasoning examples of specific knowledge data based on the user's configuration operations on the plurality of correction configuration items includes: obtaining a target flowchart adapted to the target query message as the specific knowledge data based on the user's configuration operations on the flowchart configuration item; and obtaining reasoning examples of the flowchart based on the user's configuration operations on the at least one reasoning process configuration item.

[0014] This application embodiment also provides a dialogue processing method, including: responding to a correction operation on a response result output by a large language model based on a target query message, displaying a correction configuration interface corresponding to the response result, the correction configuration interface including multiple correction configuration items; obtaining a reasoning example of specific knowledge data based on the user's configuration operation of the multiple correction configuration items, the specific knowledge data being retrieved based on the target message; and sending the reasoning example of the specific knowledge data as contextual learning data of the specific knowledge data to a server, so that the server guides the large language model's reasoning process for the specific knowledge data based on the contextual learning data.

[0015] This application embodiment also provides a dialogue processing system, including: a terminal device and a server; wherein, the terminal device is configured to: respond to a user's query operation and obtain a target query message; send a query request to the server based on the target query message; receive a response result returned by the server and output the response result to the user; the server is configured to: respond to the query request and obtain the target query message; utilize multiple knowledge retrieval components corresponding to different knowledge structures to perform knowledge pre-recall based on the target query message to obtain multiple candidate heterogeneous knowledge data; filter out target knowledge data that matches the target query message from the multiple candidate heterogeneous knowledge data; and generate a response result corresponding to the target query message by calling a large language model once, based on the target query message and the target knowledge data.

[0016] This application also provides an electronic device, including: a memory and a processor; the memory is used to store one or more computer instructions; the processor is used to execute the one or more computer instructions to perform the steps in the method provided in this application.

[0017] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can implement the steps in the method provided in this application.

[0018] This application also provides a computer program product, including: a computer program / instructions, which, when executed by a processor, can implement the steps in the method provided in this application.

[0019] In this embodiment, before calling the large language model to answer the target query message, multiple knowledge retrieval components corresponding to different knowledge structures can be used to perform pre-recall and unified screening of heterogeneous knowledge. This ensures that the knowledge data provided to the large language model is reliable data recalled from heterogeneous knowledge data, eliminating the need for the large language model to perform knowledge data structure classification operations. On the one hand, this reduces the risk of inaccurate answers due to incorrect knowledge structure classification by the large language model, thus improving the accuracy of the responses output by the large language model. On the other hand, performing knowledge pre-recall operations before calling the large language model eliminates the need for layered, multiple calls to the large language model, improving dialogue response efficiency and reducing the calling cost and end-to-end response latency of the large language model. Attached Figure Description

[0020] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0021] Figure 1 This is a schematic diagram of the structure of an intelligent dialogue robot in a dialogue-controlled mode;

[0022] Figure 2 A schematic diagram of the process of executing a dialogue processing method provided in an exemplary embodiment of this application on the server side;

[0023] Figure 3 A schematic diagram of the structure of a conversational intelligent robot including a single planning agent, provided as an exemplary embodiment of this application;

[0024] Figure 4 A schematic diagram of the process of executing a dialogue processing method on the server side, which is another exemplary embodiment of this application;

[0025] Figure 5 A schematic flowchart illustrating the execution of a dialogue processing method provided in an exemplary embodiment of this application on the terminal device side;

[0026] Figure 6a A schematic diagram of a correction configuration interface provided for an exemplary embodiment of this application;

[0027] Figure 6b A schematic diagram illustrating a process for correcting errors based on contextual learning data, provided as an exemplary embodiment of this application;

[0028] Figure 7 A schematic flowchart illustrating the execution of a dialogue processing method on a terminal device side, as provided in another exemplary embodiment of this application;

[0029] Figure 8A schematic diagram of the structure of an electronic device provided for an exemplary embodiment of this application. Detailed Implementation

[0030] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0031] The terminology used in the embodiments of this invention is for the purpose of describing particular embodiments only and is not intended to limit the invention. The singular forms “a,” “the,” and “the” used in the embodiments of this invention and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise. “Multiple” generally includes at least two, but does not exclude the inclusion of at least one.

[0032] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0033] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a product or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a product or system. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the product or system that includes said element.

[0034] Heterogeneous knowledge refers to knowledge obtained by organizing knowledge data using different structures and data organization principles. For example, heterogeneous knowledge can include structured processes, data tables, question-and-answer pairs, and unstructured document knowledge, web page knowledge, search engine results, etc.

[0035] Considering the differences in processing methods for knowledge data with different structures, some intelligent chatbots employ a dialogue-centric control model to provide question-and-answer services. In this model, the intelligent chatbot can include a central control engine and multiple dialogue engines corresponding to different knowledge types. The central control engine can schedule different dialogue engines to process knowledge data with different structures based on the user's question, and then use the processed knowledge data to call a large language model to generate the answer to the user's question.

[0036] like Figure 1 As shown, in a dialogue control model, dialogue control can be achieved based on a centralized multi-agent (Multi-agent) collaborative agent (CoAgent) scheme. Here, the agent can also be called an intelligent agent, which possesses a certain degree of autonomy and intelligence, capable of perceiving and taking actions in a specific environment to achieve its goals. In this scheme, the intelligent chatbot includes a planner agent and multiple collaborative agents, each corresponding to a different knowledge structure. For example... Figure 1 The diagram illustrates a document knowledge agent (DocAgent), a database knowledge agent (SQLAgent), and a process knowledge agent (SOPAgent). In one scheme, the planning agent, upon receiving a user question, invokes a large language model, combines the knowledge structures of multiple collaborative agents, analyzes the fit scores between the user question and the multiple collaborative agents, and selects one or more suitable target collaborative agents to handle the user question based on the fit scores returned by the large language model. The target collaborative agent retrieves knowledge of the corresponding structure based on the user question and its own knowledge processing capabilities, and can invoke the large language model to answer the user question based on the retrieved knowledge. In another scheme, the planning agent, upon receiving a user question, sends the user question to multiple collaborative agents. Each collaborative agent can invoke the large language model, calculate its ability score for solving the user question based on the user question and the knowledge structure corresponding to the collaborative agent, and return this score to the planning agent. After obtaining the respective ability scores of the multiple collaborative agents, the planning agent can select one or more suitable target collaborative agents to handle the user question. The target collaborative agent is used to: retrieve relevant knowledge based on the user's question and its own knowledge processing capabilities, and call a large language model to answer the user's question based on the knowledge it has retrieved.

[0037] In both Schemes 1 and 2, the knowledge among the multiple collaborative agents is not shared, and the knowledge between the planning agent and the collaborative agents is also not shared. This results in each collaborative agent using somewhat limited knowledge when calling the large language model to answer user questions, thus hindering the accuracy of the responses. In Scheme 1, the planning agent and collaborative agents make multiple sequential calls to the large model, leading to a high response delay for the intelligent chatbot. In Scheme 2, multiple collaborative agents need to call the large language model separately, and the selected target collaborative agent needs to call the large language model multiple times. This increases the number of model calls and the cost of generating answers.

[0038] To address the aforementioned technical problems, a solution is provided in some embodiments of this application. The technical solutions provided by each embodiment of this application are described in detail below with reference to the accompanying drawings.

[0039] Figure 2 This is a flowchart illustrating a dialogue processing method provided in an exemplary embodiment of this application. The method may include, for example: Figure 2 The steps shown are as follows:

[0040] Step 201: Respond to the query request and obtain the target query message.

[0041] Step 202: Using multiple knowledge retrieval components corresponding to different knowledge structures, perform knowledge pre-recall based on the target query message to obtain multiple candidate heterogeneous knowledge data.

[0042] Step 203: Select target knowledge data that matches the target query message from the multiple candidate heterogeneous knowledge data.

[0043] Step 204: Based on the target query message and the target knowledge data, generate the response result corresponding to the target query message by calling the large language model once.

[0044] This embodiment can be executed by a server running an application capable of providing intelligent question-and-answer services. This application includes a single intelligent agent (or a single agent), and the server can execute the dialogue processing method provided in this embodiment based on this single intelligent agent. The server can communicate and interact with the user's terminal device, receive inquiry requests sent by the terminal device, and return a response based on the inquiry request. In this embodiment, the server can be implemented as a conventional server or a cloud server; this embodiment is not limited to any particular type. In step 201, the inquiry request can be sent by the terminal device, and the inquiry request can carry a target inquiry message, which is sent by the user through the terminal device. The content of the inquiry corresponding to the target inquiry message varies in different application scenarios. For example, in e-commerce scenarios, the target inquiry message can be an order inquiry message or a consultation message regarding the return and exchange process; in education and training scenarios, the target inquiry message can be a course inquiry message, an exam schedule inquiry message, or a consultation message regarding the registration process; in the healthcare field, the target inquiry message can be a consultation message regarding the medical treatment process, an insurance reimbursement consultation message, etc., and so on.

[0045] In step 202, knowledge pre-recall refers to recalling multiple knowledge data points before invoking the large language model. Compared to the scheme where the large language model scores multiple collaborative engines based on different knowledge structures, the knowledge pre-recall approach eliminates the need to invoke the large language model to analyze heterogeneous knowledge, thus effectively reducing the cost of invoking the large language model. Multiple knowledge retrieval components are used to provide retrieval services for knowledge data with various structures. In this embodiment, knowledge data refers to data in various forms used to express, store, and utilize knowledge. In this embodiment, knowledge data may include general knowledge data, domain knowledge data, and personalized knowledge data. Personalized knowledge data refers to the personalized knowledge data of merchants / organizations that use intelligent chatbots to provide customer service functions. For example, in the e-commerce field, a merchant's personalized knowledge data may include: store product data, store member data, store shipping rules, store after-sales rules, etc. As another example, in the education and training field, personalized knowledge data may include: course data, student data, examination rule data, etc., of the education platform.

[0046] Knowledge structure, in this context, refers to the structure of knowledge data, describing its organizational form. Knowledge data can be structured, semi-structured, or unstructured. Structured knowledge data can include diagrams (e.g., flowcharts, knowledge graphs), data tables, question-answer pairs, etc. Unstructured knowledge data can include text data, such as documents, books, articles, reports, search engine results, and webpage information capture results. Semi-structured data can include XML (eXtensible Markup Language) files, JSON (JavaScript Object Notation) objects, etc. For example, in e-commerce, diagrammatic structures (such as flowcharts and knowledge graphs) can be used to effectively organize and connect large amounts of product information, user behavior data, and merchants' pre-sales / after-sales processing logic. Besides diagrammatic structures, data tables can also be used in e-commerce to store order data, inventory data, user review data, payment data, etc.

[0047] In this embodiment, a knowledge retrieval component can be used to retrieve knowledge data with a specific structure. For example, the multiple knowledge retrieval components may include: a text retrieval component, a data table retrieval component, a chart retrieval component, an XML file retrieval component, and a JSON file retrieval component. Each of these retrieval components corresponds to a knowledge base with a specific structure; for example, the text retrieval component corresponds to a text knowledge base, the data table retrieval component corresponds to a data table knowledge base, the chart retrieval component corresponds to a chart knowledge base, the XML file retrieval component corresponds to an XML knowledge base, and the JSON file retrieval component corresponds to a JSON knowledge base.

[0048] Different knowledge retrieval components possess varying knowledge retrieval capabilities. Text retrieval components can be used for full-text search based on inverted indexes; alternatively, they can analyze the semantics of text using Natural Language Processing (NLP) techniques and retrieve textual knowledge based on the semantic analysis results; or they can use keyword matching methods and regular expressions to match specific text paragraphs. Data table retrieval components can be used to query data tables in relational databases using Structured Query Language (SQL) and analyze the retrieved data using data mining techniques; alternatively, they can use the query language corresponding to non-relational databases to query data tables in non-relational databases and aggregate functions to aggregate the retrieved data. Chart retrieval components can be used to find similar charts using graphs or graph semantic matching algorithms. Taking product poster images as an example, the chart retrieval component can identify the main information of the product in the image and perform knowledge retrieval based on the identified main information. Taking flowcharts as an example, the chart retrieval component can identify the attribute information of nodes and edges in the flowchart, identify the semantics of the flowchart based on the identified attribute information of nodes and edges, and perform retrieval operations for specific processes or steps according to the semantics of the flowchart.

[0049] Based on this, multiple knowledge retrieval components corresponding to different knowledge structures can be used to retrieve their respective knowledge bases, thereby pre-recalling knowledge data. In this embodiment, the various knowledge returned by the multiple knowledge retrieval components are marked as multiple candidate heterogeneous knowledge data. These candidate heterogeneous data may include knowledge data with at least two different structures. For example, in an e-commerce scenario, if the target query message is a return and exchange process consultation message, the candidate heterogeneous data may include: return and exchange rule text retrieved from a text knowledge base by a text retrieval component and a return and exchange process diagram retrieved from a chart knowledge base by a chart retrieval component.

[0050] In this implementation, different knowledge retrieval components enable the retrieval of heterogeneous knowledge data. This eliminates the need for the large language model to classify various heterogeneous knowledge data, reducing the number of calls to the large language model and mitigating the problem of low accuracy in response results caused by inaccurate classification of heterogeneous knowledge by the large language model.

[0051] In step 203, after obtaining multiple candidate heterogeneous knowledge data, target knowledge data that matches the target query message can be selected from these candidate heterogeneous knowledge data. The target knowledge data may include knowledge data of one structure or may include knowledge data of multiple different structures.

[0052] Optionally, when filtering multiple heterogeneous knowledge data from candidates, the matching degree between the multiple heterogeneous knowledge data from candidates and the target query message can be calculated separately, and the multiple heterogeneous knowledge data from candidates can be sorted according to the matching degree.

[0053] After obtaining the target knowledge data based on the above implementation method, in step 204, a large language model can be invoked once to generate the response result corresponding to the target query message, based on the target query message and the target knowledge data. The large language model is a Natural Language Processing (NLP) model trained on a large scale. Large language models are typically built based on deep learning techniques and trained on large training datasets, thus exhibiting powerful performance in processing natural language tasks. The number of parameters in the large language model is greater than a set threshold, which is typically on the order of millions or billions. In some optional embodiments, the large language model can be a large language model based on the Transformer architecture. The large language model is first pre-trained on a public dataset containing more than 1TB of text data to learn general language representations. Subsequently, to adapt to the specific application scenarios of this application embodiment, the model is fine-tuned on a dedicated dataset containing a large amount of heterogeneous knowledge and question-answer pairs. Through fine-tuning, the large language model can accept heterogeneous knowledge and user questions as input and generate accurate response results as output. Compared with traditional multi-agent methods, this embodiment does not require a large language model to classify heterogeneous knowledge. Instead, it can directly utilize heterogeneous knowledge to accurately generate answers, reducing the risk of inaccurate answers due to misclassification of heterogeneous knowledge.

[0054] Optionally, a structured prompt word template can be used to organize the target query message and target knowledge data into prompt words, and input the prompt words into a large language model so that the large language model can generate the response result corresponding to the target query message based on the target knowledge data.

[0055] In this embodiment, before calling the large language model to answer the target query message, multiple knowledge retrieval components corresponding to different knowledge structures can be used to perform pre-recall and unified screening of heterogeneous knowledge. This ensures that the knowledge data provided to the large language model is reliable data recalled from heterogeneous knowledge data, eliminating the need for the large language model to perform knowledge data structure classification operations. On the one hand, this reduces the risk of inaccurate answers due to incorrect knowledge structure classification by the large language model, thus improving the accuracy of the responses output by the large language model. On the other hand, performing knowledge pre-recall operations before calling the large language model eliminates the need for layered, multiple calls to the large language model, improving dialogue response efficiency and reducing the calling cost and end-to-end response latency of the large language model.

[0056] In some optional embodiments, when the server uses multiple knowledge retrieval components corresponding to different knowledge structures to perform knowledge pre-recall based on the target query message and obtain multiple heterogeneous knowledge data for the candidate, it can query the historical question-and-answer set to determine whether there is a target question-and-answer pair matching the target query message in the historical question-and-answer set. The historical question-and-answer set may include one or more sets of historical question-and-answer pairs. Any historical question-and-answer pair refers to a question-and-answer pair formed by a user's query message issued in a historical period and the response generated by the large language model based on the user's query message. When querying the historical question-and-answer set, the similarity between the target query message and each historical query message in the historical question-and-answer set can be calculated, and the target historical query message matching the target query message can be selected based on the similarity. The question-and-answer pair corresponding to the target historical query message can be used as the target question-and-answer pair.

[0057] Optionally, if a target question-and-answer pair matching the target query message exists in the historical question-and-answer set, the server can return the response corresponding to the target query message based on the target question-and-answer pair. That is, in this implementation, prioritizing the determination of whether a question-and-answer pair matching the target query message exists before knowledge retrieval is beneficial for reusing question-and-answer pairs generated in historical periods, thereby reducing the retrieval time of the knowledge retrieval component and the number of calls to the large model.

[0058] Optionally, if no target question-answer pair matching the target query message exists in the historical question-answer set, the server can perform knowledge pre-recall and response generation operations on the target query message. Optionally, when performing knowledge retrieval operations on the target query message, multiple knowledge retrieval components corresponding to different knowledge structures can be used to perform knowledge retrieval in parallel based on the target query message and the corresponding knowledge bases of each component, obtaining multiple candidate heterogeneous knowledge data. For example, two or more of the following components—text retrieval, data table retrieval, chart retrieval, XML file retrieval, and JSON file retrieval—can be called to perform parallel retrieval of their respective knowledge bases; or, all of the above retrieval components can be called to perform parallel retrieval of their respective knowledge bases.

[0059] For example, in some optional embodiments, the server may perform at least two of the following operations in parallel: using a text retrieval component to perform text knowledge retrieval based on the target query message to obtain candidate text knowledge data; using a data table retrieval component to perform data table knowledge retrieval based on the target query message to obtain candidate data table knowledge data; and using a chart retrieval component to perform chart retrieval based on the target query message to obtain candidate chart knowledge data.

[0060] like Figure 3 As shown, an intelligent chatbot may include a planning agent (i.e., a single intelligent agent) that coordinates the response processing of target query messages. In the planning agent's tool definition, functions such as getSOP() for retrieving graph knowledge data, getDoc() for retrieving document knowledge data, getTable() for retrieving data table knowledge data, and ExecuteSQL() for querying the database can be defined. Figure 3 As shown, the above function can retrieve knowledge data from task flows, document search engines (DocIndex), and databases, and obtain the corresponding structured knowledge data.

[0061] In this implementation, employing multiple knowledge retrieval components for knowledge retrieval results in more comprehensive and reliable retrieved knowledge. Furthermore, the parallel execution of knowledge retrieval by multiple components improves retrieval efficiency and reduces response time to target queries. Figure 3 The structure of the intelligent conversational robot shown is relative to Figure 1 The multi-agent collaborative structure shown eliminates the need for a multi-agent negotiation process, reducing interactions between agents and further minimizing response latency.

[0062] In some optional embodiments, when filtering out target knowledge data that matches the target query message from multiple heterogeneous knowledge data of the candidates, the knowledge tags of each of the multiple heterogeneous knowledge of the candidates can be obtained based on the association information between the multiple heterogeneous knowledge of the candidates and the target query message in at least one dimension.

[0063] Optionally, the at least one dimension may include at least one of the following: entity dimension, field dimension, semantic dimension, and logical dimension. An entity refers to an object with a clear meaning, such as a person's name, place name, organization name, time, number, currency value, product name, product model, etc. A field refers to a specific item appearing in structured data or a form, containing a specific attribute or characteristic. For example, in an order query, "order number," "shipping address," and "shipping status" can be considered fields. Semantics refers to the actual content and meaning contained in the target query message or knowledge. Logic refers to the logical relationship between different descriptive objects, such as causal relationships, conditional relationships, etc. For example, a pre-sales consultation question could be: If I place an order at 4 PM today (condition), will it be shipped today (result)?

[0064] For example, for any one of multiple heterogeneous candidate knowledge sources, the entity corresponding to that knowledge can be obtained, and the entity corresponding to the target query message can be identified. If the entity corresponding to the knowledge is the same as the entity corresponding to the target query message, a "same entity" tag can be added to the knowledge. If the entity corresponding to the knowledge is partially the same as the entity corresponding to the target query message, a "partially same entity" tag can be added to the knowledge. If the entity corresponding to the knowledge is different from the entity corresponding to the target query message, a "different entity" tag can be added to the knowledge.

[0065] For example, for any one of the multiple heterogeneous knowledge candidates, the logic corresponding to that knowledge can be obtained, and the logic corresponding to the target query message can be identified. Taking the pre-sales consultation question mentioned above as an example, the logic corresponding to this pre-sales consultation question is: If an order is placed at 4 PM, can it be shipped today? In this scenario, if a candidate knowledge is a shipping flowchart S1, and there is a corresponding shipping time judgment node on the shipping flowchart S1, the judgment condition of this judgment node is 3 PM, and this judgment node points to two branches, namely: if the order time is earlier than 3 PM, then it will be shipped on the same day; if the order time is later than 3 PM, then it will be shipped the next day. If the pre-sales consultation query matches the conditions and results in the shipping flowchart S1, then a logically identical tag can be added to the shipping flowchart S1. If a candidate knowledge is a shipping flowchart S2, and this flowchart has a corresponding shipping time judgment node, the judgment condition of which is the 15th of the current month, and this judgment node points to two branches: if the order time is earlier than the 15th of the current month, then logistics company B1 will be used for shipping; if the order time is later than the 15th of the current month, then logistics company B2 will be used for shipping. If the pre-sales consultation question does not match the conditions and results in the shipping flowchart S2, then a logical difference label can be added to the flowchart S2.

[0066] After obtaining the knowledge tags of multiple heterogeneous knowledge items based on the above implementation method, the target knowledge data that matches the target query message can be determined from the candidate heterogeneous knowledge items based on their respective knowledge tags. Optionally, different knowledge tags have different matching scores, and the matching scores of the candidate heterogeneous knowledge items can be calculated based on their respective knowledge tags. Based on the matching scores of the candidate heterogeneous knowledge items, the candidate heterogeneous knowledge items can be sorted, and the N knowledge items with higher matching scores can be selected as the target knowledge data, where N is a positive integer. For example, taking the aforementioned pre-sales consultation question as an example, the target knowledge data that matches the pre-sales consultation question may include: shipping rule documents and shipping flowchart S1, etc.

[0067] In some optional embodiments, the large language model can be further guided using in-context learning (ICL) data to improve the accuracy of the generated responses. In-context learning refers to enabling the large language model to learn to perform new tasks by observing a series of input-output examples without explicit fine-tuning. This will be illustrated below.

[0068] Optionally, when generating a response result corresponding to the target query message by calling the large language model once based on the target query message and the target knowledge data, the context learning dataset is retrieved based on the target knowledge data to obtain target context learning data that matches the target knowledge data. In this embodiment, the context learning dataset is obtained based on the inference examples configured by the user for specific knowledge data. The specific knowledge data may be the full amount of knowledge data retrieved from the user's query messages in historical time periods, and / or the knowledge data corresponding to the response results that received negative feedback, and / or knowledge data of a certain structure that is difficult for the large language model to process, such as graph data, etc. This embodiment includes, but is not limited to, these.

[0069] Optionally, when retrieving the contextual learning dataset based on the target knowledge data, the structural type of the target knowledge data can be obtained, and a portion of the contextual learning dataset that matches the structural type can be retrieved as the target contextual learning data. Alternatively, the knowledge topic of the target knowledge data can be obtained, and a portion of the contextual learning dataset that matches the knowledge topic can be retrieved as the target contextual data. Alternatively, the contextual learning dataset can be retrieved based on both the structural type and the knowledge topic of the target knowledge data to obtain a portion of the data that matches both the structural type and the knowledge topic as the target contextual data.

[0070] After obtaining the target scenario data based on the above implementation method, prompt words can be generated according to the target query message, the target scenario learning data, and the target knowledge data. Based on the prompt words, the large language model can be called to generate the response result corresponding to the target query message.

[0071] In this implementation, the target context learning data can be used to guide the large language model to output better answers without fine-tuning the large language model, thereby enabling the large language model to quickly adapt to new tasks and improving its flexibility and generalization ability.

[0072] Optionally, after generating the response to the target query message by calling a large language model once, the response can be further parsed to determine whether to directly output the response or re-answer. In this implementation, a parsing tool can be invoked to parse the response and obtain the parsed result. During the parsing, a word segmenter or syntactic analyzer can be used to extract key information from the response, and logical reasoning tools (such as rule engines or logical reasoning libraries) can be used to perform logical analysis on the extracted information to check the logical relationships in the response. Furthermore, tools such as knowledge graphs or search engines can be used to verify the factual accuracy of the response, or consistency checking tools (such as logical consistency checkers) can be used to check for logical contradictions in the response.

[0073] After obtaining the parsing result, it can be determined whether the parsing result meets the set quality conditions. For example, the set quality conditions may include: the logical relationship in the response result is accurate, the facts in the response result are accurate, and there are no logical contradictions in the response result. Optionally, if the parsing result indicates that the response result does not meet the set quality conditions, the operation of using the multiple knowledge retrieval components to perform knowledge pre-recall based on the target query message, the operation of filtering the multiple heterogeneous knowledge candidates obtained from the pre-recall, and the operation of calling the large language model once based on the filtered target knowledge data adapted to the target query message and the target query message can be referred to the description in the foregoing embodiments, which will not be repeated here.

[0074] The following will combine Figure 4 The following example further illustrates the dialogue processing method executed on the server side.

[0075] like Figure 4 As shown, after receiving a user's question, the server can perform entity recognition to identify the objects associated with the question. Following entity recognition, in the high-confidence direct output stage, based on preset rules and semantics, it can determine whether a target question-answer pair with high confidence exists in the historical question-answer pairs. If a target question-answer pair is found in the historical pairs, the user's question is answered directly based on the response from the target question-answer pair. For example... Figure 4 As shown, if the target question-answer pair is not found in the historical question-answer pairs, the knowledge retrieval stage can be initiated. In the knowledge retrieval stage, various knowledge retrieval components corresponding to different knowledge structures can be used to perform knowledge retrieval operations in parallel. For example... Figure 4As shown, various knowledge retrieval components corresponding to different knowledge structures may include: a plugin for obtaining contextual learning data, the getSOPKnow() function for obtaining chart knowledge data, the getDocKnow() function for obtaining document knowledge data, the getTableKnow() function for obtaining data table knowledge data, and the getSearchEngine function for obtaining search engine data, etc. Figure 4 As shown, the `getDocKnow()` function can retrieve document knowledge data from external knowledge bases; the `getTableKnow()` function can perform database queries to retrieve data table knowledge from the database. In the knowledge retrieval stage, after retrieving candidate heterogeneous knowledge data, the candidate heterogeneous knowledge data can be sorted, and the top-ranked target knowledge data can be selected based on the sorting results.

[0076] In the model inference phase, the server can invoke the large language model to execute the answer to the user's question based on the target knowledge data and the user's question. Compared to Figure 1 Regarding the large language model planning, knowledge retrieval enhancement, and large language model response process shown, the process of pre-retrieval knowledge enhancement and large model response adopted in this embodiment updates the two calls to the large language model into a single call to the large language model, thereby effectively reducing the call cost and response latency of the large language model.

[0077] Furthermore, in the knowledge retrieval stage, the server can employ multi-threaded concurrency technology to retrieve knowledge of various structures in parallel, reducing latency. When ranking the retrieved knowledge, heterogeneous candidate knowledge can be merged before unified ranking, thus reducing the impact of knowledge structure on the ranking process. This facilitates the discovery of connections between knowledge of different structures, promotes knowledge fusion, and ultimately improves the accuracy of the responses output by the large language model. Compared to schemes where the large language model perceives different knowledge structures and selects knowledge based on these structures, this scheme shields the large language model from detailed knowledge classifications, allowing it to perceive as much complete relevant knowledge as possible. This reduces the risk of subsequent answer generation errors due to misclassification by the large language model.

[0078] like Figure 4 As shown, the response reasoned by the large language model can enter the parsing stage. In the parsing stage, corresponding parsing tools can be called to determine the quality of the response. If the quality of the response meets the quality criteria, the server can reply to the user's question based on that response. For example... Figure 4As shown, the server can send configuration data related to the response result, as well as external resources (such as links, images, and multimedia content) referenced in rendering the response page, to the terminal device so that the terminal device can reply to the user's question. Typically, the response result can contain data with different structures. The configuration data sent by the server is used to configure the parsing tool corresponding to the response result, so that the terminal device can call different parsing tools to parse the data with different structures in the response result, in order to accurately render the response result output by the large language model. For example... Figure 4 As shown, if the quality of the response does not meet the quality criteria, a multi-step reasoning process can be executed to improve the quality of the response. In this process, the user question can be rewritten, and the knowledge retrieval operation can be re-executed based on the rewritten question. After recalling new knowledge, the large language model is invoked again to answer the user question. Further details are omitted here.

[0079] In addition to the foregoing embodiments, this application also provides a dialogue processing method, which can be executed by a terminal device. The terminal device can be a smartphone, desktop computer, laptop computer, tablet computer, smart wearable device, etc., running on the user side. The terminal device runs an intelligent chatbot, which is an application capable of interacting with the user and communicating with a server to access intelligent question-and-answer services on the server.

[0080] like Figure 5 As shown, when this dialogue processing method is executed on the terminal device side, it may include, for example: Figure 5 The steps shown are as follows:

[0081] Step 501: Respond to the user's query and obtain the target query message.

[0082] Step 502: Send the target query message to the server so that the server can use multiple knowledge retrieval components corresponding to different knowledge structures to perform knowledge pre-recall based on the target query message, obtain multiple candidate heterogeneous knowledge data, filter out target knowledge data that matches the target query message from the multiple candidate heterogeneous knowledge data, and generate the response result corresponding to the target query message by calling a large language model once based on the target query message and the target knowledge data.

[0083] Step 503: Receive the response result returned by the server and output the response result.

[0084] In this embodiment, the terminal device can be a user-side mobile phone, tablet computer, computer, smart wearable device, etc. The terminal device can run a client program or browser for accessing the intelligent chatbot, allowing the user to converse with the intelligent chatbot on the server. During the conversation, the user can send targeted query messages to the intelligent chatbot through the terminal device. These targeted query messages can be user questions, query commands, etc. For example, in an e-commerce scenario, the intelligent chatbot can function as a smart customer service representative for merchants, where the terminal device can acquire pre-sales and after-sales questions from consumers and answer them through the smart customer service. As another example, in an education and training scenario, the intelligent chatbot can function as a course manager, where the terminal device can acquire students' course query messages, exam schedule query messages, etc., and respond to user queries through the course manager.

[0085] The server can utilize multiple knowledge retrieval components corresponding to different knowledge structures and a large language model to respond to the user's target query message, as described in the foregoing embodiments, and will not be repeated here. The terminal device can obtain the response result for the target query message from the server and output the response result. Optionally, the terminal device can display the text corresponding to the response result to the user, or convert the text corresponding to the response result into a voice message and play the voice message; this embodiment does not impose any limitations.

[0086] In some optional embodiments, the terminal device may provide the user with a correction operation of the response result, which is used to generate contextual learning data to guide a large language model to perform a dialogue generation task that is the same as or similar to the target query message. Exemplary examples will be provided below.

[0087] Optionally, the terminal device can respond to a correction operation on the response result and display a correction configuration interface corresponding to the response result. Optionally, when displaying the response result, the terminal device can display a correction control. The terminal device can determine that a correction operation corresponding to the response result has been detected when it detects a user's triggering operation on the correction control. The correction configuration interface includes multiple correction configuration items, which are used to configure inference examples for specific knowledge data, so that the large language model can enhance its processing capabilities for that specific knowledge data based on the inference examples. Optionally, the specific knowledge data can be any type of knowledge data retrieved by the server based on the target query message. In some optional embodiments, the specific knowledge data can be knowledge data of a certain structure that is difficult for the large language model to process, such as a flowchart, among the knowledge data retrieved based on the target query message; this embodiment is not limited to this.

[0088] The terminal device can obtain reasoning examples for specific knowledge data based on the user's configuration operations for multiple correction configuration items, and send these reasoning examples as contextual learning data for that specific knowledge data to the server. This allows the server to guide the large language model's reasoning process for that specific knowledge data based on the contextual learning data. Furthermore, when the server retrieves knowledge data that is the same as or similar to that specific knowledge data again, it can provide the contextual learning data for that specific knowledge data to the large language model to improve the large language model's processing capabilities for the retrieved knowledge data.

[0089] Optionally, the specific knowledge data may be a flowchart, and the correction configuration interface may be an interface for configuring the reasoning illustration of the flowchart. Multiple correction configuration items on the correction configuration interface may include: flowchart configuration items and at least one reasoning process configuration item.

[0090] Accordingly, when the terminal device obtains reasoning examples of specific knowledge data based on the user's configuration operations on the multiple correction configuration items, it can obtain the target flowchart adapted to the target query message as the knowledge data of the specified structure based on the user's configuration operations on the flowchart configuration item, and obtain reasoning examples of the flowchart based on the user's configuration operations on at least one reasoning process configuration item.

[0091] When displaying flowchart configuration items, the terminal device can provide a flowchart list through a drop-down menu. This flowchart list can display all flowcharts retrieved based on the target query message. The target flowchart can be determined based on the user's selection of flowcharts in the flowchart list. This target flowchart is a flowchart that is selected based on the user's experience and is adapted to the target query message.

[0092] Optionally, such as Figure 6a As shown, the at least one reasoning process configuration item includes at least one of the following: process branch configuration item, jump node configuration item, model thinking configuration item, and model action configuration item. The terminal device can, based on the user's configuration operation of the process branch configuration item, obtain the process branch matched by the target query message in the target flowchart; can, based on the user's configuration operation of the jump node configuration item, obtain the jump node corresponding to the target query message in the target flowchart; can, based on the user's configuration operation of the model thinking configuration item, obtain a model thinking example that answers the target query message according to the target flowchart; and can, based on the user's configuration operation of the model action configuration item, obtain an action example when answering the target query message according to the target flowchart. This action example may include: an Application Programming Interface (API) call example or a response example.

[0093] like Figure 6aAs shown, after determining the target flowchart, the terminal device can obtain the flowchart branch matching the target query message through the flowchart branch configuration item, and obtain the jump node matching the target query message through the jump node configuration item. Furthermore, it can obtain the reasoning logic of the large language model provided by the user through the model thinking configuration item, in order to provide reasoning prompts for the large language model. For example... Figure 6a As shown, when a large language model needs to call an API to perform inference tasks, the terminal device can obtain the API name, API parameters, etc. through the configuration operation of the model action configuration item, which will not be elaborated further.

[0094] Figure 6a The configured contextual learning data can be used to correct the reasoning process of the target query message, forming reasoning examples to guide large language models. For example... Figure 6b As shown, taking a user question as an example, after retrieving target knowledge data based on the user question, the user question and the reasoning process using the target knowledge data can be displayed through the correction configuration interface. Based on the user's configuration operations on the correction configuration interface, contextual learning data corresponding to the target knowledge data can be obtained, and the reasoning process for inferring the answer to the user question based on the target knowledge data can be corrected based on the contextual learning data. After obtaining the corrected reasoning process, the target knowledge data can be used to perform reasoning operations on the user question, and the reasoning result can be returned to the user. If the reasoning result has a deviation, the user question and the reasoning process of the target knowledge data can be displayed again through the correction configuration interface, allowing the user to correct the reasoning process of the target knowledge data once more. Figure 6b As shown, the above correction operation can be repeated until the inference result meets the quality requirements.

[0095] Based on this implementation method, by configuring the reasoning process of the flowchart, a reasoning example is generated to guide the large language model to generate output results based on the input data, thereby facilitating the improvement of the large language model's adaptability to tasks without fine-tuning the large language model.

[0096] In addition to the foregoing embodiments, this application also provides a dialogue processing method for correcting responses to target query messages based on human interaction. The following will be described exemplarily with reference to the accompanying drawings.

[0097] Figure 7 This is a flowchart illustrating a dialogue processing method provided in another exemplary embodiment of this application, such as... Figure 4 As shown, the method includes:

[0098] Step 701: The response to the large language model's output of the answer result based on the target query message is corrected by displaying the correction configuration interface corresponding to the answer result. The correction configuration interface includes multiple correction configuration items.

[0099] Step 702: Based on the user's configuration operations for the multiple correction configuration items, obtain a reasoning example of specific knowledge data, wherein the specific knowledge data is retrieved based on the target message.

[0100] Step 703: Send the reasoning example of the specific knowledge data as the contextual learning data of the specific knowledge data to the server, so that the server can guide the reasoning process of the large language model on the specific knowledge data based on the contextual learning data.

[0101] This embodiment can be executed by a terminal device. For details, please refer to the description in the foregoing embodiment. It will not be described again here.

[0102] In addition to the dialogue processing methods described in the foregoing embodiments, this application also provides a dialogue processing system, which may include a terminal device and a server. The terminal device is configured to: respond to a user's query and obtain a target query message; send a query request to the server based on the target query message; receive a response result returned by the server and output the response result to the user. The server is configured to: respond to the query request and obtain the target query message; perform knowledge retrieval based on the target query message using multiple knowledge retrieval components corresponding to different knowledge structures to obtain multiple candidate heterogeneous knowledge data; filter out target knowledge data that matches the target query message from the multiple candidate heterogeneous knowledge data; and generate a response result corresponding to the target query message by calling a large language model based on the target query message and the target knowledge data. For details, please refer to the descriptions in the foregoing embodiments; they will not be repeated here.

[0103] It should be noted that the execution subject of each step of the method provided in the above embodiments can be the same device, or the method can be executed by different devices. For example, the execution subject of steps 201 to 204 can be device A; or the execution subject of steps 201 and 202 can be device A, and the execution subject of step 203 can be device B; and so on.

[0104] Furthermore, in some of the processes described in the above embodiments and accompanying drawings, multiple operations appear in a specific order. However, it should be clearly understood that these operations may not be executed in the order they appear herein, or they may be executed in parallel. The operation numbers, such as 201, 202, etc., are merely used to distinguish different operations and do not represent any execution order. Additionally, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel. It should be noted that the descriptions such as "first" and "second" in this document are used to distinguish different messages, devices, modules, etc., and do not represent a sequential order, nor do they limit "first" and "second" to different types.

[0105] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.

[0106] Figure 8 This application illustrates a schematic diagram of the structure of an electronic device provided in an exemplary embodiment, as shown below. Figure 8 As shown, the electronic device includes: a memory 801, a processor 802, and a communication component 803.

[0107] Memory 801 is used to store computer programs and can be configured to store various other data to support operation on the electronic device. Examples of this data include instructions for any application or method used to operate on the electronic device.

[0108] In some embodiments, Figure 8 The illustrated electronic device can be implemented as a server, which can be used to execute the following dialogue processing method, wherein a processor 802, coupled to a memory 801, is used to execute a computer program in the memory 801 for: responding to an inquiry request and obtaining a target inquiry message; using multiple knowledge retrieval components corresponding to different knowledge structures to perform knowledge pre-recall based on the target inquiry message, obtaining multiple candidate heterogeneous knowledge data; filtering target knowledge data that matches the target inquiry message from the multiple candidate heterogeneous knowledge data; and generating a response result corresponding to the target inquiry message by calling a large language model once, based on the target inquiry message and the target knowledge data.

[0109] Optionally, when the processor 802 uses multiple knowledge retrieval components corresponding to different knowledge structures to perform knowledge pre-recall based on the target query message and obtain the candidate multiple heterogeneous knowledge data, it is specifically used to: use multiple knowledge retrieval components corresponding to different knowledge structures to perform knowledge retrieval in parallel based on the target query message on the knowledge base corresponding to each of the multiple knowledge retrieval components, so as to pre-recall the candidate multiple heterogeneous knowledge data.

[0110] Optionally, when the processor 802 uses multiple knowledge retrieval components corresponding to different knowledge structures to perform knowledge retrieval in parallel according to the target query message on the knowledge bases corresponding to each of the multiple knowledge retrieval components, it specifically performs at least two of the following operations in parallel: using the text retrieval component to perform text knowledge retrieval according to the target query message to obtain candidate text knowledge data; using the data table retrieval component to perform data table knowledge retrieval according to the target query message to obtain candidate data table knowledge data; and using the chart retrieval component to perform chart retrieval according to the target query message to obtain candidate chart knowledge data.

[0111] Optionally, when the processor 802 uses multiple knowledge retrieval components corresponding to different knowledge structures to perform knowledge pre-recall based on the target query message, it specifically performs the following: queries the historical question-and-answer set to determine whether there is a target question-and-answer pair matching the target query message in the historical question-and-answer set; if there is no target question-and-answer pair matching the target query message in the historical question-and-answer set, it uses multiple knowledge retrieval components corresponding to different knowledge structures to perform knowledge retrieval based on the target query message to pre-recall the multiple heterogeneous knowledge data. Optionally, if there is a target question-and-answer pair matching the target query message in the historical question-and-answer set, the processor 802 can directly return the response result corresponding to the target query message based on the target question-and-answer pair.

[0112] Optionally, when the processor 802 filters out target knowledge data that matches the target query message from the candidate heterogeneous knowledge data, it specifically performs the following steps: obtaining knowledge tags for each of the candidate heterogeneous knowledge based on the association information between the candidate heterogeneous knowledge and the target query message in at least one dimension; and determining the target knowledge data that matches the target query message from the candidate heterogeneous knowledge based on the knowledge tags for each of the candidate heterogeneous knowledge.

[0113] Optionally, when the processor 802 generates a response corresponding to the target query message by calling a large language model once based on the target query message and the target knowledge data, it specifically performs the following steps: retrieving a contextual learning dataset based on the target heterogeneous knowledge data to obtain target contextual learning data adapted to the target knowledge data; the contextual learning dataset is obtained based on reasoning examples configured by the user for specific knowledge data; generating prompt words based on the target query message, the target contextual learning data, and the target knowledge data; and calling the large language model once based on the prompt words to generate a response corresponding to the target query message.

[0114] Optionally, after the processor 802 generates the response result corresponding to the target query message by calling the large language model, it is further configured to: call a parsing tool to parse the response result and obtain a parsing result; if the parsing result indicates that the response result does not meet the set quality conditions, then re-execute the operation of using the multiple knowledge retrieval components to perform knowledge pre-recall based on the target query message, the operation of filtering multiple heterogeneous knowledge candidates obtained from the pre-recall, and the operation of calling the large language model once based on the filtered target knowledge data that matches the target query message and the target query message.

[0115] In other embodiments, Figure 8 The illustrated electronic device can be implemented as a terminal device, which can be used to execute the following dialogue processing method, wherein a processor 802, coupled to a memory 801, is used to execute a computer program in the memory 801 for: responding to a user's query operation and obtaining a target query message; sending a query request to a server based on the target query message, so that the server obtains a response result corresponding to the target query message using the method provided in the embodiments of this application; receiving the response result returned by the server and outputting the response result to the user.

[0116] Optionally, after outputting the response result, the processor 802 is further configured to: respond to a correction operation on the response result, display a correction configuration interface corresponding to the response result, the correction configuration interface including multiple correction configuration items; obtain a reasoning example of specific knowledge data based on the user's configuration operation on the multiple correction configuration items, the specific knowledge data being retrieved based on the target message; and send the reasoning example of the specific knowledge data as contextual learning data of the specific knowledge data to the server, so that the server guides the large language model's reasoning process for the specific knowledge data based on the contextual learning data.

[0117] Optionally, the plurality of correction configuration items include: a flowchart configuration item and at least one reasoning process configuration item, wherein the at least one reasoning process configuration item includes at least one of: a process branch configuration item, a jump node configuration item, a model thinking configuration item, and a model action configuration item; when the processor 802 obtains a reasoning example of specific knowledge data based on the user's configuration operation on the plurality of correction configuration items, it is specifically used to: obtain a target flowchart adapted to the target query message as the specific knowledge data based on the user's configuration operation on the flowchart configuration item; and obtain a reasoning example of the flowchart based on the user's configuration operation on the at least one reasoning process configuration item.

[0118] In yet other embodiments, Figure 8 When the illustrated electronic device is implemented as a terminal device, the terminal device can be used to execute the following dialogue processing method, wherein the processor 802, coupled to the memory 801, is used to execute the computer program in the memory 801 for: responding to a correction operation on the response result output by the large language model based on the target query message; displaying a correction configuration interface corresponding to the response result, the correction configuration interface including multiple correction configuration items; obtaining a reasoning example of specific knowledge data based on the user's configuration operation of the multiple correction configuration items, the specific knowledge data being retrieved based on the target message; and sending the reasoning example of the specific knowledge data as contextual learning data of the specific knowledge data to the server, so that the server guides the large language model's reasoning process for the specific knowledge data based on the contextual learning data.

[0119] Furthermore, such as Figure 8 As shown, the electronic device also includes other components such as a power supply component 804, a display component 805, and an audio component 806. Figure 8 The diagram only shows some components and does not mean that the electronic device includes only these components. Figure 8 The components shown. Figure 8 In this embodiment, the components within the dashed boxes are optional, not mandatory, and their specific requirements depend on the product form of the electronic device. The electronic device in this embodiment can be a terminal device such as a desktop computer, laptop computer, smartphone, or IoT device, or a server-side device such as a conventional server, cloud server, or server array. If the electronic device in this embodiment is a terminal device such as a desktop computer, laptop computer, or smartphone, it may include... Figure 8 The components within the dashed box; if the electronic device in this embodiment is implemented as a conventional server, cloud server, or server array, etc., it may be omitted. Figure 8 The component within the dashed box.

[0120] The memory 801 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random-access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0121] The communication component 803 is configured to facilitate wired or wireless communication between the device containing the communication component and other devices. The device containing the communication component can access wireless networks based on communication standards, such as Wi-Fi, 2G (e.g., Global System for Mobile Communications (GSM)), 3G (e.g., Wideband Code Division Multiple Access (WCDMA), 4G (e.g., Long Term Evolution (LTE)), 4G+ (e.g., LTE-Advanced (LTE-A)), or 5G (5th Generation Mobile Communication Technology), or combinations thereof. In one exemplary embodiment, the communication component receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication component may be implemented based on Near Field Communication (NFC), Radio Frequency Identification (RFID), Infrared Data Association (IrDA), Ultra Wide Band (UWB), Bluetooth (BT), and other technologies.

[0122] The power supply component 804 is used to provide power to various components of the device in which the power supply component is located. The power supply component may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device in which the power supply component is located.

[0123] The display component includes a screen, which may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touchscreen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation.

[0124] An audio component may be configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC) configured to receive external audio signals when the device containing the audio component is in an operating mode, such as call mode, recording mode, or voice recognition mode. The received audio signals may be further stored in memory or transmitted via a communication component. In some embodiments, the audio component also includes a speaker for outputting audio signals.

[0125] In this embodiment, before calling the large language model to answer the target query message, multiple knowledge retrieval components corresponding to different knowledge structures can be used to perform pre-recall and unified screening of heterogeneous knowledge. This ensures that the knowledge data provided to the large language model is reliable data recalled from heterogeneous knowledge data, eliminating the need for the large language model to perform knowledge data structure classification operations. On the one hand, this reduces the risk of inaccurate answers due to incorrect knowledge structure classification by the large language model, thus improving the accuracy of the responses output by the large language model. On the other hand, performing knowledge pre-recall operations before calling the large language model eliminates the need for layered, multiple calls to the large language model, improving dialogue response efficiency and reducing the calling cost and end-to-end response latency of the large language model.

[0126] Accordingly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed, can implement the steps that can be performed by an electronic device in the above method embodiments.

[0127] This application also provides a computer program product, including: a computer program / instructions, which, when executed by a processor, can implement the steps in the method provided in this application.

[0128] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM (Compact Disc Read-Only Memory), optical storage, etc.) containing computer-usable program code.

[0129] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0130] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0131] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0132] In a typical configuration, a computing device includes one or more processors (Central Processing Unit, CPU), input / output interfaces, network interfaces, and memory.

[0133] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0134] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, Digital Video Disc (DVD) or other optical storage, magnetic tape, disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0135] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, product, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, product, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, product, or apparatus that includes said element.

[0136] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A dialogue processing method applied to a single intelligent agent, characterized in that, include: Respond to the query request and obtain the target query message; By utilizing multiple knowledge retrieval components corresponding to different knowledge structures, knowledge pre-recall is performed based on the target query message to obtain multiple candidate heterogeneous knowledge data. From the multiple candidate heterogeneous knowledge data, target knowledge data that matches the target query message is selected; Based on the target query message and the target knowledge data, a response result corresponding to the target query message is generated by calling a large language model once.

2. The method according to claim 1, characterized in that, By utilizing multiple knowledge retrieval components corresponding to different knowledge structures, knowledge pre-recall is performed based on the target query message to obtain multiple candidate heterogeneous knowledge data, including: By utilizing multiple knowledge retrieval components corresponding to different knowledge structures, knowledge retrieval is performed in parallel on the knowledge bases corresponding to each of the multiple knowledge retrieval components based on the target query message, in order to pre-recall multiple candidate heterogeneous knowledge data.

3. The method according to claim 2, characterized in that, Using multiple knowledge retrieval components corresponding to different knowledge structures, knowledge retrieval is performed in parallel on the knowledge bases corresponding to each of the multiple knowledge retrieval components based on the target query message, including performing at least two of the following operations in parallel: Using a text retrieval component, text knowledge retrieval is performed based on the target query message to obtain candidate text knowledge data; Using the data table retrieval component, data table knowledge is retrieved based on the target query message to obtain candidate data table knowledge data. Using the chart retrieval component, chart retrieval is performed based on the target query message to obtain candidate chart knowledge data.

4. The method according to claim 1, characterized in that, Utilizing multiple knowledge retrieval components corresponding to different knowledge structures, knowledge pre-recall is performed based on the target query message, including: The historical question and answer set is queried to determine whether there is a target question and answer pair in the historical question and answer set that matches the target query message; If there is no target question-answer pair matching the target query message in the historical question-answer set, then multiple knowledge retrieval components corresponding to different knowledge structures are used to perform knowledge retrieval based on the target query message in order to pre-recall the multiple heterogeneous knowledge data.

5. The method according to claim 1, characterized in that, From the candidate heterogeneous knowledge data, target knowledge data that matches the target query message is selected, including: Based on the association information between the candidate heterogeneous knowledge and the target query message in at least one dimension, obtain the knowledge tags of each of the candidate heterogeneous knowledge. Based on the knowledge tags of the candidate heterogeneous knowledge, the target knowledge data that matches the target query message is determined from the candidate heterogeneous knowledge.

6. The method according to claim 1, characterized in that, Based on the target query message and the target knowledge data, a response result corresponding to the target query message is generated by calling a large language model once, including: Based on the target heterogeneous knowledge data, the context learning dataset is retrieved to obtain target context learning data that is adapted to the target knowledge data; the context learning dataset is obtained based on the reasoning examples configured by the user for specific knowledge data; Based on the target query message, the target context learning data, and the target knowledge data, generate prompt words; Based on the prompt words, the large language model is invoked once to generate a response to the target query message.

7. The method according to any one of claims 1-6, characterized in that, After generating the response to the target query message by calling the large language model once, the process also includes: The parsing tool is invoked to parse the response result, and the parsing result is obtained; If the parsing result indicates that the response does not meet the set quality conditions, then the operation of using the multiple knowledge retrieval components to perform knowledge pre-recall based on the target query message, the operation of filtering multiple heterogeneous knowledge candidates for pre-recall, and the operation of calling the large language model once based on the target knowledge data adapted to the target query message and the target query message are re-executed.

8. A dialogue processing method, characterized in that, include: Respond to user queries and retrieve the target query message; Based on the target query message, a query request is sent to the server so that the server can obtain the response result corresponding to the target query message using the method described in any one of claims 1-7; Receive the response result returned by the server and output the response result to the user.

9. The method according to claim 8, characterized in that, After outputting the response result, the following is also included: In response to the correction operation of the response result, the correction configuration interface corresponding to the response result is displayed, and the correction configuration interface includes multiple correction configuration items; Based on the user's configuration operations on the multiple correction configuration items, a reasoning example of specific knowledge data is obtained, wherein the specific knowledge data is retrieved based on the target message; The reasoning examples of the specific knowledge data are sent to the server as contextual learning data for the specific knowledge data, so that the server can guide the reasoning process of the large language model on the specific knowledge data based on the contextual learning data.

10. The method according to claim 9, characterized in that, The plurality of correction configuration items include: flowchart configuration items and at least one reasoning process configuration item, wherein the at least one reasoning process configuration item includes at least one of the following: process branch configuration item, jump node configuration item, model thinking configuration item, and model action configuration item; Based on the user's configuration operations on the multiple correction configuration items, inference examples for obtaining specific knowledge data are obtained, including: Based on the user's configuration operation of the flowchart configuration items, obtain the target flowchart adapted to the target query message, as the specific knowledge data; Based on the user's configuration operations for the at least one reasoning process configuration item, a reasoning example of the flowchart is obtained.

11. A dialogue processing method, characterized in that, include: The system responds to the error correction operation of the response result output by the large language model based on the target query message, and displays the error correction configuration interface corresponding to the response result. The error correction configuration interface includes multiple error correction configuration items. Based on the user's configuration operations on the multiple correction configuration items, a reasoning example of specific knowledge data is obtained, wherein the specific knowledge data is retrieved based on the target message; The reasoning examples of the specific knowledge data are sent to the server as contextual learning data for the specific knowledge data, so that the server can guide the reasoning process of the large language model on the specific knowledge data based on the contextual learning data.

12. A dialogue processing system, characterized in that, include: Terminal devices and servers; The terminal device is configured to: respond to a user's query operation and obtain a target query message; send a query request to the server based on the target query message; receive a response result returned by the server and output the response result to the user; The server is configured to: respond to query requests and obtain target query messages; utilize multiple knowledge retrieval components corresponding to different knowledge structures to perform knowledge pre-recall based on the target query messages to obtain multiple candidate heterogeneous knowledge data; filter target knowledge data that matches the target query messages from the multiple candidate heterogeneous knowledge data; and generate a response result corresponding to the target query messages by calling a large language model once, based on the target query messages and the target knowledge data.

13. An electronic device, characterized in that, include: Memory and processor; The memory is used to store one or more computer instructions; The processor is configured to execute one or more computer instructions for performing the steps of the method according to any one of claims 1-7 or any one of claims 8-11.

14. A computer-readable storage medium storing a computer program, characterized in that, When a computer program is executed by a processor, it is able to perform the steps of the method described in any one of claims 1-11.

15. A computer program product, characterized in that, include: A computer program / instruction that, when executed by a processor, enables the implementation of the steps in the method described in any one of claims 1-11.