Multi-turn dialogue method, device and equipment, and computer program product

By using a scenario-driven multi-turn dialogue approach, the system dynamically matches multi-turn dialogue strategies and context acquisition strategies in banking business scenarios, solving the efficiency and accuracy issues of multi-turn dialogue processing in banking business scenarios and improving user experience and system performance.

CN122114158APending Publication Date: 2026-05-29中国邮政储蓄银行股份有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
中国邮政储蓄银行股份有限公司
Filing Date
2026-02-04
Publication Date
2026-05-29

Smart Images

  • Figure CN122114158A_ABST
    Figure CN122114158A_ABST
Patent Text Reader

Abstract

The application discloses a multi-round dialogue method, device and equipment, and a computer program product. The method comprises the following steps: obtaining user input information and performing scene recognition to obtain a scene recognition result; matching a corresponding target multi-round dialogue strategy and a target context acquisition strategy according to the scene recognition result; acquiring context information from the historical record of the current dialogue according to the target context strategy; and responding to the user input information and the context information by using the target multi-round dialogue strategy and a preset dialogue model to output a response result. Through the "scene-driven strategy" mechanism, the application realizes fine and dynamic management of the multi-round dialogue, ensures high consistency of the dialogue process and the business logic, avoids the insufficient adaptability of the traditional single strategy to complex scenes, reduces noise interference, improves the accuracy of intent understanding and slot filling, avoids unnecessary search and calculation in the full historical record, and improves the efficiency of the dialogue question and answer.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of multi-turn dialogue technology, and in particular to a multi-turn dialogue method, apparatus and equipment, and computer program product. Background Technology

[0002] With the rapid development of information technology, bank customer service systems are undergoing a profound transformation from traditional human agents to intelligent customer service. Intelligent customer service, with its advantages of efficiency, convenience, and 24 / 7 service, is gradually becoming an important channel for communication between banks and customers. In banking scenarios, customer-customer interactions are often not simple single-round question-and-answer sessions, but rather multi-round dialogues involving multiple business stages and complex semantic interactions. For example, a customer might simultaneously inquire about multiple business scenarios in a single conversation, such as account inquiries, investment returns, loan progress, and credit card statements; or, for the same business scenario, such as a loan application, they might supplement relevant information multiple times at different stages. This requires intelligent customer service systems to possess powerful multi-round dialogue processing capabilities, accurately understand customer intent, maintain semantic context coherence, and thus provide accurate and efficient service to customers.

[0003] Traditional natural language processing (NLP) models are mostly designed for single-turn dialogues, with their core function limited to responding to a single question. When faced with multi-turn conversations, these models fail to effectively maintain semantic context and struggle to accurately understand the true intent expressed by customers in different turns of the dialogue. For example, when a customer mentions different business scenarios in several consecutive turns, traditional models may treat each scenario in isolation, failing to organically integrate this information, leading to misunderstandings of customer needs and consequently impacting service quality. This limitation makes traditional NLP models ill-suited to the practical needs of multi-turn dialogues in complex banking business scenarios.

[0004] The banking business is highly complex and diverse, with different scenarios having varying requirements for multi-turn dialogue processing and context management. Currently, most banks employ a single multi-turn dialogue strategy, such as feeding all context into a large model or using guided context assembly, without differentiating between different scenarios. This uniform approach produces significantly different results across various scenarios. Using a uniform method for multi-turn dialogue recognition without differentiation inevitably leads to poor recognition performance, reduced efficiency, and a subpar user experience. Furthermore, a single context strategy cannot meet the diverse needs of banks across multiple scenarios, easily creating system performance bottlenecks, affecting system stability and response speed, and ultimately degrading user experience, hindering the promotion and application of intelligent customer service systems in banks.

[0005] In summary, existing multi-turn dialogue processing technologies and strategies have many limitations in bank customer service systems, failing to meet the demands for efficient, accurate, and flexible multi-turn dialogue processing in complex banking scenarios. Therefore, developing a multi-turn dialogue processing method that can adapt to various banking scenarios and achieve high efficiency and accuracy has significant practical implications and broad application prospects. Summary of the Invention

[0006] This application provides a multi-turn dialogue method, apparatus, device, and computer program product to improve the accuracy and efficiency of multi-turn dialogues in business scenarios such as banking.

[0007] The embodiments of this application adopt the following technical solutions:

[0008] In a first aspect, embodiments of this application provide a multi-turn dialogue method, the multi-turn dialogue method comprising:

[0009] Obtain user input information;

[0010] The user input information is subjected to scene recognition to obtain scene recognition results;

[0011] Based on the scene recognition results, match the corresponding target multi-turn dialogue strategy and target context acquisition strategy;

[0012] According to the target context strategy, obtain context information from the history of the current conversation;

[0013] Based on the user input information and the context information, the system responds using the target multi-turn dialogue strategy and the preset dialogue model, and outputs the response result.

[0014] Optionally, the step of matching the corresponding target multi-turn dialogue strategy and target context acquisition strategy based on the scene recognition result includes:

[0015] Based on the scene recognition results, a matching is performed in the predefined mapping relationship between scenes and multi-turn dialogue strategies to obtain the corresponding target multi-turn dialogue strategy;

[0016] The multi-turn dialogue strategy includes at least one of the following: full input model, RAG library matching, and guided mode.

[0017] Optionally, the step of matching the corresponding target multi-turn dialogue strategy and target context acquisition strategy based on the scene recognition result includes:

[0018] Based on the scene recognition results, a matching is performed in the predefined mapping relationship between scenes and context acquisition strategies to obtain the corresponding target context acquisition strategy;

[0019] The context acquisition strategy includes at least one of the following: full context strategy, local window strategy, intent-related strategy, and entity core strategy.

[0020] Optionally, the step of matching the scene recognition result in a predefined mapping relationship between scenes and multi-turn dialogue strategies to obtain the corresponding target multi-turn dialogue strategy includes:

[0021] If the scene recognition result is chat-like, then the matched target multi-turn dialogue strategy is the strategy of the full input model;

[0022] If the scene recognition result is a security-sensitive class, then the matched target multi-turn dialogue strategy is the strategy matched by the RAG library;

[0023] If the scene recognition result is a complex business type, then the matched target multi-turn dialogue strategy is the guided mode strategy.

[0024] Optionally, the step of matching the scene recognition result in a predefined mapping relationship between scenes and context acquisition strategies to obtain the corresponding target context acquisition strategy includes:

[0025] If the scene recognition result is chat-related, then the matching target context acquisition strategy is the full context strategy;

[0026] If the scene identification result is a security-sensitive class, then the matching target context acquisition strategy is the local window strategy;

[0027] If the scene recognition result is a simple query, then the matching target context acquisition strategy is a local window strategy or an intent-related strategy.

[0028] If the scene recognition result is a complex business class, then the matching target context acquisition strategy is an intent-related strategy or an entity core strategy.

[0029] Optionally, obtaining context information from the history of the current conversation according to the target context strategy includes:

[0030] If the target context policy is a full context policy, then the entire history of the current conversation is obtained as the context information;

[0031] If the target context strategy is a local window strategy, then the most recent N rounds of history before the current round of dialogue statements are obtained from the history of the current dialogue as the context information, where N is an integer not less than 1;

[0032] If the target context policy is an intent-related policy, then the intent of the current dialogue statement is identified, and historical records that match the intent of the current dialogue statement are obtained from the history of the current dialogue as the context information.

[0033] If the target context policy is an entity core policy, then the core entity of the current dialogue statement is identified, and the historical records that match the core entity of the current dialogue statement are obtained from the history of the current dialogue as the context information.

[0034] Optionally, the step of responding based on the user input information and the context information, using the target multi-turn dialogue strategy and a preset dialogue model, and outputting the response result includes:

[0035] If the target multi-turn dialogue strategy is a full-input model strategy, then the user input information and the context information are assembled and input into the preset dialogue model to respond, and the response result is obtained.

[0036] If the target multi-turn dialogue strategy is a RAG library matching strategy, then the RAG library is matched according to the most recent N-turn history records before the current dialogue statement to obtain the RAG library matching information, and the user input information and the RAG library matching information are assembled and input into the preset dialogue model for response to obtain the response result.

[0037] If the target multi-turn dialogue strategy is a guided mode strategy, then necessary information is obtained from the context information, and guided question answering is performed using the preset dialogue model based on the user input information and the necessary information to obtain the response result.

[0038] Secondly, embodiments of this application also provide a multi-turn dialogue device, the multi-turn dialogue device comprising:

[0039] The acquisition unit is used to acquire user input information;

[0040] A scene recognition unit is used to perform scene recognition on the user input information and obtain scene recognition results;

[0041] The strategy matching unit is used to match the corresponding target multi-turn dialogue strategy and target context acquisition strategy based on the scene recognition result;

[0042] The context acquisition unit is used to acquire context information from the history of the current dialogue according to the target context strategy;

[0043] The response unit is used to respond based on the user input information and the context information, using the target multi-turn dialogue strategy and the preset dialogue model, and output the response result.

[0044] Thirdly, embodiments of this application also provide an apparatus, comprising:

[0045] A processor; and a memory arranged to store computer-executable instructions, which, when executed, cause the processor to perform any of the aforementioned multi-turn dialogue methods.

[0046] Fourthly, embodiments of this application also provide a computer program product, including a computer program / instructions, which, when executed by a processor, implement any of the aforementioned multi-turn dialogue methods.

[0047] The above-mentioned technical solutions adopted in the embodiments of this application can achieve the following beneficial effects: The multi-turn dialogue method of the embodiments of this application first obtains user input information; then performs scene recognition on the user input information to obtain scene recognition results; then matches the corresponding target multi-turn dialogue strategy and target context acquisition strategy according to the scene recognition results; then, according to the target context strategy, obtains context information from the current dialogue history; finally, according to the user input information and context information, responds using the target multi-turn dialogue strategy and preset dialogue model, and outputs the response results. The embodiments of this application realize refined and dynamic management of multi-turn dialogue through the "scene-driven strategy" mechanism. The strategy matching based on scene recognition ensures a high degree of fit between the dialogue process and business logic, avoiding the insufficient adaptability of traditional single strategies to complex scenarios; by selecting the optimal multi-turn dialogue strategy and context acquisition strategy for different scenarios, it ensures that the information input to the dialogue model is the most relevant and critical, reduces noise interference, significantly improves the accuracy of intent understanding and slot filling, and avoids unnecessary searches and calculations in the full history, thus improving the efficiency of dialogue question answering. Attached Figure Description

[0048] 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:

[0049] Figure 1 This is a flowchart illustrating a multi-turn dialogue method in an embodiment of this application;

[0050] Figure 2 This is a schematic diagram of the structure of a multi-turn dialogue device according to an embodiment of this application;

[0051] Figure 3 This is a schematic diagram of the structure of a device according to an embodiment of this application. Detailed Implementation

[0052] 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.

[0053] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.

[0054] Problems with existing multi-turn dialogue strategies:

[0055] (a) Shortcomings of general multi-turn dialogue strategies

[0056] Currently, most multi-turn dialogue strategies used in banking systems employ a single mode. While this can achieve multi-turn dialogue functionality in some scenarios, it has significant shortcomings when handling different types of scenarios. Because different business scenarios have unique semantic structures and logical relationships, a single multi-turn dialogue strategy struggles to accurately extract context, resulting in poor understanding of customer intent and low efficiency in interpreting meaning. For example, when handling inquiries involving multiple financial products, a single strategy may fail to accurately distinguish the connections and differences between different products, leading to inaccurate responses that fail to meet the customer's actual needs.

[0057] (ii) Disadvantages of context processing strategies

[0058] Fixed-window method: This method uses the most recent N rounds of dialogue as context for processing. While it has the advantage of relatively fixed computational cost, it has serious drawbacks in practical applications. Because it can only focus on dialogue content within a recent period, it cannot trace back to earlier historical information, potentially leading to the loss of crucial information. For example, if a customer inquires about financial services (rounds 1-3) and then suddenly asks about previous transfers (round 10), the fixed-window method, unable to access transfer information from round 10, will be unable to accurately answer the customer's question, negatively impacting the customer experience.

[0059] Full-history approach: This approach treats the entire conversation history as context. While it ensures information integrity, it introduces several problems. First, as the number of dialogue rounds increases, the amount of historical data grows exponentially, leading to a sharp increase in computational load and significantly higher response latency, severely impacting the system's real-time performance and interactivity. Second, the vast amount of historical information may contain a large amount of irrelevant content. This irrelevant information can interfere with the semantic understanding of the current dialogue, and even in critical stages, such as security steps requiring identity reconfirmation, mixing in previous casual conversation may pose security risks, reducing the system's reliability and security.

[0060] In banking and other business scenarios, multi-turn dialogue applications play a crucial role. Banking operations are diverse, and different multi-turn dialogue strategies are suitable for each scenario. Using a single multi-turn dialogue strategy and context acquisition strategy can negatively impact unsuitable scenarios, significantly reducing the recognition effectiveness. For example, simple questions are suitable for query scenarios, guided approaches are suitable for processing scenarios, and RAG library queries are suitable for special scenarios such as security. If these distinctions are not made and a single approach is used for multi-turn dialogue recognition, the recognition results will be poor, the efficiency will be reduced, and the user experience will be subpar.

[0061] Context-based strategies also need to be selected according to different scenarios. For example, simple queries (such as "checking balance") typically rely on only the most recent 1-2 rounds of dialogue (such as identity verification); complex business processes (such as "purchasing wealth management products") involve multiple rounds of dialogue, and key information (such as product selection and amount confirmation) is scattered across different stages, requiring precise extraction of historical fragments related to the current step; security-sensitive operations (such as "changing password" and "large transfer") should, for security reasons, avoid relying on distant or indirectly related history, forcing users to confirm key information to prevent the context from being maliciously misled; casual conversation and complaints require a more comprehensive context to understand user emotions and the coherence of the topic. A single context-based strategy cannot meet the differentiated needs of banks in multiple scenarios, resulting in system performance bottlenecks and a decline in user experience.

[0062] Based on this, this application optimizes the process and technology by adopting a combined approach for multi-turn dialogue recognition. It uses different multi-turn dialogue strategies and different context acquisition strategies to match different business scenarios, thereby improving the overall multi-turn dialogue recognition effect and efficiency, and thus enhancing the user experience.

[0063] Specifically, embodiments of this application provide a multi-turn dialogue method, such as... Figure 1 The diagram shows a flowchart of a multi-turn dialogue method according to an embodiment of this application. The multi-turn dialogue method includes the following steps S110 to S150:

[0064] Step S110: Obtain user input information.

[0065] The system captures the user's current dialogue input in real time through natural language interaction interfaces such as speech recognition modules or text input boxes, and converts it into structured text data, performing preprocessing operations such as stop word removal and punctuation standardization. Input formats support text, speech-to-text (ASR), or multimodal input.

[0066] Step S120: Perform scene recognition on the user input information to obtain scene recognition results.

[0067] A scene recognition model (such as a classification model based on BERT or RoBERTa) is used to classify user input into a scene and output predefined scene labels, such as "query details" or "loan application". The scene recognition model can be trained using an annotated banking business dialogue dataset, covering common business scenarios and edge cases.

[0068] Step S130: Match the corresponding target multi-turn dialogue strategy and target context acquisition strategy based on the scene recognition result.

[0069] Multiple multi-turn dialogue strategies (such as full input model, RAG library matching, and guided mode) and multiple context acquisition strategies (such as full context strategy, local window strategy, intent-related strategy, and entity core strategy) are predefined, each strategy being associated with a specific scenario. Based on the current scenario recognition result (such as "query details"), the corresponding multi-turn dialogue strategy and context acquisition strategy are dynamically matched from the strategy library.

[0070] It supports dynamic adjustment of strategies and the mapping relationship between strategies and scenarios through configuration files or visual interfaces, without the need to modify the code.

[0071] Step S140: Obtain context information from the history of the current dialogue according to the target context strategy.

[0072] Maintain a dialogue state table to record key information for each round of dialogue (such as the user's provided ID number, business progress flags, etc.). Based on the target context strategy, filter relevant context information from the dialogue state table.

[0073] Step S150: Based on the user input information and the context information, respond using the target multi-turn dialogue strategy and the preset dialogue model, and output the response result.

[0074] The user's current input and context information are concatenated into the model input, and the target multi-turn dialogue strategy is combined to guide the preset dialogue model (such as a generative model based on GPT) to generate a response.

[0075] This application's embodiments achieve refined and dynamic management of multi-turn dialogues through a "scenario-driven strategy" mechanism. Scenario-based strategy matching ensures a high degree of alignment between the dialogue flow and business logic, avoiding the insufficient adaptability of traditional single strategies to complex scenarios. By selecting the optimal multi-turn dialogue strategy and context acquisition strategy for different scenarios, it ensures that the information input into the dialogue model is the most relevant and critical, reducing noise interference and significantly improving the accuracy of intent understanding and slot filling. Furthermore, it avoids unnecessary searches and calculations in the entire historical record, improving the efficiency of dialogue question answering.

[0076] In some embodiments of this application, the step of matching the corresponding target multi-turn dialogue strategy and target context acquisition strategy according to the scene recognition result includes: matching the scene recognition result in a predefined mapping relationship between scenes and multi-turn dialogue strategies to obtain the corresponding target multi-turn dialogue strategy; wherein, the multi-turn dialogue strategy includes at least one of the following: full input model, RAG library matching, and guided mode.

[0077] A predefined structured scenario-policy mapping table (such as JSON or a database table) is used, where each entry contains a scenario label and the corresponding optimal multi-turn dialogue strategy. Scenario labels include, for example, "query details," "loan application," and "bank activity consultation," while multi-turn dialogue strategies include, for example, "full input model," "RAG (Retrieval-Augmented Generation) library matching," and "guided mode." The mapping table can be modified in real time via the management backend or configuration file.

[0078] The corresponding target multi-turn dialogue strategy is obtained by querying the predefined mapping table based on the scene label.

[0079] This application's embodiments achieve a triple optimization of dialogue management in terms of accuracy, efficiency, and security through a scenario-driven multi-turn dialogue strategy matching mechanism. Dynamically invoking the optimal multi-turn dialogue strategy for different scenarios improves the accuracy of intent understanding and dialogue efficiency, thereby enhancing user satisfaction. Furthermore, the mapping relationship between multi-turn dialogues and scenarios supports hot updates; adding new business scenarios only requires configuring the corresponding strategy entries, without needing to refactor the system, thus adapting to the rapidly changing regulatory and market demands of the financial industry.

[0080] In some embodiments of this application, the step of matching the corresponding target multi-turn dialogue strategy and target context acquisition strategy according to the scene recognition result includes: matching the scene recognition result in a predefined mapping relationship between the scene and the context acquisition strategy to obtain the corresponding target context acquisition strategy; wherein, the context acquisition strategy includes at least one of the following: full context strategy, local window strategy, intent-related strategy, and entity core strategy.

[0081] Construct a structured scene-policy mapping table, where each record contains a scene label and the corresponding target context retrieval policy. Context retrieval policies include, for example, "full context policy," "local window policy," "intent-related policy," and "entity core policy." The mapping table can be dynamically updated via a management interface or API.

[0082] The predefined mapping table is queried based on the scene label to obtain the corresponding target context acquisition strategy.

[0083] This application's embodiments significantly improve the accuracy, efficiency, and adaptability of dialogue scheme context management through a scenario-driven dynamic context acquisition strategy. By invoking the optimal context acquisition strategy for different scenarios, the accuracy of intent understanding and dialogue efficiency are improved, thereby enhancing user satisfaction. Furthermore, the mapping relationship between context acquisition strategies and scenarios supports hot updates; adding new business scenarios only requires configuring the corresponding strategy entries, without needing to refactor the system, thus adapting to the rapidly changing regulatory and market demands of the financial industry.

[0084] In some embodiments of this application, the step of matching the scene recognition result with a predefined mapping relationship between scenes and multi-turn dialogue strategies to obtain the corresponding target multi-turn dialogue strategy includes: if the scene recognition result is a casual conversation type, the matched target multi-turn dialogue strategy is the strategy of the full input model; if the scene recognition result is a security sensitive type, the matched target multi-turn dialogue strategy is the strategy matched by the RAG library; if the scene recognition result is a complex business type, the matched target multi-turn dialogue strategy is the strategy of the guided mode.

[0085] For casual conversation scenarios, such as "weather information" or "interest discussions," the multi-turn dialogue strategy can be configured as a full-input model strategy. The full-input model strategy requires the complete history of the dialogue to maintain contextual coherence. For example, if a user talks about "weekend plans" and then "movie recommendations," the entire dialogue record must be retained.

[0086] For security-sensitive scenarios, such as "account unfreezing" and "password reset", the multi-turn dialogue strategy can be configured as a RAG library matching strategy. The RAG library matching strategy needs to be combined with a preset knowledge base to verify the legitimacy of user operations. For example, the RAG library stores documents such as "password reset process" and "risk control rules".

[0087] For complex business scenarios, such as "loan application" and "credit card activation", the multi-turn dialogue strategy can be configured as a guided mode strategy. Configuring a guided mode strategy requires collecting user information step by step, such as guiding users to provide "ID number", "proof of income", and "contact information" in sequence.

[0088] It supports dynamic updates of the policy mapping table through the management interface or API, including adding, deleting, and modifying multi-turn dialogue policies.

[0089] This application's embodiments significantly improve the dialogue solution's performance in terms of scenario adaptability, response accuracy, and business processing efficiency through a scenario-driven, multi-turn dialogue strategy dynamic matching mechanism. The mapping table supports flexible configuration, enabling rapid adaptation to new business scenarios and avoiding the poor scalability issues caused by hard-coded strategies. For casual conversation scenarios, a full-input model strategy is used to preserve complete context, avoiding misunderstandings caused by topic jumps; for security-sensitive scenarios, a RAG library matching strategy combined with an authoritative knowledge base ensures response compliance; and for complex business scenarios, a guided mode strategy collects information step-by-step, reducing user error rates.

[0090] In some embodiments of this application, the step of matching the scene recognition result with a predefined mapping relationship between scenes and context acquisition strategies to obtain a corresponding target context acquisition strategy includes: if the scene recognition result is a casual chat type, the matched target context acquisition strategy is a full context strategy; if the scene recognition result is a security sensitive type, the matched target context acquisition strategy is a local window strategy; if the scene recognition result is a simple query type, the matched target context acquisition strategy is a local window strategy or an intent-related strategy; if the scene recognition result is a complex business type, the matched target context acquisition strategy is an intent-related strategy or an entity core strategy.

[0091] For casual conversation scenarios, such as "interest discussions" or "daily greetings," the context acquisition strategy can be configured as a full context strategy, which means that all historical dialogue records must be retained to maintain topic coherence. For example, if a user changes their conversation from "movies" to "travel," the entire context must be understood to prevent the topic from jumping.

[0092] For security-sensitive scenarios such as "account unfreezing" and "password reset", the context acquisition strategy can be configured as a local window strategy, that is, only the most recent N rounds of dialogue records (e.g., N=3) are needed to verify the compliance of the operation in combination with the preset knowledge base. For example, if a user asks "how to unfreeze the account", the "frozen reason" information in the most recent dialogue needs to be matched.

[0093] For simple query scenarios, such as "branch opening hours" or "exchange rate query," the context retrieval strategy can be configured as a partial window strategy or an intent-related strategy. If the query is strongly related to the current conversation, such as the user first asking "nearby branches" and then "opening hours," a partial window strategy can be used; if the query is independent, such as the user directly asking "today's USD exchange rate," an intent-related strategy can be used.

[0094] For complex business scenarios, such as "loan application" and "credit card activation," the context retrieval strategy can be configured as either an intent-related strategy or an entity-centric strategy. If information needs to be collected step by step, such as for a loan application which requires "amount," "term," and "purpose," an intent-related strategy should be used. If the focus is on core entities, such as for credit card activation which requires information like "ID number" and "mobile phone number," an entity-centric strategy can be used.

[0095] It supports dynamic updates of the policy mapping table through the management interface or API, including update operations such as adding, deleting, and modifying policies obtained from context.

[0096] This application's embodiments significantly improve the dialogue solution's performance in terms of scenario adaptability, response accuracy, security, and business processing efficiency through a scenario-driven context acquisition strategy dynamic matching mechanism. The mapping table supports flexible configuration, enabling rapid adaptation to new business scenarios and avoiding the poor scalability issues caused by hard-coded strategies. In casual conversation scenarios, a full context strategy is used to preserve the complete context, avoiding misunderstandings caused by topic jumps; in security-sensitive scenarios, a local window strategy is used to limit the context scope, reducing the risk of information leakage; in simple query scenarios, an intent-related strategy focuses on core needs, reducing interference from irrelevant information; and in complex business scenarios, an entity-centric strategy verifies key information, preventing business operation risks.

[0097] In some embodiments of this application, obtaining context information from the history of the current dialogue according to the target context policy includes: if the target context policy is a full context policy, then obtaining the entire history of the current dialogue as the context information; if the target context policy is a local window policy, then obtaining the most recent N rounds of history before the current dialogue statement from the history of the current dialogue as the context information, where N is an integer not less than 1; if the target context policy is an intent-related policy, then identifying the intent of the current dialogue statement and obtaining the history of the current dialogue statement that matches the intent of the current dialogue statement from the history of the current dialogue as the context information; if the target context policy is an entity core policy, then identifying the core entity of the current dialogue statement and obtaining the history of the current dialogue statement that matches the core entity of the current dialogue statement from the history of the current dialogue as the context information.

[0098] Maintain a dialogue history cache queue to store all dialogue records of the current session (including user input and system responses) in chronological order. When the target context retrieval strategy is the full context strategy, all records (such as all text from the start of the session to the current round) are directly retrieved from the cache queue without truncation or filtering.

[0099] For example, in casual conversation scenarios, if users talk about "movies," "travel," and then "food," it is necessary to retain all conversation history to understand topic jumps. For instance, if a user suddenly asks "What are some good restaurants nearby?", it is necessary to recommend restaurants based on the previous context of "travel."

[0100] For the local window strategy, a preset window size N (e.g., N=3) is used, and it can be dynamically adjusted through configuration files or the management interface (e.g., N=5 can be set to retain more verification information in security-sensitive scenarios). When the target context acquisition strategy is the local window strategy, the most recent N rounds of records before the current round of dialogue are extracted from the cache queue. For example, if the user is currently asking "how to unfreeze the account", information such as "reason for freezing" and "operation time" from the previous 3 rounds of dialogue are extracted.

[0101] For example, in security-sensitive scenarios, such as account unfreezing consultations, users need to provide "account", "reason for freezing", and "operation time" in the first three rounds. The unfreezing conditions need to be verified based on this information, such as "Your account has been frozen due to login from a different location. You need to provide your ID number to verify your identity."

[0102] For intent-related strategies, a pre-trained intent classification model (such as a BERT-based text classifier) ​​can be used to identify the intent tags of the current dialogue, such as "query business hours" or "apply for a loan." Historical records matching this intent can be retrieved from a cache queue. For example, if a user previously asked "nearby branches" and is now asking "business hours," historical dialogues under the intent "branch query" need to be matched. If the intent tags in the historical records are completely consistent with the current intent, the record can be directly extracted. If the intent tags are different but semantically related, a word vector model can be used to calculate similarity; a similarity score above a certain threshold is considered a match.

[0103] For example, in simple query scenarios, such as when a user first asks for the "USD exchange rate" and then asks for the "EUR exchange rate", the system identifies the current intent as "exchange rate query" and matches all historical exchange rate-related conversations to generate a comprehensive response, such as "Today's USD exchange rate is 6.5 and the EUR exchange rate is 7.2".

[0104] For core entity strategies, core entities in the current dialogue can be extracted using named entity recognition models (such as CRF or BiLSTM-CRF), such as "ID number" and "loan amount". Historical records containing these entities can be retrieved from the cache queue. For example, if the user previously provided "ID number", and now it is necessary to verify "ID validity period", it is necessary to match the historical dialogue under the "ID number" entity.

[0105] For example, in complex business scenarios such as credit card activation, the user previously provided their "ID number" and "mobile phone number," and now needs to fill in their "mailing address." After recognizing the "ID number" entity, the system matches all historical dialogues involving identity verification and generates a response, such as "Please provide your mailing address to complete the card activation."

[0106] This application's embodiments achieve significant improvements in scenario adaptability, response accuracy, security, and business processing efficiency of the dialogue solution by dynamically matching multiple context acquisition strategies. The full context strategy preserves the complete context, supporting topic coherence in casual conversation scenarios; the partial window strategy limits the context scope of security-sensitive scenarios, reducing the risk of information leakage; the intent-related strategy focuses on the core needs of simple query scenarios, reducing irrelevant information interference and improving the response accuracy of simple query scenarios; the entity core strategy processes key information in complex business scenarios step by step, improving the rigor of business logic and the response completeness of complex business scenarios.

[0107] In some embodiments of this application, the step of responding based on the user input information and the context information using the target multi-turn dialogue strategy and a preset dialogue model, and outputting a response result, includes: if the target multi-turn dialogue strategy is a full-input model strategy, then the user input information and the context information are assembled and input into the preset dialogue model to respond, obtaining the response result; if the target multi-turn dialogue strategy is a RAG library matching strategy, then matching is performed in the RAG library based on the most recent N rounds of historical records before the current dialogue statement to obtain RAG library matching information, and the user input information and the RAG library matching information are assembled and input into the preset dialogue model to respond, obtaining the response result; if the target multi-turn dialogue strategy is a guided mode strategy, then necessary information is obtained from the context information, and guided question answering is performed using the preset dialogue model based on the user input information and the necessary information, obtaining the response result.

[0108] If the current multi-turn dialogue strategy is a full-input model strategy, then the current user input information is concatenated with the full context information to form a complete dialogue history sequence. The concatenated text is encoded through the input layer of the preset dialogue model, and the model generates a response based on the complete context.

[0109] The strategy of the full input model described above is applicable to main query scenarios (such as restaurant recommendations and weather queries) and casual conversation scenarios (such as continuous topic dialogues). It relies on the complete context to understand the user's intent (for example, when the user talks about "restaurants" from "Beijing", the model needs to combine the previous "just arrived in Beijing" to infer that "nearby" refers to the current location).

[0110] If the current multi-turn dialogue strategy uses RAG database matching, then the most recent N turns of historical records are extracted from the current dialogue, and similar historical dialogues or knowledge base entries are matched using the RAG database retrieval module. The matching result is concatenated with the user's current input and input into the dialogue model, which then uses the retrieved information to generate a response.

[0111] The aforementioned RAG library matching strategy is mainly applicable to banking activity scenarios (such as points redemption and promotional activity inquiries) and security-sensitive scenarios (such as password reset processes that require matching historical verification information), and relies on accurate retrieval to reduce model illusions.

[0112] If the current multi-turn dialogue strategy is a guided approach, the model identifies the key fields required for the current business transaction from the context information. For example, for loan applications, information such as "ID number" and "income certificate" are required. If the user's current input is incomplete (e.g., only "ID number"), the model generates a guided question, such as "Please supplement your income certificate information." After the user supplements the information, the user's input (e.g., "Income certificate: Monthly income of 20,000 yuan") is concatenated with the necessary information (e.g., "ID number: 123456xx"), and the input dialogue model generates the final response (e.g., "Loan application has been submitted and is expected to be reviewed within 3 business days").

[0113] The aforementioned guidance model strategy is mainly applicable to scenarios such as transaction processing (e.g., account opening, loan application) and complex business scenarios (e.g., insurance claims require the collection of "accident photos" and "policy numbers" in stages). It is necessary to ensure the integrity of information through interaction to avoid business interruption due to missing information.

[0114] This application's embodiments significantly improve the overall performance of the dialogue solution in terms of intent understanding accuracy, response security, business processing efficiency, and scenario adaptability by dynamically matching different multi-turn dialogue strategies. The full-input model strategy, through complete context concatenation, greatly improves the intent recognition accuracy in scenarios such as queries and casual conversations; the RAG library matching strategy, through enhanced retrieval, reduces the response error rate in scenarios such as banking activities and security-sensitive scenarios, and prevents information misuse in security-sensitive scenarios; the guided mode strategy, by collecting necessary information step by step, ensures the integrity of information in complex business scenarios, reduces operational risks, and improves business processing efficiency. Multiple multi-turn dialogue strategies cover diverse scenarios ranging from simple queries to complex businesses, flexibly adapting to different business needs and improving user satisfaction.

[0115] This application also provides a multi-turn dialogue device 200, such as... Figure 2 As shown, a structural schematic diagram of a multi-turn dialogue device according to an embodiment of this application is provided. The multi-turn dialogue device 200 includes:

[0116] Acquisition unit 210 is used to acquire user input information;

[0117] Scene recognition unit 220 is used to perform scene recognition on the user input information and obtain scene recognition results;

[0118] The strategy matching unit 230 is used to match the corresponding target multi-turn dialogue strategy and target context acquisition strategy according to the scene recognition result;

[0119] The context acquisition unit 240 is used to acquire context information from the history of the current dialogue according to the target context strategy;

[0120] The response unit 250 is used to respond based on the user input information and the context information, using the target multi-turn dialogue strategy and the preset dialogue model, and output the response result.

[0121] In some embodiments of this application, the policy matching unit 230 is specifically used to: match the scene recognition result in a predefined mapping relationship between the scene and the multi-turn dialogue strategy to obtain the corresponding target multi-turn dialogue strategy; wherein, the multi-turn dialogue strategy includes at least one of the full input model, RAG library matching, and guided mode.

[0122] In some embodiments of this application, the policy matching unit 230 is specifically used to: match the scene recognition result in a predefined mapping relationship between the scene and the context acquisition policy to obtain the corresponding target context acquisition policy; wherein, the context acquisition policy includes at least one of the following: full context policy, local window policy, intent-related policy and entity core policy.

[0123] In some embodiments of this application, the policy matching unit 230 is specifically used to: if the scene recognition result is a casual conversation type, then the matched target multi-turn dialogue policy is the policy of the full input model; if the scene recognition result is a security sensitive type, then the matched target multi-turn dialogue policy is the policy matched by the RAG library; if the scene recognition result is a complex business type, then the matched target multi-turn dialogue policy is the policy of the guided mode.

[0124] In some embodiments of this application, the policy matching unit 230 is specifically used to: if the scene identification result is a casual chat type, then the matched target context acquisition policy is a full context policy; if the scene identification result is a security sensitive type, then the matched target context acquisition policy is a local window policy; if the scene identification result is a simple query type, then the matched target context acquisition policy is a local window policy or an intent-related policy; if the scene identification result is a complex business type, then the matched target context acquisition policy is an intent-related policy or an entity core policy.

[0125] In some embodiments of this application, the context acquisition unit 240 is specifically used for: if the target context policy is a full context policy, then acquiring all the history records of the current dialogue as the context information; if the target context policy is a local window policy, then acquiring the most recent N rounds of history records before the current dialogue statement from the history records of the current dialogue as the context information, where N is an integer not less than 1; if the target context policy is an intent-related policy, then identifying the intent of the current dialogue statement and acquiring the history records matching the intent of the current dialogue statement from the history records of the current dialogue as the context information; if the target context policy is an entity core policy, then identifying the core entity of the current dialogue statement and acquiring the history records matching the core entity of the current dialogue statement from the history records of the current dialogue as the context information.

[0126] In some embodiments of this application, the response unit 250 is specifically used for: if the target multi-turn dialogue strategy is a full-input model strategy, then assembling the user input information and the context information and inputting them into the preset dialogue model to respond, thereby obtaining the response result; if the target multi-turn dialogue strategy is a RAG library matching strategy, then matching is performed in the RAG library based on the most recent N rounds of historical records before the current dialogue statement to obtain the RAG library matching information, and assembling the user input information and the RAG library matching information and inputting them into the preset dialogue model to respond, thereby obtaining the response result; if the target multi-turn dialogue strategy is a guided mode strategy, then necessary information is obtained from the context information, and guided question answering is performed using the preset dialogue model based on the user input information and the necessary information, thereby obtaining the response result.

[0127] It is understood that the above-mentioned multi-turn dialogue device can realize all the steps of the multi-turn dialogue method provided in the foregoing embodiments. The relevant explanations of the multi-turn dialogue method are applicable to the multi-turn dialogue device, and will not be repeated here.

[0128] Figure 3 This is a schematic diagram of the structure of a device according to an embodiment of this application. For example... Figure 3As shown, the device includes one or more processors (or processing units), and may also include one or more memories coupled to the processors, and may also include a communication module coupled to the processors.

[0129] A communication module can be used to communicate with other devices or apparatuses, such as sending or receiving data and / or signals. A communication module may have at least one communication module for communication. A communication module may include any interface necessary for communicating with other devices. Exemplarily, a communication module may be a transceiver, circuit, bus, module, or other type of communication module.

[0130] The processor may include, but is not limited to, one or more of the following: a general-purpose computer, a special-purpose computer, a microcontroller, a digital signal processor (DSP), or a controller-based multi-core controller architecture. The device may have multiple processors, such as application-specific integrated circuit (ASIC) chips, which are time-dependent on a clock synchronized with the main processor.

[0131] The memory may include one or more non-volatile memories and one or more volatile memories. Examples of non-volatile memories include, but are not limited to, at least one of the following: read-only memory (ROM), electrically programmable read-only memory (EPROM), flash memory, hard disk, compact disc (CD), digital video disc (DVD), or other magnetic and / or optical storage. Examples of volatile memories include, but are not limited to, at least one of the following: random access memory (RAM), or other volatile memories that do not persist during the duration of a power outage.

[0132] A computer program consists of computer-executable instructions that are executed by an associated processor. Programs can be stored in ROM. A processor can perform any appropriate action and processing by loading the program into RAM.

[0133] Possible implementations of this application can be achieved through a program, enabling the communication device to execute any of the processes discussed in the foregoing embodiments. Possible implementations of this application can also be achieved through hardware or a combination of software and hardware.

[0134] In some implementations, the program may be tangibly contained in a computer-readable storage medium, which may include in a device (such as in memory) or other storage device accessible by the device. The program may be loaded from the computer-readable storage medium into RAM for execution. The computer-readable storage medium may include any type of tangible non-volatile memory, such as ROM, EPROM, flash memory, hard disk, CD, DVD, etc.

[0135] This application also provides a computer-readable storage medium storing computer instructions or program code thereon, which, when executed by a processor, causes the processor to perform the methods and functions involved in any of the above embodiments. A computer-readable medium can be any tangible medium that contains or stores a program for or relating to an instruction execution system, apparatus, or device. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. More detailed examples of computer-readable storage media include electrical connections with one or more wires, magnetic media (e.g., disks, floppy disks, hard disks, magnetic tapes, magnetic storage devices), optical media (e.g., optical storage devices, DVDs), semiconductor media (e.g., solid-state drives), random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), or any suitable combination thereof.

[0136] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. Embodiments of this application also provide at least one computer program product tangibly stored on a non-transitory computer-readable storage medium. This computer program product includes one or more computer-executable instructions, such as instructions included in a program module, which execute in a device on a target real or virtual processor to perform the processes, methods, and functions involved in any of the above embodiments. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means.

[0137] This application also proposes a computer program product, including a computer program or instructions that, when run on a computer, cause the computer to perform the processes, methods, and functions described in the above embodiments. Typically, program modules include routines, programs, libraries, objects, classes, components, data structures, etc., that perform specific tasks or implement specific abstract data types. In various embodiments, the functionality of program modules can be combined or divided as needed. The machine-executable instructions for the program modules can be executed locally or in a distributed device. In a distributed device, the program modules can reside in both local and remote storage media.

[0138] Generally, the various embodiments of this application can be implemented in hardware or dedicated circuitry, software, logic, or any combination thereof. Some aspects can be implemented in hardware, while others can be implemented in firmware or software, which can be executed by a controller, microprocessor, or other computing device. Although various aspects of the embodiments of this disclosure are shown and described as block diagrams, flowcharts, or represented using some other illustration, it should be understood that the blocks, apparatuses, systems, techniques, or methods described herein can be implemented as, as non-limiting examples, in hardware, software, firmware, dedicated circuitry or logic, general-purpose hardware or controllers or other computing devices, or some combination thereof.

[0139] It should be noted that although embodiments of this application have been described above with reference to the accompanying drawings, these embodiments are not independent of each other, and they can be combined to obtain other embodiments. The methods, situations, categories, and classifications of embodiments in this application are only for the convenience of description and should not constitute a special limitation. Various methods, categories, situations, and features in embodiments can be combined with each other if logically consistent. The various embodiments of this application can be arbitrarily combined to achieve different technical effects. The embodiments of this application will not list various combinations.

[0140] Furthermore, although the operation of the methods of this disclosure is described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all of the operations shown must be performed to achieve the desired result. Rather, the steps depicted in the flowcharts may be performed in a different order. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps. It should also be noted that the features and functions of two or more devices according to this disclosure may be embodied in one device. Conversely, the features and functions of one device described above may be further divided and embodied by multiple devices.

[0141] 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, article, 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, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0142] 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 multi-turn dialogue method, characterized in that, The multi-turn dialogue method includes: Obtain user input information; The user input information is subjected to scene recognition to obtain scene recognition results; Based on the scene recognition results, match the corresponding target multi-turn dialogue strategy and target context acquisition strategy; According to the target context strategy, obtain context information from the history of the current conversation; Based on the user input information and the context information, the system responds using the target multi-turn dialogue strategy and the preset dialogue model, and outputs the response result.

2. The multi-turn dialogue method according to claim 1, characterized in that, The step of matching the corresponding target multi-turn dialogue strategy and target context acquisition strategy based on the scene recognition result includes: Based on the scene recognition results, a matching is performed in the predefined mapping relationship between scenes and multi-turn dialogue strategies to obtain the corresponding target multi-turn dialogue strategy; The multi-turn dialogue strategy includes at least one of the following: full input model, RAG library matching, and guided mode.

3. The multi-turn dialogue method according to claim 1, characterized in that, The step of matching the corresponding target multi-turn dialogue strategy and target context acquisition strategy based on the scene recognition result includes: Based on the scene recognition results, a matching is performed in the predefined mapping relationship between scenes and context acquisition strategies to obtain the corresponding target context acquisition strategy; The context acquisition strategy includes at least one of the following: full context strategy, local window strategy, intent-related strategy, and entity core strategy.

4. The multi-turn dialogue method according to claim 2, characterized in that, The step of matching the scene recognition result with the predefined mapping relationship between scenes and multi-turn dialogue strategies to obtain the corresponding target multi-turn dialogue strategy includes: If the scene recognition result is chat-like, then the matched target multi-turn dialogue strategy is the strategy of the full input model; If the scene recognition result is a security-sensitive class, then the matched target multi-turn dialogue strategy is the strategy matched by the RAG library; If the scene recognition result is a complex business type, then the matched target multi-turn dialogue strategy is the guided mode strategy.

5. The multi-turn dialogue method according to claim 3, characterized in that, The step of matching the scene recognition result with the predefined mapping relationship between scenes and context acquisition strategies to obtain the corresponding target context acquisition strategy includes: If the scene recognition result is chat-related, then the matching target context acquisition strategy is the full context strategy; If the scene identification result is a security-sensitive class, then the matching target context acquisition strategy is the local window strategy; If the scene recognition result is a simple query, then the matching target context acquisition strategy is a local window strategy or an intent-related strategy. If the scene recognition result is a complex business class, then the matching target context acquisition strategy is an intent-related strategy or an entity core strategy.

6. The multi-turn dialogue method according to claim 1, characterized in that, The step of obtaining context information from the history of the current conversation according to the target context strategy includes: If the target context policy is a full context policy, then the entire history of the current conversation is obtained as the context information; If the target context strategy is a local window strategy, then the most recent N rounds of history before the current round of dialogue statements are obtained from the history of the current dialogue as the context information, where N is an integer not less than 1; If the target context policy is an intent-related policy, then the intent of the current dialogue statement is identified, and historical records that match the intent of the current dialogue statement are obtained from the history of the current dialogue as the context information. If the target context policy is an entity core policy, then the core entity of the current dialogue statement is identified, and the historical records that match the core entity of the current dialogue statement are obtained from the history of the current dialogue as the context information.

7. The multi-turn dialogue method according to claim 1, characterized in that, The step of responding based on the user input information and the context information, utilizing the target multi-turn dialogue strategy and a preset dialogue model, and outputting the response result includes: If the target multi-turn dialogue strategy is a full-input model strategy, then the user input information and the context information are assembled and input into the preset dialogue model to respond, and the response result is obtained. If the target multi-turn dialogue strategy is a RAG library matching strategy, then the RAG library is matched according to the most recent N-turn history records before the current dialogue statement to obtain the RAG library matching information, and the user input information and the RAG library matching information are assembled and input into the preset dialogue model for response to obtain the response result. If the target multi-turn dialogue strategy is a guided mode strategy, then necessary information is obtained from the context information, and guided question answering is performed using the preset dialogue model based on the user input information and the necessary information to obtain the response result.

8. A multi-turn dialogue device, characterized in that, The multi-turn dialogue device includes: The acquisition unit is used to acquire user input information; A scene recognition unit is used to perform scene recognition on the user input information and obtain scene recognition results; The strategy matching unit is used to match the corresponding target multi-turn dialogue strategy and target context acquisition strategy based on the scene recognition result; The context acquisition unit is used to acquire context information from the history of the current dialogue according to the target context strategy; The response unit is used to respond based on the user input information and the context information, using the target multi-turn dialogue strategy and the preset dialogue model, and output the response result.

9. An apparatus comprising: processor; And a memory arranged to store computer-executable instructions, which, when executed, cause the processor to perform any of the multi-turn dialogue methods of claims 1 to 7.

10. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements any one of the multi-turn dialogue methods described in claims 1 to 7.