Multi-Agent distribution method and device based on intermediate layer
By adopting a multi-Agent dispatch method based on an intermediate layer, the problems of multiple interfaces, high maintenance costs, and inconsistent results in traditional dispatch methods are solved. This achieves efficient and secure multi-Agent invocation and result standardization, improving the scalability and traceability of the system.
Patent Information
- Application Number
- CN202511004246.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-21
- Publication Date
- 2025-11-14
AI Technical Summary
In traditional multi-agent dispatching methods, the front-end needs to interface with different agents or back-end modules, resulting in high development and maintenance costs. Furthermore, once the interface or logic changes, the entire call chain is easily affected. User requests need to be filtered multiple times or manually configured, which can easily lead to routing errors. The response formats and content vary greatly, and there is a lack of standardized result aggregation and merging mechanisms, resulting in inconsistent and incomplete response results.
A multi-agent dispatching method based on an intermediate layer is adopted. By acquiring user requests, performing format validation and text preprocessing, a unique request identifier is generated, the target agent is intelligently matched, and after receiving the response, the results are structurally integrated based on preset result integration rules. This achieves a closed-loop process from request reception to result return, ensuring the integrity and consistency of the response content.
It improves the efficiency, scalability, maintainability and security of agent invocation, reduces the risk of routing errors and information leakage, realizes closed-loop control of multi-agent collaborative processes and unified result aggregation, and enhances the system's flexibility and resource utilization.
Smart Images

Figure CN120952039A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of large model technology, and in particular to a multi-agent dispatching method and apparatus based on an intermediate layer. Background Technology
[0002] With the rapid development of artificial intelligence, especially Large Language Models (LLMs), these models have been widely applied in the financial industry, covering multiple business areas such as investment research and analysis, customer service, risk control, and compliance review. Building on this foundation, agents constructed based on large models, as user-facing proxy execution tools, are demonstrating a rapid and widespread adoption in actual financial operations due to their natural language interaction capabilities and multi-task processing capabilities.
[0003] In existing technologies, intelligent agents used in the financial industry mainly possess the following core capabilities: First, standardized customer interaction capabilities, enabling them to handle basic business issues such as account inquiries and product consultations in customer service scenarios, and provide strategy suggestions or decision support in intelligent investment advisory scenarios; second, structured knowledge service capabilities, leveraging knowledge retrieval and generation mechanisms based on RAG (Retrieval-Augmented Generation) technology to efficiently complete user-facing tasks such as document retrieval and regulatory interpretation; third, non-interactive text processing capabilities, including but not limited to financial news summaries, market sentiment analysis, and emotion recognition, assisting institutions in grasping information dynamics and market trends; and fourth, agent orchestration and execution capabilities, namely, through large model frameworks such as PEER and ReAct that support the construction of inference chains and tool calls, enabling the decomposition of complex tasks, the autonomous generation of execution steps, and the collaborative invocation of multiple agents until the problem is solved.
[0004] However, in traditional multi-agent dispatching methods, the front-end often needs to interface with different agents or back-end modules, resulting in high development and maintenance costs. Furthermore, any changes to the interface or logic can easily affect the entire call chain. Without a unified scheduling layer, user requests must undergo multiple filtering steps or manual configuration before reaching the target agent. This increases the number of interaction steps, increases the risk of routing errors, and leads to significant differences in the response formats and content of each agent. The lack of a standardized result aggregation and merging mechanism necessitates additional development work for front-end rendering and fails to guarantee the consistency and completeness of the response results. Summary of the Invention
[0005] This invention provides a multi-Agent dispatching method and apparatus based on an intermediate layer to standardize the processing of multi-Agent dispatching calls, thereby improving the efficiency and security of multi-Agent dispatching calls.
[0006] To address the aforementioned technical problems, embodiments of the present invention provide a multi-agent dispatch method based on an intermediate layer, comprising:
[0007] Obtain a user request, perform format validation and text preprocessing on the user request, obtain the user question text, and generate a request identifier for the user question text;
[0008] The target agent is matched based on the user question text, and the user question text and the request identifier are sent to the target agent;
[0009] Obtain the response data of the target Agent, and generate the user request result based on the request identifier, the preset result integration rules, and the response data;
[0010] The user request result is sent to the user terminal based on the request identifier.
[0011] This invention generates a unique request identifier for each user request, combined with format validation and text preprocessing, enabling unified and standardized interface decoupling between the front-end and back-end. Based on intelligent matching of user question text, requests are efficiently and accurately dispatched to the corresponding Agent. After receiving responses from each Agent, multi-source responses are structurally integrated using preset result integration rules and request identifiers, ensuring the integrity, consistency, and traceability of the response content. Finally, the integrated results are uniformly distributed to the user terminal through the request identifier, realizing a closed-loop process from request reception, Agent dispatch, response aggregation to result return. This achieves decoupling of request and Agent calls, automation of dispatch paths, and standardized aggregation of response content, thereby effectively improving Agent call efficiency, scalability, maintainability, and overall security and traceability.
[0012] Furthermore, the text preprocessing includes word segmentation and filtering, and standardization; the process of obtaining the user request, performing format validation and text preprocessing on the user request, obtaining the user question text, and generating a request identifier for the user question text includes:
[0013] Obtain the user request, perform format validation on the user request, and after the validation passes, perform word segmentation, filtering and standardization processing on the user request in sequence to obtain the user question text;
[0014] The request identifier for the user's question is generated based on a preset identifier combination rule, and the request identifier is unique.
[0015] This invention, through word segmentation filtering and standardization, can comprehensively clean and standardize user input, effectively eliminating the interference of character encoding differences, noise words, and spelling ambiguities on subsequent Agent matching. At the same time, the generated globally unique request identifier not only ensures request isolation and conflict avoidance in a multi-session concurrent environment, but also provides a reliable basis for subsequent tracking, auditing, and performance analysis.
[0016] Furthermore, the step of matching the target agent based on the user question text and sending the user question text and the request identifier to the target agent includes:
[0017] The first target agent is matched based on the user's question text, and the question format is determined based on the target agent;
[0018] Based on the aforementioned question format, the user's question text is converted to obtain the first question text;
[0019] Send the first question text and the request identifier to the first target Agent.
[0020] This invention ensures the accuracy and security of request dispatch by formatting and matching the pre-processed user question text with the preferred target Agent, and then sending the format-converted and encrypted task data package to the corresponding Agent. Format conversion allows different Agents to seamlessly parse the input based on their respective interface protocols, and encryption packaging provides protection for the transmission of sensitive information in cross-cloud or cross-domain call scenarios, reducing the risk of routing errors and information leakage, and improving system execution efficiency and call security.
[0021] Furthermore, the step of obtaining the response data of the target Agent and generating a user request result based on the request identifier, the preset result integration rules, and the response data includes:
[0022] Obtain the response data of the target Agent, and determine the processing status based on the response data. The processing status includes processing completed and pending processing.
[0023] When the processing status is pending, a second target agent is matched based on the response data, and a second question text is generated based on the second target agent. The second question text and the request identifier are then forwarded to the second target agent.
[0024] When the processing status is "processing complete", the user request result is generated based on the request identifier, the preset result integration rules, and the response data.
[0025] This invention, upon receiving a response from an Agent, automatically determines and triggers subsequent dispatch or merging processes based on the response status, achieving closed-loop control of multi-Agent collaborative processes. For requests in the "pending processing" state, it can automatically match the next-level Agent and resend the request, ensuring the continuity of multi-round interactions in complex scenarios; for requests in the "processed" state, it can directly enter the result integration stage, avoiding unnecessary resource consumption. This improves the system's response flexibility and resource utilization, ensuring the smooth progress of tasks in a multi-Agent environment.
[0026] Furthermore, when the processing status is "processing complete," generating a user request result based on the request identifier, preset result integration rules, and the response data includes:
[0027] When the processing status is "processing complete", obtain all response data corresponding to the user question text based on the request identifier;
[0028] Based on preset result integration rules, the response data is standardized, filtered, and multimodal spliced to generate user request results.
[0029] When the processing status is complete, this invention batches all responses based on the same request identifier and performs standardization, content filtering, and multimodal splicing according to preset integration rules. This can aggregate multi-source heterogeneous results from different agents into a consistent final response that meets the front-end display requirements. Furthermore, by using strategic filtering and splicing, the compliance and readability of the response content can be improved, thereby significantly optimizing the user experience and enhancing the overall interaction quality of the system.
[0030] Secondly, the present invention provides a multi-agent dispatching device based on an intermediate layer, comprising: a text processing module, a dispatching module, an integration module, and a result feedback module;
[0031] The text processing module is used to obtain user requests, perform format validation and text preprocessing on the user requests, obtain user question text, and generate a request identifier for the user question text based on a preset.
[0032] The dispatch module is used to match the target agent based on the user question text, and send the user question text and the request identifier to the target agent;
[0033] The integration module is used to obtain the response data of the target Agent and generate the user request result based on the request identifier, the preset result integration rules and the response data;
[0034] The result feedback module is used to send the user request result to the user terminal based on the request identifier.
[0035] Furthermore, the text preprocessing includes word segmentation and filtering, and standardization; the text processing module is used to obtain user requests, perform format validation and text preprocessing on the user requests, obtain user question text, and generate a request identifier for the user question text, including:
[0036] Obtain the user request, perform format validation on the user request, and after the validation passes, perform word segmentation filtering and standardization processing on the user request in sequence to obtain the user question text;
[0037] The request identifier for the user's question is generated based on a preset identifier combination rule, and the request identifier is unique.
[0038] Furthermore, the dispatch module is configured to match a target Agent based on the user question text, and send the user question text and the request identifier to the target Agent, including:
[0039] The first target agent is matched based on the user's question text, and the question format is determined based on the target agent;
[0040] Based on the aforementioned question format, the user's question text is converted to obtain the first question text;
[0041] Send the first question text and the request identifier to the first target Agent.
[0042] Furthermore, the integration module is used to obtain the response data of the target Agent, and generate a user request result based on the request identifier, the preset result integration rules, and the response data, including:
[0043] Obtain the response data of the target Agent, and determine the processing status based on the response data. The processing status includes processing completed and pending processing.
[0044] When the processing status is pending, a second target agent is matched based on the response data, and a second question text is generated based on the second target agent. The second question text and the request identifier are then forwarded to the second target agent.
[0045] When the processing status is "processing complete", the user request result is generated based on the request identifier, the preset result integration rules, and the response data.
[0046] Furthermore, the integration module is used to generate a user request result based on the request identifier, preset result integration rules, and the response data when the processing status is "processing complete," including:
[0047] When the processing status is "processing complete", obtain all response data corresponding to the user question text based on the request identifier;
[0048] Based on preset result integration rules, the response data is standardized, filtered, and multimodal spliced to generate user request results. Attached Figure Description
[0049] Figure 1 A flowchart illustrating a multi-agent dispatching method based on an intermediate layer provided in an embodiment of the present invention;
[0050] Figure 2 This is a schematic diagram of a multi-agent dispatching device based on an intermediate layer provided in this embodiment. Detailed Implementation
[0051] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples. The following examples are for illustrative purposes only and are not intended to limit the scope of the invention.
[0052] The terms "first" and "second," etc., in the specification, claims, and drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such processes, methods, products, or apparatus.
[0053] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0054] Example 1
[0055] See Figure 1 , Figure 1 This is a flowchart illustrating a multi-agent dispatch method based on an intermediate layer provided by an embodiment of the present invention. The embodiment of the present invention provides a multi-agent dispatch method based on an intermediate layer, including steps 101 to 104, as detailed below:
[0056] Step 101: Obtain the user request, perform format verification and text preprocessing on the user request, obtain the user question text, and generate a request identifier for the user question text based on a preset.
[0057] In this embodiment, the text preprocessing includes word segmentation filtering processing and standardization processing; the obtaining of the user request, performing format verification and text preprocessing on the user request, obtaining the user question text, and generating a request identifier for the user question text includes:
[0058] Obtain the user request, perform format verification on the user request, and after passing the verification, perform word segmentation filtering processing and standardization processing on the user request in sequence to obtain the user question text;
[0059] Generate a request identifier for the user question based on a preset identifier combination rule, and the request identifier is unique.
[0060] In this embodiment, when the user sends a request "Help me view the channel portrait of ICBC Guangzhou Branch" to the middle layer through the front end, the system first performs format verification on the request message according to the predefined JSON Schema, and enters the text preprocessing stage after passing the verification.
[0061] In one embodiment, the user request can be encoded and unified, that is, the text in the "payload" field of the request is converted to UTF-8 encoding regardless of its original character set (such as GBK, ISO-8859-1, etc.) to eliminate garbled characters and ensure the accuracy of subsequent large model parsing.
[0062] In this embodiment, the word segmentation filtering processing is to segment "Help me view the channel portrait of ICBC Guangzhou Branch" into word tokens based on a preset large language model, and剔除 business-irrelevant words such as "help", "me", "of", etc., to obtain a core word token set ["ICBC", "Guangzhou Branch", "channel portrait"].
[0063] In one embodiment, the word segmentation filtering processing can also use a built-in word segmenter and stop word library to segment "Help me view the channel portrait of ICBC Guangzhou Branch" into word tokens, and剔除 business-irrelevant words such as "help", "me", "of", etc., to obtain a core word token set ["ICBC", "Guangzhou Branch", "channel portrait"].
[0064] In this embodiment, the standardization processing is to replace "Guangzhou Branch" with the standard term "Guangzhou Sub-branch" based on a business synonym dictionary, and unify the case and the simplified and traditional forms to generate the final user question text "ICBC Guangzhou Sub-branch Channel Portrait".
[0065] In this embodiment, a request identifier is generated according to the identifier combination rules. When a user initiates interaction for the first time, the built-in token generation module is invoked based on the user type (e.g., regular user, administrator, or partner) to generate a globally unique userToken, i.e., the request identifier, using the format of "user identifier + timestamp + random number". This token, along with the corresponding user information, is stored in a Redis cache deployed within the same business cluster and simultaneously returned to the front-end service through a secure channel. Subsequently, when a user's question request is routed to any backend agent, the request will carry the accompanying userToken parameter. Upon receiving the request, each agent does not need to additionally query the user's status; it only needs to initiate a lightweight authentication request to the middleware layer, passing the obtained userToken. Upon receiving an authentication request, the middleware layer retrieves the Token record from Redis. First, it verifies the Token's integrity and signature validity. Second, it checks if the Token's expiration time in Redis has not exceeded a preset expiration threshold. If both checks pass, the middleware layer returns an authentication success indication to the calling Agent and simultaneously extends the expiration time of the userToken by one interactive session window to ensure that the user does not need to log in again during continuous operations. If the verification fails, it returns an authentication failure notification and rejects the request. Through this mechanism, the entire authentication process is uniformly implemented only in the middleware layer, eliminating the differences in authentication logic designed by each Agent, simplifying the integration complexity of multi-Agent systems, and ensuring the reliability of permission verification and the continuity of user interaction.
[0066] In this embodiment, through unified encoding, word segmentation filtering, and standardization, user input can be thoroughly cleaned and standardized, effectively eliminating the interference of character encoding differences, noise words, and spelling ambiguities on subsequent Agent matching. At the same time, the generated globally unique request identifier not only ensures request isolation and conflict avoidance in a multi-session concurrent environment, but also provides a reliable basis for subsequent tracking, auditing, and performance analysis.
[0067] Step 102: Match the target Agent based on the user question text, and send the user question text and the request identifier to the target Agent;
[0068] In this embodiment, the target agent includes one or more agents. For a user request, there may be one or more intentions. When the user request contains only one intention, it can be processed based on the first target agent. In this case, the target agent includes one agent. If the user request contains multiple intentions, after processing it based on the first target agent, it is necessary to match other target agents for further processing. In this case, the target agent includes multiple agents.
[0069] In this embodiment, the step of matching the target Agent based on the user question text and sending the user question text and the request identifier to the target Agent includes:
[0070] The first target agent is matched based on the user's question text, and the question format is determined based on the target agent;
[0071] Based on the aforementioned question format, the user's question text is converted to obtain the first question text;
[0072] Send the first question text and the request identifier to the first target Agent.
[0073] In one embodiment, the first question text and the request identifier need to be encrypted and packaged to obtain a task data packet, and then the task data packet is sent to the first target Agent.
[0074] In this embodiment, upon receiving the preprocessed user question text "ICBC Guangzhou Branch Channel Profile" with a unique request identifier, the system first matches the target Agent, such as "Channel Profile Agent" and "Data Cache Agent", based on the user question text.
[0075] In this embodiment, the "channel profile agent" is used as the first target agent, and the user question text is converted according to the message format required by the agent (such as Protocol Buffer, JSON-RPC or a pre-agreed custom format). The natural language text is encapsulated into a field structure that conforms to the protocol to form the first question text. Subsequently, the intermediate layer encrypts and packages the first question text and the request identifier according to the security policy.
[0076] In this embodiment, a symmetric encryption algorithm (such as AES-256) is used to encrypt the data content and identifier, and a necessary message digest (HMAC-SHA256) is appended to the message header to generate a secure and verifiable task data packet. This task data packet is sent to the first target Agent through an internal high-efficiency channel. Upon receiving the packet, the Agent first verifies the message digest and decrypts the request content to obtain the original user question text and request identifier, thereby ensuring the security, consistency, and traceability of cross-Agent calls.
[0077] In this embodiment, the preprocessed user question text is formatted and matched against the preferred target Agent. The format-converted and encrypted task data package is then sent to the corresponding Agent, ensuring the accuracy and security of request dispatch. Format conversion allows different Agents to seamlessly parse the input based on their respective interface protocols. Encryption packaging provides protection for the transmission of sensitive information in cross-cloud or cross-domain call scenarios, reducing the risk of routing errors and information leakage, and improving the system's execution efficiency and call security.
[0078] Step 103: Obtain the response data of the target Agent, and generate the user request result based on the request identifier, the preset result integration rules, and the response data;
[0079] In this embodiment, obtaining the response data of the target Agent and generating the user request result based on the request identifier, the preset result integration rules, and the response data includes:
[0080] Obtain the response data of the target Agent, and determine the processing status based on the response data. The processing status includes processing completed and pending processing.
[0081] When the processing status is pending, a second target agent is matched based on the response data, and a second question text is generated based on the second target agent. The second question text and the request identifier are then forwarded to the second target agent.
[0082] When the processing status is "processing complete", the user request result is generated based on the request identifier, the preset result integration rules, and the response data. In this embodiment, when the intermediate layer receives the response data returned by the first target agent, it first retrieves the corresponding context information from the cache based on the request identifier, and parses the key fields in the response data (such as the "status" flag and the "resultPayload" content) to determine its processing status. If the "status" is "pending", it indicates that the agent has only completed the first stage of processing and needs to call other agents for collaborative processing. At this time, the intermediate layer matches the second target agent (such as "data verification agent" or "supplementary information agent") based on the response data according to the preset agent capability matrix and the business instructions in the response data (such as needing to supplement data or perform secondary verification). According to the interface specification of the second target agent, the intermediate layer encapsulates the necessary fields and context information in the original response to generate a new second question text. Finally, the second question text, together with the original request identifier, is forwarded to the second target agent to continue to complete the business loop.
[0083] In this embodiment, when a user sends a request through the front end to "help me view the channel profile and June performance of ICBC Guangfen", the user request includes two intentions: one is to obtain the channel profile, and the other is to obtain the June performance. First, the first target agent, namely the channel profile agent, is matched based on the user's question text. After the channel profile agent returns the response data, the processing status is pending. Therefore, the second target agent is matched based on "June performance" and user identifier. The second question text is generated based on the agreed format of the second target agent, and then the second question text is sent to the second target agent.
[0084] In this embodiment, if the initial response status is "completed", the intermediate layer will directly combine the request identifier and preset result integration rules (such as multi-source merging, priority sorting, sensitive information masking, etc.) to perform structured summarization and formatting of the response data, generate the final user request result and return it to the front end, thereby realizing dynamic collaboration and closed-loop response of multiple agents.
[0085] In this embodiment, after receiving a response from an Agent, the system automatically determines and triggers subsequent dispatch or merging processes based on the response status, achieving closed-loop control of the multi-Agent collaborative process. For requests in the "pending processing" state, the system can automatically match the next-level Agent and resend the request, ensuring the continuity of multi-round interactions in complex scenarios. For requests in the "processing completed" state, the system can directly enter the result integration stage, avoiding unnecessary resource consumption. This improves the flexibility of system response and resource utilization, ensuring the smooth progress of tasks in a multi-Agent environment.
[0086] In this embodiment, when the processing status is "processing complete," generating the user request result based on the request identifier, the preset result integration rule, and the response data includes:
[0087] When the processing status is "processing complete", obtain all response data corresponding to the user question text based on the request identifier;
[0088] Based on preset result integration rules, the response data is standardized, filtered, and multimodal spliced to generate user request results.
[0089] In this embodiment, when the intermediate layer retrieves all Agent response data associated with the request identifier from the cache or log library (such as structured channel information returned by the channel profiling Agent, sentiment scores and visualization charts returned by the public opinion analysis Agent, historical statistical charts returned by the data caching Agent, etc.), it sequentially performs standardization processing, content filtering processing and multimodal splicing processing according to the preset result integration rules.
[0090] In this embodiment, standardization processing refers to converting heterogeneous data returned by different agents into a standard data model defined internally by the middle layer, including field name mapping, data type validation, and format unification (such as converting multiple timestamp formats to "YYYY-MM-DD HH:mm:ss").
[0091] In this embodiment, content filtering refers to strategically blocking or desensitizing sensitive information (such as customer privacy, keywords in compliance restricted areas, etc.) that may be contained in text or metadata, and pruning and summarizing excessively long texts according to length or key summary rules.
[0092] In this embodiment, multimodal splicing processing refers to combining the standardized and filtered text results with corresponding charts, images or other media resources according to front-end UI rendering specifications (such as card layout or timeline format) to generate composite content units.
[0093] In this embodiment, the final output integrates structured text, data visualization, and multimedia materials to meet the user request requirements. This result ensures both information integrity and front-end display needs, and is returned to the user through a unified interface, achieving efficient closed-loop fusion of multi-agent, multi-source, and heterogeneous data.
[0094] In this embodiment, when the processing status is complete, all responses are obtained in batches based on the same request identifier and standardized, filtered, and multimodal spliced according to preset integration rules. This can aggregate multi-source heterogeneous results from different agents into a consistent final response that meets the front-end display requirements. Furthermore, the compliance and readability of the response content are improved through strategic filtering and splicing, thereby significantly optimizing the user experience and enhancing the overall interaction quality of the system.
[0095] Step 104: Send the user request result to the user terminal based on the request identifier.
[0096] In this embodiment, after the middleware layer completes multi-agent collaboration and generates the final user request result based on the request identifier, it sends the user request result to the user client based on the request identifier. Specifically, when generating the request identifier, the middleware layer retrieves the associated user request result data from its internal cache or persistent storage (such as Redis or a relational database); then, according to the interface protocol agreed upon with the frontend (such as RESTful JSON format or real-time push format based on WebSocket), it encapsulates the retrieved structured result data into a response message, including the request identifier, result content, and necessary metadata (such as timestamps, status codes, etc.); next, it sends the above response message to the user client through the established communication channel—using HTTP response for synchronous requests, and WebSocket push or asynchronous delivery via message queue for asynchronous or subscription scenarios; finally, after sending, the middleware layer logs the sending status and performs renewal or expiration cleanup operations on the request identifier to ensure the integrity of request tracking and release occupied cache resources.
[0097] In this embodiment, by generating a unique request identifier for each user request, combined with format validation and text preprocessing, unified and standardized interface decoupling can be achieved between the front-end and back-end. Based on intelligent matching of user question text, requests are efficiently and accurately dispatched to the corresponding Agents. After receiving responses from each Agent, multi-source responses can be structurally integrated based on preset result integration rules and request identifiers, ensuring the integrity, consistency, and traceability of the response content. Finally, the integrated results are uniformly sent to the user end through the request identifier, realizing a closed-loop process from request reception, Agent dispatch, response aggregation to result return. This achieves decoupling of request and Agent calls, automation of dispatch paths, and standardized aggregation of response content, thereby effectively improving Agent call efficiency, scalability, maintainability, and overall security and traceability.
[0098] Please refer to Figure 2 , Figure 2 This is a schematic diagram of a multi-agent dispatching device based on an intermediate layer provided in this embodiment, including: a text processing module 201, a dispatching module 202, an integration module 203, and a result feedback module 204;
[0099] The text processing module 201 is used to obtain user requests, perform format verification and text preprocessing on the user requests, obtain user question text, and generate a request identifier for the user question text based on a preset.
[0100] The dispatch module 202 is used to match the target agent based on the user question text, and send the user question text and the request identifier to the target agent;
[0101] The integration module 203 is used to obtain the response data of the target Agent and generate the user request result based on the request identifier, the preset result integration rules and the response data;
[0102] The result feedback module 204 is used to send the user request result to the user terminal based on the request identifier.
[0103] In this embodiment, the text preprocessing includes word segmentation and filtering, and standardization. The text processing module is used to obtain a user request, perform format validation and text preprocessing on the user request, obtain the user question text, and generate a request identifier for the user question text, including:
[0104] Obtain the user request, perform format validation on the user request, and after the validation passes, perform word segmentation filtering and standardization processing on the user request in sequence to obtain the user question text;
[0105] The request identifier for the user's question is generated based on a preset identifier combination rule, and the request identifier is unique.
[0106] In this embodiment, the dispatch module is used to match a target Agent based on the user question text, and send the user question text and the request identifier to the target Agent, including:
[0107] The first target agent is matched based on the user's question text, and the question format is determined based on the target agent;
[0108] Based on the aforementioned question format, the user's question text is converted to obtain the first question text;
[0109] Send the first question text and the request identifier to the first target Agent.
[0110] In this embodiment, the integration module is used to obtain the response data of the target Agent, and generate a user request result based on the request identifier, preset result integration rules, and the response data, including:
[0111] Obtain the response data of the target Agent, and determine the processing status based on the response data. The processing status includes processing completed and pending processing.
[0112] When the processing status is pending, a second target agent is matched based on the response data, and a second question text is generated based on the second target agent. The second question text and the request identifier are then forwarded to the second target agent.
[0113] When the processing status is "processing complete", the user request result is generated based on the request identifier, the preset result integration rules, and the response data.
[0114] In this embodiment, the integration module is used to generate a user request result based on the request identifier, preset result integration rules, and the response data when the processing status is "processing complete," including:
[0115] When the processing status is "processing complete", obtain all response data corresponding to the user question text based on the request identifier;
[0116] Based on preset result integration rules, the response data is standardized, filtered, and multimodal spliced to generate user request results.
[0117] In this embodiment of the invention, a terminal device is also provided, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the above-described multi-agent dispatch method based on an intermediate layer.
[0118] In this embodiment of the invention, a computer-readable storage medium is also provided, which includes a stored computer program, wherein the computer program controls the device where the computer-readable storage medium is located to execute the above-described multi-agent dispatch method based on the intermediate layer when it is running.
[0119] For example, a computer program can be divided into one or more modules, one or more of which are stored in memory and executed by a processor to perform the present invention. The one or more modules can be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in a terminal device.
[0120] The terminal device may be a desktop computer, laptop, handheld computer, or cloud server, etc. The terminal device may include, but is not limited to, a processor, memory, and display. Those skilled in the art will understand that the above components are merely examples of terminal devices and do not constitute a limitation on the terminal device. It may include more or fewer components, or combinations of certain components, or different components. For example, the terminal device may also include input / output devices, network access devices, buses, etc.
[0121] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the terminal device, connecting all parts of the terminal device through various interfaces and lines.
[0122] Memory can be used to store computer programs and / or modules. The processor implements various functions of the terminal device by running or executing the computer programs and / or modules stored in the memory, and by accessing data stored in the memory. Memory can mainly include a program storage area and a data storage area. The program storage area can store the operating system, application programs required for at least one function (such as sound playback, text conversion, etc.), etc.; the data storage area can store data created based on the use of the mobile phone (such as audio data, text message data, etc.). In addition, memory can include high-speed random access memory, and can also include non-volatile memory, such as hard disks, RAM, plug-in hard disks, smart media cards (SMC), secure digital cards (SD cards), flash cards, at least one disk storage device, flash memory device, or other volatile solid-state storage devices.
[0123] In this invention, if the module for multi-agent dispatch based on the intermediate layer is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. Those skilled in the art can understand and implement this invention without any inventive effort.
[0124] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.
Claims
1. A multi-agent dispatching method based on an intermediate layer, characterized in that, include: Obtain a user request, perform format validation and text preprocessing on the user request, obtain the user question text, and generate a request identifier for the user question text based on a preset; The target agent is matched based on the user question text, and the user question text and the request identifier are sent to the target agent; Obtain the response data of the target Agent, and generate the user request result based on the request identifier, the preset result integration rules, and the response data; The user request result is sent to the user terminal based on the request identifier.
2. The multi-agent dispatching method based on an intermediate layer as described in claim 1, characterized in that, The text preprocessing includes word segmentation and filtering, and standardization. The process of obtaining a user request, performing format validation and text preprocessing on the user request, obtaining the user question text, and generating a request identifier for the user question text includes: Obtain the user request, perform format validation on the user request, and after the validation passes, perform word segmentation filtering and standardization processing on the user request in sequence to obtain the user question text; The request identifier for the user's question is generated based on a preset identifier combination rule, and the request identifier is unique.
3. The multi-agent dispatching method based on an intermediate layer as described in claim 2, characterized in that, The step of matching the target agent based on the user question text and sending the user question text and the request identifier to the target agent includes: The first target agent is matched based on the user's question text, and the question format is determined based on the target agent; Based on the aforementioned question format, the user's question text is converted to obtain the first question text; Send the first question text and the request identifier to the first target Agent.
4. The multi-agent dispatching method based on an intermediate layer as described in claim 3, characterized in that, The process of obtaining the response data of the target Agent and generating a user request result based on the request identifier, preset result integration rules, and the response data includes: Obtain the response data of the target Agent, and determine the processing status based on the response data. The processing status includes processing completed and pending processing. When the processing status is pending, a second target agent is matched based on the response data, and a second question text is generated based on the second target agent. The second question text and the request identifier are then forwarded to the second target agent. When the processing status is "processing complete", the user request result is generated based on the request identifier, the preset result integration rules, and the response data.
5. The multi-agent dispatch method based on an intermediate layer as described in claim 4, characterized in that, When the processing status is "processing complete", the user request result is generated based on the request identifier, the preset result integration rule, and the response data, including: When the processing status is "processing complete", obtain all response data corresponding to the user question text based on the request identifier; Based on preset result integration rules, the response data is standardized, filtered, and multimodal spliced to generate user request results.
6. A multi-agent dispatching device based on an intermediate layer, characterized in that, include: Text processing module, dispatch module, integration module, and result feedback module; The text processing module is used to obtain user requests, perform format validation and text preprocessing on the user requests, obtain user question text, and generate a request identifier for the user question text based on a preset. The dispatch module is used to match the target agent based on the user question text, and send the user question text and the request identifier to the target agent; The integration module is used to obtain the response data of the target Agent and generate the user request result based on the request identifier, the preset result integration rules and the response data; The result feedback module is used to send the user request result to the user terminal based on the request identifier.
7. A multi-agent dispatching device based on an intermediate layer as described in claim 6, characterized in that, The text preprocessing includes word segmentation and filtering, and standardization. The text processing module is used to obtain user requests, perform format validation and text preprocessing on the user requests, obtain user question text, and generate a request identifier for the user question text, including: Obtain the user request, perform format validation on the user request, and after the validation passes, perform word segmentation filtering and standardization processing on the user request in sequence to obtain the user question text; The request identifier for the user's question is generated based on a preset identifier combination rule, and the request identifier is unique.
8. A multi-agent dispatching device based on an intermediate layer as described in claim 7, characterized in that, The dispatch module is used to match a target agent based on the user question text, and send the user question text and the request identifier to the target agent, including: The first target agent is matched based on the user's question text, and the question format is determined based on the target agent; Based on the aforementioned question format, the user's question text is converted to obtain the first question text; Send the first question text and the request identifier to the first target Agent.
9. A multi-agent dispatching device based on an intermediate layer as described in claim 8, characterized in that, The integration module is used to obtain the response data of the target Agent, and generate a user request result based on the request identifier, preset result integration rules, and the response data, including: Obtain the response data of the target Agent, and determine the processing status based on the response data. The processing status includes processing completed and pending processing. When the processing status is pending, a second target agent is matched based on the response data, and a second question text is generated based on the second target agent. The second question text and the request identifier are then forwarded to the second target agent. When the processing status is "processing complete", the user request result is generated based on the request identifier, the preset result integration rules, and the response data.
10. A multi-agent dispatching device based on an intermediate layer as described in claim 9, characterized in that, The integration module is used to generate a user request result based on the request identifier, preset result integration rules, and the response data when the processing status is "processing complete," including: When the processing status is "processing complete", obtain all response data corresponding to the user question text based on the request identifier; Based on preset result integration rules, the response data is standardized, filtered, and multimodal spliced to generate user request results.