A multi-agent cooperative task scheduling method and system
Patent Information
- Application Number
- CN202610590421.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-29
- Publication Date
- 2026-08-18
AI Technical Summary
然而,现实世界的复杂业务(如供应链管理、金融资产配置等)本质上需要多个角色协同完成的复杂任务流,如何将多个专才智能体组织起来形成高效协作的“数字员工队伍”,已成为释放大模型技术潜力的核心挑战
[0014]本申请的第三方面提供一种计算机可读存储介质,其上存储有计算机程序,程序被处理器执行时实现前述的多智能体协作任务调度方法的步骤。
Smart Images

Figure CN122594419A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of artificial intelligence technology, and specifically relates to a multi-agent collaborative task scheduling method and system. Background Technology
[0002] Currently, agent technology driven by large language models has demonstrated efficiency surpassing human capabilities in single-task domains. However, complex real-world businesses (such as supply chain management and financial asset allocation) inherently require complex task flows that require collaboration among multiple roles. How to organize multiple specialized agents into a highly efficient collaborative "digital workforce" has become a core challenge in unlocking the potential of large-scale model technology.
[0003] Existing technologies suffer from three fundamental flaws in building multi-agent collaborative systems: First, task planning capabilities are "rigidly lagging." Traditional workflow engines rely on manually preset static processes, which cannot cope with unexpected situations in real business environments (such as port closures and flight cancellations) and lack dynamic replanning capabilities. Second, there are serious "interoperability barriers" between heterogeneous agents. Agents built by different developers are incompatible with each other in terms of communication protocols, data formats, and capability semantics, forming "capability silos." This means that any integration requires costly point-to-point hard coding. Third, the collaboration process is highly opaque. Task decomposition logic, agent calling relationships, state transitions, and root causes of failures are completely hidden from users, forming a "black box" system that is difficult to debug, monitor, and audit, which seriously undermines user trust in high-risk areas.
[0004] In summary, existing technologies have significant shortcomings in three key dimensions: intelligent task decomposition and dynamic planning, standardized management and dynamic discovery of agent capabilities, and visualization and traceability of the collaboration process. There is an urgent need for a new approach to achieve efficient, reliable, and scalable multi-agent collaboration. Summary of the Invention
[0005] To address the aforementioned issues, this application proposes a multi-agent cooperative task scheduling method and system. This method enables efficient, reliable, and scalable multi-agent cooperation.
[0006] To achieve the above objectives, this application provides the following technical solution: The first aspect of this application provides a multi-agent cooperative task scheduling method, the method comprising: It receives complex natural language tasks from user input; it calls large-scale language models to dynamically decompose and plan complex natural language tasks, generating a task decomposition graph containing multiple subtasks and their dependencies. Based on subtasks, one or more candidate agent agents capable of executing the subtask are dynamically discovered by querying the agent registry center; a target agent agent is selected from the candidate agent agents, and the subtask is assigned to the target agent agent according to the predefined A2A protocol; The system receives the execution result returned by the target executor agent according to the A2A protocol, calls the large language model again to fuse the execution result, generates a structured final answer, and presents the final answer to the user.
[0007] In this embodiment of the application, a large language model is invoked to dynamically decompose and plan complex natural language tasks, generating a task decomposition graph containing multiple sub-tasks and their dependencies, including: Taking complex natural language tasks as input, we call large-scale language models to perform semantic parsing and identify the core objectives and constraints of the tasks. By using pre-set prompts, a large language model is instructed to use thought chain technology to perform step-by-step reasoning, generating a series of atomized subtasks; Analyze the logical dependencies between subtasks to determine the execution order of the subtasks; Subtasks and their dependencies are encapsulated into a structured task decomposition graph data format for subsequent scheduling.
[0008] In this embodiment, based on the task decomposition graph and subtasks, one or more candidate agent executors capable of executing subtasks are dynamically discovered by querying the agent registry center. A target agent executor is selected from the candidate agents, and subtasks are assigned to the target agent according to a predefined A2A protocol. Specifically, this includes: For each subtask in the task decomposition graph, the capability identifiers required by the subtask are parsed; the built-in agent discovery tool is invoked to send a query request to the agent registry center, and the query request contains the capability identifiers. In response to the capability identifier in the query request, the agent registry returns a list of one or more candidate agent agents; each candidate agent agent in the list contains its network address, capability description and current health status; The target executor agent is selected from the list of candidate executor agents according to the preset strategy; the built-in task dispatch tool is invoked to construct a standard message encapsulating subtask instructions and parameters according to the A2A protocol, and sent to the network address of the target executor agent via an HTTP request.
[0009] In this embodiment of the application, selecting a target executor agent from a list of candidate executor agents according to a preset strategy specifically includes: Obtain the attribute information of each candidate agent in the candidate executor agent list. The attribute information shall include at least one of the following: capability matching degree, historical performance data and current load status. Each candidate agent is comprehensively scored based on a pre-defined selection strategy model. The candidate agent with the highest overall score is selected as the target executor agent. When there are multiple candidate agents with the same comprehensive score, one of them is selected as the target executor agent according to the load balancing strategy.
[0010] In this embodiment, the built-in task dispatch tool is invoked to construct a standard message encapsulating subtask instructions and parameters according to the A2A protocol, and then sent to the network address of the target executor agent via an HTTP request. Specifically, this includes: Call the task dispatch tool to obtain the network address and security authentication requirements of the target executor intelligent agent; Based on the message format specification of the A2A protocol, a standardized task dispatch message is constructed, which includes at least a message header, a message body, and security authentication information. The instructions and parameters of the subtask are encapsulated into the specified fields of the message body according to the protocol specifications; Generate a security token that meets the security authentication requirements and write it to the security authentication information field of the message or the HTTP request header; The encapsulated standard message is sent to the network address of the target executor agent via an HTTP POST request; Based on the HTTP response status code and message body returned by the target executor agent, determine whether the task assignment was successful.
[0011] In this embodiment of the application, the main control agent maintains a context notepad to track the execution status and intermediate results of all subtasks; The system receives the execution result returned by the target executor agent according to the A2A protocol, then calls a large language model to fuse the execution result again, generating a structured final answer, which is then presented to the user. Specifically, this includes: According to the A2A protocol, the execution result returned by the target executor intelligent agent is received. The execution result includes the subtask identifier and the corresponding artifact. Based on the subtask identifier, update the received artifact to the corresponding subtask record in the context notepad; Based on the dependencies in the task decomposition diagram, determine whether all subtasks of the current original task have been executed. Once all subtasks have been completed, extract all the artifacts from the context notepad and combine them into a data set to be integrated. The large language model is invoked again to fuse the data set, generate a structured final answer, and present it to the user through the front-end interface.
[0012] In this embodiment of the application, the A2A protocol supports synchronous request / response mode and asynchronous callback mode.
[0013] A second aspect of this application provides a multi-agent cooperative task scheduling system, the system comprising: Task planning module: Used to receive complex natural language tasks from user input; calls large language models to dynamically decompose and plan complex natural language tasks, generating a task decomposition graph containing multiple subtasks and their dependencies. Task scheduling module: Based on a subtask, it dynamically discovers one or more candidate executor agents capable of executing the subtask by querying the agent registry center; selects the target executor agent from the candidate executor agents; and assigns the subtask to the target executor agent according to the predefined A2A protocol. The output module receives the execution results returned by the target agent according to the A2A protocol, calls the large language model again to fuse the execution results, generates a structured final answer, and presents the final answer to the user.
[0014] A third aspect of this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the aforementioned multi-agent cooperative task scheduling method.
[0015] A fourth aspect of this application provides an electronic device, including: a memory and a processor; Memory: Used to store computer programs; Processor: Used to execute computer programs to implement the steps of the aforementioned tiered refund and modification rule display method.
[0016] In summary, the multi-agent collaborative task scheduling method and system proposed in this application fundamentally solves the problem of rigid processes and inability to adapt to dynamic changes in traditional BPM / RPA technology by introducing a large language model for dynamic planning and replanning. This significantly improves the fault tolerance and task completion rate of the multi-agent system in complex environments, and achieves a leap from "static execution" to "dynamic intelligence".
[0017] This application also breaks down the "capability silos" between heterogeneous intelligent agents by constructing a standardized capability description and intelligent agent registration center, enabling any third-party intelligent agent that follows the standard to be seamlessly integrated as a "plug-and-play" component, greatly reducing the cost of technology integration, and laying a technical foundation for building an open intelligent agent capability market and promoting industrial development.
[0018] Furthermore, by introducing an event-based state persistence mechanism, this application transforms the complex internal scheduling process into a clear, controllable, and auditable "white-box" state, solving the "black-box" dilemma of existing technologies and meeting the industry access conditions for high-risk fields such as finance and healthcare, thus possessing significant practical application value.
[0019] Other features and advantages of this application will be set forth in the following description and will be apparent in part from the description or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the techniques pointed out in the description, claims and drawings. Attached Figure Description
[0020] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a flowchart illustrating a multi-agent collaborative task scheduling method provided in an embodiment of this application.
[0022] Figure 2 This application provides a configuration interface diagram for registering a regular application as a standard intelligent agent conforming to the A2A (Agent-to-Agent, inter-agent communication) protocol, as provided in an embodiment of the present application.
[0023] Figure 3 This is a diagram of the orchestration and configuration interface of a host agent provided in an embodiment of this application.
[0024] Figure 4 This is an initial interface diagram for a wizard for creating an intelligent agent application, provided as an embodiment of this application.
[0025] Figure 5 This is a flowchart illustrating the architecture of a multi-agent cooperative scheduling mechanism provided in an embodiment of this application.
[0026] Figure 6 This is a structural diagram of a multi-agent cooperative task scheduling system provided in an embodiment of this application.
[0027] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0028] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0029] The term “comprising” and its variations as used herein are open-ended inclusions, meaning “including but not limited to”; the term “based on” means “at least partially based on”; and the term “one embodiment” means “at least one embodiment”.
[0030] It should be noted that the terms "a" and "a plurality of" used in this application are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0031] Terminology Explanation Intelligent agent: refers to a computational entity that possesses autonomy, is capable of perceiving its environment, making decisions, and executing actions. In this invention, it specifically refers to a software program built upon a large-scale language model that is capable of understanding and executing tasks.
[0032] Large Language Model (LLM): refers to a deep learning model trained on large-scale text data, which has powerful natural language understanding, generation and reasoning capabilities, and is the core engine for task planning and integration of the intelligent agent in this invention.
[0033] Host Agent: The core agent that plays the role of "commander-in-chief" in the "host-executor" collaborative model. It is responsible for receiving complex tasks from users, using LLM to automatically decompose and plan tasks, and dynamically discovering and scheduling other "executor agents" to collaboratively complete the tasks.
[0034] A2AA Agent: Refers to an intelligent agent that follows the A2A protocol and plays the role of "executor" in a collaborative model. An A2AA agent typically focuses on one or more tasks in a specific domain (such as flight ticket inquiries) and registers its capabilities in an "agent registry" using standardized "agent cards" for discovery and invocation by the controlling agent.
[0035] A2A Protocol (Agent-to-Agent Protocol): In this application, the A2A protocol refers to a communication protocol system used to standardize interactions between intelligent agents. This protocol defines the registration and discovery process for intelligent agents, capability description methods, message exchange format specifications, and authentication and security mechanisms, thereby ensuring interoperability and reliability between different intelligent agents.
[0036] A skill is a standardized description of a specific function or task that an intelligent agent can perform. In this invention, a skill is typically defined as structured data (such as JSON) containing information such as name, description, input and output parameters, enabling it to be understood and invoked by other intelligent agents.
[0037] Agent Registry: A directory service for unified management of A2A agents. All A2A agents must register their metadata and capability list here upon startup. The controlling agent dynamically discovers available executor agents by querying this center.
[0038] Chain of Thought (CoT): A technique for guiding large language models to perform complex reasoning. By allowing the model to output its reasoning process before answering a question, its accuracy and logical consistency in complex tasks can be significantly improved. In this invention, it is used in the automatic task decomposition process of the controlling agent.
[0039] Task Decomposition Graph (TDG): A graph structure that visualizes the subtasks and their dependencies after a complex task is decomposed. In the front-end interface of this invention, the results of the main control agent automatically decomposing the task are presented to the user in the form of a task decomposition graph.
[0040] Agent Card: A standardized JSON document that declares complete information about an agent and is the cornerstone of dynamic discovery. It contains the agent's name, description, communication address (URL), and a detailed list of "skills".
[0041] Prompt: A natural language instruction that guides a large language model (LLM) to produce specific outputs. In this invention, by performing prompt engineering on the controlling agent, its role as an "expert task delegator," its working principles, and its tool usage logic are defined, thereby achieving the automatic decomposition and orchestration of complex tasks.
[0042] Artifact: Data or results generated and returned by the executor agent during task execution. The master agent is responsible for collecting artifacts from each subtask and intelligently integrating them in the final stage to form a complete task answer.
[0043] Figure 1 The flowchart illustrates a multi-agent cooperative task scheduling method provided in this application embodiment. The method includes the following steps: S1. Receive complex natural language tasks from user input; invoke a large language model to dynamically decompose and plan the complex natural language tasks, generating a task decomposition graph containing multiple sub-tasks and their dependencies.
[0044] S2. Based on the subtask, dynamically discover one or more candidate executor agents capable of executing the subtask by querying the agent registry center; select the target executor agent from the candidate executor agents and assign the subtask to the target executor agent according to the predefined A2A protocol.
[0045] S3. Receive the execution result returned by the target executor intelligent agent according to the A2A protocol, call the large language model again to fuse the execution result, generate the structured final answer, and present the final answer to the user.
[0046] In summary, the multi-agent collaborative task scheduling method proposed in this application fundamentally solves the problem of rigid processes and inability to adapt to dynamic changes in traditional BPM / RPA technology by introducing a large language model for dynamic planning and replanning. It significantly improves the fault tolerance and task completion rate of multi-agent systems in complex environments, and achieves a leap from "static execution" to "dynamic intelligence".
[0047] This application also breaks down the "capability silos" phenomenon among heterogeneous intelligent agents by constructing a standardized capability description and intelligent agent registration center. This enables any third-party intelligent agent that follows the standard to be seamlessly integrated as a "plug-and-play" component, greatly reducing the cost of technology integration and laying a technical foundation for building an open intelligent agent capability market and promoting industrial development.
[0048] Furthermore, by introducing an event-based state persistence mechanism, this application transforms the complex internal scheduling process into a clear, controllable, and auditable "white-box" state, solving the "black-box" dilemma of existing technologies and meeting the industry access conditions for high-risk fields such as finance and healthcare, thus possessing significant practical application value.
[0049] The workflow of the multi-agent cooperative task scheduling method provided in this application will now be explained using a specific embodiment. Specifically: Figure 2This application provides a configuration interface diagram for registering a regular application as a standard intelligent agent conforming to the A2A (Agent-to-Agent, inter-agent communication) protocol, as shown in the embodiments of this application. Figure 3 This is a diagram illustrating the orchestration and configuration interface of a host agent provided in an embodiment of this application. Figure 4 This application provides an initial interface diagram for a wizard to create an intelligent agent application. Figure 5 A flowchart illustrating the architecture of a multi-agent cooperative scheduling mechanism provided in this application embodiment is shown below. Figures 2 to 5 As shown, when an application needs to be discovered and invoked as a "normal intelligent agent" with specific capabilities, it can complete capability registration by responding to the user's "Associate A2A" function interface.
[0050] Reference Figure 2 The interface contains a set of structured forms that respond to the following standardized information provided by the user: Basic metadata: including application name, icon, description, and version number, used for agent identification. Communication endpoint (URL): defines the network address where the agent receives requests and is its unique entry point in the multi-agent network. Skills description: the user must explicitly define here that the agent can perform one or more skills. The description of each skill is a structured data object (e.g., JSON format) containing the skill name, a natural language description of the function, definitions of input and output parameters (including data types, requirements, etc.), and metadata such as version, estimated cost, and execution timeout.
[0051] After the interface receives and saves the above standardized information, the "ordinary intelligent agent" is successfully registered to the system's agent registry.
[0052] The aforementioned intelligent agents can be retrieved and added in the configuration interface of the main intelligent agent, providing a prerequisite for their dynamic discovery and task scheduling.
[0053] like Figure 3 The "A2A agent list" shown here, within the main agent's editing interface, has a core orchestration tool: a "prompt word" text input field. Users can use natural language to define the main agent's role as an "expert delegator," its operating principles, and the tools it can use.
[0054] For example, tool A (list_remote_agents) is used to dynamically query the agent registry in step 1 during the planning phase to discover executors with specific capabilities.
[0055] Tool B (send_message): Used to send formatted task messages to the URL endpoint of a specific executor after a target has been selected.
[0056] Developers can also manually bind one or more executors to the current master agent through the "A2A agents" management area on this interface, as a supplement or alternative to dynamic discovery. At this point, the "brain" of the master agent is ready to receive user tasks.
[0057] The system's built-in default prompt template provided in this application contains the core instructions for task discovery and execution, as detailed below: Task discovery mechanism: The prompt words guide the master agent to use a built-in tool called list_remote_agents. When a macro-level task is received, the master agent will call this tool to query the agent registry center to dynamically discover "ordinary agents" registered in the current network that have the ability to execute the corresponding sub-tasks.
[0058] Task execution mechanism: Once the target agent is identified, the prompt word guides the master agent to use another built-in tool called send_message. Through this built-in tool, the master agent sends the specific subtask instructions and required parameters to the target agent's communication endpoint (URL) in the form of a message, thereby realizing task delegation and execution.
[0059] In addition, the module's user interface provides an "A2A agents" management area, allowing users to manually statically bind one or more "ordinary agents" to the current master agent. This ensures deterministic task delegation and complements the dynamic discovery mechanism.
[0060] In summary, by engineering the prompts of the master agent and configuring its available toolset and associated agent list, users can define the complete logic of task decomposition and orchestration.
[0061] Based on the above embodiments, the instantiation and capability definition of intelligent agent applications can provide users with a unified entry point and management interface.
[0062] like Figure 4 As shown, this application provides a wizard-style interface for "creating a blank application," where users can select preset application types based on their business scenarios, specifically including: Workflow: An orchestration process for single-round automated tasks.
[0063] Chatflow: An interactive flow for complex, multi-turn conversations that supports memory functionality.
[0064] A2A Host Agent: As the core of task distribution and scheduling, it is an agent designed specifically for complex tasks.
[0065] Specifically, when a user selects a target application type through the interactive interface, the system responds to this selection by triggering and presenting a configuration view based on a protected theme. This configuration view includes at least an instantiated configuration area for receiving personalized definition information from the user for the application instance to be created.
[0066] In response to user input in the configuration view, the system obtains the user-defined application name, application icon, and application description information, and associates and binds the information with the selected application type to generate an application instance with a unique identifier.
[0067] The configuration view based on the protected theme uses preset security color values (such as RGB values of a specific color system) to highlight the visual style, distinguishing it from the normal operation interface and providing users with visual feedback that the current operation is in the instantiation configuration stage.
[0068] In summary, this application provides a mechanism for registering any standard application as an intelligent agent conforming to the A2A (Agent-to-Agent) protocol.
[0069] like Figure 5 As shown, this application provides a multi-agent collaborative scheduling process with "Host-Executor" as the core mode to ensure that the system can intelligently, dynamically and reliably complete complex tasks.
[0070] Reference Figure 5 The agent registration and discovery mechanism is the foundation for building an open agent ecosystem.
[0071] This application establishes a centralized "Agent Registry". All A2A agents acting as "executors" must send a registration request to this registry upon startup, submitting their network address (URL endpoint), security credentials, and a skill manifest conforming to the aforementioned standardized format. The registry also requires agents to provide a health check interface and periodically performs probes to ensure service availability, automatically remove malfunctioning or unresponsive agents, and maintain the real-time and accuracy of the directory.
[0072] When the master agent needs to schedule external capabilities during the planning phase, it no longer uses hard-coded calls, but instead sends dynamic query requests to the agent registry. Queries can be based on precise capability IDs or fuzzy searches based on keywords or natural language descriptions. The registry uses its stored capability descriptions, through keyword matching or even vector similarity searches, to return a list of currently available A2A agents that meet the requirements, for the master agent to choose from.
[0073] Reference Figure 5 The dynamic task scheduling process based on a large language model is the brain and central nervous system of the entire system, and its function is as follows: Task reception: The process begins when the main intelligent agent receives a complex natural language task input by the user through the front-end interface.
[0074] Task decomposition and planning: The master agent utilizes its built-in planning capabilities based on a powerful Large Language Model (LLM) to logically decompose the task, generating a series of ordered or parallel subtasks. This planning process is dynamic; if a subtask fails, the planner can dynamically replan based on the reason for the failure, such as trying to call an alternative agent or adjusting subsequent task steps, demonstrating strong robustness and adaptability.
[0075] Agent discovery and matching: For each decomposed subtask, the master agent, based on its required capabilities, executes the "discovery" process described above to obtain a list of candidate A2A agents capable of performing the task from the registry center. The master agent may also make the optimal selection from the list based on factors such as the agent's historical performance (e.g., success rate, response time) and cost.
[0076] Task Assignment and Communication: Based on the discovery and matching results, the master agent selects the most suitable A2A agent and assigns subtasks by sending secure HTTP requests to the target A2A agent's URL endpoint, strictly adhering to the A2A protocol's message format. The protocol header includes a JWT token for authentication and authorization, ensuring secure communication. The protocol itself supports synchronous request / response modes (for fast queries) and asynchronous callback modes (for tasks requiring longer processing times), increasing the system's interactive flexibility.
[0077] Results aggregation and integration: The master agent maintains a contextual "notebook" throughout its lifecycle to track the execution status and results of all subtasks. It receives execution results returned by each A2A agent asynchronously or synchronously. For the diverse results data collected, the master agent again utilizes LLM capabilities for validation, deduplication, sorting, summarization, and deep integration to resolve potential information conflicts, ultimately forming a logically coherent, complete, and structured final answer, which is presented to the user in a user-friendly manner through the front-end interface.
[0078] For example, in one specific embodiment, in response to a user's natural language request containing a specific intent (e.g., "Help me plan a five-day trip from Beijing to Shanghai next week, requiring affordable round-trip airfare, hotels that are four-star or higher with a rating of no less than 4.5, and tell me the weather in Shanghai during the trip"), the platform backend receives the request and dispatches it to a master intelligent agent that is associated with the user and pre-instantiated, to initiate the background scheduling method of this application.
[0079] In response to receiving a user's request instruction, the master control agent invokes a large language model (LLM) instance deployed in the model layer and uses a preset chain of thought (CoT) prompt template to automatically parse the user request.
[0080] Specifically, the master agent inputs a system prompt into the large language model, which contains a set of instructions to guide the model to perform logical decomposition. In response to the output of the large language model based on the system prompt, the master agent obtains a structured parsing result and transforms the user's single request into a task decomposition graph (TDG) containing multiple atomic subtasks and their dependencies.
[0081] In this example, the structured task plan output by LLM (in JSON format) is as follows: [{"task_id": "T1", "description": "Search for budget round-trip flights from Beijing to Shanghai", "skill_required": "Flight search", "dependencies": []}, {"task_id": "T2", "description": "Search for hotels in Shanghai that meet the specified criteria", "skill_required": "Hotel search", "dependencies": []}, {"task_id": "T3", "description": "Get weather forecast for your trip to Shanghai", "skill_required": "Weather query", "dependencies": []}, {"task_id": "T4", "description": "Integrate information to generate the final travel plan", "skill_required": "Information integration and report generation", "dependencies": ["T1", "T2", "T3"]}.
[0082] The Task Graph (TDG) generated during the Task Decomposition and Planning phase will be sent to the backend system as the basis and guide for subsequent automated execution.
[0083] After the global task planning phase is completed, the Master Agent enters the atomic task execution phase. For the decomposed atomic task T1, the Master Agent needs to dynamically locate the execution unit with the target skill in the distributed agent network, that is, the executor agent (A2A Agent) capable of performing the "flight query" operation.
[0084] To achieve the aforementioned positioning, the master control agent interacts with the pre-defined agent registry in this invention. The agent registry, as the core routing node in the multi-agent system, maintains a real-time updated registration database. This database stores the capability declaration information, i.e., agent cards, of all registered A2A agents in the network.
[0085] The proxy card is a standard structured electronic document generated based on a preset JSON Schema. It is used to standardize the description of the agent's capabilities and interface information, and forms the technical foundation for realizing the dynamic agent discovery mechanism. Each proxy card contains at least the following key technical fields: The url field represents the network communication address of the agent, which is used for subsequent task invocation; The skills field: represents the set of functions supported by the agent in array form.
[0086] Taking JSON format as an example: {"name": "Travel Planner Agent", "description": "An intelligent agent capable of planning trips", "url": "http: / / localhost:10001 / a2a", "skills": [{"id": "travel_planner", ...}], ...} To locate the executor of atomic task T1, the controlling agent initiates a capability matching query to the agent registry center. The query request includes the target skill tag `skill_required` required for atomic task T1.
[0087] The agent registry is equipped with a matching engine, which performs a semantic comparison between the received target skill tags and the skills field of the agent cards stored in the database. When the matching engine determines that the skills field includes skill_required, it identifies the agent corresponding to that agent card as the matching agent.
[0088] In a preferred embodiment, the matching engine identifies the "Travel Planner Agent" as the executor agent that matches task T1 and extracts the communication address URL declared in the agent's agent card.
[0089] The agent registry sends the communication address to the master agent, which then calls the "TravelPlanner Agent" to execute task T1.
[0090] After identifying the executor, the controlling agent must precisely convey task instructions to it. Communication between the two strictly follows the A2A protocol defined in this invention, which is based on JSON-RPC 2.0 over HTTP(S), and its message structure is as follows: Figure 5 As shown.
[0091] Task assignment is accomplished by the send_message function inside the master intelligence, which is responsible for constructing a standardized A2A message containing authentication information and task content.
[0092] async def send_message(self, agent_name: str, message: str, tool_context: ToolContext): # ... Pre-verification... client = self.remote_agent_connections[agent_name] state = tool_context.state # Construct a MessageSendParams request body conforming to the A2A protocol request: MessageSendParams = MessageSendParams( id=str(uuid.uuid4()), message = Message( role='user', parts=[TextPart(text=message)], taskId=state.get('task_id'), contextId=state.get('context_id') ), # ... Other configurations ) # Send request asynchronously response = await client.send_message(request, self.task_callback) # ... Results Processing... The above function generates an HTTP POST request carrying a JWT token, whose JSON-RPC request body precisely describes the instructions of task T1, and is sent to the URL of the target executor agent.
[0093] Once the executor agent receives a request at its server endpoint, it is processed by its web application framework. This framework is responsible for parsing the JSON-RPC request and invoking the appropriate handler based on the method field (such as a2a.message.send).
[0094] # Request processing logic snippet in DynamicFlaskJSONRPCApplication class DynamicFlaskJSONRPCApplication(ABC): def _handle_requests(self, request, resource_id=None): # ... Parsing and validating requests... body = request.get_json(force=True) a2a_request = A2ARequest.model_validate(body) # ... # Dispatch to different processing functions based on request type if isinstance(request_obj, SendMessageRequest): handler_result = handler.on_message_send(request_obj, context) # ... The request is ultimately routed to a specific implementation class of AgentExecutor, such as Travel Planner AgentExecutor. This class serves as an adaptation layer between the A2A protocol and the internal business logic of the agent.
[0095] # AgentExecutor Implementation for Executor Intelligent Agents class TravelPlannerAgentExecutor(AgentExecutor): async def execute(self, context: RequestContext, event_queue:EventQueue): query = context.get_user_input() # 1. Call internal business logic async for event in self.agent.stream(query): # 2. Encapsulate the result as a TaskArtifactUpdateEvent message = TaskArtifactUpdateEvent( taskId=context.task_id, artifact=new_text_artifact(text=event['content']) ) # 3. Push events into a queue and notify the master agent via streaming response or callback. await event_queue.enqueue_event(message) # 4. Send task completion status event status = TaskStatusUpdateEvent( taskId=context.task_id, status=TaskStatus(state=TaskState.completed), final=True ) await event_queue.enqueue_event(status) Throughout the task execution process, to ensure state consistency and traceability in a distributed environment, the executor agent uses the TaskManager component for state management. The design of this component strictly adheres to key technical solutions such as "event sourcing" and "optimistic concurrency control."
[0096] Furthermore, the core of Task Manager is its event handling mechanism, as shown in the save_task_event method: # Logic for saving events and updating state in TaskManager class TaskManager: async def save_task_event(self, event: ...): task: Task = await self.ensure_task(event) if isinstance(event, TaskStatusUpdateEvent): task.status = event.status elif isinstance(event, TaskArtifactUpdateEvent): append_artifact_to_task(task, event) # Persist the updated complete Task object via TaskStore await self._save_task(task) When persisting data, the `save_task` method uses an Event Sourced TaskStore implementation, where each state change (event) is appended as an atomic event instead of directly overwriting the old state. This ensures that the complete history of tasks is preserved, greatly enhancing the system's auditability and fault recovery capabilities.
[0097] While the main control agent waits for the result of task T1, it does not block, but instead starts the scheduling process for tasks T2 (querying hotels) and T3 (querying weather) in parallel, repeating steps two through five. This parallel processing mechanism is the key to the efficient completion of complex tasks in this invention.
[0098] Once the master agent asynchronously receives notification that all three subtasks have been completed and has collected all the "artifacts" returned by each of them, containing the query results, it triggers the execution conditions for the final task T4.
[0099] In the final step, the master agent invokes LLM again, but this time the purpose is integration rather than decomposition. It uses the structured data (flight lists, hotel lists, weather forecasts) collected from T1, T2, and T3 as context and issues an integration instruction: "You are a professional travel consultant. Based on the following data: [T1 artifact], [T2 artifact], [T3 artifact], please generate a well-formatted and detailed five-day travel plan for the user." LLM leverages its powerful natural language generation capabilities to integrate these fragmented data points into a logically coherent and user-friendly report. This final report is presented to the user through a front-end interactive interface, thus completing an end-to-end multi-agent collaborative process.
[0100] In this embodiment, a large language model is invoked to dynamically decompose and plan complex natural language tasks, generating a task decomposition graph containing multiple subtasks and their dependencies. This includes: taking the complex natural language task as input, invoking the large language model for semantic parsing to identify the core objectives and constraints of the task; instructing the large language model to use thought chain technology for step-by-step reasoning through preset prompts to generate a series of atomized subtasks; analyzing the logical dependencies between the subtasks to determine the execution order of the subtasks; and encapsulating the subtasks and their dependencies into a structured task decomposition graph data format for subsequent scheduling.
[0101] Furthermore, based on the task decomposition graph and subtasks, by querying the agent registry, one or more candidate agent agents capable of executing subtasks are dynamically discovered. A target agent agent is selected from these candidate agents, and subtasks are assigned to the target agent agent according to a predefined A2A protocol. Specifically, this includes: For each subtask in the task decomposition graph, the capability identifiers required by the subtask are parsed; the built-in agent discovery tool is invoked to send a query request to the agent registry center, and the query request contains the capability identifiers. In response to the capability identifier in the query request, the agent registry returns a list of one or more candidate agent agents; each candidate agent agent in the list contains its network address, capability description and current health status; The target executor agent is selected from the list of candidate executor agents according to the preset strategy; the built-in task dispatch tool is invoked to construct a standard message encapsulating subtask instructions and parameters according to the A2A protocol, and sent to the network address of the target executor agent via an HTTP request.
[0102] Furthermore, the target executor agent is selected from the candidate executor agent list according to a preset strategy. Specifically, this includes: obtaining the attribute information of each candidate agent in the candidate executor agent list, the attribute information including at least one of capability matching degree, historical performance data and current load status; performing a comprehensive score on each candidate agent according to a preset selection strategy model; selecting the candidate agent with the highest comprehensive score as the target executor agent; when there are multiple candidate agents with the same comprehensive score, selecting one of them as the target executor agent according to a load balancing strategy.
[0103] In this embodiment, the built-in task dispatch tool is invoked to construct a standard message encapsulating subtask instructions and parameters according to the A2A protocol, and sent to the network address of the target executor intelligent agent via an HTTP request. Specifically, this includes: invoking the task dispatch tool to obtain the network address and security authentication requirements of the target executor intelligent agent; constructing a standardized task dispatch message according to the message format specifications of the A2A protocol, the message containing at least a message header, message body, and security authentication information; encapsulating the subtask instructions and parameters into specified fields of the message body according to the protocol specifications; generating a security token that meets the security authentication requirements and writing it into the security authentication information field of the message or the HTTP request header; sending the encapsulated standard message to the network address of the target executor intelligent agent via an HTTP POST request; and determining whether the task dispatch was successful based on the HTTP response status code and message body returned by the target executor intelligent agent.
[0104] In this embodiment of the application, the master control agent maintains a context notepad to track the execution status and intermediate results of all subtasks.
[0105] In this application, the execution result returned by the target executor agent according to the A2A protocol is received, and a large language model is invoked again to fuse the execution result, generating a structured final answer, which is then presented to the user. Specifically, this includes: receiving the execution result returned by the target executor agent according to the A2A protocol, the execution result containing subtask identifiers and corresponding artifacts; updating the received artifacts to the corresponding subtask records in the context notepad based on the subtask identifiers; determining whether all subtasks of the current original task have been executed based on the dependencies in the task decomposition graph; when all subtasks have been executed, extracting all subtask artifacts from the context notepad and combining them into a data set to be integrated; invoking the large language model again to fuse the data set, generating a structured final answer, which is then presented to the user through a front-end interface.
[0106] In this application, the A2A protocol supports synchronous request / response mode and asynchronous callback mode.
[0107] Figure 6 This application provides a structural diagram of a multi-agent cooperative task scheduling system, as shown in the embodiments below. Figure 6 As shown, the system includes: a task planning module, a task scheduling module, and a result output module.
[0108] The task planning module receives complex natural language tasks input by the user; it then calls a large-scale language model to dynamically decompose and plan the complex natural language tasks, generating a task decomposition graph containing multiple subtasks and their dependencies. The task scheduling module, based on a subtask, dynamically discovers one or more candidate agents capable of executing that subtask by querying the agent registry; it selects a target agent from the candidate agents and assigns the subtask to the target agent according to a predefined A2A protocol. The result output module receives the execution result returned by the target agent according to the A2A protocol, calls the large-scale language model again to fuse the execution result, generates a structured final answer, and presents the final answer to the user.
[0109] The above system implements the steps of the tiered refund and modification rule display method disclosed in this application when it is running.
[0110] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0111] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, such as... Figure 7 As shown, the electronic device includes: a processor 310, a communication interface 320, a memory 330 for storing processor-executable computer programs, and a communication bus 340. The processor 310, communication interface 320, and memory 330 communicate with each other via the communication bus 340. The processor 310 executes the executable computer program to implement the steps of the aforementioned tiered refund / modification rule display method.
[0112] It is understandable that, in addition to memory and a processor, this electronic device may also include input devices such as a keyboard, output devices such as a display, and other communication modules. The input devices, output devices, and other communication modules communicate with the processor through I / O interfaces (i.e., input / output interfaces).
[0113] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof. These programming languages include, but are not limited to, object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0114] Furthermore, this application also discloses a computer-readable storage medium, which, when the instructions in the computer-readable storage medium are executed by the processor of an electronic device, enables the electronic device to perform the various steps of the tiered refund and modification rule display method disclosed in this application.
[0115] In the context of this application, computer-readable storage media can be tangible media, and more specific examples include portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, and portable compact disc read-only memory (CD). ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0116] Specifically, according to embodiments of this application, the process described in the flowchart can be implemented as a computer software program. For example, embodiments of this application include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for executing the tiered refund / modification rule display method disclosed in this application. When the computer program is executed by a processing system, it performs the functions defined in the methods of the embodiments of this application.
[0117] While the foregoing discussion includes several specific implementation details, these should not be construed as limiting the scope of this application. The above description is merely a preferred embodiment of this application and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of disclosure in this application is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept.
[0118] Those skilled in the art should also understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A multi-agent cooperative task scheduling method, characterized in that, Applied to a system comprising a controlling agent and at least one executor agent, the method includes: It receives complex natural language tasks from user input, calls a large language model to dynamically decompose and plan the complex natural language tasks, and generates a task decomposition graph containing multiple subtasks and their dependencies. Based on the task decomposition graph and subtasks, one or more candidate executor agents capable of executing subtasks are dynamically discovered by querying the agent registry center. The target executor agent is selected from the candidate executor agents, and the subtask is assigned to the target executor agent according to the predefined A2A protocol. The system receives the execution result returned by the target executor agent according to the A2A protocol, calls the large language model again to fuse the execution result, generates a structured final answer, and presents the final answer to the user.
2. The method according to claim 1, characterized in that, Large-scale language models are invoked to dynamically decompose and plan complex natural language tasks, generating a task decomposition graph containing multiple subtasks and their dependencies, including: The complex natural language task is used as input, and the large language model is invoked to perform semantic parsing to identify the core objectives and constraints of the task. The large language model is instructed by preset prompts to use thought chain technology to perform step-by-step reasoning and generate a series of atomized sub-tasks. Analyze the logical dependencies between subtasks to determine the execution order of the subtasks; The subtasks and their dependencies are encapsulated into a structured task decomposition graph data format for subsequent scheduling.
3. The method according to claim 1, characterized in that, Based on the task decomposition graph and subtasks, one or more candidate agent agents capable of executing subtasks are dynamically discovered by querying the agent registry. A target agent agent is selected from these candidates, and subtasks are assigned to the target agent according to a predefined A2A protocol. Specifically, this includes: For each subtask in the task decomposition graph, the capability identifiers required by the subtask are parsed; the built-in agent discovery tool is invoked to send a query request to the agent registry center, and the query request contains the capability identifiers. In response to the capability identifier in the query request, the agent registry returns a list of one or more candidate executor agents; each candidate executor agent in the candidate executor agent list includes its network address, capability description and current health status; According to the preset strategy, a target executor agent is selected from the list of candidate executor agents; the built-in task dispatch tool is invoked to construct a standard message encapsulating subtask instructions and parameters according to the A2A protocol, and sent to the network address of the target executor agent via an HTTP request.
4. The method according to claim 3, characterized in that, The target executor agent is selected from the list of candidate executor agents according to a preset strategy, specifically including: Obtain the attribute information of each candidate agent in the candidate executor agent list. The attribute information includes at least one of the following: capability matching degree, historical performance data, and current load status. Each candidate agent is comprehensively scored based on a pre-defined selection strategy model. The candidate agent with the highest comprehensive score is selected as the target executor agent. When there are multiple candidate agents with the same comprehensive score, one of them is selected as the target executor agent according to the load balancing strategy.
5. The method according to claim 1, characterized in that, The built-in task dispatch tool is invoked to construct a standard message encapsulating subtask instructions and parameters according to the A2A protocol, and then sent to the network address of the target executor agent via an HTTP request. Specifically, this includes: Invoke the task dispatch tool to obtain the network address and security authentication requirements of the target executor intelligent agent; Based on the message format specification of the A2A protocol, a standardized task dispatch message is constructed, which includes at least a message header, a message body, and security authentication information. The instructions and parameters of the subtask are encapsulated into the specified fields of the message body according to the protocol specifications; Generate a security token that meets the security authentication requirements and write it to the security authentication information field of the message or the HTTP request header; The encapsulated standard message is sent to the network address of the target executor agent via an HTTP POST request; Based on the HTTP response status code and message body returned by the target executor intelligent agent, determine whether the task assignment was successful.
6. The method according to claim 1, characterized in that, The master intelligent agent maintains a context notepad to track the execution status and intermediate results of all subtasks; The system receives the execution result returned by the target executor agent according to the A2A protocol, and then calls a large language model again to fuse the execution result, generating a structured final answer, which is then presented to the user. Specifically, this includes: According to the A2A protocol, the execution result returned by the target executor intelligent agent is received, and the execution result includes the subtask identifier and the corresponding artifact; Based on the subtask identifier, update the received workpiece to the corresponding subtask record in the context notepad; Based on the dependencies in the task decomposition graph, determine whether all subtasks of the current original task have been executed. Once all subtasks have been completed, extract all the artifacts from the context notepad and combine them into a data set to be integrated. The large language model is invoked again to fuse the data set, generate a structured final answer, and present it to the user through the front-end interface.
7. The method according to claim 1, characterized in that, The A2A protocol supports both synchronous request / response mode and asynchronous callback mode.
8. A multi-agent cooperative task scheduling system, characterized in that, The system includes: Task planning module: used for complex natural language tasks that receive user input; A large language model is invoked to dynamically decompose and plan the complex natural language task, generating a task decomposition graph containing multiple sub-tasks and their dependencies. Task scheduling module: Based on the sub-task, it dynamically discovers one or more candidate executor agents capable of executing the sub-task by querying the agent registry center; Select a target executor agent from the candidate executor agents and assign sub-tasks to the target executor agent according to the predefined A2A protocol; The result output module is used to receive the execution result returned by the target executor agent according to the A2A protocol, call the large language model again to perform fusion processing on the execution result, generate a structured final answer, and present the final answer to the user.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of any one of claims 1 to 7.
10. An electronic device, characterized in that, include: Memory and processor; Memory: Used to store computer programs; Processor: Used to execute computer programs to achieve the functionality described in claim 1 The steps for displaying the tiered refund / modification rules for any of the 7 items.