A multi-device collaborative agent method and system is supported
Patent Information
- Application Number
- CN202611168938.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-03
- Publication Date
- 2026-10-30
AI Technical Summary
[0032]1.本发明采用短位易读配对码实现子智能体的WebSocket鉴权接入,配对码剔除易混淆字符,适配非技术人员手动输入场景;子智能体接入时同步上传名称与功能描述,无需预先录入API接口、能力标签等结构化配置信息,省去人工维护注册库的环节,异构设备接入效率提升,运维成本显著降低。
Smart Images

Figure CN123013995A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of multi-agent cooperative scheduling technology, and in particular to a method and system that supports multi-device cooperative agents. Background Technology
[0002] In recent years, large language models and intelligent agent technology have been gradually applied in enterprise office and business automation scenarios. Since the functional coverage of a single intelligent agent is limited, forming a collaborative cluster by mounting sub-intelligent agents on multiple terminal devices to jointly complete complex business tasks has become the mainstream deployment mode for current intelligent agent systems. In such systems, the efficiency of sub-intelligent agent access, the accuracy of task assignment, and the operational stability under multi-task concurrency directly determine the practicality of the entire system.
[0003] Currently, multi-agent collaborative systems in the industry mainly follow two mature technical routes.
[0004] The first type is the pre-registration centralized scheduling architecture, a typical example of which is disclosed in patent document CN121704970A, entitled "Task Processing Method, Device, Computer Equipment, Readable Storage Medium and Program Product Based on Intelligent Agents." This type of architecture pre-builds a structured intelligent agent capability registration library. Before any sub-agent goes online, configuration information such as API interface address, capability tags, and permission scope must be manually entered. After receiving a user task, the system uses keyword matching or vector retrieval to select intelligent agents with corresponding capabilities from the registration library to complete the task assignment. The advantage of this architecture is its clear management logic, but it has significant limitations in practical applications: First, the addition and functional changes of sub-agents require manual maintenance of the registration library, making the access process cumbersome and the maintenance cost high; second, task matching relies entirely on pre-set structured tags and cannot directly adapt tasks based on natural language semantic understanding, resulting in insufficient flexibility when facing non-standardized user needs.
[0005] The second category is basic connection authentication solutions, a typical example being the patent document CN112492017A entitled "A WebSocket Connection Method and System Based on Token Authentication." This type of solution uses tokens to verify the identity of long-lived WebSocket connections, ensuring the legitimacy of the connection link. However, this solution only addresses the "connection access" issue and does not carry business information related to agent scheduling. Furthermore, the accompanying scheduling mechanism is relatively weak, lacking both semantic task assignment capabilities based on large models and concurrency control design for multi-channel access. When multiple channels simultaneously issue tasks, the same agent is prone to being repeatedly assigned tasks, leading to execution conflicts. Furthermore, a blockage in a single communication link can affect the normal operation of the overall business.
[0006] Overall, existing technical solutions generally suffer from three common shortcomings: First, the sub-agent access process relies on manual pre-configuration, lacks a lightweight and rapid access mechanism, has a high operational threshold for non-technical personnel, and has low adaptation efficiency for heterogeneous devices; Second, task assignment relies on structured registration libraries and preset rules, and cannot rely on the semantic understanding capabilities of large models to achieve automatic assignment without pre-registration, resulting in insufficient flexibility in business adaptation; Third, when multiple channels access tasks, there is a lack of unified state control and channel isolation design, which can easily lead to execution conflicts among concurrent tasks, and the stability and robustness of system operation need to be improved.
[0007] Therefore, how to achieve lightweight and rapid access of sub-agents, task assignment without pre-registration based on natural language, and stable operation under multi-channel concurrency are the technical problems that urgently need to be solved in this field. Summary of the Invention
[0008] The purpose of this invention is to provide a method and system that supports multi-device collaborative intelligent agents, so as to solve the problems of cumbersome access process, scheduling dependence on registration library, and easy conflict of multiple channels in the prior art mentioned in the background.
[0009] To achieve the above objectives, the present invention provides the following technical solution: a method for supporting multi-device collaborative intelligent agents, applied to a collaborative system comprising a server and several remote terminal intelligent agents, comprising the following steps:
[0010] S1. Pairing Code Generation and Sub-Agent WebSocket Authentication: The server generates a short, easy-to-read pairing code based on the user identifier (userId) and a random salt value (salt). The pairing code filters out easily confused characters I, O, 0, and 1. The remote sub-agent initiates an authentication access request via a WebSocket long connection, carrying the pairing code (code), userId, visible identifier (visible), agent name (name), and function description (desc). After the server verifies the request, the cluster access registration of the sub-agent is completed.
[0011] S2. Natural Language Information Injection Prompts: The main agent collects the name and desc natural language description information of all connected sub-agents and injects the team information of all sub-agents into the prompt context of the large model in batches.
[0012] S3. Automatic Task Assignment Based on Large Model Semantics: The main agent receives the business tasks issued by the user, calls the built-in large model to read the natural language function descriptions of each sub-agent within the prompt words, matches the appropriate sub-agent, and calls the message sending interface to complete the task assignment.
[0013] S4. State Machine Concurrency Management and Dual-Channel Parallel Service: A finite state machine containing three states—unauthenticated, idle, and busy—is used to manage the running state of each sub-agent and to intercept concurrent task requests from the same agent. At the same time, two independent communication channels are built for the Web front-end and the instant messaging platform to handle external task interactions in parallel.
[0014] S5. Task Tracking and Summary Output: The main agent tracks the task execution progress of all sub-agents in real time, collects the execution result data of all sub-agents, summarizes and generates a unified task conclusion report and outputs it.
[0015] Furthermore, the pairing code generation process is as follows: the string concatenated with userId and salt is used as the encrypted original text, and after HMAC-MD5 hash operation, 6 characters are extracted, and easily confused characters I, O, 0, and 1 are filtered out to generate the final readable pairing code.
[0016] Furthermore, when a sub-agent initiates a WebSocket authentication access request, the transmitted parameters always include five types of information: code, userId, visible, name, and desc. These five types of parameters are simultaneously uploaded to the main agent to complete the registration of the sub-agent. The visible parameter is used to identify whether the sub-agent is visible to external users. The main agent filters the list of agents displayed on the user interface based on the visible parameter. The entire process does not require pre-entry of registration configuration information such as API interfaces.
[0017] Furthermore, the prompts injected into the large model consist only of the names and functional descriptions of each sub-agent in natural text, without including pre-entered structured capability tags, interface addresses, or other configuration data.
[0018] Furthermore, relying on contextual learning capabilities, the large model completes semantic matching of tasks based solely on natural language descriptions within prompt words, without needing to retrieve pre-built agent capability databases or rely on preset label rules, thus achieving automatic task assignment without pre-registration.
[0019] Furthermore, the transition rules of the three-state finite state machine are as follows: when the sub-agent fails to pass the pairing code authentication, it is in the unauthenticated state and does not have the right to receive tasks; when there are no tasks to be executed, it is in the idle state and can receive new tasks; when it is executing a task, it switches to the busy state and refuses to receive new concurrent tasks.
[0020] Furthermore, the Web front-end channel and the instant messaging platform channel are two independent WebSocket logical links, with channel resources and message queues isolated from each other; when one channel is blocked, it does not affect the normal task sending and receiving of the other channel.
[0021] A multi-device collaborative intelligent agent system includes a server and several remote terminal intelligent agents;
[0022] The server is equipped with a master agent and a pairing code generation and authentication module. The pairing code generation and authentication module is used to generate a short and easy-to-read pairing code based on the user identifier userId and the random salt value salt, filtering out easily confused characters I, O, 0, and 1. It receives WebSocket authentication access requests initiated by sub-agents carrying the above parameters and completes the legality verification.
[0023] The main intelligent agent is configured with a prompt word injection module, a large model scheduling module, a state machine management module, a dual-channel communication module, and a task aggregation module;
[0024] The prompt word injection module is used to collect the name and desc natural language descriptions of all online sub-agents and write them in batches into the prompt word context of the large model;
[0025] The large model scheduling module is used to read prompt words, match suitable sub-agents based on the natural language descriptions of the sub-agents, and automatically complete task assignment by calling the message sending interface.
[0026] The state machine management module maintains a finite state machine containing three states: unauthenticated, idle, and busy, and intercepts concurrent tasks of sub-agents;
[0027] The dual-channel communication module establishes independent Web front-end channels and instant messaging platform channels to handle external task interactions in parallel.
[0028] The task aggregation module tracks the task execution progress of each sub-agent in real time, collects execution result data, and aggregates and generates a task conclusion report.
[0029] Furthermore, the pairing code generation and authentication module generates the pairing code as follows: the string concatenated with userId and salt is used as the encrypted original text, and after HMAC-MD5 hashing, 6 characters are extracted and easily confused characters are filtered out; the visible parameter uploaded by the sub-agent is used to identify its external visibility, and the main agent filters the list of agents displayed on the user interface based on the visible parameter; the entire system does not require pre-entry of structured configuration information such as API interfaces and capability tags, realizing the sub-agent's access without pre-registration and automatic task assignment.
[0030] Furthermore, the Web front-end channel and the instant messaging platform channel of the dual-channel communication module are independent WebSocket logical links, and the channel resources and message queues are isolated from each other; the state machine management module performs concurrent interception and verification on the task requests sent from the two channels respectively, ensuring the consistency of the state transition of the three-state finite state machine.
[0031] Compared with the prior art, the beneficial effects of the present invention are:
[0032] 1. This invention uses a short, easy-to-read pairing code to achieve WebSocket authentication access for sub-agents. The pairing code eliminates easily confused characters and is suitable for scenarios where non-technical personnel manually input information. When a sub-agent accesses the system, it simultaneously uploads its name and function description, eliminating the need to pre-enter structured configuration information such as API interfaces and capability tags. This saves the step of manually maintaining the registration database, improves the access efficiency of heterogeneous devices, and significantly reduces operation and maintenance costs.
[0033] 2. This invention relies on the context learning capability of a large model to directly inject the natural language function description of the sub-agent into the prompt words to complete the task matching. There is no need to search the pre-built agent capability database or preset label matching rules. When facing non-standard natural language tasks, it can automatically adapt to the corresponding sub-agent through semantic understanding. The business adaptation flexibility is far higher than that of traditional label matching schemes.
[0034] 3. This invention uses a three-state finite state machine to uniformly manage the running state of sub-agents, which can intercept concurrent task requests sent from multiple channels and avoid conflicts caused by the same agent repeatedly executing tasks; at the same time, it uses two independent WebSocket logical channels to handle task interaction, and the channel resources and message queues are isolated from each other. Blocking of a single channel does not affect the global business, and the overall robustness and operational stability of the system are significantly improved. Attached Figure Description
[0035] Figure 1 This is a schematic diagram of the architecture of the multi-device collaborative intelligent agent system supported by the present invention;
[0036] Figure 2 This is a flowchart illustrating the method for supporting multi-device collaborative intelligent agent operation according to the present invention. Detailed Implementation
[0037] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. 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.
[0038] like Figure 1As shown, this embodiment of the multi-device collaborative intelligent agent system consists of a server and multiple remote sub-intelligent agents. The sub-intelligent agents are deployed across heterogeneous devices such as office computers, edge gateways, and business servers, each possessing independent business execution capabilities. The server has a built-in pairing code generation and authentication module and deploys the main intelligent agent. To address the need for multi-channel access, the server exposes two independent WebSocket links: a web front-end channel and an instant messaging platform channel. Channel resources are logically isolated from message queues, ensuring no interference. In this embodiment, the instant messaging platform is the enterprise-grade Lark IM, and the large model is a general-purpose large language model with context learning capabilities, integrated within the main intelligent agent. The pairing code is designed as a 6-character string, balancing security and ease of manual input.
[0039] Combination Figure 2 The process shown is as follows: The specific execution process of the system is as follows:
[0040] S1 pairing code generation and sub-agent authentication are now online.
[0041] The administrator clicks "Add Smart Agent" in the server backend. The pairing code generation and authentication module 2 reads the current user identifier (userId, e.g., U20240512) and generates a 16-bit random salt value (salt). The module concatenates the userId and salt and performs an HMAC-MD5 hash operation. It extracts the first 6 characters from the result and filters out easily confused characters such as I, O, 0, and 1. If the number of characters after filtering is insufficient, it continues to extract characters until a compliant and easy-to-read pairing code is generated and displayed on the interface.
[0042] After the remote sub-agent 6 is started, the operations and maintenance personnel enter the pairing code in the configuration interface, and the sub-agent immediately initiates a WebSocket long connection request. The request message specifies five required parameters: pairing code (code), user identifier (userId), visibility identifier (visible), agent name (name), and function description (desc). Among them, the visible parameter is defined as a boolean value (0 or 1) to distinguish the visibility of the agent: a value of 1 makes it visible to ordinary users, and a value of 0 makes it visible only to the administrator backend, which is convenient for internal testing and canary release.
[0043] The pairing code generation and authentication module 2 verifies the binding relationship between the code and the userId. Upon successful verification, the sub-agent cluster registration is completed. At this point, the sub-agent's state is marked as unauth, and it immediately switches to idle state after successful registration. The entire process requires no pre-recording of API addresses or capability tags; the device can be used plug-and-play solely based on the pairing code.
[0044] S2 Sub-Agent Information Injection Prompt
[0045] The main agent 3 monitors cluster state changes. Once a new sub-agent comes online or its desc field is updated, the main agent immediately pulls the name and desc fields of the full quantum agent, organizes them into a natural language list, and injects it into the large model's Prompt context.
[0046] A typical example of injected content is as follows:
[0047] List of currently available agents:
[0048] Sales data query intelligent agent: can access the enterprise's sales database and generate sales statistical reports for a specified period;
[0049] Document format processing intelligent agent: Supports conversion of Word, PDF and Excel formats, and can extract content summaries;
[0050] Messaging notification agents: Business notifications can be pushed to designated departments or personnel via Lark.
[0051] It should be emphasized here that the injected content is only the plain text description mentioned above, and does not contain any structured configurations such as interface schemas and parameter definitions. It relies entirely on the subsequent semantic understanding capabilities of the large model.
[0052] S3 large-scale model semantic automatic order dispatch
[0053] Users can issue tasks via the web interface or the Lark client. For example, a user might enter in Lark: "Calculate the sales data for the East China region this month, generate a summary, and send it to the department manager." After the main agent 3 captures this instruction, it calls the built-in large model and, relying on its context learning capabilities, parses the agent list in the Prompt to automatically plan the execution path.
[0054] In response to this instruction, the large model identified that the "Sales Data Query Agent" (to retrieve data), the "Document Format Processing Agent" (to generate a summary), and the "Message Notification Agent" (to send the result) needed to be invoked sequentially. The main agent 3 then issued sub-tasks through the internal message interface. This process skips the API registration library retrieval and tag matching steps required by traditional agent platforms, realizing end-to-end order dispatch based on natural language.
[0055] S4 state machine concurrency management and dual-channel service
[0056] Before the task is issued, the state machine management module verifies the state of the target sub-agent: it allows the task to be received only when the state is idle and immediately sets it to busy; if a busy state is detected, the request is intercepted and a queuing prompt is returned, thus fundamentally eliminating concurrent conflicts.
[0057] Since Web Channel 4 and Lark IM Channel 5 are two independent WebSocket logical links, even if the Lark side experiences queue congestion due to message surges, the task sending and receiving on the Web side remains unaffected. The state machine management module, acting as a global singleton, performs unified arbitration on requests from both links, ensuring consistency in state transitions and solving the problem of multi-entry concurrency control.
[0058] S5 Task Tracking and Results Summary
[0059] The task summary module polls the progress of each sub-agent at fixed intervals and updates the global view synchronously. After the full quantum task is completed, the module integrates the returned data from each node, generates a unified task conclusion report, and sends it back to the user via the original request channel (Feishu in this example).
[0060] To prevent single points of failure, the system is designed with a fault tolerance mechanism: if a sub-agent goes offline during execution, the state machine management module will mark the task as failed after detecting an abnormal WebSocket connection, and will attempt to select other idle agents of the same type from the cluster to take over, thus ensuring business continuity.
[0061] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for supporting multi-device collaborative intelligent agents, characterized in that, Includes the following steps: S1. Pairing Code Generation and Sub-Agent WebSocket Authentication Launch: The server generates a short, easy-to-read pairing code based on the user identifier (userId) and a random salt value (salt). The pairing code filters out easily confused characters I, O, 0, and 1. The remote sub-agent initiates an authentication access request through a WebSocket long connection, carrying the pairing code (code), userId, visible identifier (visible), agent name (name), and function description (desc). After the server verifies the request, the cluster access registration of the sub-agent is completed. S2. Natural Language Information Injection Prompt Words: The main agent collects the name and desc natural language description information of all connected sub-agents and injects the team information of all sub-agents into the prompt word context of the large model in batches. S3. Automatic task assignment using large model semantics: The main agent receives the business tasks issued by the user, calls the built-in large model to read the natural language function descriptions of each sub-agent within the prompt words, matches the appropriate sub-agent, and calls the message sending interface to complete the task assignment. S4. State Machine Concurrency Control and Dual-Channel Parallel Service: A finite state machine containing three states—unauthenticated, idle, and busy—is used to control the running state of each sub-agent, intercept concurrent task requests from the same agent, and simultaneously build two independent communication channels—a web front-end and an instant messaging platform—to handle external task interactions in parallel. S5. Task Tracking and Summary Output: The main agent tracks the task execution progress of all sub-agents in real time, collects the execution result data of all sub-agents, summarizes and generates a unified task conclusion report and outputs it.
2. The method for supporting multi-device collaborative intelligent agents according to claim 1, characterized in that, The pairing code generation process is as follows: the string concatenated with userId and salt is used as the encrypted original text. After HMAC-MD5 hash operation, 6 characters are extracted, and easily confused characters I, O, 0, and 1 are filtered out to generate the final readable pairing code.
3. The method for supporting multi-device collaborative intelligent agents according to claim 1, characterized in that, When a sub-agent initiates a WebSocket authentication access request, the transmitted parameters always include five types of information: code, userId, visible, name, and desc. These five types of parameters are simultaneously uploaded to the main agent to complete the registration of the sub-agent. The visible parameter is used to identify whether the sub-agent is visible to external users. The main agent filters the list of agents displayed on the user interface based on the visible parameter. The whole process does not require pre-entry of registration configuration information such as API interfaces.
4. The method for supporting multi-device collaborative intelligent agents according to claim 1, characterized in that, The prompts for injecting into the large model consist only of the names and functional descriptions of each sub-agent in natural text, and do not include pre-entered structured capability tags, interface addresses, or other configuration data.
5. A method for supporting multi-device collaborative intelligent agents according to claim 1, characterized in that, The large model relies on context learning capabilities to complete the semantic matching of tasks based solely on the natural language description within the prompt words. It does not require searching a pre-built database of agent capabilities or relying on preset label rules, thus achieving automatic task assignment without pre-registration.
6. The method for supporting multi-device collaborative intelligent agents according to claim 1, characterized in that, The transition rules of the three-state finite state machine are as follows: when the sub-agent is not authenticated by the pairing code, it is in the unauthenticated state and does not have the right to receive tasks; when there are no tasks to be executed, it is in the idle state and can receive new tasks; when it is executing a task, it switches to the busy state and refuses to receive new concurrent tasks.
7. A method for supporting multi-device collaborative intelligent agents according to claim 1, characterized in that, The Web front-end channel and the instant messaging platform channel are two independent WebSocket logical links, and the channel resources and message queues are isolated from each other; when one channel is blocked, it will not affect the normal task sending and receiving of the other channel.
8. A multi-device collaborative intelligent agent system, capable of executing the multi-device collaborative intelligent agent operation method as described in any one of claims 1 to 7, characterized in that, Includes a server and several remote terminal intelligent agents; The server is equipped with a master agent and a pairing code generation and authentication module. The pairing code generation and authentication module is used to generate a short and easy-to-read pairing code based on the user identifier userId and the random salt value salt, filtering out easily confused characters I, O, 0, and 1. It receives WebSocket authentication access requests initiated by sub-agents carrying the above parameters and completes the legality verification. The main intelligent agent is configured with a prompt word injection module, a large model scheduling module, a state machine management module, a dual-channel communication module, and a task aggregation module; The prompt word injection module is used to collect the name and desc natural language descriptions of all online sub-agents and write them in batches into the prompt word context of the large model; The large model scheduling module is used to read prompt words, match suitable sub-agents based on the natural language descriptions of the sub-agents, and automatically complete task assignment by calling the message sending interface. The state machine management module maintains a finite state machine containing three states: unauthenticated, idle, and busy, and intercepts concurrent tasks of sub-agents; The dual-channel communication module establishes independent web front-end channels and instant messaging platform channels to handle external task interactions in parallel. The task aggregation module tracks the task execution progress of each sub-agent in real time, collects execution result data, and aggregates and generates a task conclusion report.
9. A multi-device collaborative intelligent agent system according to claim 8, characterized in that, The pairing code generation and authentication module generates the pairing code as follows: the userId and salt are concatenated into a string as the encrypted original text, which is then hashed using HMAC-MD5 and truncated to 6 characters with easily confused characters removed; the visible parameter uploaded by the sub-agent is used to identify its external visibility, and the main agent filters the list of agents displayed on the user interface based on the visible parameter; the entire system does not require pre-entry of structured configuration information such as API interfaces and capability tags, enabling sub-agents to access without pre-registration and automatically assign tasks.
10. A multi-device collaborative intelligent agent system according to claim 8, characterized in that, The Web front-end channel and the instant messaging platform channel of the dual-channel communication module are independent WebSocket logical links, and the channel resources and message queues are isolated from each other. The state machine management module performs concurrent interception and verification on the task requests sent from the two channels respectively to ensure the consistency of the state transition of the three-state finite state machine.
Citation Information
Patent Citations
Websocket connection method and websocket connection system based on token authentication
CN112492017A
Task processing method and device based on agent, computer equipment, readable storage medium and program product
CN121704970A
