A method and system for collaborative scheduling of server edge agents based on a model context protocol

By employing a server-side edge agent collaborative scheduling method based on the Model Context Protocol, and utilizing dual-agent collaborative scheduling and dynamic scheduling optimization algorithms, the problems of decision space expansion and inaccurate intent parsing in agent scheduling in edge computing are solved, achieving efficient and accurate task execution and adaptive scheduling.

CN122635366APending Publication Date: 2026-08-25SHANGHAI HONGZE INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610772502.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-01
Publication Date
2026-08-25

AI Technical Summary

Technical Problem

Traditional edge computing agent scheduling schemes face problems such as decision space expansion, inaccurate intent parsing, inability to adapt to dynamic environments, high parameter completion errors, and insufficient self-healing capabilities, resulting in inference delays, call deadlocks, and low execution efficiency.

Method used

A server-side edge agent collaborative scheduling method based on model context protocol is adopted. Through the collaboration of two agents, intent parsing, dynamic scheduling and parameter completion are completed. Hierarchical intent parsing algorithm, reinforcement learning and transfer learning algorithm are used, combined with natural language understanding and reinforcement learning to optimize the scheduling strategy, so as to achieve adaptive tool combination and parameter completion.

Benefits of technology

It effectively compresses the decision space, improves the execution accuracy and efficiency of edge agents, adapts to dynamic environmental changes, reduces inference latency and call deadlock, and enhances the fluency and automation level of multi-turn interactions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122635366A_ABST
    Figure CN122635366A_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on model context protocol's server edge intelligent agent collaborative scheduling method and system.The method includes: protocol server hides atomic level tool and exposes composite tool to first intelligent agent;First intelligent agent sends query instruction to server;Second intelligent agent embedded in server uses hierarchical intention analysis algorithm, cooperates recurrent neural network and attention mechanism to generate task execution atlas;With the atlas as action constraint, the scheduling sequence of atomic level tool is optimized adaptively using reinforcement learning model, and in execution, missing parameters are dynamically completed through transfer learning, and operation suggestions are returned.Business data is generated.When scheduling error occurs, use the counterfactual reasoning-based causal inference algorithm to diagnose the root cause, and use the causal value as negative feedback to input the reinforcement learning model to correct the path.The application realizes high-precision intention correction, dynamic adaptive scheduling, cross-tool parameter completion and link flexible self-healing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of artificial intelligence and edge computing technology, and more specifically, to a server-side edge agent collaborative scheduling method and system based on a model context protocol. Background Technology

[0002] With the widespread application of large language models and multi-agent systems, deploying agents at the network edge to execute business processes has become a key development direction for industrial automation, smart government, and data privacy-sensitive scenarios. Model context protocols, as a standardized communication framework, enable agents to securely invoke server-side tools and data contexts.

[0003] However, in the actual deployment of edge computing, traditional scheduling schemes face significant technical obstacles. User query commands in edge environments exhibit high ambiguity and industry specificity. Existing intent parsing mechanisms rely solely on single inputs or basic keyword matching, failing to effectively integrate historical dialogue states and domain knowledge graph features. This leads to continuous intent drift during multi-turn interactions, with task decomposition paths deviating from the actual business logic. Particularly in vertical sectors such as healthcare and finance, the lack of industry ontology support makes it difficult for intelligent agents to accurately map user needs.

[0004] Meanwhile, the direct exposure of all atomic-level tools on the server side leads to an exponential expansion of the decision space. When agents handle complex tasks, they face a surge in the number of tools, causing inference delays or deadlocks in the call chain. Fixed scheduling strategies, such as predefined directed acyclic graphs, cannot adapt to edge network jitter, computing power fluctuations, and dynamic changes in dependent services, and lack the ability to adjust concurrency strategies and fault tolerance mechanisms in real time.

[0005] During toolchain execution, parameter passing dependencies are complex, and subsequent tools often encounter implicit parameter missingness or missing required fields. Traditional solutions rely on manual intervention or static default values ​​for filling in these gaps, severely hindering the continuity of automated processes. In the cold start phase for new users or new businesses, the parameter completion error increases significantly due to a lack of historical data.

[0006] Furthermore, the uncertainty of the edge environment makes the execution of tools susceptible to network timeouts, logical conflicts, or third-party failures. Existing anomaly handling only captures surface error logs and cannot penetrate the call chain black box to locate deep causal roots. Diagnostic results cannot be transformed into decision optimization signals, causing the agent to repeatedly try on the wrong path and lose its closed-loop self-healing ability.

[0007] To address the aforementioned issues, existing technologies urgently need improvement. Summary of the Invention

[0008] The purpose of this invention is to provide a server-side edge agent collaborative scheduling method and system based on model context protocol, which can effectively compress the decision space of edge agents, avoid inference delays or call deadlocks caused by a surge in the number of tools, and combine context to complete intent parsing and dynamic scheduling, adapt to the dynamic characteristics of the edge environment, and improve the accuracy and efficiency of complex task execution.

[0009] The above-mentioned technical objective of the present invention is achieved through the following technical solution:

[0010] A server-side edge agent collaborative scheduling method based on a model context protocol, characterized by the following steps:

[0011] Step 1: The protocol server registers and exposes the composite tool with the first agent, and hides all atomic tools; the first agent generates a natural language query command and sends it to the protocol server through the model context protocol;

[0012] Step 2: The protocol server transmits the received natural language query command to the internally configured second intelligent agent; the second intelligent agent performs semantic parsing using a hierarchical intent parsing algorithm that combines natural language understanding, and outputs a structured task execution graph;

[0013] Step 3: The second intelligent agent adopts a dynamic task decomposition and scheduling optimization algorithm based on reinforcement learning to transform the task execution graph into a sequence decision problem of atomic tools. During the execution process, it uses a joint inference and transfer learning algorithm with automatic parameter completion to complete missing parameters in real time to generate business response data.

[0014] Step 4: Based on the business response data and the current business logic state, the second intelligent agent generates additional suggestions for the next operation and returns them to the first intelligent agent through the protocol server.

[0015] Furthermore, in step 2, the hierarchical intent parsing algorithm achieves dynamic correction through the following mathematical logic:

[0016] S21. Introducing a multi-turn dialogue state tracking operator ;

[0017] in, This represents the current dialogue state. This is the semantic vector of the currently input query command. These are the business domain ontology features extracted from the knowledge graph; RNN() is a recurrent neural network operator used to extract features from hidden states. Persist the features of historical dialogue information and store the hidden state. semantic vector of the query instruction at the current moment and business domain ontology features Perform nonlinear mapping fusion to generate the dialogue state for the current round, which includes contextual constraints. ;

[0018] S22. Calculate the distribution weight of intent using the attention mechanism. The query vector Q originates from the semantic vector of the currently input query command. The key vector K is mapped from the user profile and historical interaction records; V is the feature dimension; the attention mechanism calculates the association score between the query vector Q and the key vector K, and uses the softmax function to normalize it to generate a distribution weight W, which is used to identify the feature components in the historical information that are highly related to the current intent, and corrects the original intent through weighted fusion, and outputs the final task execution map.

[0019] Furthermore, in step 3, the dynamic task decomposition and scheduling optimization algorithm is optimized using the following reinforcement learning model:

[0020] Define the state space S as the real-time state of the atomic tool, the action space D as the set of candidate tools defined by the task execution graph, and the reward function R as the representation of... Where P is the execution success rate, T is the response time, C is the resource consumption, and M1, M2, and M3 are weighting coefficients.

[0021] The reinforcement learning model modulates the policy function through a deep modulation network. Training was conducted, including... This represents an atomic-level tool scheduling action selected from the action space D. This represents the current system state; the reinforcement learning model uses the reward function R as a goal guide, and continuously tries different combinations of tools in the action space D to optimize the policy function. This enables adaptive optimization of the atomic-level tool combination order, concurrency strategy, and fault tolerance mechanism under the constraints of the task execution graph.

[0022] Furthermore, in step 3, the joint inference and transfer learning algorithm for automatic parameter completion specifically includes:

[0023] Construct a migration mapping function with the source domain being the historical tool call set and the target domain being the tool with the currently missing parameters;

[0024] Calculate the probability distribution of missing parameters using a parametric inference network:

[0025]

[0026] in, Let X be the parameter value space, H be the context semantic vector, H be the prior distribution in the cross-tool knowledge base, and Z be the neural network parameters.

[0027] The transfer learning algorithm transfers the parameter-related features accumulated in the source domain to the target domain through the transfer mapping function. The parameter inference network calculates the conditional probability of the candidate parameter values ​​in the feature space and extracts the parameter corresponding to the maximum probability for automatic filling. The parameter inference network supports incremental learning and corrects the neural network parameters Z by capturing the user's new interaction habits in real time, so as to reduce the completion error in the cold start scenario.

[0028] Furthermore, step 3 also includes a causal inference algorithm for error diagnosis and self-repair, the specific steps of which are as follows:

[0029] S31. By combining log analysis, anomaly detection and cause-effect graph model, it automatically identifies whether execution errors originate from parameters, network, dependent services, or logical conflicts.

[0030] S32. Calculate the causal effectiveness E of the error using counterfactual reasoning;

[0031]

[0032] Where Y is the execution failure index, B is the diagnosed root cause variable; Mean[] is the expected value operator, which is used to calculate the mathematical expectation of the potential outcome distribution after the intervention simulated by the do() operator. By eliminating the random bias of a single call, the average marginal contribution of the root cause variable B to the system execution failure rate is quantified, and the difference in the average execution failure rate before and after the intervention is calculated to quantify the causal strength of each potential failure source.

[0033] S33. The causal effect value E is input as a negative feedback signal to the reinforcement learning model, and the second agent is forced to regenerate the execution path in the task execution graph by reducing the reward expectation of the corresponding scheduling sequence.

[0034] A server-side edge agent collaborative scheduling system based on a model context protocol includes:

[0035] The first intelligent agent is used to generate natural language query instructions and send requests through the model context protocol;

[0036] The protocol server is used to register with the first agent and expose composite tools while hiding all atomic tools, and to receive the request from the first agent through the model context protocol;

[0037] The second intelligent agent, embedded within the protocol server, includes:

[0038] The intent parsing module is used to generate a structured task execution graph using a hierarchical intent parsing algorithm;

[0039] The dynamic scheduling module is used to adaptively optimize the scheduling sequence of atomic tools using a reinforcement learning model, with the task execution graph as a constraint.

[0040] The parameter inference module is used to automatically complete missing parameters through a transfer learning model during the scheduling process;

[0041] The error self-healing module is used to diagnose the source of errors based on a causal inference algorithm and feed the diagnosis results back to the dynamic scheduling module to trigger the execution path correction.

[0042] In summary, the present invention has the following beneficial effects:

[0043] By exposing composite tools and hiding atomic-level tools on the protocol server, the decision space is compressed. In conjunction with dual agents, intent parsing, dynamic scheduling, parameter completion, and result return are completed. This solves the technical problems of decision space expansion, inaccurate intent parsing, and inability to adapt to dynamic edge environments in traditional edge agent scheduling. It can effectively compress the decision space of edge agents, avoid inference delays or call deadlocks caused by a surge in the number of tools, and combine context to complete intent parsing and dynamic scheduling, adapting to the dynamic characteristics of the edge environment and improving the accuracy and efficiency of complex task execution. Attached Figure Description

[0044] Figure 1 This is a flowchart of the server-side edge intelligent agent collaborative scheduling method described in this invention.

[0045] Figure 2 This is a structural diagram of the server-side edge intelligent agent collaborative scheduling system described in this invention. Detailed Implementation

[0046] To make the technical means, creative features, objectives and effects of this invention easier to understand, the invention will be further described below with reference to the figures and specific embodiments.

[0047] like Figure 1 As shown, the present invention proposes a server-side edge agent cooperative scheduling method based on a model context protocol, which includes the following steps:

[0048] Step 1: The protocol server registers and exposes the composite tool with the first agent, while hiding all atomic-level tools; the first agent generates a natural language query command and sends it to the protocol server via the model context protocol;

[0049] Step 2: The protocol server passes the received natural language query command to the internally configured second agent; the second agent uses a hierarchical intent parsing algorithm that combines natural language understanding to perform semantic parsing and outputs a structured task execution graph;

[0050] Step 3: The second intelligent agent adopts a dynamic task decomposition and scheduling optimization algorithm based on reinforcement learning to transform the task execution graph into a sequence decision problem of atomic tools. During the execution process, it uses joint inference and transfer learning algorithms with automatic parameter completion to complete missing parameters in real time to generate business response data.

[0051] Step 4: Based on the business response data and the current business logic state, the second intelligent agent generates additional suggestions for the next operation and returns them to the first intelligent agent through the protocol server.

[0052] For ease of understanding, the following explains some key terms in this embodiment:

[0053] The protocol server is configured to act as a communication hub between agents and backend tools and data sources in the edge computing environment. It is responsible for receiving requests from agents, coordinating internal agents for processing, and managing the registration and exposure of tools.

[0054] The first intelligent agent is configured as an intelligent entity that interacts directly with the user. It is responsible for receiving the user's natural language input, converting it into standardized query commands, and sending them to the protocol server through the model context protocol.

[0055] The second intelligent agent is configured as an intelligent processing unit embedded within the protocol server. It is responsible for performing core business logic processing on the received query commands, such as deep semantic parsing, task decomposition, scheduling optimization, and parameter completion, in order to generate business response data.

[0056] Composite tools are defined as abstract tool interfaces with specific business functions, composed of one or more atomic-level tools, whose internal implementation details are hidden from external intelligent agents.

[0057] Atomic tools are defined as the smallest, indivisible execution units that make up a composite tool. They typically correspond to specific microservice interfaces or APIs and directly execute underlying operations.

[0058] Model Context Protocol (MGP) is defined as a unified open communication standard used to regulate the mechanism for securely and dynamically discovering and invoking tools and transmitting data context between agents and protocol servers, as well as between modules within the protocol server.

[0059] The hierarchical intent parsing algorithm is configured as a method that combines natural language understanding technology to perform multi-level and multi-dimensional semantic analysis of user query commands, thereby identifying the user's true intent and transforming it into a structured task representation.

[0060] The task execution graph is defined as a graphical representation of the output of a hierarchical intent parsing algorithm, where nodes represent atomic tools or subtasks, and edges represent the dependencies and data flow between them, used to guide subsequent task scheduling.

[0061] Reinforcement learning is defined as a machine learning paradigm that uses the interaction between an agent and its environment to learn optimal policies based on reward signals in order to achieve specific goals, such as optimizing task scheduling sequences.

[0062] The joint reasoning and transfer learning algorithm for automatic parameter completion is configured as a technique that can automatically identify and fill in missing parameters during task execution. It combines contextual reasoning ability with transfer learning ability to learn from historical data and apply it to new scenarios.

[0063] This embodiment provides a server-side edge agent collaborative scheduling method based on the model context protocol.

[0064] In practice, the protocol server is configured to maintain a tool registry containing a list of composite tools available for use by the first agent. When the first agent starts up or needs to discover new functionality, it can query this registry from the protocol server. During registration, the protocol server only provides the interface information of the composite tools to the first agent, while encapsulating and hiding the detailed information of the underlying atomic tools that constitute these composite tools. For example, a composite tool for "booking a flight" might consist of atomic tools such as "searching for flights," "selecting seats," and "paying for the order," but the first agent can only see the high-level interface of "booking a flight."

[0065] The first agent is configured to receive natural language input from the user, such as "Help me check flights from Beijing to Shanghai tomorrow." The first agent performs a preliminary understanding of the input and transforms it into a standardized natural language query command format. For example, it may perform preprocessing such as word segmentation and part-of-speech tagging on the user input, while still maintaining the natural language form. Subsequently, the command is encapsulated in a message body conforming to the model context protocol specification and transmitted over the network to the protocol server.

[0066] After receiving a natural language query command from the first agent, the protocol server performs initial protocol parsing and security verification. If the verification passes, the command is routed to a pre-configured second agent within the protocol server. This internal configuration ensures low latency and high security in command processing, avoiding the overhead of cross-service calls.

[0067] The second agent is configured to perform deep semantic parsing of received natural language query instructions using a hierarchical intent parsing algorithm. This algorithm first identifies the core intent in the user query, such as "query flights," and then further identifies relevant entity information, such as "departure point: Beijing," "destination: Shanghai," and "date: tomorrow." The parsing process can include multiple levels; for example, first identifying broad intent categories, and then refining them to specific operations and parameters. Finally, the parsing result is transformed into a structured task execution graph, which represents the task's decomposition steps, required atomic tools, and their dependencies in the form of nodes and edges. For example, for the instruction "book a flight," the graph might contain a "query flights" node, followed by a "select flights" node, and then a "pay" node.

[0068] The second agent is configured to receive a structured task execution graph and treat it as a sequence decision problem to be solved. To achieve dynamic decomposition and scheduling optimization of atomic tools, the second agent employs a reinforcement learning-based algorithm. In this algorithm, the system state can be defined as currently executed tools, tools to be executed, and the system resource status; the action space contains all available atomic tools and their possible execution methods, such as concurrent or serial. Through continuous interaction with the environment, the reinforcement learning model learns to select the optimal sequence of atomic tool executions under different system states to maximize a predefined reward function, such as minimizing response time or maximizing success rate.

[0069] In the execution sequence of atomic tools, when a tool requires a parameter not explicitly provided in the current context or task execution graph, a second agent is configured to initiate a joint inference and transfer learning algorithm for automatic parameter completion. This algorithm analyzes the context information of the current task, existing parameter values, and the input requirements of the tool in real time, and combines this with parameter association patterns learned from historical tool call data to predict and fill in missing parameters. For example, if a user does not specify a class of service when querying "book a flight," the algorithm can automatically complete it to "economy class" based on the user's historical preferences or current business logic. After the above task decomposition, scheduling optimization, and parameter completion, all necessary atomic tools are successfully invoked and executed. The execution results of these tools are collected, integrated, and formatted into the final business response data according to the intent of the original query instruction. For example, if the query is "query flights," the business response data may include information such as flight lists, prices, and times.

[0070] After generating business response data, the second agent is configured to further analyze the current business logic state. For example, if flight query results have been returned but the user has not yet selected or paid, the current state may be in the "pending flight selection" or "pending payment" stage. Based on this business logic state and the generated business response data, the second agent intelligently generates a series of next-step operation suggestions. For example, for flight query results, it may suggest "select flight," "view details," or "re-query." These suggestions aim to guide the first agent to engage in smoother multi-turn interactions with the user. The generated business response data and next-step operation suggestions are encapsulated in a message body conforming to the model context protocol and forwarded back to the first agent through the protocol server. During this process, the protocol server can perform necessary logging and monitoring to ensure the integrity and security of data transmission. After receiving this information, the first agent can present it to the user or continue to generate new query instructions based on the suggestions.

[0071] This embodiment effectively avoids the decision space explosion problem caused by an excessive number of atomic tools in complex edge business flow scheduling scenarios by exposing tools in a layered manner through the protocol server. The hierarchical intent parsing algorithm adopted by the second agent significantly improves the accuracy of intent recognition in multi-turn interactions and effectively compensates for domain knowledge gaps. The dynamic task decomposition and scheduling optimization algorithm based on reinforcement learning enables the system to adaptively respond to dynamic changes in the edge environment, solving the problem of rigidity in traditional scheduling. Furthermore, the joint inference and transfer learning algorithm with automatic parameter completion significantly improves the efficiency and accuracy of parameter completion during cross-tool calls, especially in cold start scenarios. Finally, by generating suggestions for the next operation, this embodiment improves the fluency and automation level of user interaction.

[0072] In some of the solutions mentioned above in this application, a hierarchical intent parsing algorithm is proposed to perform semantic parsing on natural language query commands and generate a structured task execution graph. However, in this process, the original methods mostly rely on a single prompt trigger or simple keyword matching, lacking the ability to persistently remember the historical dialogue state and fuse deep contextual features. Intent drift is very likely to occur during multi-round interactions. At the same time, it is difficult to combine business domain ontology knowledge and relevant information in historical interactions to correct the original intent. The generated task decomposition path cannot be accurately mapped to the actual underlying business logic, and cannot meet the semantic parsing requirements of complex business scenarios on the edge side.

[0073] In response, this application further proposes that the aforementioned hierarchical intent parsing algorithm achieves dynamic correction through the following mathematical logic:

[0074] S21. Introducing a multi-turn dialogue state tracking operator ;

[0075] in, This represents the current dialogue state. This is the semantic vector of the currently input query command. These are the business domain ontology features extracted from the knowledge graph; RNN() is a recurrent neural network operator used to extract features from hidden states. Persist the features of historical dialogue information and store the hidden state. semantic vector of the query instruction at the current moment and business domain ontology features Perform nonlinear mapping fusion to generate the dialogue state for the current round, which includes contextual constraints. ;

[0076] S22. Calculate the distribution weight of intent using the attention mechanism. The query vector Q originates from the semantic vector of the currently input query command. The key vector K is mapped from the user profile and historical interaction records; V is the feature dimension; the attention mechanism calculates the association score between the query vector Q and the key vector K, and uses the softmax function to normalize it to generate a distribution weight W, which is used to identify the feature components in the historical information that are highly related to the current intent, and corrects the original intent through weighted fusion, and outputs the final task execution map.

[0077] The multi-turn dialogue state tracking operator aims to address the intent drift problem in multi-turn interactions by persisting historical dialogue information as a feature, ensuring full utilization of contextual information in subsequent intent parsing processes. Its implementation can include, but is not limited to: an encoder-decoder structure based on a recurrent neural network (RNN) or its variants (such as LSTM, GRU) to encode the historical dialogue sequence into a fixed-dimensional hidden state, which can capture long-term dependencies in the dialogue; or a self-attention mechanism based on the Transformer architecture, which generates a context vector representing the current dialogue state by weighting each word or sentence in the historical dialogue. This operator plays a core role in memory and context aggregation throughout the intent parsing process, providing rich historical information support for subsequent semantic understanding. The recurrent neural network operator (RNN()) is a neural network model specifically designed for processing sequential data. Its core function is to remember and transmit historical information through its internal hidden states. In this application, the RNN() operator is used to persist historical dialogue information as a feature, meaning it can compress and encode the content of previous rounds of dialogue into a continuous vector representation, i.e., the hidden state. This persistence mechanism allows the system to "remember" the previous dialogue context and user intent when processing the current query command, thus avoiding intent drift. Besides traditional RNNs, variants such as Long Short-Term Memory (LSTM) networks or Gated Recurrent Units (GRUs) can also be used. These variants, by introducing gating mechanisms, can more effectively address the gradient vanishing or exploding problems that traditional RNNs may encounter when processing long sequences, thereby better capturing long-term dependencies. The nonlinear mapping fusion refers to combining feature vectors from multiple different sources through a nonlinear function to generate a more expressive comprehensive feature vector. In this application, the hidden state, the semantic vector of the currently input query command, and the business domain ontology features are fused, aiming to integrate historical context, current user intent, and domain expertise into a unified representation. Implementation methods may include, but are not limited to: using a multilayer perceptron (MLP) to concatenate these vectors and then perform a nonlinear transformation, such as using activation functions like ReLU, Tanh, or Sigmoid; or employing a gating mechanism (such as a gated fusion network) to dynamically adjust the fusion weights according to the importance of different features to generate the current round's dialogue state containing contextual constraints. This fusion approach captures the complex relationships between different information sources, ensuring that the final dialogue state fully reflects the user's true intent, while also incorporating domain knowledge constraints. The attention mechanism described is a technique that simulates human cognitive attention; its function is to filter out the most relevant information from a large amount of data and assign it higher weight.In this application, an attention mechanism is used to calculate the distributed weights of intent. Its core function is to identify feature components in historical information that are highly relevant to the current intent, thereby correcting the original intent. Implementation methods may include, but are not limited to: Dot-Product Attention, which measures the similarity between query vector Q and key vector K by calculating the dot product, and then normalizes the weights using a softmax function; or Additive Attention, which combines query vector Q and key vector K through a feedforward neural network, then calculates and normalizes the score. Through this mechanism, the system can dynamically focus on the most relevant parts of historical dialogues, user profiles, or historical interaction records to the current query, effectively filtering out irrelevant information and thus improving the accuracy of intent parsing. The softmax function is a commonly used normalization function that transforms a real-valued vector into a probability distribution. In this application, the softmax function is used to convert the association score calculated by the attention mechanism into distributed weights W. Its function is to map the original score to the (0,1) interval, and the sum of all weights is 1, thus intuitively representing the relative importance of each historical information component to the correction of the current intent. This normalization process ensures the effectiveness and interpretability of the weights, enabling subsequent weighted fusion to accurately correct the original intent. The weighted fusion correction of the original intent refers to combining the distributed weights W calculated based on the attention mechanism with the original intent, using the feature components highly correlated with the current intent from historical information, to generate a more accurate and context-aware final intent representation. This can be achieved, but is not limited to: directly concatenating the vector representation of the original intent with the weighted historical feature vectors and then using a classifier to predict the final intent; or performing a weighted summation of the vector representation of the original intent with the weighted historical feature vectors; or fusing them through a gating mechanism to generate a corrected intent vector, and then outputting the task execution graph based on this vector. This correction mechanism ensures that intent parsing not only considers the current query but also dynamically integrates historical context and user preferences, thereby generating a more accurate task execution graph.

[0078] Through the above technical solution, the second intelligent agent configured within the protocol server significantly improves the accuracy and robustness of the hierarchical intent parsing algorithm in multi-turn interaction scenarios by introducing a multi-turn dialogue state tracking operator and an attention mechanism. Specifically, the multi-turn dialogue state tracking operator utilizes recurrent neural network operators to persist historical dialogue information, effectively solving the problem of intent drift caused by the lack of historical dialogue state memory in traditional solutions. By nonlinearly mapping and fusing the persisted hidden state with the current query command semantic vector and business domain ontology features, it ensures that the generated current-turn dialogue state not only contains rich contextual constraints but also incorporates vertical domain expertise, thereby compensating for the parsing bias caused by the lack of domain knowledge and making the intent parsing results closer to actual business logic. Furthermore, the introduction of the attention mechanism enables the system to accurately calculate the distribution weight of intent based on the current input query command semantic vector as the query vector and combined with user profiles and historical interaction records as key vectors. This mechanism can intelligently identify and weightedly fuse feature components in historical information that are highly relevant to the current intent, effectively filtering out irrelevant or interfering information, thereby dynamically correcting the original intent. Ultimately, through this two-stage dynamic correction process, the second intelligent agent can output a more accurate and structured task execution graph that better reflects the user's true intent and business logic. This greatly enhances the semantic parsing capability for fuzzy, random, and industry-specific query commands in complex business scenarios at the edge, avoiding subsequent task decomposition and scheduling errors caused by inaccurate intent parsing. This lays a solid foundation for the smooth execution of the entire server-side edge intelligent agent collaborative scheduling method.

[0079] In some of the embodiments described above in this application, dynamic task decomposition and scheduling are proposed to transform the parsed structured task execution graph into an execution sequence of atomic tools, thereby completing the collaborative scheduling of server-side edge agents. However, in its implementation, traditional multi-step task scheduling often uses fixed directed acyclic graphs or hard-coded scripts. When faced with complex combinatorial tasks and a large number of atomic tools, the action decision space will explode exponentially, easily leading to inference timeouts or call chain deadlocks. Furthermore, in complex environments with edge-side network jitter, computing power fluctuations, or dynamic changes in dependent services, it lacks the dynamic planning capability to adaptively adjust concurrency strategies and fault-tolerance mechanisms, failing to balance scheduling efficiency and flexibility, and making it difficult to adapt to the complex and ever-changing operating environment of the edge side.

[0080] In response, this application further proposes that the dynamic task decomposition and scheduling optimization algorithm in step 3 be optimized using the following reinforcement learning model:

[0081] Define the state space S as the real-time state of the atomic tool, the action space D as the set of candidate tools defined by the task execution graph, and the reward function R as the representation of... Where P is the execution success rate, T is the response time, C is the resource consumption, and M1, M2, and M3 are weighting coefficients.

[0082] The reinforcement learning model modulates the policy function through a deep modulation network. Training was conducted, including... This represents an atomic-level tool scheduling action selected from the action space D. This represents the current system state; the reinforcement learning model uses the reward function R as a goal guide, and continuously tries different combinations of tools in the action space D to optimize the policy function. This enables adaptive optimization of the atomic-level tool combination order, concurrency strategy, and fault tolerance mechanism under the constraints of the task execution graph.

[0083] To better understand the above technical solution, the key technical features involved are elaborated below. Defining the state space S as the real-time state of atomic tools means that the reinforcement learning model can obtain information such as the current running status, availability, load, and performance metrics of each atomic tool. This can be achieved by periodically querying the API interfaces of each atomic tool, monitoring system logs, or collecting metrics such as CPU utilization, memory usage, network latency, and error counts through dedicated agents. Alternatively, a global state database or distributed cache can be maintained, with each atomic tool or its agent reporting its own state in real time for the reinforcement learning model to query.

[0084] Limiting the action space D to the set of candidate tools defined by the task execution graph means that the reinforcement learning model can only select and schedule pre-planned atomic tools that are allowed by the current task logic. The task execution graph can be a directed acyclic graph (DAG), where nodes represent atomic tools and edges represent dependencies between tools. At each decision point, the action space D contains only the set of currently executable tools that satisfy the prerequisite dependencies. Alternatively, a rule-based engine or semantic parser can dynamically generate a list of candidate atomic tools that conforms to the business logic as the action space D based on the context of the current task and the steps already executed.

[0085] The reward function R is a composite metric that comprehensively considers execution success rate P, response time T, and resource consumption C. By introducing weighting coefficients M1, M2, and M3, the importance of each metric can be adjusted according to actual business needs. For example, in scenarios with high real-time requirements, the weight of M1 can be increased, while in resource-constrained edge environments, the weight of M2 can be increased. Execution success rate P can be calculated by counting the number of successful and failed calls to atomic tools; response time T can be obtained by recording the time difference between the tool sending a call request and returning a result; resource consumption C can be measured by monitoring the amount of CPU, memory, network bandwidth, and other resources used by the tool during runtime. These metrics can be collected in real time through integrated monitoring systems, log analysis tools, or performance counters, and after standardization, they are input into the reward function for calculation.

[0086] Reinforcement learning models train policy functions using deep modulating networks. These deep modulating networks act as policy learners, receiving the current system state as input and outputting a probability distribution of various atomic tool scheduling actions. The network can employ architectures such as Deep Q-Networks (DQNs), Policy Gradient algorithms (e.g., REINFORCE, Actor-Critic), or Proximal Policy Optimization (PPO). The network structure can include multiple fully connected layers, convolutional layers, or recurrent layers to handle different types and dimensions of state input. The training process typically involves interaction with simulated or real-world environments, collecting state-action-reward sequence data, and updating the network's weight parameters using backpropagation to maximize cumulative rewards.

[0087] The policy function is the core output of a reinforcement learning model. It guides the agent in selecting atomic tools to schedule actions given the current system state. These actions include not only choosing a tool but also potentially starting, stopping, concurrently executing, and configuring its parameters. The policy function can be a probability distribution; for example, for a discrete action space, it outputs the probability of each candidate atomic tool being selected; for a continuous action space, it might output the mean and variance of the actions. The policy function is typically derived from the output of the last layer of a deep modulating network, for example, by converting the network output into a probability distribution using a softmax activation function.

[0088] Reinforcement learning models optimize the policy function by continuously trying different combinations of tools in the action space D, with the reward function R as the optimization objective. This means the model tends to select atomic tool combinations that yield higher success rates, shorter response times, and lower resource consumption. The model can explore the action space using greedy policies, Monte Carlo Tree Search (MCTS), or model-based planning methods. Policy optimization can be achieved through algorithms such as gradient ascent or Q-value iteration, continuously adjusting the parameters of the deeply modulated network to maximize the expected future reward from the policy function's output actions. Ultimately, under the logical constraints of the task execution graph, the reinforcement learning model can dynamically adjust the execution order of atomic tools, concurrency strategies, and fault tolerance mechanisms. This adaptability allows the system to flexibly respond to network fluctuations, changes in computing power, or service failures in edge environments.

[0089] Through the above technical solution, this application effectively solves the problems of exponential explosion of action decision space and scheduling rigidity in traditional scheduling schemes. By limiting the action space D to the set of candidate tools defined by the task execution graph, the decision range of the reinforcement learning model is significantly reduced, avoiding the dilemma of excessive decision space when facing a large number of atomic tools, thereby improving the efficiency of scheduling inference. At the same time, the reinforcement learning model can learn to select the optimal scheduling action under different system states by deeply tuning the network training policy function, breaking the rigid limitations of traditional fixed directed acyclic graphs or hard-coded scripts. In addition, the reward function R comprehensively considers the execution success rate P, response time T, and resource consumption C, and introduces weight coefficients M1, M2, and M3, enabling the reinforcement learning model to be guided by multi-objective optimization. By continuously trying different combinations of tools in the action space D and optimizing the policy function, the model can adaptively adjust the combination order, concurrency strategy, and fault tolerance mechanism of atomic tools according to the complex environment of edge network jitter, computing power fluctuations, or dynamic changes in dependent services. This reinforcement learning-based dynamic scheduling optimization enables server-side edge agents to achieve efficient and flexible tool scheduling, significantly improving task execution efficiency, reliability, and resource utilization in complex edge environments. It effectively solves the technical challenges of traditional scheduling schemes that cannot balance efficiency and flexibility and are difficult to adapt to the complex and ever-changing operating environment on the edge side.

[0090] In some of the embodiments described above in this application, automatic parameter completion is proposed to fill in missing parameters during dynamic task decomposition and scheduling. However, when decomposing high-order intents into a continuous sequence of atomic tool calls, complex parameter dependencies and data flow often exist between different tools. When subsequent tools encounter missing implicit parameters or required fields not mentioned in the context, traditional solutions typically rely on blocking manual interaction for secondary confirmation or static default value filling rules. This approach not only severely reduces the efficiency of automated execution but also results in extremely high errors in parameter prediction and completion during the cold start phase for new users or new business scenarios due to the lack of incremental learning and feature transfer capabilities.

[0091] In response, this application further proposes a joint inference and transfer learning algorithm with automatic parameter completion, which specifically includes:

[0092] Construct a migration mapping function with the source domain being the historical tool call set and the target domain being the tool with the currently missing parameters;

[0093] Calculate the probability distribution of missing parameters using a parametric inference network:

[0094]

[0095] in, Let X be the parameter value space, H be the context semantic vector, H be the prior distribution in the cross-tool knowledge base, and Z be the neural network parameters.

[0096] The transfer learning algorithm transfers the parameter-related features accumulated in the source domain to the target domain through the transfer mapping function. The parameter inference network calculates the conditional probability of the candidate parameter values ​​in the feature space and extracts the parameter corresponding to the maximum probability for automatic filling. The parameter inference network supports incremental learning and corrects the neural network parameters Z by capturing the user's new interaction habits in real time, so as to reduce the completion error in the cold start scenario.

[0097] Specifically, the purpose of constructing a transfer mapping function with the source domain being a set of historical tool calls and the target domain being a tool currently lacking parameters is to establish a connection between the source domain (i.e., historical tool call records with accumulated data and knowledge) and the target domain (i.e., the tool call scenario where parameters need to be completed but data is sparse). Its core function is to effectively bridge the general or specific pattern knowledge learned in the source domain to the target domain, thus solving the difficulty of parameter completion caused by insufficient data in the target domain, especially in cold-start scenarios. This transfer mapping function can be implemented through feature space alignment techniques, such as using Maximum Mean Discrepancy (MMD) or Correlation Alignment (CORAL) to minimize the distribution differences between the source and target domains in the feature space, thereby enabling the model trained in the source domain to better adapt to the target domain data. Alternatively, it can be implemented through instance weight adjustment methods. For example, the TrAdaBoost algorithm iteratively adjusts the weights of source domain instances, giving higher attention to source domain instances more similar to the target domain during training, thereby improving the model's performance in the target domain.

[0098] Parameter inference networks are specially designed neural network models whose main function is to calculate the probability distribution of various possible values ​​for missing parameters based on given contextual information, prior knowledge, and other relevant features. Through this probability distribution, the system can identify the most likely parameter value, thus achieving automatic parameter completion. This network can adopt an architecture based on deep neural networks (such as multilayer perceptrons, recurrent neural networks, or Transformers), taking contextual semantic vectors and prior distributions across tool knowledge bases as input. It learns complex parameter dependencies through multilayer nonlinear transformations, ultimately outputting a softmax layer representing the probability of each candidate value in the parameter value space. Alternatively, it can be built based on Bayesian networks or graph neural networks (GNNs) to explicitly model conditional dependencies between parameters or process structured information and complex relationships between parameters in tool call sequences.

[0099] The core idea of ​​the transfer learning algorithm is to apply knowledge learned on one task (source domain) to another related but different task (target domain). In this application, its role is to effectively transfer parameter-related features (source domain knowledge) accumulated from historical tool calls to the completion task (target domain) of the tool with missing parameters, thereby solving the problem of insufficient target domain data or cold start and improving the accuracy and efficiency of parameter completion. This algorithm can be implemented through feature transfer, for example, by pre-training a feature extractor on the source domain and then applying the extractor to the target domain data, or by learning domain-invariant feature representations through a shared encoder. Alternatively, it can be implemented through model transfer, i.e., training a complete parameter completion model on the source domain, then using the parameters of this model as the initialization of the target domain model, and fine-tuning it on a small amount of data from the target domain.

[0100] The parameter inference network supports incremental learning, meaning it has the ability to continuously update and optimize its model parameters after receiving new data, without retraining the entire model from scratch. This allows the model to adapt in real time to new user interaction habits, changes in business logic, or new tool features, thereby continuously improving the accuracy of parameter completion and effectively reducing completion errors caused by a lack of historical data in cold start scenarios. Incremental learning can be implemented through online learning algorithms, such as a variant based on stochastic gradient descent (SGD), where only small updates to the model parameters are made each time new user interaction data is received. Alternatively, it can be implemented through an experience replay mechanism, where a small, representative portion of historical data is stored during incremental learning and mixed with new data for training to mitigate the catastrophic forgetting problem.

[0101] Through the above technical solution, this application effectively solves the problems of low efficiency and high completion error in traditional parameter completion scenarios. Specifically, by constructing a transfer mapping function with the source domain being the historical tool call set and the target domain being the tool with the currently missing parameters, this application can transfer the rich parameter association knowledge accumulated in historical tool calls to the current sparse data completion task, providing a solid foundation for subsequent parameter inference and significantly alleviating the completion difficulty caused by insufficient data in cold start scenarios. On this basis, a parameter inference network is used to calculate the probability distribution of missing parameters. This network comprehensively considers multi-dimensional information such as parameter value space, context semantic vector, prior distribution in cross-tool knowledge base, and neural network parameter Z, transforming parameter completion into probability-based intelligent inference, ensuring the rationality and accuracy of the completion results. The introduction of the transfer learning algorithm enables the parameter inference network to fully utilize the knowledge of the source domain, efficiently calculate the conditional probability of candidate parameters in the feature space of the target domain, and extract the parameter corresponding to the maximum probability for automatic filling, thereby avoiding the limitations of traditional static default value filling and improving the efficiency of automated execution. Furthermore, the parameter inference network supports incremental learning, enabling it to capture and learn new user interaction habits in real time and continuously correct the neural network parameters Z. This allows the model to continuously adapt to new business scenarios and user behavior patterns, thereby continuously optimizing the completion results. This further reduces the completion error in cold start scenarios and improves the robustness and adaptability of the entire server-side edge agent collaborative scheduling method.

[0102] In some of the solutions mentioned above in this application, a process of generating business response data by completing parameters in task decomposition and scheduling is proposed. However, in this process, the edge operating environment itself is highly uncertain. The tool may be interrupted at any time due to various faults when executing sequence decisions. Most of the original exception handling mechanisms only stay at the shallow error log capture and passive retry stage. They cannot break the boundary between correlation and causation, cannot locate the deep topological root cause of the error in the black box call chain, and cannot transform the diagnostic results into feedback signals for optimization decisions. This makes it easy for the agent to repeatedly try on the wrong path and cannot achieve closed-loop flexible self-healing of the scheduling link.

[0103] In response, this application further proposes a causal inference algorithm that includes error diagnosis and self-repair in step 3 above, the specific steps of which are as follows:

[0104] S31. By combining log analysis, anomaly detection and cause-effect graph model, it automatically identifies whether execution errors originate from parameters, network, dependent services, or logical conflicts.

[0105] S32. Calculate the causal effectiveness E of the error using counterfactual reasoning;

[0106]

[0107] Where Y is the execution failure index, B is the diagnosed root cause variable; Mean[] is the expected value operator, which is used to calculate the mathematical expectation of the potential outcome distribution after the intervention simulated by the do() operator. By eliminating the random bias of a single call, the average marginal contribution of the root cause variable B to the system execution failure rate is quantified, and the difference in the average execution failure rate before and after the intervention is calculated to quantify the causal strength of each potential failure source.

[0108] S33. The causal effect value E is input as a negative feedback signal to the reinforcement learning model, and the second agent is forced to regenerate the execution path in the task execution graph by reducing the reward expectation of the corresponding scheduling sequence.

[0109] This causal inference algorithm for error diagnosis and self-repair aims to identify the root cause of errors during system execution and automatically adjust system behavior based on the diagnostic results to achieve self-healing. Its core lies in going beyond traditional correlation-based error detection by accurately identifying the root cause of problems through causal relationship analysis and transforming it into actionable feedback signals to drive system strategy adjustments. This algorithm can be integrated into the server-side second agent as its error handling module, triggered every time an atomic tool call fails; alternatively, it can be deployed as a standalone microservice, receiving error logs and system status via message queues or API interfaces, analyzing them, and then sending repair instructions to the second agent.

[0110] In step S31, log analysis, anomaly detection, and cause-effect graphing models are combined to automatically identify whether execution errors originate from parameters, network issues, dependent services, or logical conflicts. This step is the initial stage of error diagnosis, aiming to extract fault characteristics from multi-dimensional data and preliminarily locate the error type. Log analysis refers to the structured parsing and pattern matching of various logs generated during system operation (such as application logs, system logs, network logs, etc.). For example, regular expressions or natural language processing techniques can be used to extract key information such as error codes, exception stacks, and request parameters from logs to identify known error patterns or abnormal events. Anomaly detection uses statistical methods or machine learning models to monitor system operating indicators (such as response time, throughput, CPU utilization, memory utilization, etc.) in real time, identifying abnormal behaviors that deviate from the normal baseline. For example, threshold-based detection, time-series anomaly detection, or deep learning-based anomaly detection models can be used to discover potential performance bottlenecks or resource exhaustion problems. A causal graph model is a graphical model that represents the causal relationships between system components. Nodes represent system variables (such as service status, parameter values, and network connections), and edges represent causal dependencies. During diagnosis, reasoning can be performed on the causal graph based on observed error phenomena to trace possible root cause paths. For example, a Bayesian network or structural causal model can be constructed, with predefined dependencies between services and fault propagation paths. When a service fails, the model can infer potential upstream or downstream root causes based on the causal chain.

[0111] In step S32, counterfactual reasoning is used to calculate the causal effectiveness E for the occurrence of the error. Counterfactual reasoning is a powerful tool for causal inference that quantifies the causal impact of a particular event by answering the question, "What would have happened if a certain cause had not occurred?" Here, it is used to precisely quantify the contribution of each potential root cause to the system's execution failure. This can be achieved by constructing a simulation environment or by performing counterfactual simulations using historical data. For example, for a diagnosed root cause B, the expected value of the system's execution failure index Y can be simulated "if B had not occurred (i.e., do(B=0))" and compared with the expected value of Y when B actually occurred, thus calculating the causal effectiveness E. This typically involves modeling the system's behavior and predicting the intervention's effect. Alternatively, statistical methods such as propensity score matching or dual robust estimation can be used to find a control group (without root cause B) similar to the intervention group (with root cause B) in the observed data, and then the difference in execution failure rates between the two groups can be compared to approximate the counterfactual outcome. This section defines in detail how the causal effectiveness E is calculated, emphasizing its precision in quantifying the impact of root causes. The execution failure indicator Y can be a Boolean value (success / failure) or a continuous value (such as failure rate or number of errors). For example, Y can be defined as the number of times a certain atomic-level tool call fails, or the proportion of the entire task execution graph that fails to complete successfully. The root cause variable B refers to the specific fault cause diagnosed through step S31, such as "parameter error," "network timeout," or "database connection failure." B can be a binary variable (occurred / not occurred) or a multi-category variable (different types of root causes). The do() operator is a core concept in causal inference, representing "intervention" or "forced setting" of the value of a variable, rather than simply "observing" its value. For example, do(B=0) means that we force the root cause B not to occur and then observe the change in Y. This is different from the conditional probability P(Y|B=0), which only observes the distribution of Y under the condition that B=0. The do() operator simulates the effect of actual intervention in the system, thereby severing the causal chain between B and other variables and more accurately reflecting the independent causal influence of B on Y. The Mean[] expectation operator is used to calculate the average value of the potential outcome Y under the do() intervention. By calculating the expectation value, random noise and chance in a single call or observation can be eliminated, resulting in a more stable and representative estimate of the causal effect. For example, after multiple simulations of do(B=0), the average value of Y is calculated and then compared with the average value of Y actually observed to obtain the causal effect value E.

[0112] In step S33, the causal efficacy value E is input as a negative feedback signal to the reinforcement learning model. By reducing the expected reward of the corresponding scheduling sequence, the second agent is forced to regenerate the execution path within the task execution graph. This is a key step in achieving closed-loop self-healing, transforming the causal diagnosis result into an optimized input for the scheduling policy. The causal efficacy value E quantifies the contribution of root cause B to execution failure; the larger the value, the higher the probability or severity of failure caused by that root cause. Using it as negative feedback means that when a scheduling sequence leads to an error with a high causal efficacy value, the "reward" of that sequence will be significantly reduced. The reinforcement learning model learns the optimal policy function by interacting with the environment to maximize the cumulative reward. When a negative feedback signal is received, the model updates its policy so that the scheduling sequence that leads to the error is suppressed in future selections. Specifically, a penalty term can be introduced into the reward function R of the reinforcement learning model, which is positively correlated with the causal efficacy value E. When the causal efficacy value E is high, the reward R will be significantly reduced, thus enabling the reinforcement learning model to "learn" to avoid selecting scheduling paths containing that root cause during training. When the reinforcement learning model receives negative feedback and updates its policy, in subsequent task scheduling, the second agent will explore and select new atomic tool combination order, concurrency strategy or fault tolerance mechanism according to the new policy function and under the constraints defined by the task execution graph, thereby avoiding the path that previously caused the error and realizing adaptive correction and self-healing of the scheduling path.

[0113] Through the above technical solution, this application introduces a causal inference algorithm for error diagnosis and self-repair, effectively solving the technical problems of "black box" fault diagnosis and lack of closed-loop self-healing mechanism in edge operating environments. Specifically, by combining log analysis, anomaly detection, and causal graph model, the system can accurately identify potential sources of execution errors from multi-dimensional data, such as parameters, network, dependent services, or logical conflicts, overcoming the limitations of traditional methods that rely solely on shallow logs or passive retries. Based on this, counterfactual reasoning is used to calculate the causal effect value E of the error occurrence, which can accurately quantify the average marginal contribution of each potential fault source to the system's execution failure rate, thereby accurately distinguishing between correlation and causality, avoiding misjudging irrelevant factors as root causes, and achieving deep localization of the fault root cause. Furthermore, the calculated causal effect value E is used as a negative feedback signal input to the above reinforcement learning model, forcing the second agent to regenerate the execution path within the task execution graph by reducing the reward expectation of the corresponding error scheduling sequence. This mechanism enables fault diagnosis results to directly drive the optimization of scheduling strategies, realizing a complete closed-loop self-healing process from error identification and root cause quantification to strategy adjustment. It avoids agents repeatedly trying on wrong paths, significantly improves the robustness and adaptability of edge agent collaborative scheduling, and ensures the stable and efficient operation of complex business processes in uncertain environments.

[0114] With the widespread application of large language models and multi-agent systems in edge computing scenarios, traditional server scheduling schemes based on model context protocols face technical bottlenecks such as long-tail drift in intent parsing and multi-round interactions, decision space explosion caused by atomic tool exposure, high error in cross-tool parameter missing completion, and lack of closed-loop self-healing mechanism for fault diagnosis.

[0115] See Figure 2 To address the aforementioned issues, this application also discloses a server-side edge agent collaborative scheduling system based on a model context protocol, comprising:

[0116] The first intelligent agent is used to generate natural language query instructions and send requests through the model context protocol;

[0117] The protocol server is used to register with the first agent, expose composite tools and hide all atomic tools, and receive requests from the first agent through the model context protocol;

[0118] The second intelligent agent, embedded within the protocol server, includes:

[0119] The intent parsing module is used to generate a structured task execution graph using a hierarchical intent parsing algorithm;

[0120] The dynamic scheduling module is used to adaptively optimize the scheduling sequence of atomic tools using a reinforcement learning model, with the task execution graph as a constraint.

[0121] The parameter inference module is used to automatically complete missing parameters through a transfer learning model during the scheduling process;

[0122] The error self-healing module is used to diagnose the source of errors based on causal inference algorithms and feed the diagnosis results back to the dynamic scheduling module to trigger the correction of the execution path.

[0123] The core innovation of this embodiment lies in combining a composite tool exposure mechanism with an embedded intelligent agent architecture, and introducing four core modules: hierarchical intent parsing, reinforcement learning scheduling, transfer learning parameter completion, and causal inference self-healing. This enables dynamic correction of multi-turn interaction intents, adaptive scheduling in a controlled action space, intelligent completion of cross-tool parameters, and closed-loop self-healing of the scheduling link in an edge computing environment, thereby achieving the technical effect of improving the robustness and automation level of edge intelligent agent scheduling.

[0124] Specifically, the protocol server acts as a communication hub in the edge computing environment, exposing only composite tool interfaces to the first agent while hiding the underlying atomic tools. For example, when the first agent initiates a "book a flight" request, the protocol server only provides the high-level interface of this composite tool, while the implementation details of its internal atomic tools, such as "query flights," "select seats," and "pay for the order," are completely encapsulated. After receiving the user's natural language input, the first agent sends standardized query instructions to the protocol server via the model context protocol. Upon receiving the request, the protocol server routes the instructions to the embedded second agent for in-depth processing.

[0125] The second agent's intent parsing module employs a hierarchical intent parsing algorithm, integrating historical dialogue states and vertical domain ontology knowledge for semantic analysis. Taking the user input "Help me check flights from Beijing to Shanghai tomorrow" as an example, the module first identifies the core intent "check flights," then extracts entity information such as "departure location: Beijing," "destination: Shanghai," and "date: tomorrow," ultimately outputting a structured task execution graph containing nodes and dependencies. This graph clearly defines the task decomposition steps and data flow, effectively solving the intent drift problem in multi-turn interactions and ensuring that the task structure is accurately mapped to the underlying business logic.

[0126] The dynamic scheduling module uses the task execution graph as a constraint framework, modeling the scheduling process as a sequence decision problem. The system state is defined as executed tools, pending tools, and resource status, and the action space is limited to the execution sequence of atomic tools. The reinforcement learning model continuously optimizes the scheduling strategy through interaction, such as dynamically adjusting the concurrent execution order of "querying flights" and "selecting seats" when the network fluctuates, or switching to a serial execution mode when computing power is limited, thereby adapting to the dynamic changes in the edge environment and avoiding the rigidity problem caused by traditional fixed DAG scheduling.

[0127] The parameter inference module detects missing parameters in real time during the scheduling process. When the "Pay Order" tool lacks the "Payment Method" parameter, the module analyzes the current context and historical call data based on a transfer learning model to automatically complete it as "Credit Card Payment". The transfer learning mechanism effectively utilizes the correlation features of historical parameters, significantly reducing the completion error in cold start scenarios and avoiding the efficiency loss caused by relying on manual confirmation in traditional solutions.

[0128] The error self-healing module quantifies the impact weight of fault sources through a causal inference algorithm. For example, when a "payment order" fails, the system distinguishes between network timeout (correlation) and parameter distortion (causality) as the root causes, and the diagnostic results are fed back to the dynamic scheduling module in real time. Based on this, the dynamic scheduling module triggers execution path correction, such as retrying payment or switching to a backup payment channel, forming a closed-loop self-healing mechanism of "diagnosis-feedback-correction," which completely solves the problem of repeated erroneous attempts caused by the black-box nature of traditional solutions.

[0129] Through the above technical solutions, this application constructs a layered exposure mechanism and an embedded intelligent processing system at the protocol server level. This not only avoids the decision space explosion caused by atomic-level tool exposure, but also realizes dynamic intention correction, adaptive scheduling optimization, intelligent parameter completion, and fault closed-loop self-healing through modular collaboration, which significantly improves the robustness and automation level of edge intelligent agents in complex business flow scheduling.

[0130] The following example will provide a more detailed explanation of the above technical solution:

[0131] This approach was deployed in an edge computing environment within a smart manufacturing plant to optimize production line operations. The plant's production manager interacts with the system through their intelligent assistant (acting as the primary intelligent agent).

[0132] Scenario description: The production manager wants to optimize the energy consumption of the production line for product A and increase output.

[0133] The protocol server registers with the production manager's intelligent assistant and exposes composite tools such as "production line optimization," "equipment maintenance," and "quality control," but strategically hides atomic-level tools such as "read sensor data," "adjust equipment parameters," and "query inventory." The production manager inputs a natural language query command through the intelligent assistant: "Optimize the energy consumption of the A product production line and increase output." The intelligent assistant sends this command to the protocol server via the model context protocol.

[0134] After receiving the natural language query command, the protocol server passes it to the internally configured AI orchestration engine (acting as a second agent). The second agent then initiates a hierarchical intent parsing algorithm that combines natural language understanding for semantic parsing. During the parsing process, the system introduces a multi-turn dialogue state tracking operator. For example, if the production manager previously asked, "Where is the bottleneck on the production line for product A?", this operator will perform a non-linear mapping and fusion of the historical dialogue state with the semantic vector of the current query command and business domain ontology features such as "product A," "energy consumption," and "output" extracted from the factory knowledge graph, generating the current turn's dialogue state with contextual constraints. Simultaneously, the system uses an attention mechanism to calculate the distributed weights of the intent. The query vector originates from the semantic vector of the currently input query command, and the key vector is mapped from the production manager's user profile and historical interaction records. By calculating the association score between the query vector and the key vector and normalizing it using the softmax function to generate distributed weights, these weights are used to identify feature components in historical information that are highly relevant to the current intent, and the original intent is corrected through weighted fusion. This process effectively solves the problems of intent drift and domain knowledge gaps in traditional solutions. Finally, the second agent outputs a structured task execution graph, such as: ["Analyze energy consumption data of product A production line" -> "Identify high energy consumption equipment" -> "Adjust parameters of high energy consumption equipment" -> "Monitor output changes" -> "Evaluate optimization effect"].

[0135] Next, the second agent employs a reinforcement learning-based dynamic task decomposition and scheduling optimization algorithm to transform the aforementioned task execution graph into a sequence decision problem involving atomic tools. The system defines the state space S as the real-time state of each atomic tool in the factory (e.g., "reading sensor data," "adjusting equipment parameters," "querying equipment status"), and the action space D as the set of candidate tools defined by the task execution graph. The reinforcement learning model trains the policy function through a deep modulation network, where represents the scheduling action of the atomic tool selected from the action space D, and represents the current system state. The model uses the reward function R as a goal guide, continuously trying different tool combinations in the action space D to optimize the policy function, thereby achieving adaptive optimization of the atomic tool combination order, concurrency strategy, and fault tolerance mechanism under the constraints of the task execution graph. For example, in the "adjusting parameters of high-energy-consuming equipment" step, the system dynamically chooses whether to adjust equipment X first and then equipment Y, or adjust them concurrently, taking into account network latency and equipment load, thus avoiding the problems of decision space explosion and scheduling rigidity in traditional solutions.

[0136] During execution, if an atomic tool call (e.g., "adjust device parameters") requires a parameter not explicitly provided in the current context (e.g., "adjustment range"), the system will use a joint inference and transfer learning algorithm for automatic parameter completion to complete the missing parameter in real time. The system constructs a transfer mapping function with the historical tool call set as the source domain and the tool with the missing parameter as the target domain. The parameter inference network calculates the probability distribution of the missing parameter. For example, for the "adjustment range" parameter, the network combines contextual semantic vectors (e.g., "reduce energy consumption"), prior distributions in the cross-tool knowledge base (e.g., "safe adjustment range of device X"), and neural network parameters to calculate the probability of different adjustment ranges. The transfer learning algorithm transfers the parameter-related features accumulated in the source domain to the target domain through the transfer mapping function. The parameter inference network calculates the conditional probability of candidate parameter values ​​in the feature space and extracts the parameter corresponding to the maximum probability for automatic filling. For example, the "adjustment range" is automatically filled as "5%". The parameter inference network supports incremental learning and corrects the neural network parameters Z by capturing new interaction habits of production managers or equipment operation data in real time. This reduces the completion error in cold start scenarios and solves the problems of missing parameters and high completion error in cold start scenarios in traditional solutions.

[0137] Furthermore, the above execution process also includes causal inference algorithms for error diagnosis and self-repair. The system combines log analysis, anomaly detection, and causal graph models to automatically identify whether execution errors originate from parameters, network, dependent services, or logical conflicts. For example, if the "adjust device parameters" operation fails, the system will diagnose that the command failed to be delivered to the device in time due to edge network fluctuations. The causal effect value E of the error is calculated using counterfactual reasoning. Here, Y is the execution failure index, and B is the diagnosed root cause variable. Mean[] is the expected value operator, used to calculate the mathematical expectation of the potential outcome distribution after the intervention simulated by the do() operator. By eliminating the random bias of a single call, the average marginal contribution of the root cause variable B to the system's execution failure rate is quantified, and the difference in the average execution failure rate before and after the intervention is used to quantify the causal strength of each potential fault source. The causal effect value E is input as a negative feedback signal to the reinforcement learning model. By reducing the reward expectation of the corresponding scheduling sequence, the second agent is forced to regenerate the execution path within the task execution graph. For example, if network fluctuations are found to be the main cause, the reinforcement learning model will attempt to reschedule through alternative network paths or delayed execution, overcoming the drawbacks of traditional solutions where fault diagnosis is "black box" and lacks a closed-loop self-healing mechanism.

[0138] Based on business response data (e.g., "Energy consumption on product A production line has decreased by 3%, and output has increased by 2%) and the current business logic status (e.g., "Optimization has been initially completed, but there is still room for improvement"), the second intelligent agent generates additional suggestions for the next steps, such as: "It is recommended to further analyze the maintenance cycle of equipment Z, which may help with continuous optimization." The second intelligent agent returns the above response and suggestions to the production manager's intelligent assistant through the protocol server.

[0139] Through the above-mentioned collaborative scheduling method, this solution achieves intelligent, dynamic, and adaptive management of complex business processes, significantly improving the efficiency, robustness, and intelligence level of edge agents in practical applications.

[0140] In this document, the terms "upper," "lower," "front," "back," "left," "right," "top," "bottom," "inner," "outer," "vertical," and "horizontal," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only used for the clarity of expressing the technical solution and for the convenience of description, and therefore should not be construed as limiting the present invention.

[0141] In this document, the terms “comprising,” “including,” or any other variations thereof are intended to cover non-exclusive inclusion, which includes not only the elements listed but also other elements not expressly listed.

[0142] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of this invention is defined by the appended claims and their equivalents.

Claims

1. A server-side edge agent collaborative scheduling method based on a model context protocol, characterized in that, Includes the following steps: Step 1: The protocol server registers and exposes the composite tool with the first agent, and hides all atomic tools; the first agent generates a natural language query command and sends it to the protocol server through the model context protocol; Step 2: The protocol server transmits the received natural language query command to the internally configured second intelligent agent; the second intelligent agent performs semantic parsing using a hierarchical intent parsing algorithm that combines natural language understanding, and outputs a structured task execution graph; Step 3: The second intelligent agent adopts a dynamic task decomposition and scheduling optimization algorithm based on reinforcement learning to transform the task execution graph into a sequence decision problem of atomic tools. During the execution process, it uses a joint inference and transfer learning algorithm with automatic parameter completion to complete missing parameters in real time to generate business response data. Step 4: Based on the business response data and the current business logic state, the second intelligent agent generates additional suggestions for the next operation and returns them to the first intelligent agent through the protocol server.

2. The server-side edge agent collaborative scheduling method based on model context protocol according to claim 1, characterized in that, In step 2, the hierarchical intent parsing algorithm achieves dynamic correction through the following mathematical logic: S21. Introducing a multi-turn dialogue state tracking operator ; in, This represents the current dialogue state. This is the semantic vector of the currently input query command. These are the business domain ontology features extracted from the knowledge graph; RNN() is a recurrent neural network operator used to extract features from hidden states. Persist the features of historical dialogue information and store the hidden state. semantic vector of the query instruction at the current moment and business domain ontology features Perform nonlinear mapping fusion to generate the dialogue state for the current round, which includes contextual constraints. ; S22. Calculate the distribution weight of intent using the attention mechanism. The query vector Q originates from the semantic vector of the currently input query command. The key vector K is mapped from the user profile and historical interaction records; V is the feature dimension; the attention mechanism calculates the association score between the query vector Q and the key vector K, and uses the softmax function to normalize it to generate a distribution weight W, which is used to identify the feature components in the historical information that are highly related to the current intent, and corrects the original intent through weighted fusion, and outputs the final task execution map.

3. The server-side edge agent collaborative scheduling method based on model context protocol according to claim 2, characterized in that, In step 3, the dynamic task decomposition and scheduling optimization algorithm is optimized using the following reinforcement learning model: Define the state space S as the real-time state of the atomic-level tool, the action space D as the set of candidate tools defined by the task execution graph, and the reward function R as the representation of... Where P is the execution success rate, T is the response time, C is the resource consumption, and M1, M2, and M3 are weighting coefficients. The reinforcement learning model modulates the policy function through a deep modulation network. Training was conducted, including... This represents an atomic-level tool scheduling action selected from the action space D. This represents the current system state; the reinforcement learning model uses the reward function R as a goal guide, and continuously tries different combinations of tools in the action space D to optimize the policy function. This enables adaptive optimization of the atomic-level tool combination order, concurrency strategy, and fault tolerance mechanism under the constraints of the task execution graph.

4. The server-side edge agent collaborative scheduling method based on model context protocol according to claim 3, characterized in that, In step 3, the joint inference and transfer learning algorithm with automatic parameter completion specifically includes: Construct a migration mapping function with the source domain being the historical tool call set and the target domain being the tool with the currently missing parameters; Calculate the probability distribution of missing parameters using a parametric inference network: in, Let X be the parameter value space, H be the context semantic vector, H be the prior distribution in the cross-tool knowledge base, and Z be the neural network parameters. The transfer learning algorithm transfers the parameter-related features accumulated in the source domain to the target domain through the transfer mapping function. The parameter inference network calculates the conditional probability of the candidate parameter values ​​in the feature space and extracts the parameter corresponding to the maximum probability for automatic filling. The parameter inference network supports incremental learning and corrects the neural network parameters Z by capturing the user's new interaction habits in real time, so as to reduce the completion error in the cold start scenario.

5. The server-side edge agent collaborative scheduling method based on model context protocol according to claim 1, characterized in that, Step 3 also includes a causal inference algorithm for error diagnosis and self-repair, the specific steps of which are as follows: S31. By combining log analysis, anomaly detection and cause-effect graph model, it automatically identifies whether execution errors originate from parameters, network, dependent services, or logical conflicts. S32. Calculate the causal effectiveness E of the error using counterfactual reasoning; Where Y is the execution failure index, B is the diagnosed root cause variable; Mean[] is the expected value operator, which is used to calculate the mathematical expectation of the potential outcome distribution after the intervention simulated by the do() operator. By eliminating the random bias of a single call, the average marginal contribution of the root cause variable B to the system execution failure rate is quantified, and the difference in the average execution failure rate before and after the intervention is calculated to quantify the causal strength of each potential failure source. S33. The causal effect value E is input as a negative feedback signal to the reinforcement learning model, and the second agent is forced to regenerate the execution path in the task execution graph by reducing the reward expectation of the corresponding scheduling sequence.

6. A server-side edge agent collaborative scheduling system based on a model context protocol, characterized in that, include: The first intelligent agent is used to generate natural language query instructions and send requests through the model context protocol; The protocol server is used to register with the first agent and expose composite tools while hiding all atomic tools, and to receive the request from the first agent through the model context protocol; The second intelligent agent, embedded within the protocol server, includes: The intent parsing module is used to generate a structured task execution graph using a hierarchical intent parsing algorithm; The dynamic scheduling module is used to adaptively optimize the scheduling sequence of atomic tools using a reinforcement learning model, with the task execution graph as a constraint. The parameter inference module is used to automatically complete missing parameters through a transfer learning model during the scheduling process; The error self-healing module is used to diagnose the source of errors based on a causal inference algorithm and feed the diagnosis results back to the dynamic scheduling module to trigger execution path correction.