A method for realizing AI assistant capability plugging under an AI platform

By constructing a three-layer intent recognition architecture and a tool dependency graph model, combined with Nash equilibrium game theory and an intelligent scheduling system, the problem of the AI ​​assistant system's inability to be hot-swapped was solved, enabling dynamic expansion of tool capabilities and resource optimization, thus ensuring the system's flexibility and stability.

CN120950219BActive Publication Date: 2026-04-28青岛网信信息科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
青岛网信信息科技有限公司
Filing Date
2025-08-22
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Existing AI assistant systems lack the ability to dynamically hot-swap tools during runtime, leading to business interruptions and resource waste, and failing to meet the flexibility and continuous service requirements of modern AI applications.

Method used

A three-layer intent recognition architecture, a tool dependency graph model, and an intelligent scheduling system are constructed. Service dependencies are optimized through the Kruskal algorithm, and dynamic loading, unloading, and switching of MCP services are achieved by combining the Nash equilibrium game model and the context awareness algorithm. Resource allocation is optimized using an intelligent scheduling model.

Benefits of technology

It enables dynamic runtime expansion of the AI ​​assistant tool service, allowing tools to be added or updated without service interruption. It also optimizes resource configuration and dependency management, ensuring system scalability and performance stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120950219B_ABST
    Figure CN120950219B_ABST
Patent Text Reader

Abstract

The application provides a method for realizing AI assistant capability plug-in under an AI platform, and belongs to the technical field of AI assistants.The application constructs a modular architecture based on MCP service, realizes service dynamic discovery and matching by using three-layer intent recognition, establishes a tool dependency graph model to manage the dependency relationship between services, adopts a Nash equilibrium game model to optimize resource allocation strategies, realizes performance balance of the hot plug process by combining the weight adaptive mechanism of the intelligent scheduling system, provides historical experience guidance through context perception and backtracking perception algorithms, and finally realizes runtime dynamic hot plug of AI assistant tool services, so that capability expansion, removal and update can be completed without system restart, and the feedback mechanism is used to continuously optimize the hot plug effect and system performance.The technical problem that AI assistant tool services cannot be dynamically hot plugged at runtime, so that the AI platform needs to interrupt services to complete capability expansion is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of AI assistant technology, and more specifically, relates to a method for implementing plug-and-play AI assistant capabilities under an AI platform. Background Technology

[0002] In the field of AI assistant system development, traditional tool capability integration technologies primarily employ static configuration and pre-compilation to achieve functional expansion. Existing technologies typically load all predefined tool modules at system startup, integrating various functional components into the AI ​​assistant through fixed API interfaces and configuration files. This traditional architecture is widely used in enterprise-level AI assistants, intelligent customer service systems, and automated office platforms, providing stable basic functional support for AI systems. In actual deployment, developers need to determine all required tool capabilities during the system design phase and package and compile them into a unified application. However, traditional static integration technologies suffer from serious flexibility deficiencies. First, when adding new tool capabilities or updating existing functions, the entire system must be recompiled and the service restarted, leading to business interruptions and a degraded user experience. Second, the system cannot dynamically adjust tool configurations based on actual usage, resulting in resource waste and performance bottlenecks. Finally, traditional architectures lack runtime tool dependency management mechanisms, failing to handle complex changes in dependencies between tools. The core problem that traditional technologies struggle to solve is that once an AI assistant system is deployed and running, it cannot dynamically add or remove tool capabilities without service interruption, severely limiting the system's scalability and real-time responsiveness, and failing to meet the flexibility and continuous service requirements of modern AI applications. In other words, existing technologies have a technical problem where AI assistant tool services cannot be dynamically hot-swapped during runtime, causing AI platforms to need to interrupt services to complete capability expansion. Summary of the Invention

[0003] In view of this, the present invention provides a method for implementing the pluggable capability of AI assistant under an AI platform, which can solve the technical problem in the prior art that the AI ​​assistant tool service cannot be dynamically hot-swapped at runtime, causing the AI ​​platform to need to interrupt services to complete the capability expansion.

[0004] This invention is implemented as follows: It provides a method for plugging and unplugging AI assistant capabilities on an AI platform, comprising: constructing a three-layer intent recognition architecture to perform semantic parsing, task classification, and tool matching on user input, generating intent recognition results and tool matching scores; establishing a tool dependency graph model and calculating the optimal dependency path using the Kruskal algorithm to generate a tool dependency weight matrix; outputting context influence weight values ​​and backtracking influence weight values ​​through a context-aware algorithm and a backtracking awareness mechanism; treating each MCP service as a participant based on a Nash equilibrium game model, determining the hybrid strategy by solving for the Nash equilibrium point, and outputting the optimal tool selection sequence; employing an intelligent scheduling model to receive context influence weight values, backtracking influence weight values, and the optimal tool selection sequence, outputting a resource consumption index and a cache utilization index through a hierarchical fusion weight mechanism; and dynamically matching the optimal MCP service combination based on the intent recognition results and the tool dependency weight matrix, utilizing the resource consumption index and cache utilization index to achieve real-time plugging and unplugging of AI assistant capabilities.

[0005] Specifically, the three-layer intent recognition architecture involves processing user input sequentially through a semantic understanding layer, a task reasoning layer, and a tool mapping layer. The semantic understanding layer is responsible for extracting the semantic features of the user's intent, the task reasoning layer converts the semantic features into task type identifiers, and the tool mapping layer matches the corresponding MCP service based on the task type identifier and generates a tool matching score.

[0006] Specifically, the tool dependency graph model is a weighted undirected graph structure with MCP services as nodes and inter-service call relationships as edges. The optimal service dependency relationship is determined by solving the minimum spanning tree using the Kruskal algorithm. The algorithm first arranges all edges in ascending order of weight, and then adds the minimum weight edge that does not form a cycle until a minimum spanning tree connecting all nodes is formed, generating a tool dependency weight matrix containing the dependency strength between each MCP service.

[0007] Specifically, the context-aware algorithm quantifies the influence of key information in the current dialogue state on tool selection decisions. By analyzing dialogue history, user preferences, and task complexity factors, it calculates the applicability score of each MCP service in the current context and outputs the context influence weight value.

[0008] Specifically, the backtracking perception mechanism assesses the influence of historical interaction records on the current tool call decision. Through time decay function and similarity calculation, it quantifies the guiding value of past successful call experience for the current selection and outputs the backtracking influence weight value.

[0009] Specifically, the Nash equilibrium game model models the tool selection problem as a multi-participant non-cooperative game problem. Each MCP service corresponds to a rational participant, and the payoff function of each participant is based on a comprehensive evaluation of task completion quality, response time, and resource consumption. The policy space of each participant includes the service call probability distribution, and the Nash equilibrium point is solved through iterative calculation methods.

[0010] In this context, each participant's strategy in Nash equilibrium is the optimal response to the strategies of other participants. The probability distribution of the mixed strategies of each participant in Nash equilibrium is determined by combining the tool matching score and the tool dependency weight matrix. The optimal tool selection sequence is then generated based on the probability distribution of the mixed strategies.

[0011] The intelligent scheduling model is an adaptive scheduling decision system based on a hierarchical attention network architecture. The model consists of four main components: an input encoding layer, a multi-level feature extraction layer, a hierarchical fusion layer, and an output decision layer.

[0012] The input encoding layer encodes the context influence weights, backtracking influence weights, and optimal tool selection sequence into a high-dimensional vector representation. The multi-level feature extraction layer processes scheduling information of different granularities through multiple parallel feature extraction branches. The hierarchical fusion layer uses a hierarchical fusion weight mechanism to weight and fuse features at different abstraction levels. The output decision layer generates resource consumption index and cache utilization index.

[0013] The input feature vector for constructing scheduling decisions includes the current system load status, the complexity index of the task to be scheduled, the capability characteristics of the MCP service, and the historical call success rate. It marks the quality of each scheduling decision and constructs a comprehensive evaluation index based on task completion time, resource utilization efficiency, and user satisfaction as a supervision signal. The training set, validation set, and test set are divided in chronological order.

[0014] The steps for establishing the training dataset for the intelligent scheduling model include collecting multi-source heterogeneous data such as historical tool call records, system resource usage logs, task execution results, and user satisfaction scores. The collected raw data is then cleaned and preprocessed, including removing outliers, filling in missing data, and standardizing numerical features. The training steps for the intelligent scheduling model include initializing model parameters and hierarchical fusion weights, using a stochastic gradient descent optimization algorithm for model training, and constructing a multi-objective optimization loss function that combines scheduling effect prediction error and resource utilization efficiency deviation. During training, the hierarchical fusion weights are dynamically adjusted to adapt to the scheduling requirements of different types of tasks.

[0015] Specifically, the tool capability vector encodes the functional characteristics of each MCP service into a multi-dimensional vector representation, which includes service type, input / output format, processing capability, and performance index information, to support tool similarity matching and capability evaluation.

[0016] Specifically, the hierarchical fusion weight mechanism is a weight allocation mechanism in the intelligent scheduling model used to adjust the importance of features at different abstract levels. It dynamically adjusts the fusion ratio of features at each level through a weight adaptive function, and adaptively optimizes scheduling decisions based on the current system state and task requirements.

[0017] Specifically, the weight adaptive function is a dynamic adjustment function used to adjust the hierarchical fusion weights of the intelligent scheduling model. The weight adaptive function calculates the scheduling adaptability index value based on three input parameters: the current system load rate, the task complexity index, and the historical scheduling success rate. When the scheduling adaptability index value is between 0 and 0.3, a conservative weight adjustment function is used to improve system stability. When the scheduling adaptability index value is between 0.3 and 0.7, a balanced weight adjustment function is used to balance the importance of features at each level. When the scheduling adaptability index value is between 0.7 and 1.0, an aggressive weight adjustment function is used to prioritize higher-level abstract features to improve scheduling efficiency.

[0018] This invention achieves runtime dynamic loading, unloading, and switching of tool services by constructing a three-layer intent recognition architecture, a tool dependency graph model, and an intelligent scheduling system. This invention effectively solves the shortcomings of traditional static integration techniques. Regarding the system restart issue, this invention achieves runtime hot-swapping of tool capabilities through the modular design and dynamic registration mechanism of MCP services, enabling capability expansion without interrupting existing services. Regarding the issue of fixed resource configuration, this invention employs an intelligent scheduling model and context-aware algorithms to dynamically adjust tool configuration and resource allocation based on actual usage needs. Regarding the issue of insufficient dependency management, this invention establishes a tool dependency graph model and uses the minimum spanning tree algorithm to dynamically optimize and manage dependencies. This invention fundamentally solves the technical problem of the inability to hot-swap AI assistant tool services. By abstracting tool capabilities into independent MCP service nodes and combining them with a Nash equilibrium game model to achieve coordination between services, the system can dynamically add, remove, or update tool capabilities while maintaining its operational state. The intelligent scheduling model, through a hierarchical fusion weight mechanism and a weight adaptive function, ensures service continuity and performance stability during hot-swapping, achieving true runtime dynamic capability expansion. Attached Figure Description

[0019] Figure 1 This is a flowchart of the method of the present invention.

[0020] Figure 2This is a diagram of a three-layer intent recognition architecture.

[0021] Figure 3 It is a tool-dependent graph model.

[0022] Figure 4 This is a diagram of the neural network structure of the intelligent scheduling model. Detailed Implementation

[0023] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings.

[0024] like Figure 1 The diagram shown is a flowchart of a method for implementing pluggable AI assistant capabilities on an AI platform provided by the present invention. This method includes the following steps:

[0025] S01. Construct a three-layer intent recognition architecture to perform semantic parsing, task classification, and tool matching on user input, and generate intent recognition results and tool matching scores.

[0026] S02. Establish a tool dependency graph model, optimize the calling relationship between MCP services by solving the minimum spanning tree problem, use the Kruskal algorithm to calculate the optimal dependency path, and generate a tool dependency weight matrix.

[0027] S03. Evaluate the influence weight of the current dialogue state on tool selection through the context awareness algorithm, and analyze the influence strength of historical interactions on the current decision by combining the backtracking awareness mechanism, and output the context influence weight value and the backtracking influence weight value.

[0028] S04. Based on the Nash equilibrium game model, accurately select the optimal tool combination. Treat each MCP service as a participant. Use the tool matching score and the tool dependency weight matrix as input. Determine the mixed strategy of each participant by solving the Nash equilibrium point and output the optimal tool selection sequence.

[0029] S05. The intelligent scheduling model is used to dynamically optimize the tool call sequence. The intelligent scheduling model receives the context influence weight value, the backtracking influence weight value and the optimal tool selection sequence as input. It adaptively adjusts the importance of different abstraction levels through a hierarchical fusion weight mechanism and outputs the resource consumption index and cache utilization index.

[0030] S06. Based on the intent recognition result and the tool dependency weight matrix, dynamically match the optimal MCP service combination, and use the resource consumption index and the cache utilization index to optimize resource allocation, so as to realize the real-time plug-and-play capability of AI assistant.

[0031] S07. Optionally, it also includes establishing a tool management feedback mechanism to update the tool capability vector and dependencies based on the execution results, and to continuously optimize the capability expansion effect of the AI ​​assistant using the resource consumption index and the cache utilization index.

[0032] like Figure 2 As shown, the three-layer intent recognition architecture processes user input sequentially through a semantic understanding layer, a task reasoning layer, and a tool mapping layer. The semantic understanding layer is responsible for extracting the semantic features of the user's intent, the task reasoning layer converts the semantic features into task type identifiers, and the tool mapping layer matches the corresponding MCP service based on the task type identifier and generates a tool matching score.

[0033] like Figure 3 As shown, the tool dependency graph model is a weighted undirected graph structure with MCP services as nodes and inter-service call relationships as edges. The optimal service dependency relationship is determined by solving the minimum spanning tree using the Kruskal algorithm. The algorithm first arranges all edges in ascending order of weight, and then adds the minimum weight edge that does not form a cycle until a minimum spanning tree connecting all nodes is formed, generating a tool dependency weight matrix containing the dependency strength between each MCP service.

[0034] Specifically, the context-aware algorithm quantifies the influence of key information in the current dialogue state on tool selection decisions. By analyzing factors such as dialogue history, user preferences, and task complexity, it calculates the applicability score of each MCP service in the current context and outputs the context influence weight value.

[0035] Specifically, the retrospective perception mechanism assesses the impact of historical interaction records on the current tool call decision. Through time decay function and similarity calculation, it quantifies the guiding value of past successful call experience for the current choice and outputs the retrospective impact weight value.

[0036] Specifically, the Nash equilibrium game model models the tool selection problem as a multi-participant non-cooperative game problem. Each MCP service corresponds to a rational participant, and each participant's payoff function is based on a comprehensive evaluation of task completion quality, response time, and resource consumption. The policy space of each participant includes the service call probability distribution. The Nash equilibrium point is solved through iterative calculation. In the Nash equilibrium state, each participant's policy is the optimal response to the policies of other participants. The mixed policy probability distribution of each participant in the Nash equilibrium state is determined by combining the tool matching score and the tool dependency weight matrix. The optimal tool selection sequence is generated based on the mixed policy probability distribution.

[0037] like Figure 4As shown, the specific structure of the intelligent scheduling model is an adaptive scheduling decision system based on a hierarchical attention network architecture. The model consists of four main components: an input encoding layer, a multi-level feature extraction layer, a hierarchical fusion layer, and an output decision layer. The input encoding layer encodes the context influence weight value, the backtracking influence weight value, and the optimal tool selection sequence into a high-dimensional vector representation. The multi-level feature extraction layer processes scheduling information of different granularities through multiple parallel feature extraction branches. The hierarchical fusion layer uses a hierarchical fusion weight mechanism to weight and fuse features at different abstraction levels. The output decision layer generates a resource consumption index and a cache utilization index.

[0038] The steps for establishing the training dataset for the intelligent scheduling model include collecting heterogeneous data from multiple sources, such as historical tool call records, system resource usage logs, task execution results, and user satisfaction scores. The collected raw data is then cleaned and preprocessed, including removing outliers, filling in missing data, and standardizing numerical features. An input feature vector for scheduling decisions is constructed, which includes the current system load status, the complexity index of the task to be scheduled, the capability characteristics of the MCP service, and the historical call success rate. The quality of each scheduling decision is labeled, and a comprehensive evaluation index is constructed based on task completion time, resource utilization efficiency, and user satisfaction as a supervision signal. The training set, validation set, and test set are then divided in chronological order.

[0039] The specific steps of training the intelligent scheduling model include initializing model parameters and hierarchical fusion weights, using stochastic gradient descent optimization algorithm for model training, constructing a multi-objective optimization loss function by combining scheduling effect prediction error and resource utilization efficiency deviation, dynamically adjusting hierarchical fusion weights during training to adapt to the scheduling requirements of different types of tasks, evaluating model performance and performing hyperparameter tuning through a validation set, adopting an early stopping strategy to prevent overfitting, and evaluating the scheduling decision accuracy and actual deployment effect of the final model on a test set.

[0040] Specifically, the tool capability vector encodes the functional characteristics of each MCP service into a multi-dimensional vector representation, which includes information such as service type, input / output format, processing capacity, and performance indicators, and is used to support tool similarity matching and capability evaluation.

[0041] The hierarchical fusion weight mechanism is a weight allocation mechanism in the intelligent scheduling model used to adjust the importance of features at different abstract levels. It dynamically adjusts the fusion ratio of features at each level through a weight adaptive function, and adaptively optimizes scheduling decisions based on the current system state and task requirements.

[0042] The resource consumption index is a single numerical indicator that is a comprehensive assessment of the consumption of computing resources, memory usage, network bandwidth, and storage space during the operation of the MCP service. It is used to monitor and optimize system resource allocation.

[0043] The cache utilization index specifically measures the cache hit rate and cache update frequency of tool call results. It is a numerical indicator that calculates the contribution of the caching system to the improvement of tool response speed by analyzing cache access patterns and data timeliness.

[0044] Specifically, the weight adaptive function is a dynamic adjustment function used to adjust the hierarchical fusion weights of the intelligent scheduling model. The weight adaptive function calculates the scheduling adaptability index value based on three input parameters: the current system load rate, the task complexity index, and the historical scheduling success rate. When the scheduling adaptability index value is between 0 and 0.3, a conservative weight adjustment function is used to improve system stability. When the scheduling adaptability index value is between 0.3 and 0.7, a balanced weight adjustment function is used to balance the importance of features at each level. When the scheduling adaptability index value is between 0.7 and 1.0, an aggressive weight adjustment function is used to prioritize higher-level abstract features to improve scheduling efficiency.

[0045] The specific implementation methods of the above steps are described in detail below.

[0046] The specific implementation of step S01 involves processing user input through a three-layer architecture. The semantic understanding layer first receives the user's natural language input, uses a pre-trained language model to vectorize the input text, and extracts semantic feature vectors. This layer calculates the importance weights of each word in the text based on an attention mechanism, generating a 128-dimensional semantic feature representation. This vector contains the core semantic information of the user's intent. The task inference layer receives the semantic feature vector as input and performs a non-linear transformation through a multilayer perceptron network, mapping the semantic features to a predefined task type space. This layer uses a classification algorithm to identify tasks and outputs a task type identifier vector containing a probability distribution. The dimension of this vector is equal to the number of task types supported by the system. The tool mapping layer takes the task type identifier vector as input and matches the corresponding MCP service using a similarity calculation algorithm. Cosine similarity is used to measure the degree of matching between task requirements and the capabilities of each tool, generating a tool matching score matrix. Each element in the matrix represents the matching degree between the task and the corresponding tool, with scores ranging from 0 to 1, where a score above 0.8 indicates a high degree of matching.

[0047] The specific implementation of step S02 is based on the minimum spanning tree algorithm in graph theory to optimize the calling relationship between MCP services. First, a weighted undirected graph with MCP services as nodes is constructed. The weight of each edge in the graph represents the calling cost between two services. The weight calculation comprehensively considers factors such as network latency, computational complexity, and resource consumption. The Kruskal algorithm is implemented by sorting all edges in ascending order of weight, initializing a disjoint-set data structure for loop detection, and successively selecting edges with the smallest weight that do not form loops to add to the minimum spanning tree until the spanning tree contains all nodes. The minimum spanning tree output by the algorithm determines the optimal dependency relationship between services. A tool dependency weight matrix is ​​generated by calculating the path length between each node in the tree. The matrix element values ​​represent the dependency strength between the corresponding services, with a value range of 0 to 1, where values ​​above 0.6 indicate a strong dependency relationship.

[0048] The specific implementation of step S03 involves quantifying the impact of the current dialogue state on tool selection using a context-aware algorithm. The algorithm first extracts key information from the dialogue history, including user-mentioned domain keywords, task complexity indicators, and interaction frequency. A time decay function is used to weight historical information, with more recent information receiving higher weight; the decay coefficient is set to 0.9. The algorithm calculates the applicability score of each MCP service in the current context, comprehensively considering the service's match with the user's intent, historical call success rate, and current system load to generate a context impact weight value. The retrospective awareness mechanism uses an exponential decay model to evaluate the impact strength of historical interaction records. By analyzing the task type, execution time, and user satisfaction of previously successfully called tasks, it calculates the similarity to the current task. A similarity threshold is set at 0.7; historical records exceeding this threshold have guiding value for current decisions. The output retrospective impact weight value ranges from 0.1 to 0.9.

[0049] The specific implementation of step S04 is based on solving the optimal tool combination using a Nash equilibrium game model. Each MCP service is modeled as a rational participant, and the payoff function of each participant is evaluated across three dimensions: task completion quality, response time, and resource consumption. The weight for quality is set to 0.5, the weight for time to 0.3, and the weight for resources to 0.2. The strategy space of the participants is defined as the service call probability distribution. An iterative algorithm is used to solve for the Nash equilibrium point. The algorithm initializes the mixed strategies of each participant as a uniform distribution and dynamically updates the strategies through the best response. When the strategy change is less than 0.01 in 10 consecutive iterations, an equilibrium state is considered to have been reached. Combining the tool matching score and the tool dependency weight matrix, the optimal mixed strategy probability distribution of each participant is determined under the Nash equilibrium state. An optimal tool selection sequence is generated based on the probability distribution, and the order of tools in the sequence is sorted from high to low based on the call probability.

[0050] The specific implementation of step S05 involves using an intelligent scheduling model based on a hierarchical attention network to dynamically optimize the tool call sequence. The model receives context influence weights, backtracking influence weights, and the optimal tool selection sequence as input features, and converts the input into a high-dimensional vector representation through an encoding layer. The multi-level feature extraction layer contains three parallel branches, processing task-level, service-level, and system-level scheduling information respectively. Each branch uses a multi-head attention mechanism to extract feature representations at the corresponding granularity. The hierarchical fusion layer uses a hierarchical fusion weight mechanism to weight and fuse features from different abstraction levels. The weight allocation is dynamically adjusted based on the current system state and task requirements. The fused feature vector is input to the output decision layer, which generates a resource consumption index and a cache utilization index through a fully connected network. Both indices range from 0 to 1, where values ​​below 0.3 indicate low consumption or low utilization, and values ​​above 0.7 indicate high consumption or high utilization.

[0051] The specific implementation of step S06 is based on dynamically matching the optimal MCP service combination based on the intent recognition result and the tool dependency weight matrix. First, a set of candidate services is determined according to the intent recognition result. Then, the synergy effect between services is calculated using the tool dependency weight matrix, and the service combination with the largest synergy effect is selected through a greedy algorithm. The resource allocation optimization process uses resource consumption index and cache utilization index for constraints. When the resource consumption index exceeds 0.8, a load balancing mechanism is triggered, allocating some tasks to service nodes with lighter loads. When the cache utilization index is below 0.4, a cache preloading strategy is initiated to preload potentially needed service results. The real-time plug-in mechanism monitors service status and performance indicators. When the service response time exceeds a preset threshold of 3 seconds, it automatically switches to a backup service to ensure the continuity and stability of the AI ​​assistant's capabilities.

[0052] Step S07 is optional. Its specific implementation involves establishing a tool management mechanism based on feedback learning. The system collects the execution results of each tool call, including task completion status, execution time, resource consumption, and user satisfaction ratings. An incremental learning algorithm is used to update the tool capability vector, and the vector parameters are adjusted using gradient descent with a learning rate of 0.001. Dependency updates are based on the success rate and efficiency metrics of the execution results. When the success rate of collaborative calls between two services exceeds 0.9 for five consecutive times, their dependency weight is increased; otherwise, the weight is decreased, with an adjustment increment of 0.05. The capability expansion effect of the AI ​​assistant is continuously optimized using resource consumption and cache utilization indices. A reinforcement learning algorithm is used to train the scheduling strategy, and the reward function comprehensively considers task completion quality, resource utilization efficiency, and user experience. The strategy parameters are updated every 1000 calls to ensure continuous improvement in system performance.

[0053] The detailed structure of the intelligent scheduling model includes four core components: an input encoding layer, a multi-level feature extraction layer, a hierarchical fusion layer, and an output decision layer. The input encoding layer employs a multi-head attention mechanism to encode the contextual influence weights, backtracking influence weights, and the optimal tool selection sequence, generating a 512-dimensional feature vector representation. This layer includes a positional encoding module to maintain the temporal relationships of the sequence information. The multi-level feature extraction layer is designed with a three-branch parallel structure. The task-level branch focuses on extracting task-related abstract features, employing a 4-layer transformer encoder structure with a hidden layer dimension of 256. The service-level branch handles the capability features and state information of the MCP service, using a graph neural network architecture to capture the relationships between services, with a node embedding dimension of 128 and an edge feature dimension of 64. The system-level branch processes system resource status and load information, using a convolutional neural network to extract temporal features, with a kernel size of 3 and a stride of 1. The hierarchical fusion layer dynamically adjusts the importance of features from the three branches through a weight adaptive function. The fusion function uses a gating mechanism to achieve feature selection, with an output dimension of 512. The output decision layer consists of two parallel fully connected sub-networks that predict the resource consumption index and the cache utilization index, respectively. Each sub-network contains two hidden layers with 256 and 128 hidden units, respectively. The activation function is ReLU, and the output layer uses the Sigmoid function to ensure that the index value is between 0 and 1.

[0054] The detailed steps for building the training dataset first involved collecting historical tool call records from the production environment. The data collection spanned six months and included over one million call records. Each record contained fields such as call timestamp, tool identifier, input parameters, execution time, resource consumption, and return result. System resource usage logs were collected in real-time through a monitoring agent, recording metrics such as CPU utilization, memory usage, network bandwidth, and disk I / O, with a sampling frequency of once per second. Task execution result data included information such as task completion status, accuracy score, and error type, obtained through a combination of automated testing frameworks and manual evaluation. User satisfaction scores were collected through questionnaires and implicit feedback, ranging from 1 to 5 points, with 4 points or higher indicating satisfaction. The data preprocessing stage first involved data cleaning, removing abnormal records with execution times exceeding 60 seconds, identifying and processing outliers using a 3x standard deviation method, imputing missing data using mean imputation or forward imputation, and standardizing numerical features using Z-scores. When constructing the input feature vector for scheduling decisions, the current system load status is represented by a weighted average of four dimensions: CPU, memory, network, and storage, with weights of 0.3, 0.3, 0.2, and 0.2, respectively. The complexity index of the task to be scheduled is calculated based on the input data size, the number of computation steps, and the number of dependent services. The capability characteristics of the MCP service include three dimensions: processing speed, accuracy, and stability. The historical call success rate is calculated by using a sliding window to statistically analyze the success rate of the most recent 1000 calls. The comprehensive evaluation index is constructed using a weighted average of the reciprocal of task completion time, resource utilization efficiency, and user satisfaction, with weights of 0.4, 0.3, and 0.3, respectively. This index serves as the target variable for supervised learning. The dataset is divided into training, validation, and test sets in an 8:1:1 ratio to ensure consistency in time order and avoid data leakage.

[0055] It should be noted that the first key technical idea of ​​this invention is the deep integration of a three-layer intent recognition architecture and a tool dependency graph model. Traditional AI assistant tool invocation methods typically employ simple keyword matching or single-layer classification methods, which cannot accurately understand the multi-dimensional semantic information of complex user intents, resulting in low tool selection accuracy. This invention, through hierarchical processing of a semantic understanding layer, a task reasoning layer, and a tool mapping layer, can form a progressive understanding deepening process from semantic features to task type to tool matching, effectively solving the limitations of traditional methods in understanding complex semantics. Simultaneously, the tool dependency graph model, based on the minimum spanning tree structure constructed using the Kruskal algorithm, can dynamically optimize the calling relationships between services compared to traditional static tool library management methods, avoiding redundant calling paths and significantly improving system execution efficiency and resource utilization.

[0056] The second key technical approach is a tool selection mechanism based on a Nash equilibrium game model. Existing tool selection techniques typically rely on greedy algorithms or simple priority ranking, which only consider local optima and ignore the interrelationships and competition between multiple tools. This invention treats each MCP service as a rational participant and solves for the globally optimal tool combination through a game theory model, maximizing overall gains while considering interdependencies and competition among tools. Compared to traditional heuristic algorithms, this method better balances the trade-offs between task completion quality, response time, and resource consumption, avoiding system performance bottlenecks caused by local optima.

[0057] The third key technical approach is the collaborative design of a hierarchical fusion weight mechanism and a context-aware algorithm in the intelligent scheduling model. Traditional task scheduling methods typically employ fixed weight allocation strategies, which cannot adaptively adjust based on the actual operating environment and task characteristics. This invention achieves adaptive optimization of the scheduling strategy by dynamically adjusting the importance of features at different abstract levels based on factors such as system load rate, task complexity, and historical success rate through a weight adaptive function. Combined with the quantitative analysis of the current dialogue state by the context-aware algorithm, the system can adjust scheduling decisions in real time according to changes in user intent and fluctuations in environmental conditions, exhibiting stronger environmental adaptability and decision accuracy compared to static scheduling methods.

[0058] The synergistic effect of these three key technological approaches forms an adaptive intelligent tool management ecosystem. Three-layer intent recognition provides high-quality input features for subsequent game theory models, the tool dependency graph model provides an optimized service relationship foundation for scheduling decisions, and the intelligent scheduling model achieves dynamic resource allocation and task execution optimization based on the outputs of the former two. Compared to traditional single algorithms or simple combinations, this multi-layered collaborative mechanism enables end-to-end optimization from user intent understanding to tool selection and execution scheduling, forming a closed-loop self-optimizing system. Through the continuous learning capability of the tool management feedback mechanism, the entire system can continuously improve the decision-making quality of each stage based on the execution results, achieving continuous evolution and autonomous optimization of AI assistant capabilities—a level of system-level intelligence that is difficult to achieve with existing technologies.

[0059] Specifically, the principle of this invention is:

[0060] The core principle behind this invention's ability to solve the hot-plugging problem of AI assistant tool services lies in transforming the traditional tightly coupled static architecture into a loosely coupled dynamic service architecture. This is achieved through service abstraction, dependency decoupling, and intelligent scheduling to enable dynamic runtime capability management.

[0061] First, the MCP service architecture is designed based on microservices and plug-in architecture theory. Each tool capability is encapsulated as an independent MCP service, achieving loosely coupled communication between services through standardized service interfaces and protocols. A three-layer intent recognition architecture serves as the central hub for service discovery and matching. The semantic understanding layer identifies user needs, the task reasoning layer determines the required service type, and the tool mapping layer dynamically binds service instances. This layered and decoupled design conforms to the single responsibility principle in software engineering; each service is responsible for only a specific functional domain, facilitating independent development, deployment, and maintenance.

[0062] Secondly, the tool dependency graph model addresses dependency consistency issues during hot-plugging using graph theory algorithms. When dynamically loading a new service, the system recalculates the minimum spanning tree using Kruskal's algorithm, ensuring the newly loaded service is correctly integrated into the existing dependency network. When unloading a service, the system checks the critical path in the dependency graph to avoid service interruptions caused by removing critical dependency nodes. This graph theory-based dependency management mechanism guarantees the safety and consistency of hot-plugging operations.

[0063] Finally, the collaborative working principle of the Nash equilibrium game model and the intelligent scheduling system ensures performance optimization during the hot-plugging process. During hot-plugging operations, the system models it as a dynamic game process, with newly added or soon-to-be-removed services acting as players. The optimal resource allocation strategy is determined through Nash equilibrium solving. The intelligent scheduling model's adaptive weight function adjusts scheduling parameters in real time based on system load changes, balancing resource competition between new and old services through a hierarchical weight fusion mechanism, ensuring a smooth transition in system performance during hot-plugging. Context-aware algorithms and backtracking-aware mechanisms provide historical experience guidance, enabling the system to predict the impact range of hot-plugging operations and proactively reserve resources and compensate for performance issues.

[0064] The following provides a specific embodiment 1 of the present invention, and the specific implementation of each step in this embodiment 1 is described in detail below.

[0065] In a specific implementation of step S01, the semantic feature vector extraction process of the semantic understanding layer is specifically represented as follows:

[0066]

[0067] In the formula, V s A 128-dimensional semantic feature vector; α i The attention weight for the i-th word is calculated using an attention mechanism and ranges from 0 to 1; h i is the hidden state vector of the i-th word, generated by the pre-trained language model; n is the number of words in the input text; β is the bias term used to adjust the baseline value of the feature vector. The task type identifier vector calculation process of the task inference layer is as follows:

[0068] T k =softmax(W t ·V s +b t );

[0069] In the formula, T k W is a task type identifier vector, with a dimension equal to the number of task types supported by the system. t The weight matrix is ​​obtained through training; b t is the bias vector; softmax is the normalized exponential function used to convert the output into a probability distribution. The tool matching score calculation in the tool mapping layer uses a cosine similarity metric.

[0070]

[0071] In the formula, S ij C represents the matching score between task i and tool j. j The capability vector serving the j-th MCP; ∥·∥ denotes the Euclidean norm of the vector.

[0072] In the specific implementation of step S02, the formula for calculating the edge weights of the tool-dependent graph model is as follows:

[0073] w ij =γ1·d ij +γ2c ij +γ3·r ij ;

[0074] In the formula, w ij Weighting of the call cost between service i and service j; d ij This is a network latency metric, obtained through network testing, and is measured in milliseconds; c ij To calculate the computational complexity metric, an evaluation based on the algorithm's time complexity; r ij γ1 represents resource consumption metrics, including CPU and memory usage; γ2, γ3 are weighting coefficients with default values ​​of 0.4, 0.3, and 0.3, respectively. The tool dependency weight matrix elements generated by the Kruskal algorithm are calculated as follows:

[0075]

[0076] In the formula, D ij L represents the dependency strength between service i and service j in the dependency weight matrix, with a value range from 0 to 1. ij The path length from node i to node j in the minimum spanning tree is calculated using a graph traversal algorithm.

[0077] In the specific implementation of step S03, the formula for calculating the applicability score of the context-aware algorithm is as follows:

[0078] A j =λ1·M ij +λ2·H j +λ3·(1-L j )+ε1;

[0079] In the formula, A j The suitability score for the j-th MCP service, with a value range of 0 to 1; M ij The degree of matching between service j and user intent i is calculated using cosine similarity; H j The historical call success rate for service j is obtained by statistically analyzing historical call records; L j λ1 represents the current system load status, indicating the load level of service j; λ1, λ2, and λ3 are weighting coefficients, with default values ​​of 0.5, 0.3, and 0.2 respectively; ε1 is the error term, ranging from 0.01 to 0.05. The impact strength calculation of the backtracking perception mechanism adopts an exponential decay model:

[0080]

[0081] In the formula, R k δ is the backtracking impact weight value for the current task k, ranging from 0.1 to 0.9; δ is the decay coefficient, set to 0.9, used to reduce the impact weight of historical records; m is the number of historical records; sim(T k H t Q represents the similarity between the current task and the historical task t, calculated using feature vector similarity. t The quality score for historical task t is based on task completion and user satisfaction assessment.

[0082] In the specific implementation of step S04, the payoff function of the Nash equilibrium game model is expressed as:

[0083] U j (p j p -j )=ω1·Q j -ω2·T j -ω3·R j +ε2;

[0084] In the formula, U j p represents the payoff function value for participant j. j Let p be the mixed strategy for participant j, and let p represent the calling probability distribution. -j For the strategy combinations of other participants; Q j The task completion quality is rated on a scale of 0 to 1; T j Response time, in seconds; R jω1 represents resource consumption, expressed as a standardized numerical value; ω2, ω3, are weighting coefficients, with values ​​of 0.5, 0.3, and 0.2 respectively; ε2 is a random disturbance term, ranging from 0.02 to 0.08, used to simulate system uncertainty. The update formula for the mixed strategy probability distribution is:

[0085]

[0086] In the formula, Let be the policy probability in the (t+1)th iteration; Let be the policy probability in the t-th iteration; η is the learning rate, set to 0.01, used to control the policy update step size; The partial derivative of the payoff function with respect to the policy is calculated using numerical differentiation.

[0087] In the specific implementation of step S05, the formula for calculating the hierarchical fusion weight of the intelligent scheduling model is as follows:

[0088] W l =f adapt (L sys C task S hist );

[0089] In the formula, W l f represents the fusion weights of the l-th layer, used to adjust the importance of features at different abstraction levels; adapt L is the weighted adaptive function; sys The current system load rate is obtained by monitoring system resource usage; C task S is the task complexity index, calculated based on the size of the task input data and the number of dependent services. hist The historical scheduling success rate is obtained through statistical analysis. The specific expression of the weighted adaptive function is:

[0090]

[0091] In the formula, x is the scheduling adaptability index value, ranging from 0 to 1, and is calculated as x = 0.4·L sys +0.3·C task +0.3·S hist This piecewise function implements three weight adjustment strategies: conservative, balanced, and aggressive. The formulas for calculating the resource consumption index and the cache utilization index are as follows:

[0092]

[0093] In the formula, I res This is a resource consumption index, with a value range of 0 to 1; I cacheσ is the cache utilization index, with a value range of 0 to 1; σ is the sigmoid activation function, used to map the output to the interval between 0 and 1; K is the dimension of the feature vector; w k v k The weight parameters are obtained through training; f k g k b is the k-th element of the eigenvector; res b cache This is the bias term, used to adjust the output reference value.

[0094] The specific implementation method of step S06 is the same as described above, and will not be repeated in detail here.

[0095] In the specific implementation of step S07, the incremental update formula for the tool capability vector is:

[0096]

[0097] In the formula, V j (t+1) V is the updated tool capability vector; j (t) This is the current tool capability vector, which includes information such as service type, input / output format, and performance metrics; α is the learning rate, set to 0.001, used to control the vector update magnitude; The gradient vector, based on the execution result, is calculated using the backpropagation algorithm. The dynamic adjustment formula for dependency weights is:

[0098]

[0099] In the formula, The updated dependency weights; The original dependency weights are represented by ΔD, which is the weight adjustment magnitude and set to 0.05. ij The success rate of collaborative calls is obtained by statistically analyzing the collaborative execution results of services i and j; θ is the success rate threshold, set to 0.9; sign is the sign function, returning 1 when the collaborative success rate is higher than the threshold, and -1 otherwise. The reward function for reinforcement learning is calculated as follows:

[0100] R total =φ1·Q comp +φ2·E util +φ3·S user -φ4·P penalty ;

[0101] In the formula, R total The total reward value, Q, is used to guide the optimization direction of the scheduling strategy; comp To assess task completion quality, an evaluation is conducted based on the accuracy and completeness of task execution; E utilResource utilization efficiency is calculated as the ratio of resource consumption to task output; S user User experience ratings are obtained through user feedback and satisfaction surveys; P penalty φ1 represents the penalty, including the negative impact of execution timeout and error handling; φ2, φ3, and φ4 are weighting coefficients with default values ​​of 0.4, 0.3, 0.2, and 0.1, respectively, used to balance the importance of each evaluation dimension.

[0102] To better understand and implement this invention, the following is a specific application scenario of the invention, Example 2: An AI platform system needs to automatically invoke different MCP services to complete tasks based on user queries. The system deploys 12 MCP services with different functions, including text analysis, sentiment recognition, knowledge retrieval, language translation, image processing, data calculation, email sending, schedule management, weather query, news recommendation, product recommendation, and technical support.

[0103] Researchers first collected 5,000 user queries as test data. These queries covered multiple business areas and ranged in complexity from simple information queries to complex tasks requiring multi-service collaboration. In step S01, the system processed the user input, "Help me analyze the sentiment of this sales report and translate it into English to send to the client." The semantic understanding layer extracted a 128-dimensional feature vector V. s In the query, the attention weight α1 for the keyword "analysis" is 0.85, the weight α2 for "sentiment tendency" is 0.92, the weight α3 for "translation" is 0.88, and the weight α4 for "send" is 0.76. The task inference layer identifies that the query involves four task types: text analysis, sentiment recognition, language translation, and email sending, with corresponding probability distributions T. k The values ​​are 0.91, 0.87, 0.89 and 0.82, respectively.

[0104] In step S02, the system constructs a tool dependency graph containing 12 service nodes. Taking the text analysis service and the sentiment recognition service as examples, the network latency d between them is... 12 The computational complexity is 15 milliseconds, with a computational complexity metric c. 12 The resource consumption index r is 0.3. 12 The value is 0.25, and the edge weight w is calculated. 12 The value is 0.295. After applying Kruskal's algorithm, the path length L from the text analysis service to the sentiment recognition service in the generated minimum spanning tree is [value missing]. 12 A value of 1 corresponds to a dependency weight D. 12 The value is 0.5. The tool dependency weight matrix of the entire system is shown in Table 1:

[0105] Table 1 Tool Dependency Weight Matrix

[0106]

[0107]

[0108] In step S03, the system calculates context awareness and backtracking awareness. The current dialogue history shows that the user has engaged in document processing tasks 6 out of the past 10 interactions, and the system load state L... j The success rate H1 of historical calls to the text analysis service is 0.94, and the matching degree M with the current intent is 0.35. 11 The applicability score A1 was calculated to be 0.87, with a similarity score of 0.91. The retrospective perception mechanism analyzed the execution records of the most recent 50 similar tasks, among which 23 records had a similarity score exceeding 0.7 with the current task. The retrospective influence weight value R was calculated. k It is 0.73.

[0109] In step S04, the Nash equilibrium game model uses 12 MCP services as participants. The task completion quality Q1 of the text analysis service is 0.91, the average response time T1 is 1.2 seconds, and the resource consumption R1 is 0.28, resulting in a payoff function value U1 of 0.423. After 15 rounds of iterative calculation, the system reaches Nash equilibrium, and the optimal call probabilities for each service are shown in Table 2.

[0110] Table 2. Service call probability distribution under Nash equilibrium.

[0111]

[0112] In step S05, the intelligent scheduling model determines the current system load rate L. sys The task complexity index C is 0.42. task The historical scheduling success rate S is 0.68. hist The value is 0.89, and the calculated scheduling adaptability index value x is 0.59, which falls within the balanced weight adjustment range. The corresponding weight adaptive function value f is... adapt (0.59) is 0.468. The final resource consumption index I output by the system is... res The cache utilization index is 0.34. cache It is 0.72.

[0113] Based on the aforementioned calculation results, in step S06, the system ultimately selected a combination of four services: text analysis, sentiment recognition, language translation, and email sending. The call sequence is: text analysis → sentiment recognition → language translation → email sending. Due to the high cache utilization index, the system enabled a preloading strategy, preloading commonly used dictionaries for the language translation service.

[0114] In step S07, the system recorded the execution result of this task. The total task time was 2.8 seconds, the user satisfaction score was 4.6 out of 5, and the execution status of each service is shown in Table 3.

[0115] Table 3. Statistics of Task Execution Results

[0116] Service Name Execution time (seconds) Resource consumption rate Execution status accuracy Text Analysis 0.65 0.23 success 0.96 Emotion recognition 0.48 0.19 success 0.94 Language translation 1.12 0.31 success 0.92 Email sending 0.55 0.15 success 1.00

[0117] Based on the execution results, the system updated the capability vectors and dependency weights of each service. The collaboration success rate between the text analysis service and the sentiment recognition service was 0.94, exceeding the threshold of 0.9, so the dependency weight between them was adjusted from 0.5 to 0.55.

[0118] To verify the technical effectiveness of this invention, researchers compared the system with traditional tool invocation methods based on rule matching and simple priority ranking. Traditional methods use keyword matching to determine candidate tools and then invoke them according to a preset priority order, without considering tool dependencies or system dynamics. Test results showed that on the same test set of 5000 queries, the traditional method had an average task completion time of 4.2 seconds, a task completion accuracy of 82.4%, and a system resource utilization rate of 68.5%. The method of this invention had an average task completion time of 3.1 seconds, a task completion accuracy of 89.7%, and a system resource utilization rate of 78.3%. The comparative results indicate that this invention improves execution efficiency by 26.2%, accuracy by 8.9%, and resource utilization by 14.3% compared to traditional methods.

[0119] Traditional tool invocation methods rely primarily on static rule matching and fixed priority ordering, failing to dynamically adjust based on the actual operating environment and task characteristics. This results in inaccurate tool selection and low execution efficiency. This invention achieves deep understanding of user intent through a three-layer intent recognition architecture, optimizes service invocation relationships through a tool dependency graph model, achieves globally optimal tool combination selection through a Nash equilibrium game model, and realizes adaptive resource allocation and task execution optimization through an intelligent scheduling model. This multi-layered collaborative technical architecture effectively solves the problems of inaccurate tool selection, low execution efficiency, and resource waste in complex scenarios using traditional methods, enabling intelligent management and dynamic optimization of AI assistant capabilities.

[0120] The following is an embodiment 3 of a specific application scenario of the present invention: Researchers from a shopping platform research team built a comprehensive shopping assistant system. This system needs to handle complex shopping scenarios including product search, price comparison, user review analysis, recommendation algorithms, inventory query, order processing, logistics tracking, after-sales service, coupon management, payment processing, user behavior analysis, and personalized customization. The system deploys 18 MCP services with different functions, covering all aspects of the entire shopping process, and each service has independent processing capabilities and interface specifications.

[0121] Researchers first collected 15,000 real user shopping queries as a test dataset. These queries covered various scenarios, ranging from simple product searches to complex multi-dimensional shopping decision support. The query complexity distribution showed that 35% were basic information queries, 42% were medium-complexity comparative analysis tasks, and 23% were high-complexity comprehensive tasks requiring multi-service collaboration. During the implementation of step S01, the system received user input: "Help me find a smartwatch suitable for outdoor sports, priced between 2,000 and 3,000 yuan, with heart rate monitoring and GPS functions, good user reviews, and preferably a comparison of the advantages and disadvantages of several brands."

[0122] The semantic understanding layer performs deep parsing of the query and extracts a 128-dimensional semantic feature vector V. s In the query, the attention weights for the keywords "smartwatch" (α1) are 0.94, "outdoor sports" (α2) 0.89, "price range" (α3) 0.82, "heart rate monitoring" (α4) 0.87, "GPS function" (α5) 0.85, "user reviews" (α6) 0.91, and "brand comparison" (α7) 0.88. The task inference layer identifies six main task types involved in the query: product search, price filtering, function matching, review analysis, brand comparison, and recommendation ranking. The corresponding probability distribution T... k The scores are 0.96, 0.89, 0.92, 0.88, 0.85, and 0.90, respectively. The tool mapping layer calculates the matching score between each MCP service and the task requirements, and the matching score S for the product search service. 11 The matching score for the price comparison service is 0.94. 22 The matching score S of the user review analysis service is 0.87. 33 The matching score S of the recommendation algorithm service is 0.91. 44 It is 0.89.

[0123] In step S02, the system constructs a tool dependency graph model containing 18 service nodes. The network latency d between the product search service and the price comparison service... 12 The computational complexity is 22 milliseconds, with a computational complexity metric c. 12The resource consumption index r is 0.35. 12 The value is 0.28. The edge weight w is calculated using the formula. 12 The edge weight w between the user rating analysis service and the recommendation algorithm service is 0.305. 34 The edge weight w between the product search service and the inventory query service is 0.289. 15 The value is 0.267. After applying Kruskal's algorithm to generate the minimum spanning tree, the dependency weights among the main services are shown in Table 4:

[0124] Table 4. Weight Matrix of Major MCP Service Dependencies

[0125]

[0126]

[0127] In step S03, the system performs context-aware and retrospective awareness analysis. The current user's shopping history shows that the user made 12 shopping queries in the past 30 days, of which 8 involved electronics, 5 involved sporting goods, and 3 involved price comparison functions. The system's current load status L... j The historical success rate H1 of the product search service is 0.47, and the matching degree M with the current intent is 0.96. 11 The applicability score A1 is calculated to be 0.92, with a historical success rate of 0.94. The historical success rate H2 for the price comparison service is 0.91, and the applicability score A2 is 0.85. The historical success rate H3 for the user review analysis service is 0.89, and the applicability score A3 is 0.87. The historical success rate H4 for the recommendation algorithm service is 0.93, and the applicability score A4 is 0.90.

[0128] The backtracking perception mechanism analyzed the execution records of the most recent 100 similar smartwatch query tasks, finding 47 records with a similarity exceeding 0.7 to the current task. These records had an average execution time of 3.8 seconds and an average user satisfaction score of 4.2. The backtracking impact weight value R for the current task was calculated using an exponential decay model. k The success rate is 0.78. Historical data shows that in queries involving comparisons of multifunctional electronic products, the success rate of simultaneously invoking product search, price comparison, and review analysis services reaches 94.5%, providing an important reference for the selection of service combinations for the current task.

[0129] In step S04, the Nash equilibrium game model uses 18 MCP services as participants for modeling and analysis. The product search service has a task completion quality Q1 of 0.94, an average response time T1 of 1.35 seconds, resource consumption R1 of 0.32, and a random disturbance term ε2 of 0.045, resulting in a payoff function value U1 of 0.476. The price comparison service has a quality score Q2 of 0.89, a response time T2 of 1.68 seconds, resource consumption R2 of 0.28, and a payoff function value U2 of 0.421. The user review analysis service has a quality score Q3 of 0.91, a response time T3 of 2.15 seconds, resource consumption R3 of 0.35, and a payoff function value U3 of 0.398. The recommendation algorithm service has a quality score Q4 of 0.93, a response time T4 of 1.92 seconds, resource consumption R4 of 0.31, and a payoff function value U4 of 0.436.

[0130] After 23 rounds of iterative calculations, the system reached Nash equilibrium, with the convergence condition being that the policy change between consecutive rounds was less than 0.008. The optimal call probability distribution of each major service in the equilibrium state is shown in Table 5.

[0131] Table 5. Service call probability distribution under Nash equilibrium.

[0132]

[0133] In step S05, the intelligent scheduling model makes dynamic scheduling decisions based on the current system state. System load rate L sys The task complexity index C is 0.53. task The historical scheduling success rate S is 0.74. hist The value is 0.91, and the calculated scheduling adaptability index value x is 0.66, which falls within the balanced weight adjustment range. The corresponding weight adaptive function value f is... adapt (0.66) is 0.482.

[0134] The intelligent scheduling model employs a four-layer architecture to process scheduling information at different levels. The input encoding layer encodes the context influence weight (0.78), backtracking influence weight (0.78), and optimal tool selection sequence into a 512-dimensional feature vector. In the multi-level feature extraction layer, the task-level branch extracts 256-dimensional task-related features, primarily including product category, functional requirements, and price range. The service-level branch processes the relationships between MCP services using a graph neural network, generating 128-dimensional service relationship features. The system-level branch analyzes the current system resource status, outputting 64-dimensional system status features. The hierarchical fusion layer weights the features from the three branches, with fusion weights of 0.45, 0.32, and 0.23, respectively.

[0135] The output decision layer ultimately generates the resource consumption index I. resThe cache utilization index is 0.41. cache The cache utilization index is 0.69. Due to the high cache utilization index, the system activated a smart preloading strategy, preloading basic information and popular brand data for smartwatches. Meanwhile, because the resource consumption index is at a moderate level, the system adopted a balanced scheduling strategy to avoid excessive concurrent calls.

[0136] Step S06: Based on the aforementioned analysis results, the system determines the optimal MCP service combination. Based on the intent recognition results and the tool dependency weight matrix, the system selects six core services: product search, price comparison, user review analysis, recommendation algorithm, brand comparison, and specification matching. The optimized service call sequence is determined as follows: Product Search → Specification Matching → Price Comparison → User Review Analysis → Brand Comparison → Recommendation Algorithm.

[0137] During resource allocation optimization, the system allocated reasonable computing resources to each service based on a resource consumption index of 0.41. The product search service was allocated 25% CPU resources and 30% memory resources. The price comparison service was allocated 18% CPU resources and 22% memory resources. The user review analysis service, due to its involvement in natural language processing, received a larger allocation of computing resources, with 28% CPU and 35% memory. A cache utilization index of 0.69 triggered a cache optimization strategy, causing the system to retain recently queried smartwatch-related data in memory, improving the response speed of subsequent similar queries.

[0138] In step S07, the system established a complete tool management feedback mechanism. After the task was completed, the system collected detailed execution data and user feedback information. The total execution time was 4.2 seconds, and the user ultimately selected the recommended Huawei Smartwatch GT3, giving the overall service satisfaction score of 4.7 out of 5. The specific execution status of each service is shown in Table 6:

[0139] Table 6 Detailed Statistics of Task Execution

[0140]

[0141] Based on the execution results, the system incrementally updated the tool capability vectors. Due to its superior performance, the response speed feature value in the product search service's capability vector increased from 0.89 to 0.91. The data processing capability feature value in the user review analysis service increased from 0.86 to 0.88 due to processing a large amount of review data. The dependency weights were also adjusted accordingly. The collaboration success rate between the product search service and the specification matching service reached 0.95, exceeding the threshold of 0.9; therefore, the dependency weight between them was adjusted from 0.51 to 0.56.

[0142] The system also updated the reward function parameters for reinforcement learning. The quality of this task's completion, Q...comp The resource utilization efficiency E is 0.94. util The score is 0.78, and the user experience rating is S. user The penalty term P is 0.94. penalty The value is 0.03, and the total reward value R is calculated. total The reward value is 0.823. This high reward value prompts the system to prioritize the same service combination and scheduling strategy in subsequent similar tasks.

[0143] To further verify the system performance, researchers conducted large-scale tests. The overall performance of the system on a test set of 5000 queries with varying degrees of complexity is shown in Table 7.

[0144] Table 7 Statistical Table of System Performance Test Results

[0145]

[0146] Test results show that the system exhibits good performance stability across queries of varying complexity. Low-complexity queries demonstrate the fastest response time and highest accuracy. Medium-complexity queries maintain a balanced performance across all metrics. While high-complexity queries have longer response times, they still maintain a high task completion rate and user satisfaction.

[0147] To evaluate the technical advantages of this invention, researchers conducted a comparative test with a traditional shopping assistant system based on fixed rules and static priorities. Traditional systems use predefined keyword matching rules to determine the service call sequence and select services according to a fixed priority order, without considering user history, dynamic system load, or synergistic effects between services.

[0148] Table 8 shows the test results of the traditional method under the same test environment and dataset:

[0149] Table 8 Comparison of Traditional Methods and Invention Method

[0150] Evaluation indicators Traditional methods Method of the present invention Performance improvement Average response time (seconds) 4.8 3.9 18.8% Task completion rate 0.854 0.923 8.1% User satisfaction rating 3.9 4.4 12.8% resource utilization rate 0.68 0.76 11.8% Cache hit rate 0.63 0.77 22.2% Service call accuracy 0.82 0.92 12.2% System concurrent processing capability 156 189 21.2%

[0151] The comparative results show that this invention achieves significant improvements in all key technical indicators. Regarding response time, intelligent scheduling and caching optimization improve system response speed by 18.8%. In terms of task completion rate, accurate intent recognition and optimal service combination selection improve the completion rate by 8.1%. Regarding user satisfaction, personalized recommendations and a high-quality service experience improve satisfaction by 12.8%.

[0152] Traditional shopping assistant systems rely primarily on manually defined rules and fixed service call patterns, facing technical challenges such as complex rule maintenance, poor adaptability, resource waste, and unsatisfactory user experience. When user query complexity increases or system load changes, traditional methods cannot dynamically adjust, leading to inaccurate service selection and low execution efficiency. This invention achieves accurate understanding of user shopping intentions through a three-layer intent recognition architecture, capable of handling complex, multi-dimensional shopping needs. The tool dependency graph model and Kruskal algorithm optimize the call relationships between MCP services, avoiding redundant calls and resource waste. A Nash equilibrium game model achieves globally optimal service combination selection, balancing service quality, response time, and resource consumption. Through the adaptive weight adjustment mechanism of the intelligent scheduling model, the system can dynamically optimize based on real-time status, improving environmental adaptability and execution efficiency. This multi-layered collaborative technical architecture effectively solves the technical limitations of traditional shopping assistant systems in complex shopping scenarios, enabling intelligent management and continuous optimization of shopping AI assistant capabilities.

[0153] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for implementing pluggable AI assistant capabilities on an AI platform, characterized in that, include: A three-layer intent recognition architecture is constructed to perform semantic parsing, task classification, and tool matching on user input, generating intent recognition results and tool matching scores. A tool dependency graph model is established, and the optimal dependency path is calculated using the Kruskal algorithm to generate the tool dependency weight matrix. The context-aware algorithm and backtracking-aware mechanism are used to output the context influence weights and backtracking influence weights; the hybrid strategy is determined to output the optimal tool selection sequence. An intelligent scheduling model is adopted to receive context influence weights, backtracking influence weights, and the optimal tool selection sequence. A hierarchical fusion weight mechanism is used to output resource consumption and cache utilization indices. Based on intent recognition results and the tool dependency weight matrix, the optimal MCP service combination is dynamically matched. Resource allocation is optimized using the resource consumption and cache utilization indices to achieve real-time plug-and-play functionality for the AI ​​assistant. The step of determining the optimal tool selection sequence for the hybrid strategy output specifically involves using a Nash equilibrium game model, treating each MCP service as a participant, and solving for the Nash equilibrium point. In the Nash equilibrium state, each participant's strategy is the optimal response to the strategies of other participants. The probability distribution of the hybrid strategy for each participant in the Nash equilibrium state is determined by combining the tool matching score and the tool dependency weight matrix. The optimal tool selection sequence is then generated based on the probability distribution of the hybrid strategy.

2. The method according to claim 1, characterized in that, The three-layer intent recognition architecture involves processing user input sequentially through a semantic understanding layer, a task reasoning layer, and a tool mapping layer. The semantic understanding layer is responsible for extracting the semantic features of the user's intent. The task reasoning layer converts the semantic features into task type identifiers. The tool mapping layer matches the corresponding MCP service based on the task type identifier and generates a tool matching score.

3. The method according to claim 2, characterized in that, The tool dependency graph model is specifically a weighted undirected graph structure with MCP services as nodes and inter-service call relationships as edges. The optimal service dependency relationship is determined by solving the minimum spanning tree using the Kruskal algorithm. The algorithm first arranges all edges in ascending order of weight, and then adds the minimum weight edge that does not form a cycle until a minimum spanning tree connecting all nodes is formed, generating a tool dependency weight matrix containing the dependency strength between each MCP service.

4. The method according to claim 3, characterized in that, The context-aware algorithm specifically quantifies the influence of key information in the current dialogue state on tool selection decisions. By analyzing dialogue history, user preferences, and task complexity factors, it calculates the applicability score of each MCP service in the current context and outputs the context influence weight value.

5. The method according to claim 4, characterized in that, The backtracking perception mechanism specifically assesses the influence of historical interaction records on the current tool call decision. Through time decay function and similarity calculation, it quantifies the guiding value of past successful call experience for the current choice and outputs the backtracking influence weight value.

6. The method according to claim 5, characterized in that, The Nash equilibrium game model specifically models the tool selection problem as a multi-participant non-cooperative game problem. Each MCP service corresponds to a rational participant, and the payoff function of each participant is based on a comprehensive evaluation of task completion quality, response time, and resource consumption. The strategy space of each participant includes the service call probability distribution, and the Nash equilibrium point is solved through iterative calculation methods.

7. The method according to claim 6, characterized in that, The structure of the intelligent scheduling model is an adaptive scheduling decision system based on a hierarchical attention network architecture. The model consists of four main components: an input encoding layer, a multi-level feature extraction layer, a hierarchical fusion layer, and an output decision layer.

8. The method according to claim 7, characterized in that, The input encoding layer encodes the context influence weights, backtracking influence weights, and optimal tool selection sequence into a high-dimensional vector representation. The multi-level feature extraction layer processes scheduling information of different granularities through multiple parallel feature extraction branches. The hierarchical fusion layer uses a hierarchical fusion weight mechanism to weight and fuse features from different abstraction levels. The output decision layer generates resource consumption index and cache utilization index.

9. The method according to claim 8, characterized in that, The input feature vector for constructing scheduling decisions includes the current system load status, the complexity index of the task to be scheduled, the capability characteristics of the MCP service, and the historical call success rate. It marks the merits and demerits of each scheduling decision. Based on task completion time, resource utilization efficiency, and user satisfaction, a comprehensive evaluation index is constructed as a supervision signal. The training set, validation set, and test set are divided in chronological order.

Citation Information

Patent Citations

  • Industrial park management system driven by cloud computing

    CN117891606A

  • AI model hot plug method and system based on building intelligent controller, electronic equipment and storage medium

    CN118778539A