A method and system for dynamic recognition and analysis of multi-turn dialogue intent driven by large language models

By constructing a hierarchical domain knowledge graph set and a multi-turn dialogue intent recognition method driven by a large language model, the problem of insufficient accuracy in dynamic intent recognition in multi-turn dialogue scenarios is solved, achieving compliance of dialogue content and brand consistency, and ensuring the security of enterprise social media and user interaction experience.

CN122264126BActive Publication Date: 2026-07-31NANJING DESAI JIATE INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NANJING DESAI JIATE INFORMATION TECH CO LTD
Filing Date
2026-05-25
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing technologies cannot achieve online dynamic fusion of domain knowledge graphs and large language models, resulting in insufficient accuracy in dynamic intent recognition in multi-turn dialogue scenarios. This makes it difficult to match the constraints of brand persona and corporate culture, and may lead to interactive content deviating from account positioning and touching compliance boundaries, making it impossible to predict potential risks in the dialogue in advance.

Method used

A hierarchical domain knowledge graph set is constructed, including a response subject setting subgraph, a compliance rule subgraph, and a business ontology subgraph. A large language model drives the dynamic recognition of multi-turn dialogue intent. Combined with semantic parsing and path retrieval matching, dynamic prompt words are generated for intent assessment and content generation, and cumulative risk scoring is performed.

Benefits of technology

It enables accurate identification of intent and risk assessment in multi-round dialogue scenarios, ensuring that interactive content aligns with brand persona and compliance requirements, proactively blocking the spread of illegal content, and improving the compliance and security of corporate social media posts and intelligent replies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122264126B_ABST
    Figure CN122264126B_ABST
Patent Text Reader

Abstract

This invention discloses a method and system for dynamic intent recognition and analysis in multi-turn dialogues driven by a large language model, belonging to the field of data processing technology. It includes: acquiring a domain knowledge graph set of the dialogue scenario; acquiring historical dialogue records and the input content of the current turn, performing semantic parsing through a large language model to extract entity information and topic tags as dialogue base information; traversing the domain knowledge graph set for path retrieval and matching, generating dynamic prompt words based on the path retrieval and matching results, and injecting them into the large language model to drive the large language model to generate intent evaluation conclusions for the input content and user-oriented dialogue output content; maintaining the intent evolution trajectory of the current dialogue, performing pattern matching-based risk labeling based on an intent pattern library, and calculating a cumulative risk score; and combining the risk labeling results and the cumulative risk score to perform gated output of the dialogue output content. This invention effectively improves the accuracy of dynamic intent recognition in multi-turn dialogue scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, specifically to a method and system for dynamic recognition and analysis of multi-turn dialogue intent driven by a large language model. Background Technology

[0002] As corporate social media becomes a core platform for brand communication and user interaction, multi-turn interaction scenarios, including account postings, intelligent comment replies, and manual responses from operations personnel, place high demands on intent recognition and content compliance. Currently, multi-turn dialogue intent recognition mainly employs two mainstream methods. One method relies on offline pre-training and fusion based on knowledge graphs, using meta-path pre-training to solidify model parameters and complete single-turn intent recognition and switch judgment. The other method involves the parallel and independent operation of a large language model and a semantic graph. The large model is responsible for semantic parsing to extract preliminary intents, while the semantic graph, combined with a graph neural network, evaluates intent conflicts and prioritizes them.

[0003] Existing technologies cannot achieve online dynamic fusion of domain knowledge graphs and large language models, and only remain at the level of single-round instantaneous intent determination. They have not built a compliance governance system adapted to enterprise social media scenarios, and it is difficult to match the constraints of brand persona and corporate culture. This results in insufficient accuracy of dynamic intent recognition in multi-round dialogue scenarios, which can easily lead to interactive content deviating from account positioning and touching compliance boundaries. It is also impossible to predict the potential risks of dialogue in advance, which brings online public opinion risks to enterprises. Summary of the Invention

[0004] This invention provides a method and system for dynamic recognition and analysis of multi-turn dialogue intent driven by a large language model, aiming to solve the technical problem of insufficient accuracy in dynamic intent recognition in multi-turn dialogue scenarios in the prior art.

[0005] In view of the above problems, the present invention provides a method and system for dynamic recognition and analysis of multi-turn dialogue intent driven by a large language model.

[0006] In a first aspect, this invention provides a method for dynamic recognition and analysis of multi-turn dialogue intent driven by a large language model, including: Obtain a domain knowledge graph set for the target dialogue scenario, wherein the domain knowledge graph set includes at least a response subject setting subgraph, a compliance rule subgraph, and a business ontology subgraph; The system acquires historical dialogue records and current input content, performs semantic parsing using a large language model, and extracts entity information and topic tags from the current dialogue context as dialogue base information. Based on the dialogue base information, the domain knowledge graph set is traversed to perform path retrieval and matching. Dynamic prompt words are generated according to the path retrieval and matching results and injected into the large language model to drive the large language model to generate the intent evaluation conclusion of the input content and the user-oriented dialogue output content. Based on the intent assessment conclusion, maintain the intent evolution trajectory of the current dialogue, and combine it with a preset intent pattern library to perform pattern matching-based risk labeling and calculate the cumulative risk score; By combining the risk labeling results with the cumulative risk score, the gated output of the dialogue output content is performed.

[0007] Secondly, this invention provides a multi-turn dialogue intent dynamic recognition and analysis system driven by a large language model, including: The knowledge graph acquisition module is used to acquire a domain knowledge graph set for the target dialogue scenario, wherein the domain knowledge graph set includes at least a response subject setting subgraph, a compliance rule subgraph, and a business ontology subgraph; The semantic parsing module is used to obtain historical dialogue records and the input content of the current round, and performs semantic parsing through a large language model to extract entity information and topic tags from the current dialogue context as dialogue base information; The path retrieval and matching module is used to perform path retrieval and matching by traversing the domain knowledge graph set based on the dialogue base information, generate dynamic prompt words according to the path retrieval and matching results, and inject them into the large language model to drive the large language model to generate the intent evaluation conclusion of the input content and the user-oriented dialogue output content. The risk score calculation module is used to maintain the intent evolution trajectory of the current dialogue based on the intent assessment conclusion, and to perform pattern matching-based risk labeling in conjunction with a preset intent pattern library to calculate the cumulative risk score. The gating output control module is used to combine the risk marking results with the cumulative risk score to perform gating output of the dialogue output content.

[0008] One or more technical solutions provided in this invention have at least the following technical effects or advantages: This invention provides a method and system for dynamic identification and analysis of multi-turn dialogue intent driven by a large language model. It constructs a domain knowledge graph set containing three subgraphs: brand persona, compliance rules, and business ontology. Dynamic prompts are generated by real-time retrieval of these subgraphs and injected into the large language model, driving the model to perform two-stage reasoning to complete intent assessment and content generation. Simultaneously, it dynamically maintains the intent evolution trajectory, matches risk evolution patterns, and quantifies and accumulates risk scores. A layered gating strategy is used to achieve hierarchical control of output content, covering all scenarios including corporate social media posts, intelligent replies, and manual comments. This ensures that interactive content aligns with brand persona and compliance requirements, accurately identifies dynamic intent, and proactively intercepts risks, preventing the spread of illegal content and public opinion crises from the source. Attached Figure Description

[0009] Figure 1 A flowchart illustrating the multi-turn dialogue intent dynamic recognition and analysis method driven by a large language model provided in this embodiment of the invention; Figure 2 A schematic diagram of the overall logic of the large language model-driven multi-turn dialogue intent dynamic recognition and analysis method provided in this embodiment of the invention; Figure 3 A schematic diagram of the structure of a large language model-driven multi-turn dialogue intent dynamic recognition and analysis system provided in an embodiment of the present invention; The components represented by each number in the attached diagram are explained below: The module includes a knowledge graph acquisition module (11), a semantic parsing module (12), a path retrieval and matching module (13), a risk scoring calculation module (14), and a gating output control module (15). Detailed Implementation

[0010] This invention provides a method and system for dynamic recognition and analysis of multi-turn dialogue intent driven by a large language model, which is used to address the technical problem of insufficient accuracy in dynamic intent recognition in multi-turn dialogue scenarios in the prior art.

[0011] Example 1, as Figure 1 , Figure 2 As shown, this invention provides a method for dynamic recognition and analysis of multi-turn dialogue intent driven by a large language model, the method comprising: S1: Obtain a domain knowledge graph set for the target dialogue scenario, wherein the domain knowledge graph set includes at least a response subject setting subgraph, a compliance rule subgraph, and a business ontology subgraph.

[0012] Enterprise social media dialogue scenarios encompass three interaction formats: proactive posting, intelligent replies, and human comment replies. These scenarios must simultaneously meet three constraints: consistency of the responding persona, compliance of the output content, and accuracy of business knowledge. Existing technologies employ single knowledge graphs or offline solidified knowledge, failing to break down the knowledge structure according to functional dimensions. This makes it impossible to specifically support the three differentiated knowledge categories of brand persona, compliance rules, and business ontology, and also hinders the dynamic knowledge retrieval and injection requirements in multi-turn dialogues. Therefore, it is necessary to pre-construct a hierarchical domain knowledge graph set to provide structured, searchable, and scenario-adaptive underlying knowledge support for subsequent intent recognition and compliance verification.

[0013] Step S1 in the method provided in this embodiment of the invention includes: Define the entity types and relationship types corresponding to the response subject setting subgraph, the compliance rule subgraph, and the business ontology subgraph, respectively; Based on the target dialogue scenario, domain documents are used to extract knowledge, and based on the defined entity type and relation type, they are instantiated in the form of triples to construct the response subject setting subgraph, the compliance rule subgraph and the business ontology subgraph respectively. The completed response subject setting subgraph, compliance rule subgraph, and business ontology subgraph are stored in a graph database and a retrieval index is established to obtain the domain knowledge graph set; The compliance rules subgraph includes positive example dialogue entities and negative example dialogue entities.

[0014] First, define the entity types and relationship types corresponding to the response subject setting subgraph, the compliance rule subgraph, and the business ontology subgraph, respectively. Entity type refers to the classification of things, concepts, or attributes with the same characteristics in the knowledge graph, providing a standardized category framework for knowledge construction. Relationship type refers to the classification used in the knowledge graph to describe the associated attributes between different entities, clarifying the logical connection rules between entities.

[0015] The response subject setting subgraph contains knowledge of the respondent's attributes, such as the company's social media account persona, tone, and target audience. The compliance rules subgraph contains knowledge of compliance constraints, such as legal provisions, risk types, risk levels, and dialogue examples. The business ontology subgraph contains business knowledge related to products, services, industry terminology, and user questions.

[0016] For example, taking a social media dialogue scenario of a new energy vehicle company as a unified example: Reply Subject Setting Sub-diagram: Entity Types: Brand Tone, Persona Attributes, Target Audience; Relationship Types: Maintaining Tone, Prohibited Use, Preference. Compliance Rules Sub-diagram: Entity Types: Regulatory Clauses, Risk Types, Risk Levels, Dialogue Examples; Relationship Types: Trigger, Risk Level, Best Response Examples, Negative Examples. Business Ontology Sub-diagram: Entity Types: Product Model, Product Attributes, Industry Terminology, User Questions; Relationship Types: Belonging, Core Selling Points, Standard Answer Strategy.

[0017] The compliance rules subgraph includes positive example dialogue entities and negative example dialogue entities. Positive example dialogue entities represent dialogue examples that comply with compliance requirements and can be used as a reference. Negative example dialogue entities represent dialogue examples that violate compliance requirements and should be avoided.

[0018] Specifically, from the historical dialogue logs of the target dialogue scenario, responses that comply with compliance rules are selected as compliant dialogue examples, and responses that violate compliance rules are selected as non-compliant dialogue examples. Compliant dialogue examples are defined as positive dialogue example entities, and non-compliant dialogue examples are defined as negative dialogue example entities. A triplet of association between positive dialogue example entities, negative dialogue example entities, and corresponding risk type entities is established and incorporated into the compliance rules subgraph.

[0019] For example, from the historical comment reply log, the compliant reply "Thank you for your attention. The product has excellent battery life. Welcome to experience it in-store" is selected as a compliant example, and the non-compliant reply "This product is the best in the industry, far surpassing all competitors" is selected as a non-compliant example. The compliant example is defined as the positive example dialogue entity <Compliance Positive Example 1>, and the non-compliant example is defined as the negative example dialogue entity <Compliance Negative Example 1>. A relational triple is constructed: <Exaggerated Advertising, Best Response Example, Compliance Positive Example 1>, <Exaggerated Advertising, Negative Example, Compliance Negative Example 1>, and the two entities and the triple are incorporated into the compliance rule subgraph.

[0020] Secondly, knowledge extraction is performed on the domain documents based on the target dialogue scenario. Based on the defined entity types and relation types, these are instantiated in the form of triples to construct the response subject setting subgraph, the compliance rule subgraph, and the business ontology subgraph, respectively. Domain documents refer to internal enterprise materials and industry standard documents corresponding to the target dialogue scenario, including brand manuals, compliance management documents, product manuals, industry regulatory provisions, historical dialogue logs, etc. Knowledge extraction refers to the technical process of extracting effective information such as entities, relations, and attributes from unstructured domain documents. A triple is the basic building block of a knowledge graph, formatted as <head entity, relation, tail entity>, used to accurately express a single logical relationship between entities. Instantiation is the process of mapping abstract entity types and relation types to specific entities and relations in the target scenario.

[0021] Specifically, all domain documents corresponding to the target dialogue scenario are collected, ensuring that the documents cover all dimensions of content, including the respondent's persona, compliance rules, and business knowledge. Entity recognition and relation extraction technologies are used to extract entity information and inter-entity relationships from the domain documents. Based on entity type and relation type, the extracted information is transformed into standardized triples. Subgraphs are constructed according to their functions, including respondent setting subgraphs, compliance rule subgraphs, and business ontology subgraphs.

[0022] Exemplarily, the sub-graph construction of the response body setting: Content of the domain document: "The brand tone is professional and rigorous, amiable and warm, the target audience is urban white-collar workers aged 25-40, and the use of internet slang is prohibited for the professional and rigorous persona"; extract and instantiate triples: <A certain new energy vehicle, maintain tone, professional and rigorous>, <A certain new energy vehicle, target audience, urban white-collar workers aged 25-40>, <Professional and rigorous, prohibited from using, internet slang>, and complete the sub-graph construction. Sub-graph construction of compliance rules: Content of the domain document: "The Advertising Law prohibits absolute terms, and the use of 'best, first' triggers exaggerated publicity, which belongs to a red-line risk"; extract and instantiate triples: <Containing absolute terms, trigger, exaggerated publicity>, <Exaggerated publicity, risk level, red line>, and complete the basic sub-graph construction. Sub-graph construction of business ontology: Content of the domain document: "Model X is a flagship model, and the core selling points are a 72-hour battery life and a 30-minute fast charge"; extract and instantiate triples: <Model X, belongs to, flagship model>, <Model X, core selling point, 72-hour battery life>, <Model X, core selling point, 30-minute fast charge>, and complete the sub-graph construction.

[0023] Again, store the constructed response body setting sub-graph, the compliance rules sub-graph, and the business ontology sub-graph in a graph database and establish a retrieval index to obtain the domain knowledge graph set. A graph database is a database specifically used to store graph-structured data, which adapts to the associated storage requirements of knowledge graph entities and relationships and supports efficient graph query operations. A retrieval index refers to a structured data mapping table constructed to improve data query efficiency, which can quickly locate target entities, relationships, or sub-graph data. The domain knowledge graph set is formed by integrating the response body setting sub-graph, the compliance rules sub-graph, and the business ontology sub-graph, and is the carrier of all-dimensional structured knowledge in the target dialogue scenario.

[0024] Specifically, select a graph database suitable for knowledge graph storage, including Neo4j, NebulaGraph, and RDF databases; batch import all the triples of the response body setting sub-graph, the compliance rules sub-graph, and the business ontology sub-graph into the graph database; establish a retrieval index for the entity name, relationship type, and sub-graph type keyword fields to support fast retrieval by entity, relationship, and sub-graph type; integrate the three types of sub-graphs to form a complete domain knowledge graph set.

[0025] Exemplarily, select the Neo4j graph database as the storage carrier; batch import all the triples of the response body setting sub-graph, the compliance rules sub-graph, and the business ontology sub-graph into the Neo4j database; establish a retrieval index for the entity fields and relationship fields; integrate the three types of sub-graphs to obtain the domain knowledge graph set for the social media dialogue scenario of this new energy vehicle enterprise.

[0026] In this embodiment of the invention, by constructing a hierarchical subgraph of the response subject setting, compliance rules, and business ontology, modular decomposition and structured storage of brand persona, compliance constraints, and business knowledge are achieved, avoiding the knowledge mixing problem of a single knowledge graph. The use of triple instantiation ensures accurate knowledge representation, clear logic, and reasoning and scalability. Through graph database storage and retrieval index construction, rapid knowledge retrieval and retrieval are achieved, meeting the real-time requirements of dynamic knowledge injection in multi-turn dialogues. The setting of positive and negative example entities in the compliance rules subgraph provides exemplary support for subsequent prompt word generation, effectively improving the accuracy of intent recognition and compliance verification. This step provides underlying knowledge support for subsequent dynamic intent recognition and risk assessment in multi-turn dialogues, ensuring scenario adaptability, hierarchical control, and efficient retrieval, guaranteeing the feasibility and accuracy of the entire process.

[0027] S2: Obtain historical dialogue records and current input content, and perform semantic parsing through a large language model to extract entity information and topic tags from the current dialogue context as dialogue base information.

[0028] Enterprise social media conversations are highly context-dependent. The true intent, entities involved, and core topics of the current user input must be accurately grasped by considering the context of previous conversations. Existing technologies often only perform semantic parsing on single-turn input, neglecting the contextual connections across multiple rounds of dialogue. This can lead to incomplete entity recognition and fragmented topic understanding. Furthermore, the lack of semantic verification using domain-specific knowledge graphs can result in entity ambiguity and redundant topics, directly causing deviations in subsequent knowledge graph path retrieval and reduced accuracy in intent recognition. Therefore, it is necessary to acquire multiple rounds of historical dialogue and the current input, perform semantic parsing using a large language model, and combine this with a domain knowledge graph for semantic disambiguation and merging. This will output accurate and structured dialogue base information, providing a reliable contextual foundation for subsequent dynamic prompt generation and intent recognition.

[0029] Step S2 in the method provided in this embodiment of the invention includes: Get the input content of the current round and the corresponding historical dialogue records of the previous N rounds, where N is the preset context window length and N is greater than 2; The input content is concatenated with the historical dialogue record to form a semantic parsing input. A large language model is used to perform semantic parsing on the semantic parsing input to extract the dialogue entity and dialogue title corresponding to the current dialogue context. By combining the domain knowledge graph set, semantic disambiguation and merging are performed on the dialogue entities and the dialogue titles to obtain the entity information and the topic tags, and the structured output is used as the dialogue base information.

[0030] First, the input content of the current round and the corresponding historical dialogue records of the previous N rounds are obtained, where N is the preset context window length, and N is greater than 2. The current round input content refers to the text content sent by the user to the enterprise's social media account in the current interaction round, including inquiries, questions, comments, and tentative expressions. The historical dialogue records refer to the text set of user input content and corresponding responses from previous rounds completed in the current interaction session. The context window length N is the preset number of historical dialogue rounds used for association analysis, limiting the historical context range upon which semantic parsing relies, and N is a positive integer greater than 2.

[0031] Among them, the preset context window length N needs to take into account the integrity of the context, parsing efficiency and scene adaptability: N>2 can cover the key context of the gradual evolution of the intention in multiple rounds of dialogue and avoid context gaps; at the same time, avoid N being too large to introduce redundant noise and increase computational overhead, fit the short-round interaction characteristics of enterprise social media, and balance the accuracy of intention recognition and response efficiency.

[0032] Specifically, it captures the current round of input content in the current interactive session in real time; retrieves the N consecutive rounds of historical dialogue records preceding the current round of input content in the current interactive session; and summarizes the current round of input content and the previous N rounds of historical dialogue records to form a complete multi-round dialogue text set.

[0033] For example, the preset context window length N=3. The current round input is captured as: "Compared to competitor Y, can your X model really achieve a 72-hour battery life?". The system retrieves the previous three rounds of dialogue from the current session: Round 1: User "I'd like to know about the battery life of your flagship model"; Round 2: Account reply "Our flagship X model has excellent battery life"; Round 3: User "I heard the battery life can reach 72 hours, is that true?"; Fourth, the system combines the current round input with the above three rounds of dialogue to obtain a multi-round dialogue text set.

[0034] Secondly, the input content is concatenated with the historical dialogue records to form semantic parsing input. A large language model then performs semantic parsing on this input to extract the dialogue entities and dialogue titles corresponding to the current dialogue context. Semantic parsing input refers to the complete text formed by concatenating the current round's input content with the previous N rounds of historical dialogue records in chronological order, which serves as the input data for the large language model's semantic parsing. Semantic parsing refers to the process by which the large language model performs in-depth lexical, syntactic, and semantic analysis of the text content to understand the core meaning, key objects, and thematic direction of the text. Dialogue entities refer to the core nouns or noun phrases such as specific things, concepts, products, people, and attributes involved in the dialogue text, extracted after semantic parsing. Dialogue titles are concise texts extracted after semantic parsing that summarize the core theme of the current multi-round dialogue, reflecting the core discussion direction of the dialogue.

[0035] Specifically, following the chronological order of historical dialogue records (first, then the current input), the historical dialogue records from the previous N rounds are concatenated sentence by sentence with the current input to form a complete semantically parsed input text. This concatenated semantically parsed input text is then fed into a pre-trained large language model. The large language model performs semantic parsing on the input text, identifying core nouns and key objects, and extracting dialogue entities. Based on these dialogue entities and the core semantics of the text, the large language model extracts and summarizes the core themes of the multi-round dialogues, generating dialogue titles.

[0036] For example, by concatenating three rounds of historical dialogue records with the current round's input content in chronological order, a semantically parsed input is generated: "User: I'd like to know about the range of your flagship model; Account: Our flagship X model has excellent range performance; User: I heard the range can reach 72 hours, is that true?; User: Compared to competitor Y, can your X model really achieve a range of 72 hours?". This text is input into a large language model, which performs semantic parsing and extracts the dialogue entities: flagship model, X model, range, 72 hours, competitor Y. The large language model then refines the dialogue title: New Energy Vehicle Range Comparison Consultation.

[0037] Finally, based on the domain knowledge graph, semantic disambiguation and merging are performed on the dialogue entities and dialogue titles to obtain the entity information and topic tags, which are then structured and output as the dialogue base information. Semantic disambiguation is the process of eliminating ambiguities such as polysemy, vague expressions, and unclear referents in dialogue entities or dialogue titles by combining entity definitions and relational associations from the domain knowledge graph. Merging is the process of integrating and deduplicating dialogue entities or topic content with the same semantic meaning but different expressions to avoid redundant information.

[0038] Entity information refers to the precise and unambiguous set of dialogue entities after semantic disambiguation and merging, which is structured data. Topic tags refer to concise and standardized dialogue topic identifiers after semantic disambiguation and merging, used to quickly categorize the core direction of the dialogue. Dialogue base information: structured data composed of entity information and topic tags, which is the foundational data for subsequent knowledge graph retrieval, prompt word generation, and intent recognition.

[0039] Specifically, the domain knowledge graph set constructed by S1 is retrieved to obtain entity definitions and relationships in the response subject setting subgraph, compliance rule subgraph, and business ontology subgraph; the extracted dialogue entities and dialogue titles are semantically matched with entities in the domain knowledge graph set to identify and correct ambiguous content, thus completing semantic disambiguation; after semantic disambiguation, content with semantic repetition or high similarity is filtered out, integrated and merged, and redundancy is removed; the integrated entity set is defined as entity information, and the standardized topic identifier is defined as topic tag; according to the preset structured format, the dialogue base information containing entity information and topic tags is output.

[0040] For example, the domain knowledge graph set is retrieved to obtain the business ontology subgraph entities: flagship model, X model, range, competitor, 72 hours. Semantic disambiguation: the dialogue entity "competitor Y" matches the graph entity "competitor", disambiguating to "competitor"; the dialogue title "New Energy Vehicle Range Comparison Consultation" matches the graph business ontology, confirming no ambiguity. Merging: dialogue entities with no duplicate content are directly retained. Entity information is determined: flagship model, X model, range, 72 hours, competitor; topic tags: range consultation, competitor comparison. Structured output of dialogue base information: {entity information: [flagship model, X model, range, 72 hours, competitor], topic tags: [range consultation, competitor comparison]}.

[0041] In this embodiment of the invention, by acquiring historical dialogue records and current input content, the context of multi-turn dialogues is fully preserved, avoiding the context loss problem caused by single-turn parsing. Relying on the deep semantic parsing capabilities of a large language model, dialogue entities and dialogue titles are accurately extracted, ensuring the comprehensiveness of information extraction. By combining a domain knowledge graph set for semantic disambiguation and merging, entity ambiguity is effectively eliminated and information redundancy is removed, ensuring the accuracy and standardization of entity information and topic tags. Finally, the structured output of dialogue base information provides accurate and reliable input data for subsequent domain knowledge graph path retrieval and matching, and dynamic prompt word generation, reducing the risk of information deviation in subsequent steps from the source and improving the overall accuracy of dynamic recognition of multi-turn dialogue intent.

[0042] S3: Based on the dialogue base information, traverse the domain knowledge graph set to perform path retrieval and matching, generate dynamic prompt words according to the path retrieval and matching results, and inject them into the large language model to drive the large language model to generate the intent evaluation conclusion of the input content and the user-oriented dialogue output content.

[0043] In multi-round conversations on corporate social media, the brand persona, compliance rules, and business knowledge associated with different rounds vary, and static, fixed prompts cannot adapt to the dynamic needs of the context. If constraints are not layered according to compliance, persona, and business priorities, issues such as weakened compliance rules, deviations in persona, and inaccuracies in business knowledge can easily arise. Furthermore, the coupling of intent assessment and content generation exposes internal risk judgment logic, impacting the security of compliance audits. Therefore, it is necessary to dynamically retrieve knowledge graph paths based on the dialogue's foundational information, generate dynamic prompts according to the compliance priority principle, and separate internal intent assessment from external dialogue output through two-stage reasoning. This ensures compliance constraint priority, persona consistency, and business accuracy, while also guaranteeing that the assessment process is auditable and leak-proof.

[0044] Step S3 in the method provided in this embodiment of the invention includes: Specifically, based on the dialogue base information, path retrieval and matching are performed by traversing the domain knowledge graph set, and dynamic prompts are generated based on the path retrieval and matching results, including: Using entity information and topic tags in the dialogue base information as shared input, and combining the maximum path retrieval depth of each subgraph's differentiated configuration, the path retrieval is performed by traversing the response subject setting subgraph, the compliance rule subgraph, and the business ontology subgraph to obtain multiple subgraph paths associated with the current dialogue. Encode the triples of multiple subgraph paths into structured constraint text, and label the source subgraph type and risk level; The structured constraint text is sorted according to a preset priority rule and then concatenated to generate the dynamic prompt words.

[0045] First, using the entity information and topic tags in the dialogue base information as shared input, and combining the maximum path retrieval depth configured for each subgraph, path retrieval is performed by traversing the response subject setting subgraph, the compliance rule subgraph, and the business ontology subgraph to obtain multiple subgraph paths associated with the current dialogue. Path retrieval refers to the process of finding related triples along the relationships between entities in the knowledge graph subgraph, starting from a specified entity or tag. The maximum path retrieval depth refers to the preset upper limit of the number of hops for subgraph retrieval extension, limiting the retrieval scope and avoiding invalid traversal. A subgraph path is a logical link formed by connecting multiple consecutively associated triples in the knowledge graph subgraph, carrying related knowledge.

[0046] Specifically, the dialogue base information output by S2 is retrieved, and entity information and topic tags are extracted as the starting point for retrieval; the subgraphs of the responding subject, compliance rules, and business ontology are configured with differentiated maximum path retrieval depths; using entity information and topic tags as shared inputs, the three types of subgraphs are traversed respectively, and the retrieval is extended along entity relationships; triple links that are strongly related to the current dialogue context are filtered, and multiple subgraph paths are output.

[0047] Exemplarily, configure the retrieval depth: the sub-graph depth of the response body setting is 3, the sub-graph depth of the compliance rule is 4, and the sub-graph depth of the business ontology is 3. For the response body setting sub-graph: starting from "Model X" and "Battery life consultation", the retrieval path: <a new energy vehicle, maintain the tone, professional and rigorous>, <professional and rigorous, prohibited to use, Internet slang>; for the compliance rule sub-graph: starting from "Competitor comparison", the retrieval path: <derogating competitors to induce, trigger, unfair competition>, <unfair competition, risk level, red line>; for the business ontology sub-graph: starting from "Model X" and "Battery life", the retrieval path: <Model X, core selling point, 72-hour battery life> corresponds to <Model X, fast charging duration, 30 minutes>. A total of 3 associated sub-graph paths are obtained.

[0048] Secondly, encode the triples of multiple said sub-graph paths into structured constraint texts, and label the source sub-graph type and risk level. Triple encoding is a standardized process of converting knowledge graph triples into natural language constraint statements. The source sub-graph type refers to the category of the knowledge graph sub-graph to which the constraint text belongs, and is divided into the response body setting sub-graph, the compliance rule sub-graph, and the business ontology sub-graph. The risk level refers to the risk level defined by the compliance rule sub-graph, and is divided into the red line level and the warning level.

[0049] Specifically, disassemble the triples of each sub-graph path, execute triple encoding one by one, and convert them into independent constraint statements; label the source sub-graph type for each constraint statement; for the constraint statements generated by the compliance rule sub-graph, additionally label the corresponding risk level; summarize all constraint statements to form a set of structured constraint texts with labels.

[0050] Exemplarily, the constraint of the compliance rule sub-graph: [Compliance rule - Red line] It is prohibited to derogate competitors to avoid triggering the risk of unfair competition; the constraint of the response body setting sub-graph: [Response body setting] The response tone needs to be professional and rigorous, and Internet slang is not allowed; the constraint of the business ontology sub-graph: [Business ontology] The core selling points of Model X are 72-hour battery life and 30-minute fast charging.

[0051] Thirdly, sort the structured constraint texts according to the preset priority rules, and splice them to generate the dynamic prompt words. The preset priority rules refer to the rules that define the sorting order of the structured constraint texts, and the priorities from high to low are: the red line level constraint of the compliance rule sub-graph, the persona constraint of the response body setting sub-graph, the warning level constraint of the compliance rule sub-graph, and the business knowledge context of the business ontology sub-graph. The dynamic prompt words refer to the instruction texts that are dynamically generated according to the dialogue context, integrate hierarchical constraint information, and are used to guide the inference direction of the large language model.

[0052] For example, the generated dynamic prompt message reads: "You are the official account of a new energy vehicle company. Your reply must strictly adhere to the following constraints: [Compliance Rules - Red Lines] Do not disparage competitors to avoid triggering unfair competition risks; [Reply Subject Settings] The tone of your reply must be professional and rigorous, and you must not use internet slang; [Business Subject] The core selling points of Model X are 72 hours of battery life and 30 minutes of fast charging. Please complete the intent assessment before generating a compliant reply."

[0053] This involves injecting the input into a large language model, driving the model to generate intent evaluation conclusions for the input content and user-oriented dialogue output content, including: The dynamic prompt words are used as prompt instructions and are synchronously input into the pre-built large language model along with the input content to drive two-stage reasoning; In the first stage of inference, the large language model performs intent recognition on the input content based on the dynamic prompt words and generates the intent evaluation conclusion. The intent evaluation conclusion includes at least the intent classification result, confidence level and risk label, and the intent evaluation conclusion is not exposed to the user. In the second stage of reasoning, the large language model integrates the intent assessment conclusion with the input content to generate the user-oriented dialogue output content.

[0054] First, the dynamic prompts are used as prompts and are simultaneously input into a pre-built large language model along with the input content to drive two-stage reasoning. Two-stage reasoning refers to the large language model performing reasoning in two steps: first, generating an internal evaluation conclusion; second, generating external output content. The generated dynamic prompts and the current round's input content are then simultaneously input into the pre-built large language model.

[0055] In the first stage of inference, the large language model performs intent recognition on the input content based on the dynamic prompts, generating the intent evaluation conclusion. This intent evaluation conclusion includes at least an intent classification result, a confidence score, and a risk label, and is not exposed to the user. The intent evaluation conclusion refers to the large language model's determination of the input content's intent, including the intent classification result, confidence score, and risk label; it is used internally only and not exposed to the user. The confidence score is a quantitative value representing the accuracy of the large language model's intent classification result, ranging from 0 to 1. The risk label refers to the risk type identifier associated with the identified input content.

[0056] Specifically, the large language model enters the first stage of reasoning, parsing the input content based on dynamic prompts; identifying the intent of the input content, outputting intent classification results, confidence scores, and risk labels, and forming an intent assessment conclusion; the intent assessment conclusion is stored internally and is not displayed to the user.

[0057] For example, the current input is: "Compared to competitor Y, can your X model really achieve a 72-hour battery life?". The first-stage inference output intent assessment conclusion is: {Intent classification result: probing competitor comparison; Confidence: 0.93; Risk label: [Risk of competitor denigrating / inducing]}.

[0058] In the second stage of reasoning, the large language model integrates the intent assessment conclusion with the input content to generate the dialogue output content for the user. Fusion reasoning refers to the reasoning process by which the large language model combines its internal intent assessment conclusion with the original input content to generate compliant and persona-aligned output content. The dialogue output content is a response text presented to the user that conforms to the brand persona, compliance rules, and business knowledge.

[0059] Specifically, the large language model retrieves the intent assessment conclusions generated in the first stage; integrates the intent assessment conclusions, dynamic prompt constraints, and the current input content to enter the second stage of reasoning; avoids illegal expressions corresponding to risk markers, fits the personality of the responding subject, and matches business knowledge; and generates natural, fluent, compliant, and controllable dialogue output content for display to the user.

[0060] For example, the second-stage reasoning generates the following dialogue output: "Thank you for your interest! Our X model boasts a battery life of up to 72 hours and fast charging in just 30 minutes, focusing on users' needs for long-range travel. For more product details, please feel free to contact us~".

[0061] In this embodiment of the invention, differentiated deep retrieval of three types of knowledge graph subgraphs accurately matches the knowledge associated with the current dialogue, avoiding interference from irrelevant knowledge; triple encoding and hierarchical priority sorting ensure that compliance red line constraints take precedence, personality constraints are stable, and business knowledge is accurate, solving the problems of poor adaptability of static prompt words and chaotic constraint priorities; two-stage reasoning separates internal risk assessment from external output, and the intent assessment conclusion is not exposed, ensuring the security of compliance audit; the final generated dialogue output content simultaneously meets compliance requirements, brand personality, and business accuracy, effectively avoiding violation risks and improving the consistency of user interaction experience and brand image.

[0062] S4: Based on the intent assessment conclusion, maintain the intent evolution trajectory of the current dialogue, and combine it with the preset intent pattern library to perform pattern matching-based risk labeling and calculate the cumulative risk score.

[0063] In multi-round conversations on enterprise social media, user intent often evolves gradually and subtly. Single-round intent assessments can easily overlook the risk transmission patterns across rounds, leading to missed detections of hidden risks. Relying solely on single-round risk marking cannot quantify the cumulative risk across multiple rounds, and frequent shifts in intent and differences in interaction friendliness can alter the actual risk level, directly impacting the accuracy of subsequent risk management decisions. Therefore, it is necessary to maintain a time-seriesd intent evolution trajectory, identify risk evolution patterns through intent pattern matching, quantify cumulative risk scores, and combine these with intent shift levels and friendliness calibration scores to achieve dynamic, accurate, and interaction-relevant risk assessments, providing a reliable basis for subsequent output gating.

[0064] Step S4 in the method provided in this embodiment of the invention includes: The intent evaluation conclusion of the current round is appended to the intent evolution trajectory corresponding to the historical dialogue record. The intent evolution trajectory is the intent evolution sequence of the current dialogue, including multiple rounds of intent evaluation conclusions arranged in chronological order. On the intent evolution trajectory, an intent subsequence of a preset sliding window length is extracted, and sequence matching is performed with the risk evolution patterns in the intent pattern library. The similarity is calculated, and the one with the highest similarity is selected as the pattern matching result. When the similarity of the pattern matching results exceeds a preset pattern matching threshold, the risk tag associated with the risk evolution pattern is added to the risk tag of the current round. Based on the risk level quantification value corresponding to the risk marker in the current round, the similarity in the pattern matching results, and the frequency of consecutive occurrences of the risk marker, a weighted sum is performed according to a preset weight to calculate the risk increment of the current round. The risk increment is then added to the cumulative risk score to obtain the updated cumulative risk score.

[0065] The construction of the preset intent pattern library includes: Obtain historical dialogue logs of the target dialogue scenario and the corresponding approximate dialogue scenario, and combine them with a large language model to traverse the historical dialogue records to perform intent marking and obtain the corresponding intent evolution sequence. Clustering is performed based on the intent evolution sequence, and multiple risk evolution patterns are defined according to the clustering results. Each risk evolution pattern is represented by the intent evolution sequence, and the intent evolution sequence consists of multiple intent nodes arranged in sequence. By integrating the evaluation results of expert systems and manual assessments, each risk evolution pattern is labeled with an associated risk level and pattern description, and the labeled risk evolution patterns are stored to obtain the intent pattern library.

[0066] First, historical dialogue logs of the target dialogue scenario and its corresponding approximate dialogue scenarios are obtained. A large language model is then used to traverse these historical dialogue records and perform intent tagging to obtain the corresponding intent evolution sequence. The historical dialogue log refers to an archived collection of all completed interactive conversation text, interaction time, user identifiers, and other data under the target dialogue scenario and its approximate scenarios. Approximate dialogue scenarios refer to scenarios with similar interaction forms and business attributes to the target scenario, such as customer service inquiries, after-sales feedback, and product evaluation interaction scenarios in enterprises. Intent tagging refers to the process by which the large language model labels the content of each round of interaction in the historical dialogue logs, classifying intent, determining confidence levels, and identifying risks. The intent evolution sequence refers to the set of intent tagging results arranged chronologically by round in a single historical conversation, reflecting the intent change process within a single conversation.

[0067] Specifically, the system collects all historical dialogue logs of the target dialogue scenario and similar dialogue scenarios, removes duplicates, and filters valid conversations. It then splits the historical dialogue logs by conversation dimension and iterates through the interaction content of each round of each conversation. The system calls a large language model to perform intent tagging on the interaction content of each round, and outputs the single-round intent classification, confidence level, and risk tag. The system summarizes the intent tagging results of all rounds of a single conversation in the round time sequence to generate a single-conversation intent evolution sequence. Finally, the system summarizes the intent evolution sequences of all valid conversations to form an intent evolution sequence set.

[0068] For example, historical dialogue logs of the target scenario and similar scenarios are collected, and 1000 valid conversations are filtered out. One competitor-related conversation is traversed: round 1 (battery life consultation), round 2 (parameter confirmation), round 3 (competitor mention), and round 4 (inducing comparison). After being labeled by the large language model, the intention evolution sequence of this conversation is generated: [product battery life consultation, battery life parameter confirmation, initial mention of competitor, inducing comparison of competitor].

[0069] Secondly, clustering is performed based on the intent evolution sequence, and multiple risk evolution patterns are defined according to the clustering results. Each risk evolution pattern is represented by the intent evolution sequence, and the intent evolution sequence consists of multiple intent nodes arranged sequentially. Clustering refers to a data grouping technique that classifies semantically similar intent evolution sequences with similar evolutionary patterns into the same category. A risk evolution pattern is a temporal sequence composed of multiple consecutively arranged intent nodes, representing common risk development patterns in multi-turn dialogues. An intent node is a single intent unit in a risk evolution pattern, corresponding to the intent classification result of a single-turn interaction.

[0070] Specifically, semantic features of intent nodes are extracted from the set of intent evolution sequences. The K-means clustering algorithm is used to perform unsupervised clustering of the intent evolution sequences, dividing them into N clusters. Common temporal patterns of intent evolution sequences within each cluster are analyzed, and core intent node combinations are extracted. These extracted temporal intent node combinations are defined as risk evolution patterns, with each pattern being an independent intent evolution sequence.

[0071] For example, clustering 1000 intent evolution sequences yields 5 clusters; analyzing one of these clusters reveals a common pattern: normal consultation, boundary probing, and induced comparison; this pattern is defined as risk evolution pattern A: [normal product consultation, boundary probing, and induced competitor comparison].

[0072] Next, by integrating the assessment results from the expert system and manual evaluation, each risk evolution pattern is labeled with its associated risk level and pattern description. Multiple labeled risk evolution patterns are then stored to obtain the intent pattern library. The expert system is an intelligent decision-making system that integrates industry compliance knowledge and risk management experience to assist in risk level determination. The risk level refers to the severity of the risk corresponding to the risk evolution pattern, divided into three levels: red, yellow, and green. The pattern description refers to a textual explanation of the interaction characteristics, risk transmission logic, and harmful impact of the risk evolution pattern. The intent pattern library is a structured database storing multiple labeled risk evolution patterns for subsequent pattern matching.

[0073] Specifically, all risk evolution patterns are retrieved. An expert system is invoked, and in conjunction with industry compliance rules, a preliminary risk level is determined for each pattern, generating a pattern description. Human assessment personnel in the compliance field review the expert system's judgment results, revising the risk level and pattern description. The revised risk level and pattern description are then assigned to each risk evolution pattern. All labeled risk evolution patterns are stored uniformly to form an intent pattern library.

[0074] For example, risk evolution pattern A is retrieved: [Normal product consultation, boundary probing, inducing competitor comparison]. The expert system initially determines that the risk level is yellow, and the pattern description is "The user gradually probes from normal consultation, ultimately inducing and disparaging competitors, posing a risk of unfair competition." The judgment result is manually reviewed and confirmed, and the labeling is completed. Pattern A and the labeling information are stored and added to the intent pattern library.

[0075] Furthermore, the intent evaluation conclusion of the current round is appended to the intent evolution trajectory corresponding to the historical dialogue record. The intent evolution trajectory is the intent evolution sequence of the current dialogue, including multiple rounds of intent evaluation conclusions arranged chronologically. The intent evolution trajectory refers to the sequence of multiple rounds of intent evaluation conclusions arranged chronologically according to the dialogue rounds in the current interactive session, completely recording the dynamic change process of intent. The historical dialogue record refers to the set of interactive texts and corresponding intent data completed before the current round in the current session.

[0076] Specifically, the system retrieves the historical intent evolution trajectory maintained in the current interaction session and extracts the intent evaluation conclusion for the current round. This conclusion is then appended chronologically to the end of the historical intent evolution trajectory to create the latest trajectory. The updated intent evolution trajectory is stored for subsequent pattern matching and risk analysis.

[0077] For example, the historical intent evolution trajectory is as follows: {Round 1: Intent Classification: Product Battery Life Consultation; Confidence Level: 0.95; Risk Marker: None}, {Round 2: Intent Classification: Battery Life Parameter Confirmation; Confidence Level: 0.94; Risk Marker: None}, {Round 3: Intent Classification: Battery Life Authenticity Verification; Confidence Level: 0.91; Risk Marker: None}. The current round intent assessment conclusion is: {Intent Classification: Probing Competitor Comparison; Confidence Level: 0.93; Risk Marker: Risk of Competitor Disparaging and Inducing}. The updated intent evolution trajectory is: adding the current round conclusion to form a time-series sequence containing data from four rounds.

[0078] Then, on the intent evolution trajectory, intent sub-sequences of a preset sliding window length are extracted and sequence-matched with risk evolution patterns in the intent pattern library. Similarity is calculated, and the pattern with the highest similarity is selected as the pattern matching result. The sliding window length refers to the preset upper limit of the number of rounds in which intent sub-sequences are extracted, limiting the temporal range of pattern matching. An intent sub-sequence is a continuous sequence of intent nodes with a length equal to the sliding window length, extracted from the end of the intent evolution trajectory. Sequence matching refers to the process of calculating the semantic similarity between the intent sub-sequence and the intent nodes in the risk evolution pattern, and matching the most similar risk pattern. Similarity is a numerical value that quantifies the degree of semantic matching between the intent sub-sequence and the risk evolution pattern, ranging from 0 to 1.

[0079] Specifically, a preset sliding window length is used to retrieve the updated intent evolution trajectory. A continuous sequence of intent nodes with a length equal to the sliding window length is extracted from the end of the intent evolution trajectory to generate an intent subsequence. The constructed intent pattern library is retrieved, and all risk evolution patterns are traversed. The similarity between the intent subsequence and each risk evolution pattern is calculated: using the same large language model, corresponding embedding vectors are generated for each intent node in both the intent subsequence and the risk evolution pattern. The cosine similarity between the embedding vectors of corresponding intent nodes is calculated position by position. The sum of the cosine similarities for all positions is then divided by the total number of positions to obtain the final sequence similarity between the intent subsequence and the risk evolution pattern. The risk evolution pattern with the highest similarity is selected as the pattern matching result.

[0080] For example, the preset sliding window length is 3, and the last 3 rounds of intent evolution trajectory are intent nodes: [battery range parameter confirmation, battery range authenticity verification, and competitor comparison], generating intent subsequences; the intent pattern library is traversed, and the similarity with pattern A [normal product consultation, boundary probing, and induce competitor comparison] is calculated to be 0.85.

[0081] Furthermore, when the similarity of the pattern matching results exceeds a preset pattern matching threshold, the risk marker associated with the risk evolution pattern is added to the risk markers of the current round. The pattern matching threshold is a preset similarity judgment threshold used to determine whether the matching result is valid. If the similarity exceeds the pattern matching threshold, the risk marker associated with the pattern is added to the risk markers of the current round; otherwise, no new risk marker is added.

[0082] For example, the pattern matching threshold is 0.7, the similarity is 0.85 > 0.7, and the matching result is pattern A; the risk associated with pattern A is marked as "risk of inducing competitor comparison", which is added to the current round of risk marking, and the current round of risk marking is updated to [risk of inducing competitor denigration; risk of inducing competitor comparison].

[0083] Finally, based on the risk level quantification value corresponding to the risk marker in the current round, the similarity in the pattern matching results, and the frequency of consecutive risk marker occurrences, a weighted sum is calculated according to preset weights to determine the risk increment for the current round. This risk increment is then added to the cumulative risk score to obtain the updated cumulative risk score. The risk level quantification value refers to converting the textual risk level into a numerical value between 0 and 1, with red line = 1.0, yellow line = 0.5, and green line = 0.1. The frequency of consecutive risk marker occurrences refers to the number of consecutive interaction rounds containing the risk marker in the current session, starting from its first appearance.

[0084] The preset weights refer to the weight coefficients assigned to the risk level quantification, pattern matching similarity, and frequency of consecutive risks, satisfying the formula: Risk Level Weight + Similarity Weight + Frequency Weight = 1. The risk increment refers to the newly added risk quantification value in the current round of interaction, calculated by weighted summation. The cumulative risk score is the total risk value obtained by accumulating the risk increments from the start of the session to the current round, ranging from 0 to 1.

[0085] Specifically, the risk level corresponding to the current round of risk markers is extracted and converted into a quantified risk level value. The similarity score from the pattern matching results is retrieved, and the frequency of consecutive risk marker occurrences in the current session is counted. Preset weights are retrieved: risk level weight, similarity weight, and frequency weight. The current round risk increment is calculated as: Risk Increment = Quantified Risk Level Value × Risk Level Weight + Similarity × Similarity Weight + Consecutive Risk Frequency × Frequency Weight. The cumulative risk score from the previous round is retrieved, and the current round risk increment is added to the previous round's cumulative risk score. The maximum value of the accumulated score is limited to 1.0, resulting in the updated cumulative risk score.

[0086] For example, the risk level corresponding to the current round of risk markers is the yellow line, with a quantified value of 0.5, a pattern matching similarity of 0.85, and a consecutive risk frequency of 2. Preset weights: Risk level weight = 0.5, Similarity weight = 0.3, Frequency weight = 0.2; Risk increment = 0.5 × 0.5 + 0.85 × 0.3 + 2 × 0.2 = 0.905. Previous round cumulative risk score = 0.2; Updated cumulative risk score = 0.2 + 0.905 = 1.105, with a maximum value of 1.0, resulting in a final cumulative risk score of 1.0.

[0087] Step S4 in the method provided in this embodiment of the invention further includes: Based on the intent evolution trajectory of the current dialogue, the degree of intent sway is calculated, wherein the degree of intent sway is determined based on the frequency of change of intent type in the intent evolution trajectory; Based on the preset friendliness tendency value corresponding to the intent type, the intent evolution trajectory is traversed and accumulated to obtain the accumulated intent friendliness, and the friendliness is determined, wherein: When the cumulative intention friendliness exceeds a preset positive threshold, the friendliness is positive; when the cumulative intention friendliness is lower than a preset negative threshold, the friendliness is negative; when the cumulative intention friendliness is between the positive threshold and the negative threshold, the friendliness is neutral. Based on the degree of vacillation of intent and the degree of friendliness, determine the correction coefficient: When the degree of intention swing is swinging and the friendliness is neutral, the correction coefficient takes a first correction value greater than 1; When the degree of intention swing is swinging and the friendliness is positive, the correction coefficient takes a second correction value less than 1; When the degree of intention swing is swinging and the friendliness is negative, the correction coefficient takes a third correction value greater than 1; When the degree of intention swing is non-swinging and the friendliness is negative, the correction coefficient takes a fourth correction value greater than 1; When the degree of intention swing is non-swinging and the friendliness is positive, the correction coefficient takes a fifth correction value less than 1; When the degree of intention swing is non-swinging and the friendliness is neutral, the correction coefficient is 1; Wherein, the third correction value is greater than the fourth correction value, the fourth correction value is greater than the first correction value, and the absolute value of the second correction value is less than the absolute value of the fifth correction value; The cumulative risk is corrected by multiplying the correction factor by the updated cumulative risk score.

[0088] First, based on the intent evolution trajectory of the current dialogue, the degree of intent sway is calculated, whereby the degree of intent sway is determined based on the frequency of intent type changes in the intent evolution trajectory. The frequency of intent type changes refers to the number of times the intent classification result changes between two adjacent rounds in the intent evolution trajectory. A frequency change threshold is a preset critical value for the number of intent type changes, used to determine the intent sway state. A sway state refers to the intent fluctuation state when the intent type change frequency exceeds the frequency change threshold. A non-sway state refers to the stable intent state when the intent type change frequency does not exceed the frequency change threshold.

[0089] Specifically, the updated intent evolution trajectory is retrieved, and the intent classification results for all rounds are extracted. The intent classification results of adjacent rounds are compared round by round, and the frequency of intent type changes is statistically analyzed. A preset change frequency threshold is retrieved; the relationship between the change frequency and the threshold is determined: if the intent type change frequency is greater than the preset change frequency threshold, it is determined to be in a wavering state; otherwise, it is determined to be in a non-wavering state. The state result corresponding to the degree of intent wavering is output.

[0090] For example, the intent evolution trajectory is categorized into four rounds: [Product battery life consultation, battery life parameter confirmation, battery life authenticity verification, competitor comparison]. Adjacent round comparisons: Round 1 - Round 2 (change), Round 2 - Round 3 (change), Round 3 - Round 4 (change), intent vacancy level = change frequency = 3. A preset change frequency threshold of 2 is set; if 3 > 2, the intent vacancy level is determined to be in a vacancy state.

[0091] Secondly, based on the preset friendliness tendency value corresponding to the intent type, the intent evolution trajectory is traversed and accumulated to obtain the accumulated intent friendliness, and the friendliness is determined, wherein: When the cumulative intention friendliness exceeds a preset positive threshold, the friendliness is positive; when the cumulative intention friendliness is below a preset negative threshold, the friendliness is negative; when the cumulative intention friendliness is between the positive threshold and the negative threshold, the friendliness is neutral.

[0092] The friendliness tendency value refers to a pre-defined quantitative value for each intent type: positive for positive intents, 0 for neutral intents, and negative for negative intents. The cumulative intent friendliness is the sum of the friendliness tendency values ​​for each intent type across all rounds of the intent evolution trajectory. The positive threshold is a pre-defined positive threshold for cumulative friendliness, used to determine positive friendliness. The negative threshold is a pre-defined negative threshold for cumulative friendliness, used to determine negative friendliness. Positive friendliness refers to the friendly interaction state when the cumulative intent friendliness exceeds the positive threshold. Negative friendliness refers to the friendly interaction state when the cumulative intent friendliness is below the negative threshold. Neutral friendliness refers to the friendly interaction state when the cumulative intent friendliness is between the positive and negative thresholds.

[0093] Specifically, the system retrieves a preset friendliness tendency value table corresponding to each intent type, retrieves the updated intent evolution trajectory, and extracts the intent classification results for all rounds. It iterates through the intent classification results for each round, matching them against the friendliness tendency value table to obtain the corresponding tendency value. It then accumulates the friendliness tendency values ​​from all rounds to calculate the cumulative intent friendliness. Preset positive and negative thresholds are retrieved. The cumulative friendliness range is determined: exceeding the positive threshold: positive; below the negative threshold: negative; between the two: neutral. The friendliness determination result is output.

[0094] For example, the friendliness tendency values ​​are: Product battery life consultation = 1, Battery life parameter confirmation = 1, Battery life authenticity verification = 0, Probing competitor comparison = -1. After traversing 4 rounds of intent, the sum is: 1 + 1 + 0 + (-1) = 1. The preset positive threshold is 5, and the negative threshold is -3. Since 1 falls between -3 and 5, the friendliness is determined to be neutral.

[0095] Furthermore, based on the degree of intent sway and the friendliness, a correction coefficient is determined as follows: when the degree of intent sway is in a swaying state and the friendliness is neutral, the correction coefficient takes a first correction value greater than 1; when the degree of intent sway is in a swaying state and the friendliness is positive, the correction coefficient takes a second correction value less than 1; when the degree of intent sway is in a swaying state and the friendliness is negative, the correction coefficient takes a third correction value greater than 1; when the degree of intent sway is not in a swaying state and the friendliness is negative, the correction coefficient takes a fourth correction value greater than 1; when the degree of intent sway is not in a swaying state and the friendliness is positive, the correction coefficient takes a fifth correction value less than 1; and when the degree of intent sway is not in a swaying state and the friendliness is neutral, the correction coefficient takes 1.

[0096] The correction coefficient is a quantitative value used to calibrate the cumulative risk score, determined based on the combination of the degree of intentional wavering and friendliness. The first correction value is the correction coefficient corresponding to the wavering state plus neutral friendliness, with a value > 1. The second correction value is the correction coefficient corresponding to the wavering state plus positive friendliness, with a value < 1. The third correction value is the correction coefficient corresponding to the wavering state plus negative friendliness, with a value > 1, and the third correction value > the fourth correction value. The fourth correction value is the correction coefficient corresponding to the non-wavering state plus negative friendliness, with a value > 1, and the fourth correction value > the first correction value. The fifth correction value is the correction coefficient corresponding to the non-wavering state plus positive friendliness, with a value < 1, and the absolute value of the second correction value < the absolute value of the fifth correction value.

[0097] Specifically, the intention's degree of sway and friendliness are retrieved, and the combination relationship between the degree of sway and friendliness is matched. Based on the preset numerical relationship, the corresponding correction coefficients are retrieved: sway + neutral corresponds to the first correction value; sway + positive corresponds to the second correction value; sway + negative corresponds to the third correction value; non-sway + negative corresponds to the fourth correction value; non-sway + positive corresponds to the fifth correction value; non-sway + neutral corresponds to correction coefficient = 1; the fourth step is to output the determined correction coefficients.

[0098] For example, intention swing level = swing state, friendliness = neutral. Matching combination: swing + neutral; preset first correction value = 1.2, determined correction coefficient = 1.2.

[0099] Finally, the correction coefficient is multiplied by the updated cumulative risk score to perform cumulative risk correction. Cumulative risk correction refers to the process of calibrating the updated cumulative risk score through the correction coefficient to obtain a final risk score that fits the interaction characteristics. The final cumulative risk score is the corrected risk score, used for subsequent output gating decisions.

[0100] Specifically, the corrected cumulative risk score is calculated as follows: Corrected cumulative risk score = Updated cumulative risk score × Correction coefficient. The maximum corrected score is limited to 1.0, and the minimum is 0, to obtain the final cumulative risk score, which is then output.

[0101] For example, the updated cumulative risk score is 1.0, the correction factor is 1.2; the corrected cumulative risk score is 1.0 × 1.2 = 1.2; the maximum value is limited to 1.0, and the final cumulative risk score is 1.0.

[0102] In this embodiment of the invention, the evolution trajectory of intent is maintained in a time-series manner, and the dynamic changes of intent in multiple rounds are fully recorded, providing time-series data support for risk pattern analysis. The intent pattern library precipitates the common patterns of historical risk evolution, enabling accurate identification and marking of gradual and hidden risks, thus overcoming the limitations of single-round risk assessment. The weighted sum quantifies the cumulative risk score, objectively reflecting the degree of risk accumulation in multiple rounds. By combining the degree of intent sway and friendliness calibration score, the interference of intent fluctuations and interactive emotions on risk assessment is eliminated, improving the accuracy and rationality of risk scoring. The final cumulative risk score provides a reliable and scenario-appropriate decision-making basis for the hierarchical gating of subsequent dialogue output content, effectively reducing the risk of missed or misjudged judgments and helping enterprises to proactively manage social media interaction risks.

[0103] S5: Combine the risk labeling results with the cumulative risk score, and perform gated output of the dialogue output content.

[0104] The content of corporate social media conversations directly impacts brand image and public opinion security. Existing technologies often rely on single risk thresholds for assessment, resulting in coarse-grained grading and simplistic handling methods. This fails to differentiate between medium-risk and high-risk content, leading to the problem of allowing high-risk content while excessively blocking low-risk content. Furthermore, there is a lack of mechanisms for recording and tracing the risk process. Therefore, a two-tiered risk threshold system is needed. Risk levels should be determined based on cumulative risk scores, and differentiated gating strategies should be applied accordingly. This will enable precise blocking of high-risk content, early warning control for medium-risk content, and normal release for low-risk content, while simultaneously retaining early warning logs to ensure compliance, refined management, and risk traceability.

[0105] Step S5 in the method provided in this embodiment of the invention includes: The cumulative risk score is compared with a preset yellow warning threshold and a red interception threshold, wherein the red interception threshold is greater than the yellow warning threshold. When the cumulative risk score is greater than or equal to the red interception threshold, it is determined to be a red risk, and the dialogue output content is intercepted. When the cumulative risk score is greater than or equal to the yellow warning threshold and less than the red interception threshold, it is determined to be a yellow risk, the dialogue output content is subject to restricted access, and a warning log is recorded. When the cumulative risk score is less than the yellow warning threshold, it is determined to be safe, and the dialogue output content is processed normally.

[0106] First, the cumulative risk score is compared with preset yellow warning threshold and red interception threshold, respectively, wherein the red interception threshold is greater than the yellow warning threshold. The yellow warning threshold is a preset medium-risk judgment threshold used to distinguish between a safe state and a warning state, and its value is less than the red interception threshold. The red interception threshold is a preset high-risk judgment threshold used to distinguish between a warning state and an interception state, and its value is greater than the yellow warning threshold.

[0107] Specifically, the preset yellow warning threshold and red interception threshold are retrieved, and it is confirmed that the red interception threshold is greater than the yellow warning threshold. The final cumulative risk score is then compared with the yellow warning threshold and the red interception threshold respectively to determine the risk level range.

[0108] For example, the preset yellow warning threshold is 0.4, the red interception threshold is 0.75, and the final cumulative risk score is 1.0. Numerical comparison: 1.0 ≥ 0.75 and 1.0 > 0.4, indicating that the score falls within the red risk range.

[0109] Secondly, when the accumulated risk score is greater than or equal to the red interception threshold, it is determined to be a red risk, and the dialogue output content is intercepted. A red risk refers to a situation where the accumulated risk score reaches or exceeds the red interception threshold, indicating a high level of violation risk, where the output content poses serious compliance risks and is likely to trigger a major public opinion crisis. The interception process involves prohibiting the output of the original dialogue content to the user, terminating the current interaction output and triggering a high-risk alarm, and, if necessary, blocking the continuation of the session.

[0110] Specifically, if the final cumulative risk score is greater than or equal to the red interception threshold, a red risk is confirmed. The original user-facing dialogue output is intercepted and prohibited from being displayed externally. A compliance fallback text is generated to replace the original output, triggering a high-risk alert and synchronizing the risk information to the compliance management module.

[0111] For example, a cumulative risk score of 1.0 ≥ 0.75 indicates a red risk. The original dialogue output is intercepted: "Thank you for your interest! Our Model X boasts a battery life of up to 72 hours...". A compliance fallback text is output: "Thank you for your inquiry. Please refer to official announcements for relevant product information." A high-risk alarm is triggered, and the alarm information is recorded.

[0112] Furthermore, when the cumulative risk score is greater than or equal to the yellow warning threshold but less than the red interception threshold, it is determined to be a yellow risk. The dialogue output content is then subject to restricted access, and a warning log is recorded. Yellow risk refers to a cumulative risk score greater than or equal to the yellow warning threshold but less than the red interception threshold, indicating a medium potential risk. The output content has minor compliance risks and requires close monitoring. Restricted access means that the dialogue output content is allowed, but compliance verification is required, sensitive expressions are simplified, and the scope of content dissemination is limited. The warning log is a structured data record of yellow risk events, including session identifier, round, risk marker, cumulative risk score, and handling time, used for subsequent review and analysis.

[0113] Specifically, a yellow risk is confirmed when the final cumulative risk score is greater than or equal to the yellow warning threshold but less than the red interception threshold. The original dialogue output is then simplified for compliance purposes, removing vague and sensitive expressions. The simplified dialogue output is then allowed to proceed and displayed to the user. Key information from this session is extracted, a warning log is generated, and it is persistently stored.

[0114] For example, assuming a cumulative risk score of 0.6 ≥ 0.4 and < 0.75, a yellow risk is determined. The original output content is simplified, and the vague statement "far exceeding industry standards" is removed. The simplified content is then allowed: "Thank you for your attention! Our X model has a battery life of up to 72 hours, and fast charging only takes 30 minutes. Welcome to inquire." An early warning log is generated: {Session ID: 123; Round: 4; Risk Marker: [Probing competitor comparison risk]; Cumulative risk score: 0.6; Handling time: 2026-05-14}, and storage is completed.

[0115] Finally, when the cumulative risk score is less than the yellow warning threshold, the system is deemed safe, and the dialogue output content is processed normally. A safe status means the cumulative risk score is less than the yellow warning threshold, indicating no compliance risk, and the output content conforms to brand persona, compliance rules, and business knowledge requirements. Normal processing means directly releasing the originally generated dialogue output content without additional verification or restrictions, and displaying it fully to the user.

[0116] Specifically, if the final cumulative risk score is less than the yellow warning threshold, the safety status is confirmed. The original user-facing dialogue output is directly retrieved. Without additional modification or verification, the output content is normally released to the user. For example, assuming the cumulative risk score = 0.2 < 0.4, the safety status is determined. The original output content is directly released: "Thank you for your attention! Our X model has a battery life of up to 72 hours and fast charging takes only 30 minutes, focusing on users' long-range travel needs. For more product details, please feel free to contact us~", displayed to the user.

[0117] In this embodiment of the invention, by setting two levels of differentiated risk thresholds, a refined classification and judgment of risk levels is achieved, avoiding the one-sidedness of a single threshold judgment; red risk interception and handling precisely blocks the output of high-risk content, avoiding major public opinion crises from the source; yellow risk restricted access balances interactive experience and risk control, and warning log retention enables traceability and review of risk events; normal safe status ensures smooth compliant interaction and improves user experience. This step constructs a clearly graded, precise, and fully traceable output gating mechanism, comprehensively ensuring the compliance and controllability of enterprise social media dialogue output content, and effectively balancing risk control and user interaction experience.

[0118] Through the specific implementation methods described above, the embodiments of the present invention achieve the following technical effects: This invention provides a method and system for dynamic identification and analysis of multi-turn dialogue intent driven by a large language model. It constructs a hierarchical domain knowledge graph as the underlying support, accurately extracts basic dialogue information through multi-turn contextual semantic parsing, dynamically retrieves prioritized prompts based on the knowledge graph, and injects them into the large language model to achieve two-stage reasoning. Simultaneously, it maintains the intent evolution trajectory temporally, identifies hidden risks through pattern matching, and quantifies and corrects accumulated risk scores. Finally, it executes refined gating output based on hierarchical thresholds. This invention achieves dynamic integration of domain knowledge and the large language model, overcoming the limitations of poor adaptability of static prompts, one-sided single-turn intent identification, and missed detection of hidden risks. It accurately captures the dynamic evolution patterns of multi-turn dialogue intent and identifies potential risks in advance. The hierarchical control mechanism balances risk prevention and user interaction experience, ensuring that the content of corporate social media dialogue outputs conforms to brand persona, corporate culture, and compliance requirements throughout the process. It achieves accurate intent identification, refined risk control, and compliant interaction output, constructing a fully controllable, traceable, and auditable multi-turn dialogue intent dynamic identification and compliance control system, effectively avoiding public opinion crises and improving brand interaction consistency and security.

[0119] Example 2, as Figure 3 As shown, this invention provides a multi-turn dialogue intent dynamic recognition and analysis system driven by a large language model, the system comprising: The knowledge graph acquisition module 11 is used to acquire a domain knowledge graph set for a target dialogue scenario, wherein the domain knowledge graph set includes at least a response subject setting subgraph, a compliance rule subgraph, and a business ontology subgraph; The semantic parsing module 12 is used to obtain historical dialogue records and the input content of the current round, and to perform semantic parsing through a large language model to extract entity information and topic tags from the current dialogue context as dialogue base information; The path retrieval and matching module 13 is used to perform path retrieval and matching by traversing the domain knowledge graph set based on the dialogue base information, generate dynamic prompt words according to the path retrieval and matching results, and inject them into the large language model to drive the large language model to generate the intent evaluation conclusion of the input content and the user-oriented dialogue output content. The risk score calculation module 14 is used to maintain the intent evolution trajectory of the current dialogue based on the intent assessment conclusion, and to perform pattern matching-based risk labeling in conjunction with a preset intent pattern library to calculate the cumulative risk score. The gating output control module 15 is used to combine the risk marking results with the cumulative risk score to perform gating output of the dialogue output content.

[0120] In one embodiment, the knowledge graph acquisition module 11 is further configured to: Define the entity types and relationship types corresponding to the response subject setting subgraph, the compliance rule subgraph, and the business ontology subgraph, respectively; Based on the target dialogue scenario, domain documents are used to extract knowledge, and based on the defined entity type and relation type, they are instantiated in the form of triples to construct the response subject setting subgraph, the compliance rule subgraph and the business ontology subgraph respectively. The completed response subject setting subgraph, compliance rule subgraph, and business ontology subgraph are stored in a graph database and a retrieval index is established to obtain the domain knowledge graph set; The compliance rules subgraph includes positive example dialogue entities and negative example dialogue entities.

[0121] In one embodiment, the semantic parsing module 12 is further configured to: Get the input content of the current round and the corresponding historical dialogue records of the previous N rounds, where N is the preset context window length and N is greater than 2; The input content is concatenated with the historical dialogue record to form a semantic parsing input. A large language model is used to perform semantic parsing on the semantic parsing input to extract the dialogue entity and dialogue title corresponding to the current dialogue context. By combining the domain knowledge graph set, semantic disambiguation and merging are performed on the dialogue entities and the dialogue titles to obtain the entity information and the topic tags, and the structured output is used as the dialogue base information.

[0122] In one embodiment, the path retrieval and matching module 13 is further configured to: Specifically, based on the dialogue base information, path retrieval and matching are performed by traversing the domain knowledge graph set, and dynamic prompts are generated based on the path retrieval and matching results, including: Using entity information and topic tags in the dialogue base information as shared input, and combining the maximum path retrieval depth of each subgraph's differentiated configuration, the path retrieval is performed by traversing the response subject setting subgraph, the compliance rule subgraph, and the business ontology subgraph to obtain multiple subgraph paths associated with the current dialogue. Encode the triples of multiple subgraph paths into structured constraint text, and label the source subgraph type and risk level; The structured constraint text is sorted according to a preset priority rule and then concatenated to generate the dynamic prompt words.

[0123] This involves injecting the input into a large language model, driving the model to generate intent evaluation conclusions for the input content and user-oriented dialogue output content, including: The dynamic prompt words are used as prompt instructions and are synchronously input into the pre-built large language model along with the input content to drive two-stage reasoning; In the first stage of inference, the large language model performs intent recognition on the input content based on the dynamic prompt words and generates the intent evaluation conclusion. The intent evaluation conclusion includes at least the intent classification result, confidence level and risk label, and the intent evaluation conclusion is not exposed to the user. In the second stage of reasoning, the large language model integrates the intent assessment conclusion with the input content to generate the user-oriented dialogue output content.

[0124] In one embodiment, the risk scoring calculation module 14 is further configured to: The intent evaluation conclusion of the current round is appended to the intent evolution trajectory corresponding to the historical dialogue record. The intent evolution trajectory is the intent evolution sequence of the current dialogue, including multiple rounds of intent evaluation conclusions arranged in chronological order. On the intent evolution trajectory, an intent subsequence of a preset sliding window length is extracted, and sequence matching is performed with the risk evolution patterns in the intent pattern library. The similarity is calculated, and the one with the highest similarity is selected as the pattern matching result. When the similarity of the pattern matching results exceeds a preset pattern matching threshold, the risk tag associated with the risk evolution pattern is added to the risk tag of the current round. Based on the risk level quantification value corresponding to the risk marker in the current round, the similarity in the pattern matching results, and the frequency of consecutive occurrences of the risk marker, a weighted sum is performed according to a preset weight to calculate the risk increment of the current round. The risk increment is then added to the cumulative risk score to obtain the updated cumulative risk score.

[0125] The construction of the preset intent pattern library includes: Obtain historical dialogue logs of the target dialogue scenario and the corresponding approximate dialogue scenario, and combine them with a large language model to traverse the historical dialogue records to perform intent marking and obtain the corresponding intent evolution sequence. Clustering is performed based on the intent evolution sequence, and multiple risk evolution patterns are defined according to the clustering results. Each risk evolution pattern is represented by the intent evolution sequence, and the intent evolution sequence consists of multiple intent nodes arranged in sequence. By integrating the evaluation results of expert systems and manual assessments, each risk evolution pattern is labeled with an associated risk level and pattern description, and the labeled risk evolution patterns are stored to obtain the intent pattern library.

[0126] In one embodiment, the risk scoring calculation module 14 is further configured to: Based on the intent evolution trajectory of the current dialogue, the degree of intent sway is calculated, wherein the degree of intent sway is determined based on the frequency of change of intent type in the intent evolution trajectory; Based on the preset friendliness tendency value corresponding to the intent type, the intent evolution trajectory is traversed and accumulated to obtain the accumulated intent friendliness, and the friendliness is determined, wherein: When the cumulative intention friendliness exceeds a preset positive threshold, the friendliness is positive; when the cumulative intention friendliness is lower than a preset negative threshold, the friendliness is negative; when the cumulative intention friendliness is between the positive threshold and the negative threshold, the friendliness is neutral. Based on the degree of vacillation of intent and the degree of friendliness, determine the correction coefficient: When the degree of intention swing is swinging and the friendliness is neutral, the correction coefficient takes a first correction value greater than 1; When the degree of intention swing is swinging and the friendliness is positive, the correction coefficient takes a second correction value less than 1; When the degree of intention swing is swinging and the friendliness is negative, the correction coefficient takes a third correction value greater than 1; When the degree of intention swing is non-swinging and the friendliness is negative, the correction coefficient takes a fourth correction value greater than 1; When the degree of intention swing is non-swinging and the friendliness is positive, the correction coefficient takes a fifth correction value less than 1; When the degree of intention swing is non-swinging and the friendliness is neutral, the correction coefficient is 1; Wherein, the third correction value is greater than the fourth correction value, the fourth correction value is greater than the first correction value, and the absolute value of the second correction value is less than the absolute value of the fifth correction value; The cumulative risk is corrected by multiplying the correction factor by the updated cumulative risk score.

[0127] In one embodiment, the gated output control module 15 is further configured to: The cumulative risk score is compared with a preset yellow warning threshold and a red interception threshold, wherein the red interception threshold is greater than the yellow warning threshold. When the cumulative risk score is greater than or equal to the red interception threshold, it is determined to be a red risk, and the dialogue output content is intercepted. When the cumulative risk score is greater than or equal to the yellow warning threshold and less than the red interception threshold, it is determined to be a yellow risk, the dialogue output content is subject to restricted access, and a warning log is recorded. When the cumulative risk score is less than the yellow warning threshold, it is determined to be safe, and the dialogue output content is processed normally.

[0128] It should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for dynamic recognition and analysis of multi-turn dialogue intent driven by a large language model, characterized in that, include: Obtain a domain knowledge graph set for the target dialogue scenario, wherein the domain knowledge graph set includes at least a response subject setting subgraph, a compliance rule subgraph, and a business ontology subgraph; The system acquires historical dialogue records and current input content, performs semantic parsing using a large language model, and extracts entity information and topic tags from the current dialogue context as dialogue base information. Based on the dialogue base information, the domain knowledge graph set is traversed to perform path retrieval and matching. Dynamic prompt words are generated according to the path retrieval and matching results and injected into the large language model to drive the large language model to generate the intent evaluation conclusion of the input content and the user-oriented dialogue output content. Based on the intent assessment conclusion, maintain the intent evolution trajectory of the current dialogue, and combine it with a preset intent pattern library to perform pattern matching-based risk labeling and calculate the cumulative risk score; Based on the risk labeling results and the cumulative risk score, perform gated output of the dialogue output content; Specifically, based on the dialogue base information, path retrieval and matching are performed by traversing the domain knowledge graph set, and dynamic prompts are generated based on the path retrieval and matching results, including: Using entity information and topic tags in the dialogue base information as shared input, and combining the maximum path retrieval depth of each subgraph's differentiated configuration, the path retrieval is performed by traversing the response subject setting subgraph, the compliance rule subgraph, and the business ontology subgraph to obtain multiple subgraph paths associated with the current dialogue. Encode the triples of multiple subgraph paths into structured constraint text, and label the source subgraph type and risk level; The structured constraint text is sorted according to a preset priority rule and then concatenated to generate the dynamic prompt words.

2. The method for dynamic recognition and analysis of multi-turn dialogue intent driven by a large language model as described in claim 1, characterized in that, Obtain a domain knowledge graph set for the target dialogue scenario, wherein the domain knowledge graph set includes at least a response subject setting subgraph, a compliance rule subgraph, and a business ontology subgraph, including: Define the entity types and relationship types corresponding to the response subject setting subgraph, the compliance rule subgraph, and the business ontology subgraph, respectively; Based on the target dialogue scenario, domain documents are used to extract knowledge, and based on the defined entity type and relation type, they are instantiated in the form of triples to construct the response subject setting subgraph, the compliance rule subgraph and the business ontology subgraph respectively. The completed response subject setting subgraph, compliance rule subgraph, and business ontology subgraph are stored in a graph database and a retrieval index is established to obtain the domain knowledge graph set; The compliance rules subgraph includes positive example dialogue entities and negative example dialogue entities.

3. The method for dynamic recognition and analysis of multi-turn dialogue intent driven by a large language model as described in claim 1, characterized in that, The system acquires historical dialogue records and the input content of the current round, and performs semantic parsing using a large language model to extract entity information and topic tags from the current dialogue context as the dialogue's base information, including: Get the input content of the current round and the corresponding historical dialogue records of the previous N rounds, where N is the preset context window length and N is greater than 2; The input content is concatenated with the historical dialogue record to form a semantic parsing input. A large language model is used to perform semantic parsing on the semantic parsing input to extract the dialogue entity and dialogue title corresponding to the current dialogue context. By combining the domain knowledge graph set, semantic disambiguation and merging are performed on the dialogue entities and the dialogue titles to obtain the entity information and the topic tags, and the structured output is used as the dialogue base information.

4. The method for dynamic recognition and analysis of multi-turn dialogue intent driven by a large language model as described in claim 1, characterized in that, Injected into a large language model, driving the large language model to generate intent evaluation conclusions for the input content and user-oriented dialogue output content, including: The dynamic prompt words are used as prompt instructions and are synchronously input into the pre-built large language model along with the input content to drive two-stage reasoning; In the first stage of inference, the large language model performs intent recognition on the input content based on the dynamic prompt words and generates the intent evaluation conclusion. The intent evaluation conclusion includes at least the intent classification result, confidence level and risk label, and the intent evaluation conclusion is not exposed to the user. In the second stage of reasoning, the large language model integrates the intent assessment conclusion with the input content to generate the user-oriented dialogue output content.

5. The method for dynamic recognition and analysis of multi-turn dialogue intent driven by a large language model as described in claim 1, characterized in that, The construction of the pre-defined intent pattern library includes: Obtain historical dialogue logs of the target dialogue scenario and the corresponding approximate dialogue scenario, and combine them with a large language model to traverse the historical dialogue records to perform intent marking and obtain the corresponding intent evolution sequence. Clustering is performed based on the intent evolution sequence, and multiple risk evolution patterns are defined according to the clustering results. Each risk evolution pattern is represented by the intent evolution sequence, and the intent evolution sequence consists of multiple intent nodes arranged in sequence. By integrating the evaluation results of expert systems and manual assessments, each risk evolution pattern is labeled with an associated risk level and pattern description, and the labeled risk evolution patterns are stored to obtain the intent pattern library.

6. The method for dynamic recognition and analysis of multi-turn dialogue intent driven by a large language model as described in claim 1, characterized in that, Based on the intent assessment conclusion, the intent evolution trajectory of the current dialogue is maintained, and risk labeling based on pattern matching is performed in conjunction with a preset intent pattern library to calculate a cumulative risk score, including: The intent evaluation conclusion of the current round is appended to the intent evolution trajectory corresponding to the historical dialogue record. The intent evolution trajectory is the intent evolution sequence of the current dialogue, including multiple rounds of intent evaluation conclusions arranged in chronological order. On the intent evolution trajectory, a subsequence of intent of a preset sliding window length is extracted and matched with the risk evolution patterns in the intent pattern library. Similarity is calculated, and the pattern with the highest similarity is selected as the pattern matching result, including: The sliding window length is preset, the updated intent evolution trajectory is retrieved, and continuous intent nodes with a length equal to the sliding window length are extracted from the end of the intent evolution trajectory to generate an intent subsequence. The constructed intent pattern library is retrieved, all risk evolution patterns are traversed, and the similarity between the intent subsequence and each risk evolution pattern is calculated: using the same large language model, corresponding embedding vectors are generated for each position of the intent node in the intent subsequence and the risk evolution pattern, the cosine similarity between the corresponding intent node embedding vectors is calculated position by position, and then the cosine similarity of all positions is summed and divided by the total number of positions to obtain the final sequence similarity between the intent subsequence and the risk evolution pattern. The risk evolution pattern corresponding to the maximum similarity is selected as the pattern matching result; When the similarity of the pattern matching results exceeds a preset pattern matching threshold, the risk tag associated with the risk evolution pattern is added to the risk tag of the current round. Based on the risk level quantification value corresponding to the risk marker in the current round, the similarity in the pattern matching results, and the frequency of consecutive occurrences of the risk marker, a weighted sum is performed according to a preset weight to calculate the risk increment of the current round. The risk increment is then added to the cumulative risk score to obtain the updated cumulative risk score.

7. The method for dynamic recognition and analysis of multi-turn dialogue intent driven by a large language model as described in claim 1, characterized in that, Based on the risk labeling results and the cumulative risk score, the gating output of the dialogue output content is performed, including: The cumulative risk score is compared with a preset yellow warning threshold and a red interception threshold, wherein the red interception threshold is greater than the yellow warning threshold. When the cumulative risk score is greater than or equal to the red interception threshold, it is determined to be a red risk, and the dialogue output content is intercepted. When the cumulative risk score is greater than or equal to the yellow warning threshold and less than the red interception threshold, it is determined to be a yellow risk, the dialogue output content is subject to restricted access, and a warning log is recorded. When the cumulative risk score is less than the yellow warning threshold, it is determined to be safe, and the dialogue output content is processed normally.

8. The method for dynamic recognition and analysis of multi-turn dialogue intent driven by a large language model as described in claim 6, characterized in that, Also includes: Based on the intent evolution trajectory of the current dialogue, the degree of intent sway is calculated, wherein the degree of intent sway is determined based on the frequency of change of intent type in the intent evolution trajectory; Based on the preset friendliness tendency value corresponding to the intent type, the intent evolution trajectory is traversed and accumulated to obtain the accumulated intent friendliness, and the friendliness is determined, wherein: When the cumulative intention friendliness exceeds a preset positive threshold, the friendliness is positive; when the cumulative intention friendliness is lower than a preset negative threshold, the friendliness is negative; when the cumulative intention friendliness is between the positive threshold and the negative threshold, the friendliness is neutral. Based on the degree of vacillation of intent and the degree of friendliness, determine the correction coefficient: When the degree of intention swing is swinging and the friendliness is neutral, the correction coefficient takes a first correction value greater than 1; When the degree of intention swing is swinging and the friendliness is positive, the correction coefficient takes a second correction value less than 1; When the degree of intention swing is swinging and the friendliness is negative, the correction coefficient takes a third correction value greater than 1; When the degree of intention swing is non-swinging and the friendliness is negative, the correction coefficient takes a fourth correction value greater than 1; When the degree of intention swing is non-swinging and the friendliness is positive, the correction coefficient takes a fifth correction value less than 1; When the degree of intention swing is non-swinging and the friendliness is neutral, the correction coefficient is 1; Wherein, the third correction value is greater than the fourth correction value, the fourth correction value is greater than the first correction value, and the absolute value of the second correction value is less than the absolute value of the fifth correction value; The cumulative risk is corrected by multiplying the correction factor by the updated cumulative risk score.

9. A multi-turn dialogue intent dynamic recognition and analysis system driven by a large language model, characterized in that: The method for implementing the large language model-driven multi-turn dialogue intent dynamic recognition and analysis method according to any one of claims 1-8 includes: The knowledge graph acquisition module is used to acquire a domain knowledge graph set for the target dialogue scenario, wherein the domain knowledge graph set includes at least a response subject setting subgraph, a compliance rule subgraph, and a business ontology subgraph; The semantic parsing module is used to obtain historical dialogue records and the input content of the current round, and performs semantic parsing through a large language model to extract entity information and topic tags from the current dialogue context as dialogue base information; The path retrieval and matching module is used to perform path retrieval and matching by traversing the domain knowledge graph set based on the dialogue base information, generate dynamic prompt words according to the path retrieval and matching results, and inject them into the large language model to drive the large language model to generate the intent evaluation conclusion of the input content and the user-oriented dialogue output content. The risk score calculation module is used to maintain the intent evolution trajectory of the current dialogue based on the intent assessment conclusion, and to perform pattern matching-based risk labeling in conjunction with a preset intent pattern library to calculate the cumulative risk score. The gating output control module is used to combine the risk marking results with the cumulative risk score to perform gating output of the dialogue output content.