A heterogeneous terminal interaction method and system based on distributed intelligent agent collaboration
By employing a distributed intelligent agent collaboration method, the terminal status is perceived in real time and configuration files are exchanged to determine the collaboration mode. Task instructions are generated using a lightweight large language model, which solves the compatibility and task scheduling problems of heterogeneous terminal devices in collaborative work, and realizes flexible collaboration and efficient task execution.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGZHOU ZHIYONGKAIWU ARTIFICIAL INTELLIGENCE TECHNOLOGY CO LTD
- Filing Date
- 2026-04-20
- Publication Date
- 2026-06-26
AI Technical Summary
Existing technologies face challenges in the collaborative operation of heterogeneous terminal devices, including issues with capability description and matching, protocol adaptation in dynamic network environments, task scheduling for large-scale terminal collaboration, and balancing semantic understanding with resource optimization. They also lack flexible configuration and efficient dynamic adaptation capabilities.
By using a distributed agent-based collaborative approach, the system can perceive the status of terminals within the communication range in real time, exchange agent configuration files, determine the collaboration mode, and generate task instructions using a lightweight large language model, thereby achieving flexible collaboration and efficient task allocation among heterogeneous terminals.
It enables flexible collaboration mode selection for any type of heterogeneous terminal, adapts to complex and ever-changing task requirements, and improves system compatibility and efficiency.
Smart Images

Figure CN122294093A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, specifically to a heterogeneous terminal interaction method and system based on distributed intelligent agent collaboration. Background Technology
[0002] With the rapid development of Internet of Things (IoT) technology, the demand for collaborative work among heterogeneous terminal devices (such as smartphones, tablets, smart home devices, industrial sensors, etc.) is growing.
[0003] However, existing terminals have the following problems when performing system operations: First, there is the issue of describing and matching heterogeneous terminal capabilities: terminal devices have different hardware capabilities (CPU computing power, memory size, sensor type), software functions (supported protocols, running applications), and communication protocols (WiFi, BLE, ZigBee). Existing technologies use static description files (such as W3C WoT Thing Description) and lack the ability to calculate semantic-level device similarity.
[0004] Secondly, there is the issue of protocol adaptation in dynamic network environments: network bandwidth (1Mbps-1Gbps), latency (1ms-500ms), and stability (packet loss rate 0-10%) change constantly. Existing technologies mostly use predefined rules for protocol selection, which cannot be dynamically adjusted according to real-time conditions.
[0005] Furthermore, there is the issue of task scheduling for large-scale terminal collaboration: multi-terminal collaborative execution of complex tasks requires effective task decomposition and allocation, and consideration of terminal load balancing and capacity matching to avoid resource waste.
[0006] Furthermore, there is a trade-off between semantic understanding and resource optimization: semantic understanding requires complex computation, which is difficult for resource-constrained terminals (such as sensor nodes) to handle. Existing attention mechanisms are based solely on query-key similarity, ignoring historical collaboration relationships between terminals. Summary of the Invention
[0007] In view of the above problems, embodiments of the present invention provide a heterogeneous terminal interaction method and related apparatus based on distributed intelligent agent collaboration, which is used to solve the problem in the prior art of how to achieve flexible configuration and efficient dynamic adaptation for collaborative work while achieving broad compatibility of heterogeneous terminals.
[0008] According to one aspect of the present invention, a heterogeneous terminal interaction method based on distributed intelligent agent collaboration is provided, the method comprising: The first terminal senses at least one second terminal within its communication range in real time and exchanges intelligent agent configuration files with the at least one second terminal to determine the status information of the at least one second terminal; wherein, the status information includes capability description information, previous status, and a list of resource statuses; The first terminal determines the collaboration mode between itself and at least one second terminal based on the status information and the task to be processed. Based on the collaboration mode, the first terminal calls a lightweight large language model to generate task instructions corresponding to at least one second terminal, and sends them to the at least one second terminal respectively. The at least one second terminal executes the task according to the task instruction.
[0009] In one alternative approach, the first terminal senses at least one second terminal within its communication range in real time and exchanges agent configuration files with the at least one second terminal to determine the status information of the at least one second terminal, including: The first terminal establishes a handshake connection with the at least one second terminal; If the handshake connection with the current second terminal fails, the current second terminal is skipped, and a handshake connection is established with the next second terminal. When the handshake connection is successful, the first terminal and the second terminal exchange intelligent agent configuration files; The first terminal parses the agent configuration file, converts the parsed specific capability text into capability semantic feature vectors, converts the parsed resource status information into resource status vectors, and forms a resource status list, thereby obtaining the status information of the at least one second terminal.
[0010] In one optional approach, the first terminal determines a collaboration mode between itself and at least one second terminal based on the status information and the current task to be processed, including: After weighted fusion and residual connection of the capability semantic feature vector and resource state vector of each target intelligent agent, the fused feature vector of the target intelligent agent is obtained; the target intelligent agent includes a first terminal and the at least one second terminal; The fused feature vectors of each target agent are converted into graph structure data respectively; Calculate the difference information between the graph structure data of the two target agents; The difference information is input into the conflict resolution model to obtain the conflict resolution parameters corresponding to each target agent; the conflict resolution model is pre-trained on the neural network based on historical collaborative conflict samples; the historical collaborative conflict samples include conflict samples of each target agent in historical task collaboration and corresponding resolution parameter labels; The fused feature vectors of each target agent and the conflict resolution parameters between each target agent and other target agents are input into the cooperation mode decision function to determine the cooperation mode corresponding to the task to be processed; the cooperation mode includes parallel mode, serial mode or hybrid mode.
[0011] In one optional approach, the fused feature vector of the target agent is obtained by weighted fusion and residual connection of the capability semantic feature vector and resource state vector of each target agent, including: For each target agent's capability semantic feature vector and resource state vector, an adaptive weighting mechanism is used to calculate the weights corresponding to the capability semantic feature vector and the resource state vector, respectively; the adaptive weighting mechanism is determined based on the system resource scarcity and the matching degree between the target agent's capability semantic feature vector and the task to be processed. The capability semantic feature vector and the resource state vector are weighted, fused, and residually connected according to the weights to obtain the fused feature vector of each target agent.
[0012] In one alternative approach, the adaptive weighting mechanism is calculated using the following formula: ; in, The weights of the capability semantic feature vector; For activation functions; and d represents the learnable parameter; d represents the feature dimension. These are the standardized semantic feature vector and resource feature vector, respectively.
[0013] In an optional approach, before determining the cooperation mode corresponding to the task to be processed based on the fused feature vectors of each target agent and the conflict resolution parameters between each target agent and other target agents, the method further includes: Input the two task variables of the two target agents into the relation classifier to obtain the classification result of the relationship between the two target agents; Calculate the interaction quality score of the execution results of the two task variable pairs of the target agent; The relationship classification results are incorporated into the relationship matrix, and the relationship matrix is evolved based on the interaction quality score. Based on the relationship matrix, attention weights are assigned to the two target agents to obtain a lightweight large language model.
[0014] In an alternative approach, the relation matrix The formula is: ; in, The weight coefficients of the relation matrix are represented. The k-th capability attribute of the second terminal i is represented. Characterizes the k-th capability attribute of the second terminal j; This indicates similarity calculation; The evolution formula for the relation matrix is: ; in, For the evolution rate parameter, This is the new relation matrix calculated based on the t-th interaction; The formula for calculating the attention weight is: ; in, The relation strength coefficient controls the degree of influence of the relation matrix on the attention score; This represents the dimension of the Key vector.
[0015] In one optional approach, the first terminal, based on the collaborative mode, invokes a lightweight large language model to generate task instructions corresponding to at least one second terminal, and then sends these instructions to the at least one second terminal, including: When the collaboration mode is parallel mode, the agent configuration files of each target agent, the current collaboration mode, and the historical interaction records with other target agents are input into the lightweight large language model to generate task instructions corresponding to the target agent, and the task instructions are marked as parallel tasks and added to the task list; When the collaboration mode is serial mode, all target agents are sorted according to the dependency relationship between each target agent, and the dependency relationship, agent configuration file, current collaboration mode and historical interaction record with other target agents of each target agent are input into the lightweight large language model, and corresponding task instructions are generated in sequence and added to the task list. When the collaboration mode is a hybrid mode, the target agents are divided into serial and parallel groups based on the comparison of the fused feature vectors of each target agent with a preset threshold. The corresponding task instructions are generated by a lightweight large language model and added to the task list. The preset threshold is an empirical threshold or is calculated based on a threshold scalar value, the task complexity of the current task to be processed, and the system resource tension. The threshold scalar value is obtained by similarity calculation or prediction by a logistic regression model using the fused feature vectors of the target agents.
[0016] In one alternative approach, the at least one second terminal executes a task according to the task instruction, including: Time synchronization is performed on all the target agents. Generate a globally unique identifier for the task to be processed and perform a hash calculation on the task list to obtain the task fingerprint; Send the globally unique identifier and the task fingerprint to the at least one second terminal; The at least one second terminal simulates the execution of the task instructions and votes; the affirmative vote indicates that the second terminal simulation is successful, and the negative vote indicates that the second terminal simulation is unsuccessful. When all at least one second terminal returns a vote in favor, the at least one second terminal executes the task instruction and returns the actual execution result to the first terminal. According to another aspect of the present invention, a heterogeneous terminal interaction system based on distributed intelligent agent collaboration is provided, comprising: The first terminal is used to sense at least one second terminal within the communication range in real time, and exchange intelligent agent configuration files with the at least one second terminal to determine the status information of the at least one second terminal; wherein, the status information includes capability description information, previous status, and a list of resource statuses. The first terminal is further configured to determine the collaboration mode between the first terminal and at least one second terminal based on the status information and the task to be processed. The first terminal is also used to, based on the collaboration mode, call a lightweight large language model to generate task instructions corresponding to at least one second terminal, and send them to the at least one second terminal respectively. The at least one second terminal is used to execute tasks according to the task instructions.
[0017] This invention provides an embodiment where a first terminal senses at least one second terminal within its communication range in real time and exchanges agent configuration files with the at least one second terminal to determine the status information of the at least one second terminal. The status information includes capability description information, a previous status, and a resource status list. Based on the status information and the current task to be processed, the first terminal determines the collaboration mode between itself and the at least one second terminal. Based on the collaboration mode, the first terminal invokes a lightweight large language model to generate task instructions corresponding to the at least one second terminal and sends them to the at least one second terminal. The at least one second terminal then executes the task according to the task instructions. This allows for the access of heterogeneous terminals of any type, enables flexible selection of collaboration modes, and allows for the generation of task instructions based on a lightweight large language model, thus adapting to complex and ever-changing task requirements.
[0018] The above description is merely an overview of the technical solutions of the embodiments of the present invention. In order to better understand the technical means of the embodiments of the present invention and to implement them in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the embodiments of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0019] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings: Figure 1 A flowchart illustrating the heterogeneous terminal interaction method based on distributed intelligent agent collaboration provided in an embodiment of the present invention is shown. Figure 2 This diagram illustrates the structure of a heterogeneous terminal interaction system based on distributed intelligent agent collaboration, as provided in an embodiment of the present invention. Figure 3 A flowchart of a heterogeneous terminal interaction system based on distributed intelligent agent collaboration, provided by another embodiment of the present invention, is shown. Detailed Implementation
[0020] Exemplary embodiments of the invention will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be implemented in various forms and should not be limited to the embodiments set forth herein.
[0021] Figure 1 A flowchart of a heterogeneous terminal interaction method based on distributed agent collaboration, provided by an embodiment of the present invention, is shown. This method is executed by a heterogeneous interaction system composed of distributed agents. Figure 2 and Figure 3 As shown, this heterogeneous terminal interaction system based on distributed intelligent agent collaboration includes multiple intelligent agent devices, such as smart home terminal devices, industrial control terminal devices, and vehicle networking terminal devices. One or more of these intelligent agents possess coordination functions, enabling collaborative task processing, lightweight large language model invocation, relation matrix calculation, and conflict resolution. The heterogeneous interaction system also includes a cloud-based agent inference engine, a localized inference engine, and edge devices. Intelligent agents can possess their own inference capabilities and can perform inference analysis through a cloud-based agent engine or a localized inference engine. This embodiment of the invention does not impose specific limitations. Figure 1 As shown, the method includes the following steps: Step 110: The first terminal senses at least one second terminal within its communication range in real time, exchanges intelligent agent configuration files with the at least one second terminal, and determines the status information of the at least one second terminal.
[0022] The state information includes capability description information, the previous state, and a list of resource states. The first terminal can be any one of multiple intelligent agents capable of collaboration and invoking lightweight large language models. The second terminal can be any one of the multiple intelligent agent terminals.
[0023] In this embodiment of the invention, the first terminal establishes a handshake connection with at least one second terminal. If the handshake connection with the current second terminal fails, the first terminal is skipped, and a handshake connection is established with the next second terminal. When the handshake connection is successful, the first terminal and the second terminal exchange agent configuration files. The first terminal parses the agent configuration file, converts the parsed specific capability text into capability semantic feature vectors, converts the parsed resource status information into resource status vectors, and forms a resource status list, thereby obtaining the status information of the at least one second terminal.
[0024] Specifically, during the initialization phase, the first terminal first prepares the set T of second terminals within the communication range and the resource status list used to record terminal dynamics. Then, the first terminal sequentially traverses each second terminal in set T. For each second terminal, it first attempts to establish a communication connection with it, i.e., performs a "handshake" process. If the handshake fails (the status is not "successful"), the second terminal is skipped, and the process continues to the next one. This ensures that subsequent steps are performed only on the first and second terminals that can communicate.
[0025] For a second terminal that successfully establishes a connection, the first terminal exchanges an agent profile with it. This agent profile contains key information about the second terminal. If the exchange fails or the obtained agent profile is invalid, the terminal is skipped. This step is similar to identifying device attributes in network management by collecting the terminal's protocol fingerprint (such as DHCP Option, HTTP User-Agent). The agent profile includes the second terminal's unique identifier, normalized values for computing power, storage power, and communication power, a list of supported sensors, a list of supported actuators, maximum power consumption, maximum acceptable latency, availability metrics, a textual or structured description of its capabilities, and a list of supported communication protocols.
[0026] To enable AI systems to better understand and compare the capabilities of different second terminals, the first terminal inputs the parsed text or structured descriptions of specific capabilities into a pre-trained bidirectional encoder representation model (BERT model). This bidirectional encoder representation model generates a high-dimensional "semantic embedding" vector for these capability descriptions. This process converts human-readable capability text into a machine-processable mathematical representation, facilitating advanced analyses such as similarity calculation and clustering. Specifically, the first terminal adds a special [CLS] marker before the capability description text, and then the BERT model processes the entire marker sequence to generate the corresponding capability semantic feature vector.
[0027] While acquiring current capability information, the first terminal also queries or records the historical or previous state of the second terminal, converting it into a resource state vector. Subsequently, using the current information and state of the second terminal, the global "resource state list" is updated. This list dynamically maintains the real-time capabilities and state information of all discovered second terminals, forming a perceptible resource pool. The resource state vector Vr is a specific multi-dimensional state indicator, typically including real-time monitoring data such as CPU utilization, memory utilization, network bandwidth, and battery level.
[0028] The above process can be obtained by the first terminal through local parsing, or it can be obtained by the first terminal calling the cloud algorithm for calculation.
[0029] After traversing all terminals, the first terminal ultimately yielded three core results: capability_dict: A dictionary where the keys are the identifiers of the second terminal and the values are the set of capabilities it resolves.
[0030] embedding_dict: A dictionary where the keys are the identifiers of the second terminal and the values are the semantic embedding vectors corresponding to its capabilities.
[0031] resource_list: The updated list of resource statuses, which summarizes real-time information on all successfully discovered second terminals.
[0032] Specifically, after the first terminal obtains the status information of the second terminal, it compares the resource status in the Agent Profile files of the first terminal and the second terminal; the first terminal acts as the host node and the second terminal acts as the client node; the host node provides the client node with a generative large language model, the generated instructions are stored in the client node's memory, and task execution instructions are sent to the client node through the communication link.
[0033] Step 120: The first terminal determines the cooperation mode between the first terminal and at least one second terminal based on the status information and the task to be processed.
[0034] This invention generates a comprehensive feature vector by integrating the intrinsic capability semantic feature description of an agent with its external operating state (resources), and identifies the differences between different agents to generate conflict resolution strategies, thereby obtaining a cooperative mode.
[0035] Determining the collaboration mode between the first terminal and at least one second terminal is achieved through the following steps: Step 1201: After weighted fusion and residual connection of the capability semantic feature vector and resource state vector of each target intelligent agent, the fused feature vector of the target intelligent agent is obtained. The target intelligent agent includes a first terminal and at least one second terminal.
[0036] In this embodiment, for each target agent's capability semantic feature vector and resource state vector, an adaptive weighting mechanism is used to calculate the weights corresponding to the capability semantic feature vector and the resource state vector, respectively. The adaptive weighting mechanism is determined based on the system resource scarcity and the matching degree between the target agent's capability semantic feature vector and the current task. The capability semantic feature vector and the resource state vector are then weighted, fused, and residually connected according to the weights to obtain the fused feature vector for each target agent.
[0037] In this embodiment of the invention, the first terminal receives input vectors from two channels: a capability semantic feature vector Vs and a resource state vector Vr. These two vectors represent two key aspects of the agent. The capability semantic feature vector Vs is extracted by parsing the agent's profile and describes what it "can do." The resource state vector Vr is a specific multi-dimensional state indicator, typically including real-time monitoring data such as CPU utilization, memory utilization, network bandwidth, and battery level.
[0038] Because the two channels have different data sources and dimensions, they are first standardized to make them comparable. Specifically, the capability semantic feature vector Vs is L2 normalized, primarily adjusting the vector's direction (magnitude). The resource state vector Vr is Z-score normalized, i.e., subtracting the mean (μr) and dividing by the standard deviation (σr). This eliminates the dimensional differences between different resource indicators, making it conform to a standard normal distribution. Specifically, L2 normalization is applied to the capability semantic feature vector Vs by dividing each element of the vector by its magnitude (norm), making it a unit vector. This is mainly to unify the vector's "length" and emphasize the semantic information represented by its "direction," thus obtaining the standardized semantic feature vector and the standardized resource feature vector respectively. Z-score normalization of Vr is achieved by calculating the mean and standard deviation of all historical resource state data, then subtracting the mean from the current value and dividing by the standard deviation. This method eliminates the dimensional differences between different resource indicators (such as CPU utilization and battery power), bringing them to the same order of magnitude, facilitating model comparison and learning.
[0039] In this embodiment of the invention, when calculating the fusion feature vector of each target agent, the two vectors are not simply added together in a fixed ratio. Instead, an adaptive weight calculation mechanism is introduced. The specific steps are: first, the two standardized vectors are concatenated into a combined vector, and then a learnable weight matrix W is used... α and bias b α A score is calculated and then mapped using the sigmoid function to generate a dynamic weight α (value between 0 and 1) for each dimension of the capability semantic feature vector. The weight β of the resource state vector is automatically set to 1 - α. This design implements a competition and balance mechanism: when system resources are scarce (overall Vr' values are low), the algorithm tends to assign higher weights to resource states (β increases), making the decision more focused on real-time load; while when the agent's semantic capabilities are highly matched with the task (Vs' values are high), higher weights are assigned to semantic features (α increases), making the decision more focused on capability matching.
[0040] In one alternative approach, the linear model with adaptive weight calculation mechanism is represented as: ; in, The weights of the capability semantic feature vector; For activation functions; and d represents the learnable parameter; d represents the feature dimension. These are the standardized semantic feature vector and resource feature vector, respectively.
[0041] The adaptive weighting mechanism, a linear model, is trained by inputting historical collaborative samples and their corresponding optimal weights into a machine learning model. The optimal sample weights are obtained using grid search or reinforcement learning. The loss function during training can be set as follows: ; in, For loss function, The predicted value for the weights, The optimal weights for the corresponding samples are... For the model parameters of the linear model The regular term.
[0042] This invention transforms the intelligent decision-making problem of "dynamically adjusting weights based on context" into a supervised learning task by utilizing historical data. Through training, the model learns the complex, non-linear mapping relationship between semantic features and resource states, enabling it to automatically generate near-optimal fusion weights in new collaborative scenarios. This approach avoids the difficulty of manually designing weight rules, giving the system the ability to learn from experience and self-optimize, making it a key component in building intelligent collaborative systems.
[0043] The fusion formula can be expressed as: ,in, This yields the fused feature vectors for each target agent.
[0044] Step 1202: Convert the fused feature vectors of each target agent into graph structure data respectively.
[0045] Beyond numerical feature fusion, this invention also considers more complex structural relationships between agents. Each agent's configuration file is encoded into a graph structure (G1, G2) to represent the associations between its capabilities or services. By calculating the difference (ΔG) between the two graphs, potential structural mismatches or conflicts between the two agents during collaboration can be quantified. This difference information is input into a pre-trained conflict resolution model fcr, which outputs a conflict resolution parameter φ. This parameter guides subsequent collaboration strategies, such as adjusting task allocation order, negotiating interface protocols, or activating alternative paths, thereby achieving smooth adaptation and problem resolution in a "no-failure" state during system operation.
[0046] Specifically, the first graph structure G1=(V1,E1) of the first terminal and the second graph structure G2=(V2,E2) of each of the second terminals are obtained. Here, V1 represents the node feature matrix of the first terminal, and E1 represents the edge set. A graph encoder is used to map the graph structures into node embedding vectors. ; in, For node i at the th l The embedding of the layer, where W is the learnable weight matrix, Let i be the set of neighbors of node i.
[0047] This graph neural network encoder employs a hybrid architecture, combining two classic graph neural network layers: Graph Convolutional Networks (GCN) and GraphSAGE. This setup allows for the simultaneous capture of the global smoothness of the graph structure and local neighbor aggregation information. The GCN layer consists of two linear layers (self.gcn1, self.gcn2). The core idea of GCN is to propagate and aggregate node features through the adjacency matrix, enabling each node's representation to incorporate information from its neighbors. The GraphSAGE layer also consists of two linear layers (self.sage1, self.sage2). GraphSAGE generates node embeddings by sampling and aggregating neighbor features.
[0048] Step 1203: Calculate the difference information between the graph structure data of the two target agents.
[0049] In this embodiment of the invention, the graph structure difference is calculated based on the embedding vectors of the first graph structure and the second graph structure: ; in, These are the embedding vectors for the corresponding nodes of terminal 1 and terminal 2, respectively. Terminal 1 and terminal 2 can be any two of the first terminal and each of the second terminals.
[0050] The above formula is the difference predictor, which is a feedforward neural network. The difference predictor receives the global mean vectors of two graph encodings (h1.mean(0) and h2.mean(0), representing the overall features of the two graphs), concatenates them, and predicts a scalar value diff (diff). This value quantifies the difference between the structures of the two terminal graphs and is a basic indicator of the probability of conflict.
[0051] Step 1204: Input the difference information into the conflict resolution model to obtain the conflict resolution parameters corresponding to each target agent.
[0052] The conflict resolution model is pre-trained on a neural network based on historical collaborative conflict samples. These historical collaborative conflict samples include conflict samples from historical task collaborations between various target agents and corresponding resolution parameter labels. The conflict resolution model parameters θcr are trained based on the predicted value of the difference ΔG; the loss function is defined as: ; in, The conflict severity score is provided by the experts, and λ is the L2 regularization coefficient.
[0053] After training, the conflict resolution model outputs the resolution parameters: ; Among them, ϕ includes: protocol priority weight, resource allocation ratio, and task reordering strategy.
[0054] The conflict resolution model takes as input the difference index (diff) and global features from two graph-structured data sets. After processing, it outputs a vector `params` (the conflict resolution parameter φ) normalized by the Sigmoid function. This parameter vector guides subsequent collaborative operations, generating schemes to adjust instruction priorities, timing, or resource allocation. For example, it can adjust task allocation order, negotiate interface protocols, or activate backup paths, thereby achieving smooth adaptation and problem resolution in a "non-crash" state during system operation.
[0055] The aforementioned graph neural network encoder, dissimilarity predictor, and conflict resolution model can be integrated into a single multi-task learning framework. This framework also includes a conflict severity classifier that takes the dissimilarity score (diff) as input and classifies it into three levels: low, medium, and high. This provides the system with a qualitative assessment of conflict risk, which can be used to trigger different levels of early warning or handling mechanisms.
[0056] For this multi-task learning framework, given graph data for two endpoints (g1, edge1 and g2, edge2), the model first generates node embeddings for them separately using a shared graph encoder. Then, the entire graph is generalized by calculating the global mean of the embeddings and fed into three sub-modules, which output dissimilarity, conflict severity, and resolution parameters in parallel. During training, the model is supervised using historical cooperative conflict samples. Each sample contains graph structure data for a pair of conflicting endpoints and manually labeled conflict severity tags. label And the optimal resolution parameters. params)During training, the model uses mean squared error (MSE) as the loss function, simultaneously optimizing the accuracy of conflict classification and the precision of resolution parameter prediction. This process is carried out through backpropagation and iteration with the Adam optimizer, enabling the model to learn to automatically infer effective conflict solutions from differences in graph structure.
[0057] The above method yields the fusion feature vectors of each target agent and the conflict resolution parameters between each target agent and other target agents.
[0058] Step 1205: Input the fused feature vectors of each target agent and the conflict resolution parameters between each target agent and other target agents into the cooperation mode decision function to determine the cooperation mode corresponding to the task to be processed.
[0059] The collaboration mode includes parallel mode, serial mode, or hybrid mode.
[0060] Before determining the collaboration mode corresponding to the task to be processed through the collaboration mode decision function, the method further includes: Step 010: Input the two task variable pairs of the two target agents into the relation classifier to obtain the classification result of the relationship between the two target agents. The relation classifier is a pre-trained BERT-based classifier, and the input is the variable pairs. The output is the probability distribution of relation categories: ; in, {Dependency, Mutual Exclusion, Independence, Order} are predefined relation categories.
[0061] Step 020: Calculate the interaction quality score of the execution results of the two task variable pairs of the target agent.
[0062] The interaction quality score Q∈[0,1] is calculated based on the task execution results: : Where C∈[0,1] is the task completion rate, L∈[0,1] is the latency compliance rate, R∈[0,1] is the resource consumption rate, and E∈[0,1] is the reciprocal of the error rate; the weights w1, w2, w3, w4 can be optimized through A / B testing.
[0063] Specifically, an interaction quality scorer can be used, which calculates a comprehensive interaction quality score Q in the range of [0, 1] based on the aforementioned multi-dimensional indicators.
[0064] During initialization, the interaction quality scorer requires setting several key parameters: 1. Weights: A list containing four weights [w1, w2, w3, w4], corresponding to the four scoring dimensions: task completion rate (C), latency compliance rate (L), resource consumption rate (R), and error rate (E). The default weights are [0.35, 0.30, 0.20, 0.15], which reflects the priority setting of different dimensions (e.g., more emphasis is placed on task completion and response speed).
[0065] 2. Expected latency (ms): A time threshold (in milliseconds) used to determine whether the interaction is timely.
[0066] 3. Expected resource consumption (expected_resources): A dictionary that defines the expected upper limits of resources such as CPU utilization, memory usage, and network traffic.
[0067] Scoring Calculation Logic for Each Dimension: The scorer implements four independent methods to calculate the score for each dimension.
[0068] 1. Calculate task completion (compute_completeness): Compare the actual output with the expected output. If the expected output is a dictionary, it checks if all required fields exist. Missing fields are penalized proportionally. Additionally, numeric fields with empty or zero values are penalized extra. If the expected output is a simple type, it primarily checks if the actual output is empty. Finally, it returns a completion score between 0 and 1.
[0069] 2. Calculate the latency compliance rate (compute_latency_score): The score is based on the relationship between actual latency (actual_latency_ms) and expected latency (expected_latency_ms). No timeout: If the actual latency is less than or equal to the expected latency, the score is 1.0. Slight timeout: If the actual latency is within 1.5 times the expected latency, the score decays linearly from 1.0, with a minimum of 0.5. Severe timeout: If the actual latency exceeds 1.5 times the expected latency, the score decays rapidly, with a minimum of 0.0. This piecewise function design makes the score have different sensitivities to different levels of latency.
[0070] 3. Calculate resource efficiency (compute_resource_efficiency): Evaluates resource utilization efficiency. It receives a dictionary of resource usage (resource_usage). For each resource, such as CPU, memory, and network, it calculates the ratio of expected to actual value, capping this ratio at 1.0 (i.e., full marks are awarded when actual consumption is lower than expected). Finally, it takes the average score of all provided resource items as the total resource efficiency score.
[0071] 4. Calculate the error rate score (compute_error_score): This score is based on the number of errors (error_count) and a maximum tolerable number of errors (max_tolerable_errors). No errors: Score 1.0. Error count reaches or exceeds the tolerance limit: Score 0.0. Error count within the tolerable range: Score decreases linearly from 1.0; for example, if the maximum tolerable number of errors is 3, each error deducts 1 / 3 of the score.
[0072] The four methods described above are used to calculate the raw scores for four dimensions: completion, latency, resources, and errors. Data transformation and normalization are performed to convert the ratios into actual latency in milliseconds and resource consumption percentages for use in the corresponding calculation methods. The scores for the four dimensions are then weighted and summed according to the weights set during initialization to obtain the final comprehensive interaction quality score Q.
[0073] Step 030: Integrate the relationship classification results into the relationship matrix, and evolve the relationship matrix based on the interaction quality score.
[0074] In one alternative approach, the relation matrix R is an N×N relation strength matrix. This represents the strength of the relationship between terminal i and terminal j.
[0075] The initialization formula for the relation matrix is: ; in, The weight coefficients of the relation matrix are represented. The k-th capability attribute of the second terminal i is represented. Characterizes the k-th capability attribute of the second terminal j; This indicates similarity calculation.
[0076] The evolution formula for the relation matrix is: ; in, Let Q be the evolution rate parameter, and let Q be the overall interaction quality score calculated based on the t-th interaction.
[0077] Step 040: Assign attention weights to the two target agents based on the relation matrix to obtain a lightweight large language model.
[0078] In this embodiment of the invention, the attention weight is the attention weight of the collaborative mode decision function with adjusted weight parameters.
[0079] The formula for calculating the attention weight is as follows: ; in, The relation strength coefficient (obtained from the aforementioned relation matrix) controls the degree of influence of the relation matrix on the attention score. This represents the dimension of the Key vector.
[0080] The collaborative mode decision function determines the overall execution mode of each target agent, providing a basic strategy for task scheduling. The relationship matrix records and evolves the historical collaboration strength among the target agents, providing long-term collaborative memory. Attention weights integrate the relationship matrix into the attention mechanism of the generative model, enabling the model to dynamically adjust the terminal attention priority based on historical relationships. The collaborative mode decision function, relationship matrix, and attention weights work together to form the basis for task allocation in a lightweight pre-trained language model, achieving adaptive and intelligent heterogeneous terminal collaboration.
[0081] The collaboration mode decision function uses the fusion feature vectors of each target agent and the conflict resolution parameters between each target agent and other target agents to determine the collaboration mode according to preset judgment rules. Specifically, if the classification result of the relationship between the target agents is independent, resources are sufficient, and there is no conflict, then the parallel mode is returned. If the classification result of the relationship between the target agents is dependent and relational, or sequential and resources are insufficient, then the serial mode is returned. If other cases are found, it is determined to be a hybrid mode. In the parallel mode, multiple agents can execute their respective tasks simultaneously and independently. In the serial mode, agents need to execute tasks one after another according to a specific dependency relationship or order. The hybrid mode combines the parallel and serial methods, with some agents working in parallel and others working serially.
[0082] Step 130: Based on the collaboration mode, the first terminal calls the lightweight large language model to generate task instructions corresponding to at least one second terminal, and sends them to the at least one second terminal respectively.
[0083] When the collaboration mode is parallel mode, the agent profiles, current collaboration modes, and historical interaction records with other target agents of each target agent are input into the Lightweight Large Language Model (LLM) to generate task instructions corresponding to the target agents. These task instructions are then marked as parallel tasks and added to the task list. In parallel mode, the first terminal iterates through all input target agents. For each target agent, the first terminal calls the LLM to generate a unique task instruction based on its agent profile, current collaboration mode, and historical interaction records with other target agents. After generation, the instruction is bound to the corresponding target agent, marked as a parallel task, and added to the final task list. Once all agent tasks are generated, the list is returned. The LLM calculates its attention weights based on the relationship matrix between the two target agents. The lightweight large language model can be a lightweight large language model deployed on the first terminal, a lightweight large language model deployed on the edge terminal close to the first terminal, or a large language model deployed in the cloud of the system. This embodiment of the invention does not impose specific limitations.
[0084] When the collaboration mode is serial, all target agents are sorted according to their dependencies. A lightweight large language model is invoked, and the dependencies, agent configuration files, current collaboration mode, and historical interaction records with other target agents are input into the lightweight large language model. Corresponding task instructions are generated sequentially and added to the task list. In serial mode, agents cannot start working arbitrarily; they must follow a specific order. Therefore, the lightweight large language model first performs a topological sort on all agents based on their dependencies, resulting in an ordered sequence of agents. Then, task instructions are generated for each target agent in this order. When generating instructions, in addition to considering the agent's context (agent.context) and mode, its position in the sequence may also need to be considered. The generated task instructions are added to the list, and their execution order is explicitly specified (e.g., executed after the task with sequence number i-1).
[0085] When the collaboration mode is a hybrid mode, the target agents are divided into serial and parallel groups based on the comparison of their fused feature vectors with a preset threshold. Corresponding task instructions are then generated and added to the task list. The hybrid mode combines parallel and serial processing. The first terminal first compares the fused feature value of each target agent with a preset threshold, dividing the agents into two groups: those with high fused feature values are assigned to the parallel group, and those with low fused feature values are assigned to the serial group. Then, a lightweight large language model is invoked to generate task instructions for both groups using the aforementioned parallel and serial methods, and the results are merged into a unified task list and returned. The preset threshold is either an empirical threshold or calculated based on the complexity of the current task and the system resource constraints. For example, before system deployment, historical task data or simulation tests are used to analyze the task execution efficiency of agents under different fused feature values to determine an empirical threshold that can better balance the load of parallel and serial tasks. Alternatively, it can be calculated based on the fused feature vectors of each target agent, the complexity of the current task, and the overall system resource constraints. Specifically, the threshold scalar value is obtained by using the fusion feature vector of the target intelligent agent through similarity calculation (such as cosine similarity) or logistic regression model. Then, the threshold scalar value is calculated based on the task complexity (the number of dependencies after task decomposition) and the system resource tension (bandwidth, computing power).
[0086] Step 140: The at least one second terminal executes the task according to the task instruction.
[0087] The at least one second terminal executes a task according to the task instruction, including: synchronizing the time of all target agents; generating a globally unique identifier for the task to be processed and performing a hash calculation on the task list to obtain a task fingerprint; sending the globally unique identifier and the task fingerprint to the at least one second terminal; the at least one second terminal simulates the execution of the task instruction and votes; the affirmative vote indicates that the simulation of the second terminal is successful, and the negative vote indicates that the simulation of the second terminal is unsuccessful; when all at least one second terminal returns an affirmative vote, the at least one second terminal executes the task instruction and returns the actual execution result to the first terminal.
[0088] Specifically, to ensure that a distributed task is executed atomically (i.e., either all succeed or all fail) and synchronously across multiple agents, this invention draws on classic ideas from distributed transaction processing. Through a centralized coordination process, it guarantees that all participants reach a consensus on the execution of the task instruction list (TaskList), and ultimately outputs an aggregated execution result.
[0089] Specifically, the steps include the following: Step 1: Time Synchronization: Before commencing any transactional operations, the algorithm first ensures that the system clocks of all participating agents are highly consistent. This is achieved by calling the `synchronize_clocks` function and employing a high-precision time synchronization protocol (such as PTP, requiring an accuracy of less than 1 millisecond). This step is crucial, as it provides a unified time reference for all subsequent operations requiring timing coordination (such as timeout checks and log recording order), forming the foundation for the collaborative work of the distributed system.
[0090] Step 2: Preparation Phase: This phase involves the initiation and initialization of transactions. The algorithm first generates a globally unique identifier (transaction_id) for this distributed task execution, similar to a database transaction ID, used to track the execution throughout its lifecycle. Next, the algorithm calculates the hash fingerprint (task_fingerprint) of the entire task instruction list (TaskList), which is equivalent to "digitally signing" the task content, ensuring that all terminals process the exact same set of tasks in subsequent phases, preventing data tampering or ambiguity during transmission. Then, the coordinator (i.e., the algorithm's executor) sends a "preparation" request to all terminals, informing them of the transaction ID and task fingerprint, marking the official start of the first phase.
[0091] Step 3: Voting Phase: This is the core "voting" stage of the two-phase commit protocol, determining the final fate of the transaction. Upon receiving the prepare request, each terminal does not immediately execute the task but first performs a pre-execution or simulation. This operation is similar to "writing the redo log" in database transactions. The terminal checks its own resources, dependencies, etc., to determine whether the actual task execution would be successful, but it does not permanently affect the external state. If a terminal's simulation runs successfully, it casts a "yes" vote to the coordinator. If any terminal's simulation fails, it casts a "no" vote. Once a no vote is cast, the entire transaction must be aborted. The coordinator immediately sends a "rollback" instruction to all terminals, notifying them to clean up any temporary state reserved for this transaction, and then the algorithm directly returns failure. This ensures atomicity: if even one participant fails to guarantee success, all participants revert to the state before the transaction began.
[0092] Step 4: Commit Phase: The algorithm enters this phase only if and only if all terminals return "yes" votes. At this point, the coordinator issues the final "commit" command to all terminals. Upon receiving this command, each terminal formally and irreversibly executes the actual task assigned to it. In distributed transaction theory, once participants enter this phase and receive the commit instruction, they must ensure that the transaction will eventually complete and cannot fail again. This "commit point" is crucial for ensuring data consistency.
[0093] Step 5: Completion Phase: After the commit command is issued, the coordinator needs to collect the actual execution results from each terminal. It queries each terminal sequentially for the execution result (GET_RESULT) of this transaction (identified by transaction_id) and collects all results into a list (results).
[0094] In this embodiment of the invention, after completing the task to be executed, the relationship matrix is also updated. Specifically, the interactions between terminals during the collaboration process are analyzed, and a global relationship matrix is updated based on the quality of their respective execution results. This relationship matrix records the historical collaboration effectiveness scores between any two terminals. This information can be used for future task allocation to prioritize terminal combinations with good collaboration and high success rates, thereby achieving system self-optimization and intelligent evolution.
[0095] This invention provides an embodiment where a first terminal senses at least one second terminal within its communication range in real time and exchanges agent configuration files with the at least one second terminal to determine the status information of the at least one second terminal. The status information includes capability description information, a previous status, and a resource status list. Based on the status information and the current task to be processed, the first terminal determines the collaboration mode between itself and the at least one second terminal. Based on the collaboration mode, the first terminal invokes a lightweight large language model to generate task instructions corresponding to the at least one second terminal and sends them to the at least one second terminal. The at least one second terminal then executes the task according to the task instructions. This allows for the access of heterogeneous terminals of any type, enables flexible selection of collaboration modes, and allows for the generation of task instructions based on a lightweight large language model, thus adapting to complex and ever-changing task requirements.
[0096] Figure 2 A schematic diagram of the structure of a heterogeneous terminal interaction system based on distributed intelligent agent collaboration provided in an embodiment of the present invention is shown. Figure 2 As shown, the system includes: The first terminal 210 is used to sense at least one second terminal within the communication range in real time, and exchange intelligent agent configuration files with the at least one second terminal to determine the status information of the at least one second terminal; wherein, the status information includes capability description information, previous status, and resource status list; The first terminal 210 is also configured to determine the collaboration mode between the first terminal and at least one second terminal based on the status information and the task to be processed. The first terminal 210 is also used to, based on the collaboration mode, call a lightweight large language model to generate task instructions corresponding to at least one second terminal, and send them to the at least one second terminal respectively. The at least one second terminal 310 is used to execute tasks according to the task instructions.
[0097] The specific working process of the heterogeneous terminal interaction system based on distributed intelligent agent collaboration in this embodiment of the invention is largely the same as the specific execution steps of the aforementioned method, and will not be repeated here.
[0098] In one alternative approach, the first terminal senses at least one second terminal within its communication range in real time and exchanges agent configuration files with the at least one second terminal to determine the status information of the at least one second terminal, including: The first terminal establishes a handshake connection with the at least one second terminal; If the handshake connection with the current second terminal fails, the current second terminal is skipped, and a handshake connection is established with the next second terminal. When the handshake connection is successful, the first terminal and the second terminal exchange intelligent agent configuration files; The first terminal parses the agent configuration file, converts the parsed specific capability text into capability semantic feature vectors, converts the parsed resource status information into resource status vectors, and forms a resource status list, thereby obtaining the status information of the at least one second terminal.
[0099] In one optional approach, the first terminal determines a collaboration mode between itself and at least one second terminal based on the status information and the current task to be processed, including: After weighted fusion and residual connection of the capability semantic feature vector and resource state vector of each target intelligent agent, the fused feature vector of the target intelligent agent is obtained; the target intelligent agent includes a first terminal and the at least one second terminal; The fused feature vectors of each target agent are converted into graph structure data respectively; Calculate the difference information between the graph structure data of the two target agents; The difference information is input into the conflict resolution model to obtain the conflict resolution parameters corresponding to each target agent; the conflict resolution model is pre-trained on the neural network based on historical collaborative conflict samples; the historical collaborative conflict samples include conflict samples of each target agent in historical task collaboration and corresponding resolution parameter labels; The fused feature vectors of each target agent and the conflict resolution parameters between each target agent and other target agents are input into the cooperation mode decision function to determine the cooperation mode corresponding to the task to be processed; the cooperation mode includes parallel mode, serial mode or hybrid mode.
[0100] In one optional approach, the fused feature vector of the target agent is obtained by weighted fusion and residual connection of the capability semantic feature vector and resource state vector of each target agent, including: For each target agent's capability semantic feature vector and resource state vector, an adaptive weighting mechanism is used to calculate the weights corresponding to the capability semantic feature vector and the resource state vector, respectively; the adaptive weighting mechanism is determined based on the system resource scarcity and the matching degree between the target agent's capability semantic feature vector and the task to be processed. The capability semantic feature vector and the resource state vector are weighted, fused, and residually connected according to the weights to obtain the fused feature vector of each target agent.
[0101] In one alternative approach, the adaptive weighting mechanism is calculated using the following formula: ; in, The semantic feature vector of the capability; For activation functions; d represents the learnable parameter; d represents the feature dimension. These are the standardized semantic feature vector and resource feature vector, respectively.
[0102] In an alternative embodiment, the system further includes a first terminal configured to: Input the two task variables of the two target agents into the relation classifier to obtain the classification result of the relationship between the two target agents; Calculate the interaction quality score of the execution results of the two task variable pairs of the target agent; The relationship classification results are incorporated into the relationship matrix, and the relationship matrix is evolved based on the interaction quality score. Based on the relationship matrix, attention weights are assigned to the two target agents to obtain a lightweight large language model.
[0103] In an alternative approach, the relation matrix The formula is: ; in, The weight coefficients of the relation matrix are represented. The k-th capability attribute of the second terminal i is represented. Characterizes the k-th capability attribute of the second terminal j; This indicates similarity calculation; The evolution formula for the relation matrix is: ; in, For the evolution rate parameter, This is the new relation matrix calculated based on the t-th interaction; The formula for calculating the attention weight is: ; in, The relation strength coefficient controls the degree of influence of the relation matrix on the attention score; This represents the dimension of the Key vector.
[0104] In one optional approach, the first terminal, based on the collaborative mode, invokes a lightweight large language model to generate task instructions corresponding to at least one second terminal, and then sends these instructions to the at least one second terminal, including: When the collaboration mode is parallel mode, the agent configuration files of each target agent, the current collaboration mode, and the historical interaction records with other target agents are input into the lightweight large language model to generate task instructions corresponding to the target agent, and the task instructions are marked as parallel tasks and added to the task list; When the collaboration mode is serial mode, all target agents are sorted according to the dependency relationship between each target agent, and the dependency relationship, agent configuration file, current collaboration mode and historical interaction record with other target agents of each target agent are input into the lightweight large language model, and corresponding task instructions are generated in sequence and added to the task list. When the collaboration mode is a hybrid mode, the lightweight large language model compares the fusion feature vectors of each target agent with a preset threshold, divides the target agents into serial groups and parallel groups according to the preset threshold, and generates corresponding task instructions through the lightweight large language model and adds them to the task list; wherein, the preset threshold is an empirical threshold or is calculated based on the complexity of the current task to be processed and the tension of system resources.
[0105] In one alternative approach, the at least one second terminal executes a task according to the task instruction, including: Time synchronization is performed on all the target agents. Generate a globally unique identifier for the task to be processed and perform a hash calculation on the task list to obtain the task fingerprint; Send the globally unique identifier and the task fingerprint to the at least one second terminal; The at least one second terminal simulates the execution of the task instructions and votes; the affirmative vote indicates that the second terminal simulation is successful, and the negative vote indicates that the second terminal simulation is unsuccessful. When all at least one second terminal returns a vote in favor, the at least one second terminal executes the task instruction and returns the actual execution result to the first terminal.
[0106] This invention provides an embodiment where a first terminal senses at least one second terminal within its communication range in real time and exchanges agent configuration files with the at least one second terminal to determine the status information of the at least one second terminal. The status information includes capability description information, a previous status, and a resource status list. Based on the status information and the current task to be processed, the first terminal determines the collaboration mode between itself and the at least one second terminal. Based on the collaboration mode, the first terminal invokes a lightweight large language model to generate task instructions corresponding to the at least one second terminal and sends them to the at least one second terminal. The at least one second terminal then executes the task according to the task instructions. This allows for the access of heterogeneous terminals of any type, enables flexible selection of collaboration modes, and allows for the generation of task instructions based on a lightweight large language model, thus adapting to complex and ever-changing task requirements.
[0107] This invention provides a heterogeneous terminal interaction device based on distributed agent collaboration, used to execute the above-described heterogeneous terminal interaction method based on distributed agent collaboration.
[0108] This invention provides a computer program that can be called by a processor to enable a computer device to execute the heterogeneous terminal interaction method based on distributed intelligent agent collaboration in any of the above method embodiments.
[0109] This invention provides a computer program product, which includes a computer program stored on a computer-readable storage medium. The computer program includes program instructions, which, when executed on a computer, cause the computer to perform the heterogeneous terminal interaction method based on distributed intelligent agent collaboration in any of the above method embodiments.
[0110] The algorithms or displays provided herein are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used in conjunction with the teachings herein. The required structure for constructing such systems is apparent from the above description. Furthermore, the embodiments of the present invention are not directed to any particular programming language. It should be understood that the content of the invention described herein can be implemented using various programming languages, and the above description of specific languages is for the purpose of disclosing the best mode of implementation of the invention.
[0111] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.
[0112] Similarly, it should be understood that, in order to streamline the invention and aid in understanding one or more of the various aspects of the invention, features of the embodiments of the invention are sometimes grouped together in a single embodiment, figure, or description thereof in the above description of exemplary embodiments of the invention. However, this disclosure should not be construed as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim.
[0113] Those skilled in the art will understand that modules in the device of the embodiments can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiments can be combined into a single module, unit, or component, and can be divided into multiple sub-modules, sub-units, or sub-components. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or device so disclosed. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.
[0114] It should be noted that the above embodiments are illustrative of the invention and not restrictive, and that those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be construed as limiting the order of execution.
Claims
1. A heterogeneous terminal interaction method based on distributed intelligent agent collaboration, characterized in that, The method includes: The first terminal senses at least one second terminal within its communication range in real time and exchanges intelligent agent configuration files with the at least one second terminal to determine the status information of the at least one second terminal; wherein, the status information includes capability description information, previous status, and a list of resource statuses; The first terminal determines the collaboration mode between itself and at least one second terminal based on the status information and the task to be processed. Based on the collaboration mode, the first terminal calls a lightweight large language model to generate task instructions corresponding to at least one second terminal, and sends them to the at least one second terminal respectively. The at least one second terminal executes the task according to the task instruction.
2. The method according to claim 1, characterized in that, The first terminal senses at least one second terminal within its communication range in real time, exchanges agent configuration files with the at least one second terminal, and determines the status information of the at least one second terminal, including: The first terminal establishes a handshake connection with the at least one second terminal; If the handshake connection with the current second terminal fails, the current second terminal is skipped, and a handshake connection is established with the next second terminal. When the handshake connection is successful, the first terminal and the second terminal exchange intelligent agent configuration files; The first terminal parses the agent configuration file, converts the parsed specific capability text into capability semantic feature vectors, converts the parsed resource status information into resource status vectors, and forms a resource status list, thereby obtaining the status information of the at least one second terminal.
3. The method according to claim 2, characterized in that, The first terminal determines the cooperation mode between itself and at least one second terminal based on the status information and the current task to be processed, including: After weighted fusion and residual connection of the capability semantic feature vector and resource state vector of each target intelligent agent, the fused feature vector of the target intelligent agent is obtained; the target intelligent agent includes a first terminal and the at least one second terminal; The fused feature vectors of each target agent are converted into graph structure data respectively; Calculate the difference information between the graph structure data of the two target agents; The difference information is input into the conflict resolution model to obtain the conflict resolution parameters corresponding to each target agent; the conflict resolution model is pre-trained on the neural network based on historical collaborative conflict samples; the historical collaborative conflict samples include conflict samples of each target agent in historical task collaboration and corresponding resolution parameter labels; The fused feature vectors of each target agent and the conflict resolution parameters between each target agent and other target agents are input into the cooperation mode decision function to determine the cooperation mode corresponding to the task to be processed; the cooperation mode includes parallel mode, serial mode or hybrid mode.
4. The method according to claim 3, characterized in that, After weighted fusion and residual connection of the capability semantic feature vector and resource state vector of each target agent, the fused feature vector of the target agent is obtained, including: For each target agent's capability semantic feature vector and resource state vector, an adaptive weighting mechanism is used to calculate the weights corresponding to the capability semantic feature vector and the resource state vector, respectively; the adaptive weighting mechanism is determined based on the system resource scarcity and the matching degree between the target agent's capability semantic feature vector and the task to be processed. The capability semantic feature vector and the resource state vector are weighted, fused, and residually connected according to the weights to obtain the fused feature vector of each target agent.
5. The method according to claim 4, characterized in that, The linear model with adaptive weight calculation mechanism is represented as follows: ; in, The weights of the capability semantic feature vector; For activation functions; and d represents the learnable parameter; d represents the feature dimension. and These are the standardized semantic feature vector and resource feature vector, respectively.
6. The method according to claim 3, characterized in that, Before determining the cooperation mode corresponding to the task to be processed in this instance, based on the fused feature vectors of each target agent and the conflict resolution parameters between each target agent and other target agents, the method further includes: Input the two task variables of the two target agents into the relation classifier to obtain the classification result of the relationship between the two target agents; Calculate the interaction quality score of the execution results of the two task variable pairs of the target agent; The relationship classification results are incorporated into the relationship matrix, and the relationship matrix is evolved based on the interaction quality score. The attention weights of the lightweight large language model are calculated based on the relationship matrix between the two target agents.
7. The method according to claim 6, characterized in that, The relation matrix The formula is: ; in, The weight coefficients of the relation matrix are represented. The k-th capability attribute of the second terminal i is represented. Characterizes the k-th capability attribute of the second terminal j; This indicates similarity calculation; The evolution formula for the relation matrix is: ; in, Let Q be the evolution rate parameter, and let Q be the interaction quality score calculated based on the t-th interaction. The formula for calculating the attention weight is: ; in, The relation strength coefficient controls the degree of influence of the relation matrix on the attention score; The dimension of the Key vector; The relation matrix is the dimension of the Key vector.
8. The method according to claim 3, characterized in that, Based on the collaborative mode, the first terminal invokes a lightweight large language model to generate task instructions corresponding to at least one second terminal, and sends them to the at least one second terminal respectively, including: When the collaboration mode is parallel mode, the agent configuration files of each target agent, the current collaboration mode, and the historical interaction records with other target agents are input into the lightweight large language model to generate task instructions corresponding to the target agent, and the task instructions are marked as parallel tasks and added to the task list; When the collaboration mode is serial mode, all target agents are sorted according to the dependency relationship between each target agent, and the dependency relationship, agent configuration file, current collaboration mode and historical interaction record with other target agents of each target agent are input into the lightweight large language model, and corresponding task instructions are generated in sequence and added to the task list. When the collaboration mode is a hybrid mode, the lightweight large language model compares the fused feature vectors of each target agent with a preset threshold, divides the target agents into serial and parallel groups according to the preset threshold, and generates corresponding task instructions through the lightweight large language model for each group, adding them to the task list; wherein, the preset threshold is an empirical threshold or calculated based on a threshold scalar value, the task complexity of the current task to be processed, and the system resource tension; the threshold scalar value is obtained by similarity calculation or prediction by a logistic regression model through the fused feature vectors of the target agents.
9. The method according to claim 3, characterized in that, The at least one second terminal executes a task according to the task instruction, including: Time synchronization is performed on all the target agents. Generate a globally unique identifier for the task to be processed and perform a hash calculation on the task list to obtain the task fingerprint; Send the globally unique identifier and the task fingerprint to the at least one second terminal; The at least one second terminal simulates the execution of the task instructions and votes; the affirmative vote indicates that the second terminal simulation is successful, and the negative vote indicates that the second terminal simulation is unsuccessful. When all at least one second terminal returns a vote in favor, the at least one second terminal executes the task instruction and returns the actual execution result to the first terminal.
10. A heterogeneous terminal interaction system based on distributed intelligent agent collaboration, characterized in that, The system includes: The first terminal is used to sense at least one second terminal within the communication range in real time, and exchange intelligent agent configuration files with the at least one second terminal to determine the status information of the at least one second terminal; wherein, the status information includes capability description information, previous status, and a list of resource statuses. The first terminal is further configured to determine the collaboration mode between the first terminal and at least one second terminal based on the status information and the task to be processed. The first terminal is also used to, based on the collaboration mode, call a lightweight large language model to generate task instructions corresponding to at least one second terminal, and send them to the at least one second terminal respectively. The at least one second terminal is used to execute tasks according to the task instructions.