An intelligent customer service dialogue system based on multi-source data fusion and emotion perception

The intelligent customer service dialogue system, which integrates multi-source data fusion and emotion perception, solves the problems of inaccurate intent representation, data fragmentation, and lack of emotion in existing technologies. It achieves efficient, coherent, and emotion-aware complex dialogue services, improving the system's robustness and conversion rate.

CN122262291APending Publication Date: 2026-06-23GUANGZHOU TEAM-E DIGITAL TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGZHOU TEAM-E DIGITAL TECHNOLOGY CO LTD
Filing Date
2026-04-10
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

Existing intelligent customer service systems suffer from inaccurate intent representation in complex business scenarios, fragmented multi-source heterogeneous data, lack of implicit emotional feature perception, and easy decay of long-term context. As a result, the system cannot provide accurate, coherent, and emotionally perceptive high-quality services when faced with complex multi-turn dialogues.

Method used

An intelligent customer service dialogue system based on multi-source data fusion and emotion perception is adopted and constructed through a ten-layer technical architecture, including fine-grained access control in a multi-tenant environment, traffic shaping and global distributed link tracing based on token algorithm, query rewriting technology combining few-shot context learning and hypothetical document embedding, a hybrid model of sliding window mechanism and state flow graph, a decision engine layer integrating thinking chain and thinking tree reasoning paradigms, a hybrid retrieval architecture and reinforcement learning operators, to achieve efficient fusion of multi-source data and emotion-driven risk control.

Benefits of technology

It significantly improved the accuracy of long-tail knowledge retrieval, reduced system response latency, increased the success rate of intercepting potential customer complaints, enhanced the system's robustness and adversarial sample defense capabilities, reduced the workload of redundant human agents, and improved the conversion rate and availability of complex services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122262291A_ABST
    Figure CN122262291A_ABST
Patent Text Reader

Abstract

The application discloses an intelligent customer service dialogue system based on multi-source data fusion and emotion perception. The system constructs a six-layer core architecture covering the user and channel layer, the interface layer, the workflow arrangement layer, the core capability layer, the state and data service layer, and the infrastructure and external dependency layer. Based on this bottom layer architecture, the system sequentially executes four core technical processing procedures: first, multi-source data hierarchical retrieval is carried out through a large model drive to fuse cross-source information; second, emotion-driven risk control is carried out to dynamically map intervention strategies; for multi-round interaction, accurate commodity context follow-up question recovery is realized; finally, a large model reasoning tool is called, and external tools are cooperated to close loop complex business. The application effectively suppresses the large model illusion, and significantly improves the retrieval accuracy, emotion perception depth and business automation processing rate of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of artificial intelligence technology, specifically relating to an intelligent customer service dialogue system based on Retrieval-Augmented Generation (RAG) and Large Language Model (LLM). In particular, this invention relates to an intelligent customer service workflow orchestration technology that includes a multi-source data hierarchical retrieval mechanism for customer service scenarios, an emotion-driven risk control strategy, and a product context follow-up inquiry recovery method. Background Technology

[0002] With the continued expansion of the e-commerce and online service industries, intelligent customer service systems have been deeply embedded in enterprise operation systems, becoming a core technical support that balances service quality and cost-effectiveness. However, when the system is truly implemented in complex real customer service scenarios, the systemic defects exposed by existing technical solutions are profound and intertwined.

[0003] The primary bottleneck is the loss of control over retrieval capabilities: Traditional retrieval-enhanced generation systems use fixed retrieval strategies, mechanically performing quantitative paragraph retrieval regardless of whether the question requires external knowledge support. This rigid design introduces unnecessary computational overhead in simple consultation scenarios, and backfires in complex semantic scenarios—the retrieved text paragraphs often only form a superficial match with the question at the keyword level, but are far from the true semantic intent, thus inducing the generation model to produce illusory responses based on incorrect knowledge, causing the accuracy of the answer and user trust to be damaged simultaneously. Even if the retrieval content is improved, traditional systems still divide documents into fragmented text segments for vectorized indexing, failing to perceive the semantic relationships between entities. When a user's question spans multiple related entities, the fragmented retrieval results can neither restore the complete business context nor support the generation of coherent answers, thus revealing the structural shortcomings in knowledge integration.

[0004] The limitation of execution capability constitutes the second obstacle: When faced with complex business processes that require multi-step reasoning and tool collaboration, such as refund processing and order tracking, traditional dialogue systems rely on rule engines or intent slot filling methods, which are essentially a single-round static decision-making mode. They lack the ability to continuously reason and adjust actions during dynamic execution. Once a task needs to be completed through multiple rounds of interaction, the system falls into the predicament of process breakage and state loss, and cannot complete closed-loop processing as an independent execution entity.

[0005] The weakness in context management brings a third challenge: customer service dialogues are inherently characterized by multiple rounds of follow-up questions. Users frequently switch product categories, adjust brand preferences, and narrow down price ranges during the product selection process. This requires the system to have the ability to continuously track the dialogue status, accurately analyze referential relationships, and dynamically update filtering conditions. However, existing solutions have obvious shortcomings in key aspects such as referential resolution, condition narrowing, and theme continuation, resulting in a fragmented multi-round dialogue experience. Users have to repeatedly reiterate their expressed intentions.

[0006] The lack of emotional awareness is the most likely cause of service crises: Traditional customer service systems operate emotion analysis and dialogue decision-making as independent modules, lacking a real-time linkage mechanism between the two. When users become agitated or clearly express their intention to complain, the system continues to proceed according to the established process, failing to proactively intervene before the risk escalates, triggering actions such as transferring to human agents or creating work orders. This often turns controllable emotional friction into irreparable service incidents.

[0007] The root of these four defects points to the same problem: existing technologies have always treated retrieval, execution, context management and emotion perception as independent modules to be optimized separately, rather than incorporating them into a unified workflow orchestration system for collaborative design. The information gaps between the modules not only cannot be eliminated during system integration, but also amplify each other and hinder each other, ultimately resulting in the lack of a complete technical solution for customer service scenarios. Summary of the Invention

[0008] This invention aims to solve the technical problems of existing intelligent customer service systems, such as inaccurate intent representation in complex business scenarios, fragmentation of multi-source heterogeneous data, lack of implicit emotional feature perception, and easy decay of long-range context. It proposes an intelligent customer service dialogue system based on multi-source data fusion and emotion perception.

[0009] This invention discloses an intelligent customer service dialogue system based on multi-source data fusion and emotion perception. The system is characterized by a ten-layer technical architecture that combines vertical decoupling with horizontal collaboration: The system achieves fine-grained access control in a multi-tenant environment, traffic shaping based on token algorithms, and global distributed link tracing through the access and governance layers; it utilizes an input understanding layer, based on Few-Shot ICL and Hypothetical Document Embedding (HyDE) query rewriting techniques, to map unstructured natural language into high-dimensional semantic representations and structured intent slots; relying on the sliding window mechanism and state flow graph hybrid model of the conversation state layer, it performs multi-level cache eviction and long short-term memory decay management to maintain contextual state consistency in long-range contexts; the system's decision engine layer integrates the CoT and ToT reasoning paradigms, dynamically scheduling heterogeneous large language models based on semantic similarity routing operators to perform topology dimensionality reduction and task decomposition of complex business logic; simultaneously, the knowledge and evidence layer utilizes a hybrid retrieval architecture of dense vectors and sparse scalars, combined with a cross-encoder. The system performs secondary rearrangement and constructs a fact consistency alignment framework based on the chain of evidence. Combined with cross-modal entity linking and context-based multi-armed slot machine algorithms in the product and data orchestration layers, it achieves precise alignment of dynamic business entity attributes. Furthermore, the tool platform layer encapsulates atomic sandbox microservice call interfaces conforming to the OpenAPI specification. The response strategy and generation layer introduces system-constrained prefix tree restricted decoding and human-preference-based reinforcement learning (RLHF) operator tuning to optimize the output probability distribution. Finally, it is supplemented by automated quantitative evaluation using the referee model in the operation observation layer, and accelerated by approximate nearest neighbor vector indexing and speculative sampling inference in the underlying infrastructure layer, achieving efficient feature engineering and system governance across the entire chain.

[0010] Furthermore, this embodiment of the invention provides a multi-source data hierarchical retrieval method applied to the dialogue system, characterized by the following steps: First, the method extracts the implicit feature representation of the user query based on the intent understanding center, generates a query vector, adaptively predicts and constructs a closed loop of routing mapping pointing to the target data source; then, based on the routing mapping, it triggers parallel collaborative concurrent retrieval for the relational business data layer, the internal unstructured knowledge base layer and the external open network layer; in the retrieval recall flow, the system introduces a self-reflective retrieval mechanism (Self-RAG) based on a large language model, using reflection tokens to give the model the ability to quantitatively evaluate the confidence of the relevance and necessity of the recalled document set, so as to avoid redundant computing power consumption; finally, the system constructs a cross-source entity dependency graph and uses the multi-way merge sorting algorithm (RRF) to perform weighted fusion scoring and dynamic re-sorting of multi-source heterogeneous information features, thereby significantly optimizing the recall rate and first-choice hit precision (Precision@K) under long-tail knowledge distribution.

[0011] Furthermore, this embodiment of the invention provides an emotion-driven risk control method applied to the dialogue system, characterized by the following steps: The method constructs a dual-path parallel emotion computing and perception architecture, combining explicit emotion fast pre-feature extraction based on a heuristic rule dictionary with deep feature classification mapping based on implicit semantic dimensions (such as the VAD emotion space model) of a pre-trained large language model; the system synchronously instantiates a deterministic emotion state automaton (FSM) to perform real-time sequence tracking of emotion transition nodes in the temporal dialogue flow, and dynamically optimizes and switches the dialogue soothing strategy graph accordingly; on this basis, the system integrates the emotion polarity dimension, intent confidence dimension, and context dependency dimension to construct a three-dimensional tensor-level comprehensive risk quantification scoring model; finally, in response to the dynamically updated risk quantification threshold, the system triggers a tiered risk control circuit breaker mechanism and intervention decision, including silent warning feature injection, automated execution of business compensation operators, and seamless transfer to the human agent interface, thereby achieving millisecond-level blocking and high-level intervention of potential customer complaints.

[0012] Furthermore, this embodiment of the invention provides a product context inquiry recovery method applied to the dialogue system, characterized by the following steps: The method establishes a global product feature context tracking state machine, and performs persistent tensor management on slots with strong constraint attributes such as category, brand, price threshold, and efficacy; In the multi-turn asynchronous interaction link, the system deploys a coreference resolution and omission recovery algorithm that combines rule heuristics with autoregressive inference of a large language model to accurately reconstruct implicit dependency syntactic relations and pronoun reference mapping in the temporal dialogue context; At the same time, it supports a dynamic incremental narrowing paradigm of constraint conditions, responding to the user's added constraint intentions, updating the feature screening boundary in real time, and performing secondary clustering and pruning of the candidate product set; When the core entity constraint slot is detected to be empty or in a low confidence state, the system actively calls the inquiry recovery operator to generate a highly directional clarifying inquiry statement through autoregression to guide the user to complete the information completion loop, thereby suppressing the local optimum trap and information forgetting risk in long-cycle complex game dialogues, and achieving personalized entity recommendation with high conversion efficiency.

[0013] Furthermore, this embodiment of the invention provides a method for calling tools using a large language model applied to the dialogue system, characterized by the following steps: Based on the structured semantic parsing output and the current business state space, the method first recalls a candidate set of function call signatures with atomic operation characteristics based on vector similarity; subsequently, the decision engine evaluates the cost function of the necessity and execution timing of the tool call, selects the target execution operator with the highest information gain, and initiates a micro-loop of autonomous reasoning and external action collaboration based on the ReAct framework, alternately generating implicit logical deduction directed graphs and explicit external application programming interface (API) request instructions through autoregression; finally, the system parses the captured asynchronous execution callback payloads of external microservices, transforms them into structured observations, and seamlessly inverts them into the current working memory context sequence, driving the large language model to perform continuous autoregressive reasoning in conjunction with newly added situational awareness data until the final state of the state machine of the complex business process is reached or a preset global maximum iteration depth threshold is triggered.

[0014] The technical solutions provided by the embodiments of this invention can produce the following significant technical effects and beneficial progress: Relying on multi-source data hierarchical collaboration and an adaptive retrieval decision optimization mechanism based on high-dimensional vectors, this system breaks through the data silo bottleneck of traditional single knowledge domains, achieving a substantial leap in the accuracy of long-tail feature retrieval while avoiding redundant computing power overhead. The system's end-to-end response latency is significantly reduced by approximately 40%. By introducing a dual-path parallel sentiment computing architecture and a three-dimensional tensor-level risk modeling system, the system achieves accurate capture and millisecond-level intervention of customer complaint crisis transition nodes, significantly improving the interception success rate of intelligent early risk control. Through the deep integration of feature tracking state machines and multi-round co-inference resolution technology, the system maintains high complexity while achieving significant improvements in performance. While narrowing the logic, the system effectively suppressed the decay of contextual information and achieved a second increase in recommendation conversion rate of approximately 28% by relying on the multi-armed slot machine exploration and utilization mechanism. At the same time, by using the ReAct inference framework of the large language model to dynamically orchestrate the set of external atomic microservices, the system achieved decentralized and fully automated closed-loop processing of complex service work orders, significantly reducing the workload of redundant human agents. Overall, the ten-layer decoupled architecture, combined with speculative sampling, restricted prefix decoding, and traffic shaping and other underlying engineering-level defense and acceleration measures, endows the system with high-level high availability, robustness, and adversarial sample defense capabilities, establishing a solid, stable, and compliant technical foundation for industrial-grade artificial intelligence deployment in complex business game environments. Attached Figure Description

[0015] Figure 1 This is a six-layer system architecture diagram of the intelligent customer service dialogue system of the present invention.

[0016] Figure 2This is a schematic diagram of the seven-step pipeline of the workflow engine of this invention.

[0017] Figure 3 This is a schematic diagram of the state transition of the emotion-driven risk control method of the present invention.

[0018] Figure 4 This is a flowchart illustrating the tool invocation method based on large language model reasoning of the present invention. Detailed Implementation

[0019] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] like Figures 1-4 This invention provides an intelligent customer service dialogue system based on multi-source data fusion and emotion perception, which may specifically include: Step S101: The user and channel layer primarily serves as the unified endpoint for system-external interaction, aiming to achieve standardized access and asynchronous message scheduling in multi-terminal environments. This layer constructs a unified dialogue processing link across all channels, striving to maintain a high level of user experience and business logic consistency across different platforms such as Web, App, and WeChat Work. For the WeChat Work environment, this layer introduces a closed-loop mechanism including URL verification, message signature verification, and decryption, supplemented by an "anti-replay verification" strategy to enhance communication security. Furthermore, to address the potential long processing times caused by complex agentic workflows, the system designs a synchronous and asynchronous response mechanism. By pushing computationally intensive tasks into a background queue for asynchronous consumption, it effectively mitigates the risk of link interruption caused by platform callback timeouts.

[0021] In one implementation, such as Figure 1 As shown, the system provided by this invention adopts a decoupled vertical layered architecture, aiming to improve stability and semantic processing accuracy in high-concurrency business scenarios. The access and governance layers serve as a security barrier, integrating a hybrid RBAC and ABAC control model and deploying a traffic shaping mechanism based on the token bucket algorithm. Distributed link tracing implemented through the OpenTelemetry protocol assigns a unique TraceID to each request, and in conjunction with the input scrubbing module, heuristic rules are used to defend against prompt word injection attacks.

[0022] Specifically, distributed tracing supports full request backtracking across services by assigning a unique TraceID to each request. Combined with structured logs and alarm threshold configuration, it enables millisecond-level awareness and rapid response to abnormal system states.

[0023] Preferably, the token bucket algorithm controls the request rate by maintaining a token pool of fixed capacity, allowing short-term bursts of traffic to pass through when tokens are plentiful, thus ensuring the smooth operation of the system during peak scenarios.

[0024] For example, in the actual deployment of the WeChat Work channel, the system effectively intercepted duplicate requests through the anti-replay verification mechanism, and combined with the asynchronous callback queue, reduced the platform response timeout rate to below 0.1%.

[0025] Step S102: The interface layer primarily functions as the system traffic gateway, focusing on request governance and the construction of defense mechanisms for high-concurrency scenarios. This layer implements fine-grained traffic cleaning and parameter validation (such as dialogue ID format review and image URL whitelisting mechanisms) to reduce the potential threats posed by malicious requests to the system. Regarding system stability design, this layer integrates a series of middleware components, using API rate limiting and circuit breaking mechanisms to control traffic peaks and limit the cascading impact of dependent service anomalies. Simultaneously, in conjunction with a global anomaly capture strategy, this layer minimizes the direct exposure of underlying business logic errors to external entities, thereby improving the overall robustness of the system.

[0026] In one implementation, the interface layer and workflow orchestration layer use an asynchronous non-blocking I / O model to handle concurrent requests. The intent understanding stage introduces Few-Shot ICL technology to adapt to specific business domains, improving the accuracy of intent classification while ensuring controllable response latency.

[0027] Specifically, the service circuit breaker mechanism uses a sliding window to count the error rate of dependent services. When the error rate exceeds a preset threshold, the request link is automatically cut off. After entering the circuit breaker cooling period, the service recovery status is detected in a half-open state, which effectively prevents the spread of cascading failures.

[0028] Preferably, the image URL whitelist mechanism verifies the source of all input image URLs by pre-maintaining a list of legitimate domain names, thereby blocking security risks such as server request forgery (SSRF) at the source.

[0029] For example, in actual load testing scenarios, the interface layer uses a token bucket rate limiting strategy to smooth out external burst request peaks, and the service circuit breaker mechanism reduces the cascading timeout rate caused by service anomalies from 23% to below 2%.

[0030] Step S103: The workflow orchestration layer, as the core control unit of the system, focuses on researching and implementing a highly modular pipeline operation and multi-turn context management mechanism. This layer adopts a seven-stage standard workflow (covering input guarding, session loading, intent understanding, adaptive routing, data collection, response generation, and post-processing) to replace the traditional single-turn question-and-answer mode. Based on the context tracking module, the system attempts to achieve referential resolution, topic coherence, and gradual narrowing of intent conditions in cross-turn dialogues. In addition, this layer introduces a dynamic routing engine, which adaptively distributes computational traffic to different processing branches (such as regular business, lightweight queries, or scoring mechanisms) based on structured intent characteristics, thereby optimizing the allocation of computational resources and alleviating the problem of excessive coupling in a single model handling complex requests.

[0031] In one implementation, such as Figure 2 As shown, the workflow engine strictly executes a seven-step pipeline operation: First, risk cleanup is performed through input guards; then, session loading is performed, and long short-term memory is managed using Redis sliding window and digest compression; next, intent understanding and follow-up questioning recovery are performed, and uncertainty estimation is used to determine whether reverse clarification is needed and to verify logical coherence; the task is routed to the CoT inference or retrieval branch through branch decision; finally, the closed loop is completed through data collection and response generation under constrained decoding.

[0032] Specifically, the system's internal workflow engine first performs prompt word cleaning via an input guard. Then, the session loading module retrieves historical context through Redis's hierarchical storage mechanism, uses a sliding window to process short-term memory, and performs summary compression on long-term memory. In the intent understanding and follow-up question recovery phase, the system utilizes a large model for multi-intent recognition and introduces uncertainty estimation to determine whether reverse clarification is needed, while also identifying whether the current input is a logical supplement to a preceding question. In the branch decision and data collection phase, tasks are routed to the CoT inference branch or retrieval acceleration branch based on semantic similarity, triggering external API calls in parallel. Finally, the response generation phase employs constrained decoding technology to ensure the output format is standardized.

[0033] Preferably, the dynamic routing engine uses structured intent feature vectors and a pre-trained routing classifier to make collaborative decisions, achieving millisecond-level computational traffic distribution among three branches: regular business dialogue, lightweight knowledge query, and manual scoring mechanism, effectively reducing the frequency of calls to a single large model and the cost of inference.

[0034] For example, to address the issue of ambiguous referential meaning in multi-turn dialogues, the system establishes a Product State Tracking (DST) mechanism. It uses vectors to represent the current set of filtering conditions and employs a hybrid algorithm based on rule matching and LLM inference to resolve referential meaning. The entire process sequentially involves product context state management, referential meaning resolution, condition narrowing, and follow-up question recovery, ultimately completing the innovative product selection and updating the context. Through constraint satisfaction technology, the system allows users to perform condition narrowing operations such as "cheaper" using natural language, achieving multi-turn incremental and precise filtering.

[0035] Step S104: The core capability layer integrates the reasoning capabilities of the Large Language Model (LLM) with the underlying business execution logic, primarily focusing on the layered optimization of Retrieval Enhanced Generation (RAG) and Agent tool calls. In data retrieval, the system employs an "anti-illusion layered mechanism," scheduling relational databases, knowledge base vector retrieval based on reranking optimization, and external web searches according to factual credibility, aiming to improve the factual accuracy boundary of the generated content. Simultaneously, this layer constructs a tool call closed loop based on the ReAct paradigm, allowing the model to perform autonomous reasoning and interact with external APIs within a limited number of steps to handle complex business scenarios requiring multi-step state verification, such as refunds or order cancellations. Combining the dual perspectives of rule matching and model reasoning, this layer also introduces an emotion-driven risk control intervention mechanism, attempting to identify high-risk dialogue states and trigger timely manual intervention and work order processing.

[0036] In one implementation, for complex data environments, the system implements a multi-source data hierarchical retrieval method. The entire process sequentially involves intent understanding and data source prediction, hierarchical parallel retrieval, adaptive retrieval decision-making, and finally, data source coordination. The system first utilizes a large model for intent prediction and data source mapping, introducing HyDE (Hypothetical Document Embedding) technology to generate hypothetical documents to expand vector features. The retrieval process integrates a self-reflective mechanism (Self-RAG), using reflection tokens to evaluate relevance and support levels. If the score is insufficient, parameters are dynamically adjusted. Finally, the system uses the inverse rank fusion (RRF) algorithm to align and reorder heterogeneous data from relational and vector databases, outputting the optimal contextual evidence chain.

[0037] Specifically, in the core capability layer and knowledge orchestration layer, the system integrates entity linking technology and a hybrid search engine, and utilizes a cross-encoder to achieve semantic reordering. The retrieval process employs a multi-path recall strategy to perform exact matching from relational databases and approximate semantic retrieval from vector databases, and the reordering module performs fine-grained ranking of candidate results, ultimately outputting a high-quality contextual evidence chain for the large model to generate responses.

[0038] Preferably, such as Figure 3 As shown, the system's risk control is collaboratively handled by the emotion-driven module. This module employs a two-layer analysis architecture: the rule layer performs millisecond-level sensitive word scanning, while the semantic layer assesses implicit negative emotions based on the VAD model. The finite state machine (FSM) maintained by the system can recognize the user's state transition from "question" to "anger," thereby dynamically switching the dialogue strategy from "explanatory" to "appeasement." When the combined emotional intensity, intent sensitivity, and conflict score are too high, the system will execute an interruption response and connect to human intervention.

[0039] For example, such as Figure 4 As shown, this invention achieves automatic tool invocation closed-loop through the ReAct inference framework. The model first performs logical decomposition (Thought), then generates function call instructions (Action) conforming to the OpenAPI specification, executes them in a controlled manner (Observation) within an isolated sandbox, and captures the returned results. Through loop iteration, the model concatenates the results into the context to continue inference until the task is completed or the iteration limit is reached. Practical application data shows that this solution has achieved significant technical progress: the intent recognition rate has increased from 65% to 92% through referential resolution; thanks to KV Cache acceleration, the end-to-end response time has been reduced by 40%, and availability reaches 99.99% under high concurrency; in addition, sentiment analysis intercepts 85% of potential complaint escalation, and the order conversion rate (CVR) in the product recommendation process has increased by 28%.

[0040] Step S105: The State and Data Service Layer primarily undertakes the tasks of state maintenance and persistent data management throughout the dialogue lifecycle. Its core design philosophy lies in the reasonable separation of hot and cold data and the standardized flow of business states. For frequently read and written hot data, the system utilizes a memory-level cache (such as Redis) to manage short-term session contexts, entity tracking states, and pending information. For business process control, a Finite State Machine (FSM) model is introduced to strictly constrain key nodes such as orders and refunds, aiming to reduce the probability of dirty writes and duplicate submissions in high-concurrency scenarios. In addition, this layer uses an asynchronous mechanism to structure and deposit multi-dimensional dialogue features (including logs, intents, emotions, and evaluation feedback) into a relational database, providing underlying data support for subsequent system observability analysis and case pool scheduling.

[0041] In one implementation, Redis's hierarchical storage mechanism stores session context in layers according to access frequency and timeliness: recent conversation rounds are stored in an in-memory hash structure to support millisecond-level reads, while historical summaries are written to a low-frequency storage area using a compression algorithm, thus controlling memory usage while ensuring the integrity of context retrieval.

[0042] Specifically, Finite State Machines (FSMs) use predefined state nodes and transition condition graphs to strictly constrain key business nodes such as order creation, payment confirmation, refund application, and case closure, effectively avoiding state jumps and duplicate submissions in concurrent scenarios.

[0043] Preferably, the asynchronous write-to-database mechanism uses a message queue to smooth out high-frequency write requests, writing dialogue logs, intent tags, sentiment scores, and user feedback to the relational database in batches. This reduces the database pressure on the main process while ensuring the eventual consistency of the analyzed data.

[0044] For example, in actual operation, this tiered storage solution achieves a hot data cache hit rate of 98.5%, and FSM state constraints reduce the duplicate order rate in the refund process to below 0.3%, providing an accurate and reliable data foundation for backend case pool scheduling.

[0045] Step S106: The infrastructure and external dependency layer provides underlying computing and storage resources to support the entire system. Its architecture selection focuses on the system's horizontal scalability and basic performance. Regarding the model foundation and retrieval infrastructure, the system relies on the large language model computing power provided by cloud APIs (such as the Qwen series) and combines multilingual embedding models and vector databases to construct the underlying support environment for semantic retrieval. In terms of storage architecture, a relational database (PostgreSQL) is used as a Single Source of Truth for persistent storage of structured data, supplemented by Redis for high-frequency caching and message queue tasks. Simultaneously, this layer incorporates standardized observability interfaces, supporting mainstream monitoring ecosystems (such as Prometheus and Grafana) for real-time collection and visualization analysis of key system performance indicators.

[0046] In one implementation, the underlying infrastructure layer stores high-dimensional embeddings through a vector database and utilizes KV caching and quantization techniques to reduce first-word latency (TTFT) in inference. The multilingual embedding model supports a unified vectorized representation of mixed Chinese and English queries, significantly improving recall quality in cross-language product knowledge retrieval scenarios.

[0047] Specifically, PostgreSQL, as a trusted data source, ensures the atomicity and consistency of writes through row-level locking and transaction isolation mechanisms. Combined with read-only replicas to share query pressure, it achieves horizontal scaling of read-write separation while ensuring data reliability.

[0048] Preferably, the monitoring system consisting of Prometheus and Grafana collects core metrics such as intent recognition time, LLM call latency, cache hit rate, and FSM state transition frequency through custom metric tracking, providing quantitative basis for system capacity planning and performance tuning.

[0049] For example, by combining KV Cache acceleration with Int8 quantization technology, the first-word latency (TTFT) of a large language model was reduced from an average of 1.8 seconds to 1.1 seconds, and the system availability reached 99.99% under high-concurrency stress testing scenarios, meeting the SLA requirements of the production environment.

[0050] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. An intelligent customer service dialogue system based on multi-source data fusion and emotion perception, characterized in that, The system comprises: an access and governance layer configured to perform identity authentication in a multi-tenant environment using a hybrid access control model, employ a token bucket algorithm for traffic shaping and rate limiting of input requests, and defend against prompt injection attacks through an input scrubbing mechanism combining heuristic rules and semantic scanning; an input understanding center configured to perform deep semantic parsing of natural language using few-shot context learning technology, expand the vector space of user queries through a hypothetical document embedding algorithm, and automatically trigger reverse clarification logic when the confidence level is lower than a preset threshold; and a conversation state layer configured to manage multi-turn dialogue context using a hybrid model of finite state machines and graph-structured dialogue flows, maintain short-term memory through a sliding window mechanism, maintain long-term memory through summary compression technology, and utilize constraint satisfaction techniques. The system performs consistency checks on the conversation history. The decision engine layer integrates the MindChain reasoning framework and the ReAct reasoning-action framework, dynamically routing tasks to lightweight edge models or high-performance cloud models based on semantic similarity. It also integrates an emotion-aware risk control module to assess user emotional states in real time and drive a finite state machine to dynamically switch dialogue strategies. The knowledge and evidence layer is configured to weightedly fuse vector-based dense retrieval with BM25-based sparse retrieval, using a cross-encoder to re-rank recalled documents, and performing alignment checks on evidence sources through factual verification logic. The tool platform layer encapsulates external functions as atomic microservice interfaces conforming to the OpenAPI specification, and executes high-risk operations in a controlled manner within an independent sandbox execution environment.

2. The intelligent customer service dialogue system according to claim 1, characterized in that, The decision engine layer also includes a seven-step pipeline processing module, which executes sequentially: input guarding, session loading, intent understanding, follow-up question recovery, branch decision, data collection, and response generation. The follow-up question recovery step is configured to determine whether the current user input is a logical supplement to the previous intent, and after confirmation, merge the historical constraints into the current task context. The response generation step adopts restricted decoding technology and optimizes candidate responses through a policy gradient based on human preference alignment.

3. The intelligent customer service dialogue system according to claim 1, characterized in that, It also includes a product and data orchestration layer, which is configured to: map user colloquial terms to standardized entities in the enterprise knowledge graph through an entity linking subsystem; dynamically generate structured query statements using Text-to-SQL or Text-to-API technologies; and adopt a contextual multi-armed slot machine algorithm to balance exploration and utilization in cold start scenarios where user profiles are missing, thereby achieving adaptive product recommendation.

4. A multi-source data hierarchical retrieval method, applicable to intelligent customer service dialogue systems, characterized in that, The method Includes the following steps: S1: Receive user query input, analyze semantic intent using a large language model, and predict the activation weights of three target data sources: business database, knowledge base, and external network search. S2: Trigger retrieval tasks from at least two heterogeneous data sources in parallel according to the activation weights; S3: Perform an autonomous evaluation of the completeness and relevance of the retrieved content using a reflection token. If the score is lower than a preset threshold, adjust the retrieval parameters and perform incremental retrieval; otherwise, proceed to the next step; S4: Construct an entity association graph to identify semantic relationships between multi-source results and perform weighted fusion using the following formula: S_fused = α · S_business + β · S_knowledge + γ · S_web Wherein, α, β, and γ are weight coefficients adaptively adjusted according to the intention type predicted in step S1, and satisfy α + β + γ = 1; S_business, S_knowledge, and S_web are normalized retrieval scores from business data, knowledge base, and web search, respectively; S5: The inverse rank fusion algorithm is used to perform the final ranking of the fused candidate document set, and the optimal contextual evidence chain is output for use by the generative model.

5. The multi-source data hierarchical retrieval method according to claim 4, characterized in that, Step S1 further includes: generating simulated response text using a hypothetical document embedding algorithm, and using the vector representation of the simulated response as the expanded retrieval vector to improve the semantic matching accuracy of sparse expression queries; Step S5 further includes: performing secondary fine ranking on the top N candidate documents of the inverse rank fusion sort using a cross encoder, where N is a preset positive integer.

6. An emotion-driven dialogue risk control method, applicable to intelligent customer service dialogue systems, characterized in that, The method Includes the following steps: A1: Perform two-layer sentiment analysis in parallel for each round of user input: a rule-based fast path completes sensitive word scanning and preliminary assessment of sentiment intensity; a deep path based on the valence-arousal-dominance (VAD) model performs fine-grained quantification of user sentiment in three dimensions; A2: Input the results of the two-layer analysis into the finite state machine of emotion. The state set includes at least calm, doubt, dissatisfaction, and anger. Perform state transition based on the quantification results and dynamically switch the dialogue strategy from explanatory to reassuring. A3: Calculate the three-dimensional comprehensive risk score R according to the following formula: R = w_e · E + w_i · I + w_c · C; where E is the emotion score based on the VAD model, I is the intention sensitivity score, and C is the context conflict score. All items are normalized to the interval [0, 1], and w_e + w_i + w_c = 1. A4: Perform graded intervention according to the preset interval in which R falls: maintain the normal dialogue process in the low-risk interval; downgrade to generate reassuring words or asynchronously create business work orders in the medium-risk interval; and execute interrupted response and immediately transfer to human expert seats in the high-risk interval.

7. The emotion-driven dialogue risk control method according to claim 6, characterized in that, The weight coefficients w_e, w_i, and w_c in step A3 are pre-configured according to the business scenario type and can be dynamically updated through the operation configuration interface during system operation without redeploying the system.

8. A contextual inquiry recovery method, applicable to multi-turn conversational intelligent customer service systems, characterized in that, The method Includes the following steps: B1: Establish a product status tracking mechanism to maintain the set of filtering operators in the current session in real time in a structured form. The filtering operators include at least product category, brand, price range and efficacy parameters. B2: Perform hybrid pronoun resolution on the user's current input, using a combination of semantic attention-based model reasoning and rule-based symbol matching to restore pronouns or omitted components to specific product entities or attributes; B3: Based on the type of follow-up question in the current input, perform one of the following operations on the set of filtering operators: add a new constraint operator (condition narrowing), modify the value of an existing operator (incremental update), or remove an overly tight operator (condition relaxation); B4: Use constraint satisfaction technology to verify the logical consistency of the updated set of filtering operators, and after ensuring there are no conflicts, perform attribute completion or horizontal comparison of products to generate a response to the current follow-up question.

9. An atomic tool invocation method based on large language model reasoning, applicable to intelligent customer service dialogue systems, characterized in that, The method includes the following steps: C1: Based on the inference trajectory generated by the decision engine, retrieve candidate microservice interfaces from the tool library and evaluate the timing of the call and the applicability of the tool based on the current session context; C2: Execute a controlled inference-action loop, in which each loop generates an inference step (Thought), an external action call instruction (Action) conforming to the OpenAPI specification, and the received environmental feedback (Observation); C3: Concatenate the structured results returned by the tool call into the dialogue context as the input for the next inference step; C4: Repeat steps C2 to C3 until the task state transitions to the final state or the number of loops reaches the preset maximum number of iterations; wherein, the tool call runs in a controlled manner in an independent sandbox execution environment to ensure the observability and idempotency of the external action.

10. A method for intelligent customer service dialogue processing based on multi-source data fusion and emotion perception, applicable to the system described in any one of claims 1 to 3, characterized in that, The method includes the following steps: (i) Request access stage: Request verification is completed through identity authentication and token bucket rate limiting mechanism, and prompt word injection attack defense is performed through input washing module; (ii) Semantic understanding stage: Intent recognition is performed by using few-sample context learning, query vector is expanded by using hypothetical document embedding, and reverse clarification is triggered when confidence is insufficient; (iii) Parallel retrieval stage: The multi-source data hierarchical retrieval method described in claim 4 is executed to obtain the optimal context evidence chain; (iv) Risk assessment stage: The emotion-driven risk control method described in claim 6 is executed synchronously, and the current task process is interrupted and intervention strategy is triggered based on the comprehensive risk score R; (v) Reasoning execution stage: Under the premise that the risk assessment does not trigger advanced intervention, the ReAct reasoning-action loop is executed, and external tools are called as needed to complete the business loop; (vi) Response generation stage: Replies are generated by using restricted decoding and system-constrained prompt words, and the response quality is optimized by strategy gradient based on human preference alignment before output.