Multi-agent collaborative caching method, apparatus, caching device, storage medium, and program product

By generating context vectors and agent feature vectors combined with collaborative task maps and dynamically adjusting the caching strategy, the problems of storage redundancy and low cache hit rate in multi-agent collaborative caching are solved, and efficient cache resource utilization and fast response are achieved.

CN120234167BActive Publication Date: 2025-09-16GLORYVIEW TECH INC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510703791.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-29
Publication Date
2025-09-16
Estimated Expiration
2045-05-29

AI Technical Summary

Technical Problem

Existing multi-agent collaborative caching methods suffer from cache inconsistency, storage redundancy, low cache hit rate, and waste of computing resources. They are particularly inefficient in complex and dynamic task environments and cannot meet the needs of rapid response and real-time decision-making.

Method used

By generating context vectors, agent feature vectors and collaborative task maps, dynamically adjusting the caching strategy, setting the cache score threshold, prioritizing the caching of important data, and adopting coarse-grained and fine-grained caching strategies, the computation and communication overhead are reduced to achieve a dynamic and flexible caching mechanism.

Benefits of technology

It improves cache resource utilization, enhances the intelligence level and response speed of multi-agent collaboration, and improves collaboration efficiency in complex task environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120234167B_ABST
    Figure CN120234167B_ABST
Patent Text Reader

Abstract

The embodiments of the present invention propose a multi-agent collaborative caching method, apparatus, cache device, storage medium and program product, which relate to the field of artificial intelligence technology. The method generates a context vector through the input data, inference data and output data of the subtask, which can comprehensively capture the key information of the current context during the execution of the subtask. The context vector, the feature vector of the agent and the collaborative task map are combined for analysis to determine the cache score, thereby realizing a dynamic and flexible caching mechanism to ensure that important data with a high cache score is cached first. By setting a first threshold to intercept non-important data with a low cache score, the computing and communication overhead is effectively reduced, and the collaborative efficiency and response speed of multiple agents in complex task environments are improved, which not only improves the utilization rate of cache resources, but also enhances the intelligence level of multi-agent collaboration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a multi-agent collaborative caching method, apparatus, caching device, storage medium and program product. Background Art

[0002] In the field of multi-agent collaboration, agents need to frequently interact and share data to complete complex user tasks. Transmitted data caching technologies include local caching and centralized caching. Local caching involves caching shared data locally across multiple agents, but this can easily lead to cache inconsistencies and storage redundancy. Centralized caching manages the cache in a centralized manner, typically using the Least Recently Used (LRU) or Least Frequently Used (LFU) cache eviction strategy to update cached data, resulting in a low cache hit rate. Summary of the Invention

[0003] In view of this, the purpose of the present invention is to provide a multi-agent collaborative caching method, apparatus, caching device, storage medium and program product, which can improve the collaborative efficiency and response speed of multiple agents in complex task environments.

[0004] In order to achieve the above objectives, the technical solutions adopted in the embodiments of the present invention are as follows:

[0005] In a first aspect, the present invention provides a multi-agent collaborative caching method, which is applied to a cache device, wherein the cache device is communicatively connected to at least one task execution device, and each task execution device is provided with at least one agent, the method comprising:

[0006] Generate a context vector based on the input data, reasoning data, and output data of the subtask sent by the task execution device; the subtask is obtained by the task execution device based on the user task splitting; the reasoning data represents the reasoning process of the intelligent agent in executing the subtask;

[0007] Determining a cache score corresponding to the context vector according to the context vector, the feature vector of the agent, and the collaborative task map;

[0008] When the cache score is higher than a first threshold, the input data, the inference data, and the output data of the subtask are cached.

[0009] In an optional embodiment, when the cache score is higher than a first threshold, caching the input data, inference data, and output data of the subtask includes:

[0010] When the cache score is higher than the first threshold and not higher than a second threshold, the summary information of the output data is obtained, and the input data, the inference data, and the summary information are added to a cache pool.

[0011] In an optional embodiment, when the cache score is higher than a first threshold, caching the input data, inference data, and output data of the subtask includes:

[0012] When the cache score is higher than a second threshold, the association result corresponding to the associated subtask is obtained from the output data according to the association relationship between the multiple subtasks, and the input data, the inference data and the association result are added to the cache pool.

[0013] In an optional embodiment, before generating a context vector based on the input data, inference data, and output data of the subtask sent by the task execution device, the method further includes:

[0014] When receiving a query instruction sent by the task execution device, generating a query vector according to the step input of the subtask in the query instruction; before the agent performs the subtask, the task execution device determines whether to send the query instruction based on the similarity between the subtask and other subtasks;

[0015] Generate a cache vector corresponding to each data according to the data in the cache pool;

[0016] Determining a similar vector corresponding to the query vector from the cache vectors according to the similarity between the query vector and each of the cache vectors;

[0017] determining dependency data of the subtask according to the similarity vector;

[0018] The dependency data of the subtask is returned to the task execution device, so that the task execution device generates input data of the subtask according to the step input of the subtask and the dependency data.

[0019] In an optional implementation manner, determining the dependency data of the subtask according to the similarity vector includes:

[0020] When the similarity vector is one, converting the similarity vector into dependency data of the subtask;

[0021] When there are multiple similarity vectors, each similarity vector and the collaborative task graph are input into a graph convolutional network to obtain a similarity score for each similarity vector, and the similarity vector with the highest similarity score is converted into dependency data of the subtask.

[0022] In an optional embodiment, determining the cache score corresponding to the context vector according to the context vector, the feature vector of the agent, and the collaborative task map includes:

[0023] generating a feature vector of the agent according to the description information of the agent;

[0024] The context vector, the feature vector and the collaborative task graph are input into a graph convolutional network to obtain a cache score corresponding to the context vector.

[0025] In a second aspect, the present invention provides a multi-agent collaborative caching apparatus, which is applied to a caching device, wherein the caching device is communicatively connected to at least one task execution device, and each task execution device is provided with at least one agent, the apparatus comprising:

[0026] a processing module, configured to generate a context vector based on input data, inference data, and output data of a subtask sent by the task execution device; the subtask is obtained by the task execution device based on user task splitting; and the inference data represents the inference process of the intelligent agent in executing the subtask;

[0027] A scoring module, configured to determine a cache score corresponding to the context vector based on the context vector, the feature vector of the agent, and the collaborative task map;

[0028] A cache module is configured to cache the input data, inference data, and output data of the subtask when the cache score is higher than a first threshold.

[0029] In a third aspect, the present invention provides a cache device comprising a processor and a memory, wherein the memory stores a computer program that can be executed by the processor, and the processor can execute the computer program to implement the multi-agent collaborative caching method described in any of the aforementioned embodiments.

[0030] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the multi-agent collaborative caching method as described in any one of the aforementioned embodiments.

[0031] In a fifth aspect, the present invention provides a program product, which, when executed by a processor, implements the multi-agent collaborative caching method as described in any one of the aforementioned embodiments.

[0032] Compared with the prior art, the multi-agent collaborative caching method, apparatus, cache device, storage medium and program product provided by the embodiments of the present invention generates a context vector through the input data, inference data and output data of the subtask, which can fully capture the key information of the current context during the execution of the subtask. The context vector, the feature vector of the agent and the collaborative task map are combined for analysis to determine the cache score, thereby realizing a dynamic and flexible caching mechanism to ensure that important data with a high cache score is cached first. By setting a first threshold to intercept non-important data with a low cache score, the computing and communication overhead is effectively reduced, and the collaborative efficiency and response speed of multiple agents in complex task environments are improved, which not only improves the utilization rate of cache resources, but also enhances the intelligence level of multi-agent collaboration.

[0033] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without paying any creative work.

[0035] Figure 1 A schematic diagram of an application scenario provided by an embodiment of the present invention is shown.

[0036] Figure 2 A flow chart of a multi-agent collaborative caching method provided by an embodiment of the present invention is shown.

[0037] Figure 3 A system architecture diagram provided by an embodiment of the present invention is shown.

[0038] Figure 4 Another flow chart of the multi-agent collaborative caching method provided by an embodiment of the present invention is shown.

[0039] Figure 5 Another flow chart of the multi-agent collaborative caching method provided by an embodiment of the present invention is shown.

[0040] Figure 6 Another flow chart of the multi-agent collaborative caching method provided by an embodiment of the present invention is shown.

[0041] Figure 7 Another flow chart of the multi-agent collaborative caching method provided by an embodiment of the present invention is shown.

[0042] Figure 8 A block diagram of a multi-agent collaborative caching device provided by an embodiment of the present invention is shown.

[0043] Figure 9 A block diagram of a cache device provided by an embodiment of the present invention is shown.

[0044] Icon: 10-multi-agent collaborative caching system; 100-caching device; 110-memory; 120-processor; 130-communication module; 200-task execution device; 300-multi-agent collaborative caching device; 301-processing module; 302-scoring module; 303-caching module. DETAILED DESCRIPTION

[0045] The following will be combined with the accompanying drawings to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings herein can be arranged and designed in various different configurations.

[0046] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention as claimed, but is merely intended to represent selected embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative work are within the scope of protection of the present invention.

[0047] It should be noted that relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.

[0048] Traditional multi-agent systems often face high data access latency and severe waste of computing resources when handling large-scale, dynamically changing tasks. The inventors' research has found that in the field of multi-agent collaboration, existing data caching methods are generally relatively simple, mainly including data replication, message-based caching, and centralized caching.

[0049] Among them, data replication is to copy shared data to the local area of ​​each intelligent agent for local caching, such as CPU cache. However, since the shared data is copied multiple times, there is storage redundancy and it is easy to cause cache consistency problems.

[0050] Message-based caching caches communication messages between intelligent agents, but ignores deeper contextual information such as task status and environmental changes. It may have problems such as low cache data value and low cache hit rate.

[0051] Centralized caching uses a centralized cache server. While it can centrally manage cached data, it relies primarily on LRU or LFU cache eviction strategies to update cached data. These strategies primarily focus on the frequency and time limitations of data access, lacking effective utilization of contextual information in multi-agent collaboration scenarios. This leads to low cache hit rates, which can easily become a bottleneck in multi-agent systems and are unsuitable for highly distributed multi-agent systems.

[0052] These traditional approaches are inefficient and fail to fully utilize system resources when tackling complex and dynamic multi-agent collaborative tasks. Data access latency is particularly critical in scenarios requiring rapid response and real-time decision-making, hindering system performance. Therefore, a multi-agent collaborative caching method that can perceive context, dynamically adjust caching strategies, and accurately retrieve cached data is urgently needed to improve the overall efficiency and intelligence of the system.

[0053] Based on this, the multi-agent collaborative caching method, apparatus, cache device, storage medium and program product provided by the embodiments of the present invention can generate a context vector through the input data, inference data and output data of the subtask, and can comprehensively capture the key information of the current context during the execution of the subtask. The context vector, the feature vector of the agent and the collaborative task map are combined for analysis to determine the cache score, thereby realizing a dynamic and flexible caching mechanism to ensure that important data with a high cache score is cached first. By setting a first threshold to intercept non-important data with a low cache score, the computing and communication overhead is effectively reduced, and the collaborative efficiency and response speed of multiple agents in complex task environments are improved, which not only improves the utilization rate of cache resources, but also enhances the intelligence level of multi-agent collaboration.

[0054] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0055] The multi-agent collaborative cache system 10 includes a cache device 100 and at least one task execution device 200. The following description is made by taking the deployment of multiple task execution devices 200 as an example. Figure 1 , Figure 1 A schematic diagram of an application scenario provided by an embodiment of the present invention is shown. Figure 1In the example, a cache device 100 is communicatively connected to multiple task execution devices 200, each of which is equipped with at least one agent. The cache device 100 is used to construct cache data corresponding to user tasks and search for matching cache data based on query instructions. The task execution devices 200 are used to execute subtasks of the user tasks using agents, query the cache device 100 for dependent data corresponding to the subtasks, and send shared data to the cache device 100 for caching.

[0056] It should be noted that the cache device 100 and the task execution device 200 may be electronic devices such as personal computers (PCs), notebook computers, and servers. Figure 1 Multiple agents in the task execution device 200 can be deployed on the same task execution device 200, and the cache device 100 is connected to a task execution device 200 to implement the multi-agent collaborative caching method provided by the embodiment of the present invention. The configuration can be based on the actual application scenario and is not limited to this by the present invention.

[0057] Please refer to Figure 2 , Figure 2 A schematic flow chart of a multi-agent collaborative caching method provided by an embodiment of the present invention is shown. The method is applied to a caching device, which is communicatively connected to at least one task execution device, and each task execution device is configured with at least one agent. The method includes the following steps:

[0058] Step S100, generating a context vector based on the input data, inference data and output data of the subtask sent by the task execution device; the subtask is obtained by the task execution device based on the user task splitting; the inference data represents the inference process of the intelligent agent executing the subtask.

[0059] As a possible implementation, Figure 3 The system architecture is illustrated in this paper. A user sends a task request to the multi-agent collaborative caching system, which assigns the user task to one of the task execution devices. The task execution device uses a task planner to split and plan the user task, obtain multiple subtasks and the relationships between them, and then generates a collaborative task graph corresponding to the user task based on the subtasks and their relationships. These subtasks are then distributed to the corresponding agents through the agent center.

[0060] The agent center is responsible for agent management, scheduling, and task allocation. The collaborative task graph describes the relationships and collaboration patterns between subtasks. Nodes in the collaborative task graph represent subtasks, and edges represent collaborative relationships between subtasks. Collaborative relationships include data dependencies, communication relationships, and subtask allocation. The collaborative task graph is used to construct a relationship graph between subtasks, such as edges based on content similarity, temporal relationships, task sequences, and reference relationships.

[0061] After receiving an assigned subtask, the agent executes it based on its capabilities and current state. During the execution of a subtask, the agent generates inference data and output data. The contextual data for the subtask consists of the subtask's input data, inference data, and output results. Input data includes step inputs, which include sensor data, user instructions, task type, and collaboration phase. Inference data includes the algorithm used to execute the subtask, completed inference steps, and the predicted next action. Output data represents the results of executing the subtask, such as decision instructions, generated data, and communication messages.

[0062] After the agent completes a subtask, the task execution device sends the subtask's input data, inference data, and output data to the cache device. The cache device then performs embedding processing, converting the input data into input vectors, the inference data into inference vectors, and the output data into output vectors. The cache device then concatenates or fuses the input, inference, and output vectors to generate a context vector, which is used to adjust the cache.

[0063] As a possible implementation method, we take splicing as an example to illustrate. Assume that the input data is , the inference data is , the output data is , the context vector generation formula is as follows:

[0064]

[0065]

[0066]

[0067]

[0068] in, is the context vector; is the input vector; is the inference vector; is the output vector; is the embedded function.

[0069] Step S110 , determining a cache score corresponding to the context vector according to the context vector, the feature vector of the agent, and the collaborative task map.

[0070] Step S120 : When the cache score is higher than the first threshold, the input data, inference data, and output data of the subtask are cached.

[0071] Compared with the existing technology of updating the cache based on data access frequency or time, the embodiment of the present invention introduces a "context perception" mechanism to dynamically adjust the cache strategy, that is, dynamically adjust the cache data in the cache pool according to the context data (including the input data, reasoning data and output data of the subtask), the relevant characteristics of the intelligent agent and the collaborative task map.

[0072] The cache device obtains the relevant features of the agent corresponding to the subtask, that is, the agent's descriptive information, such as role, business capabilities, task assignment, etc., and obtains the agent's feature vector based on the agent's descriptive information. The task requirements of the subtask are captured through the context vector, the key attributes and dynamic information of the agent performing the subtask in the current task environment are captured through the agent's feature vector, and the collaborative relationship between subtasks is captured through the collaborative task map. The cache device performs a comprehensive analysis based on the subtask's context vector, the agent's feature vector, and the collaborative task map to obtain a cache score corresponding to the context vector, thereby more accurately predicting which data will be frequently used and improving the cache score corresponding to the predicted frequently used data.

[0073] When the cache score is lower than a first threshold, the cache device does not cache the subtask's input data, inference data, and output data, effectively avoiding redundant and wasted cache resources. When the cache score is higher than the first threshold, the cache device uses the cache to cache the subtask's input data, inference data, and output data, thereby improving the cache hit rate.

[0074] In summary, the multi-agent collaborative caching method provided by the embodiment of the present invention generates a context vector through the input data, inference data and output data of the subtask, which can fully capture the key information of the current context during the execution of the subtask. The context vector, the feature vector of the agent and the collaborative task map are combined for analysis to determine the cache score, thereby realizing a dynamic and flexible caching mechanism to ensure that important data with a high cache score is cached first. By setting a first threshold to intercept non-important data with a low cache score, the computing and communication overhead is effectively reduced, and the collaborative efficiency and response speed of multiple agents in complex task environments are improved, which not only improves the utilization rate of cache resources, but also enhances the intelligence level of multi-agent collaboration.

[0075] It should be noted that continuing Figure 3For example, after all subtasks are completed by the intelligent agent, the task execution device uses the aligner to integrate and align the output data corresponding to each subtask to obtain the final output, and then feeds the final output back to the user.

[0076] To facilitate system monitoring, performance analysis, and task optimization, the multi-agent collaborative caching system can store the collaborative process of user tasks as historical records in the database. The historical records may include the output data of subtasks, error information of subtask execution, task iteration status, agent iteration, etc.

[0077] Optionally, for subtasks whose cache score is not higher than the second threshold, a possible implementation method is provided below. Figure 4 , Figure 2 The sub-steps of step S120 may include:

[0078] Step S121 : when the cache score is higher than the first threshold and not higher than the second threshold, obtaining summary information of the output data, and adding the input data, inference data, and summary information to the cache pool.

[0079] In this embodiment of the present invention, the first threshold is lower than the second threshold. Both the first and second thresholds are preset based on the application scenario. Assume that the cache scores are decimals less than 1 and greater than 0, such as 0.002, 0.18, etc. The first threshold can be set to 0.1 and the second threshold can be set to 0.2. This is not limited in the present invention.

[0080] When the cache score is above the first threshold but below the second threshold, the cache device adopts a coarse-grained caching strategy, extracting summary information from the output data. The summary information of the output data is a summary and concise representation of the output data. The cache device stores the input data, inference data, and summary information corresponding to the subtask as cache data in the cache pool.

[0081] It can be seen that the embodiment of the present invention adopts a "coarse-grained" caching strategy to cache data with a cache score higher than the first threshold and not higher than the second threshold. Since the summary information is usually smaller than the output data, it can save cache space, save more key data under limited storage resources, and further improve the cache hit rate.

[0082] Optionally, for caching subtasks with a cache score higher than the second threshold, a possible implementation method is provided below. Figure 4 , Figure 2 The sub-steps of step S120 may include:

[0083] Step S122: When the cache score is higher than the second threshold, the association result corresponding to the associated subtask is obtained from the output data according to the association relationship between the multiple subtasks, and the input data, inference data and association result are added to the cache pool.

[0084] In this embodiment of the present invention, when the cache score exceeds a second threshold, the cache device adopts a "fine-grained" caching strategy. The association relationships include dependencies and communication records, which are used to support collaborative reasoning and problem diagnosis. The cache device can also cache the association results in a cache pool for subsequent use.

[0085] As a possible implementation, we'll use the example of analyzing e-commerce sales (a user task) to illustrate a fine-grained caching strategy. The user task is broken down into multiple subtasks: data retrieval, traffic metric analysis, sales performance metric analysis, operational metric analysis, RFM (recency, frequency, and monetary) user value stratification analysis, and sales trend reporting.

[0086] Generate association relationships based on the functions of the subtasks, including the traffic indicators obtained by the traffic indicator analysis depending on the data retrieval subtask, the sales form indicator analysis depending on the sales form indicator obtained by the data retrieval subtask, the operation indicators obtained by the operation indicator analysis depending on the data retrieval subtask, the user value indicators obtained by the RFM user value stratification analysis depending on the data retrieval subtask, the analysis results of the sales trend report depending on the output of the traffic indicator analysis subtask, the analysis results output by the sales form indicator analysis subtask, the analysis results output by the operation indicator analysis subtask, and the analysis results output by the RFM user value stratification analysis subtask.

[0087] Assuming that the subtask is to retrieve data, when the cache device adopts the "fine-grained" caching strategy, it obtains traffic indicators, sales form indicators, operation indicators and user value indicators from the output data of the retrieval data subtask according to the association relationship and determines them as association results, and stores the input data, inference data and association results of the subtask as cache data in the cache pool.

[0088] It can be seen that the embodiment of the present invention adopts a "fine-grained" caching strategy to cache data with a cache score higher than the second threshold, and captures the associated results that other subtasks in the output data depend on by combining the association relationship between subtasks, and stores the associated results together with the input data and reasoning data, so that the cached data not only contains the information of a single subtask, but also can feedback the overall characteristics of the entire task network. This semantic enhancement makes the cached data closer to the application requirements of user tasks and improves the adaptability to diverse task environments. Since this cache structure significantly reduces the occupancy of cache resources, it can save computing resources and time costs when other subtasks query the cache, thereby improving the efficiency and accuracy of retrieval.

[0089] It should be noted that, when the space in the cache pool is limited, in addition to caching the input data, reasoning data, and output data of the subtask, the cache device also needs to cache the cache score synchronously so that the cache data can be updated using the cache score. After generating the cache score corresponding to the context vector, the cache device needs to obtain the total capacity and used capacity of the cache pool. When the ratio of the used capacity to the total capacity exceeds the capacity threshold, the cache data with a low cache score is removed from the cache pool, and the input data, reasoning data, and output data of the subtask being processed with a cache score higher than the first threshold are cached. The example of the present invention dynamically specifies and adjusts the cache strategy in combination with the current context of the user task, including determining the data to be cached, the granularity of the cache data, and the cache elimination strategy based on the cache score.

[0090] In order to ensure that the intelligent agent can efficiently utilize cached data, the embodiment of the present invention implements the cached data retrieval function through precise matching, overcoming the problems of fuzzy matching or information redundancy that may exist in existing cache retrieval.

[0091] Optionally, before the cache device receives the input data, reasoning data, and output data of the subtask sent by the task execution device to generate the context vector, the task execution device also includes a process of querying the cache pool. As for how to obtain the dependency data corresponding to the subtask to be executed from the cache pool, the following provides a possible implementation method. Please refer to Figure 5 , the method further comprises the following steps:

[0092] Step S200: When a query instruction is received from a task execution device, a query vector is generated according to the step input of the subtask in the query instruction; before the intelligent agent executes the subtask, the task execution device determines whether to send a query instruction based on the similarity between the subtask and other subtasks (i.e., the first similarity).

[0093] In this embodiment of the present invention, before an agent executes a subtask, the task execution device calculates a first similarity between subtasks based on their descriptions. If no other subtasks exist whose first similarity exceeds a similarity threshold, the subtask step input is directly determined as the subtask's input data without querying cached data. The agent then executes the subtask based on the input data, obtaining inference data and output data for the subtask.

[0094] If there is a subtask with a first similarity exceeding the similarity threshold and other subtasks with a first similarity exceeding the similarity threshold have been completed, natural language processing techniques (such as entity recognition, relationship extraction, and intent recognition) are used to obtain the step input of the subtask. A query instruction is generated based on the step input of the subtask, and the query instruction carrying the step input is sent to the cache device.

[0095] Continue with Figure 3 For example, after receiving a query, the cache device uses a caller to parse the subtask step input from the query and convert it into a query vector through embedding. The first similarity between tasks is used to appropriately determine whether to generate a query, thus avoiding unnecessary communication overhead and resource waste.

[0096] Step S210 : generating a cache vector corresponding to each data according to the data in the cache pool.

[0097] Step S220 : determining a similar vector corresponding to the query vector from the cache vectors based on the similarity between the query vector and each cache vector.

[0098] In an embodiment of the present invention, the cache device uses a caller to transmit the query vector to the cache, so that the cache converts each data in the cache pool into a corresponding cache vector through embedding processing, and calculates the similarity between the query vector and each cache vector (i.e., the second similarity), and determines the cache vector whose second similarity exceeds the matching threshold as the similarity vector corresponding to the query vector.

[0099] It should be noted that both the similarity threshold and the matching threshold are preconfigured and can be adjusted based on the actual application scenario. The similarity between vectors can be determined using methods such as cosine similarity and Euclidean distance. The method for obtaining similarity can be selected based on the actual application scenario. This is not limited in the present invention.

[0100] Step S230: Determine the dependent data of the subtask according to the similarity vector.

[0101] Step S240: returning the dependency data of the subtask to the task execution device so that the task execution device generates input data of the subtask according to the step input and the dependency data of the subtask.

[0102] In an embodiment of the present invention, the cache device uses a caller to obtain dependency data related to the subtask using similarity vectors. This dependency data is determined based on the degree of match between the query vector and the cache vector, ensuring that the selected dependency data accurately reflects the requirements of the subtask. The cache device returns the subtask dependency data to the task execution device. After receiving the subtask dependency data, the task execution device merges the subtask step input and dependency data to obtain the corresponding input data, and uses the intelligent agent to execute the subtask based on the input data to obtain the inference data and output data of the subtask.

[0103] It can be seen that the embodiment of the present invention uses the step input of the subtask and the cached data to perform similarity calculation to achieve accurate positioning of the dependent data required for the subtask, which can significantly improve the data preparation efficiency and accuracy of the task execution device when processing subtasks. It can not only optimize the task execution process, but also improve the operating efficiency and intelligence level of the multi-intelligent collaborative caching system.

[0104] Because the cache device uses both "coarse-grained" and "fine-grained" cache strategies to implement multi-granularity caching, when the task execution device sends a subtask query instruction to the cache device before the agent executes the subtask, it supports cache data retrieval at different granularities (coarse-grained or fine-grained). For example, it can retrieve a single data item, a group of related data items, or the complete data item of the entire subtask.

[0105] For coarse-grained cached data, you can retrieve summary information about the input data, inference data, and output data corresponding to the completed subtasks. For fine-grained cached data, you can retrieve the input data, inference data, and associated results corresponding to the completed subtasks.

[0106] Optionally, a possible implementation method for determining the dependent data of a subtask is provided below. Figure 5 The sub-steps of step S230 may include:

[0107] When there is only one similarity vector, the similarity vector is converted into the dependency data of the subtask; when there are multiple similarity vectors, each similarity vector and the collaborative task graph are input into the graph convolutional network to obtain the similarity score of each similarity vector, and the similarity vector with the highest similarity score is converted into the dependency data of the subtask.

[0108] In an embodiment of the present invention, when the cache device retrieves the dependency data corresponding to the subtask, if there is a similarity vector, the similarity vector is directly converted into the dependency data of the subtask. If there are multiple similarity vectors, each similarity vector and the collaborative task graph are input into the graph convolutional network, and the similarity vector is learned on the collaborative task graph through the graph convolutional network, so that when calculating the similarity score, not only the similarity vector itself is considered, but also the contextual relationship in the graph is considered, and the similarity score of each similarity vector is obtained, and the similarity vector with the highest similarity score is converted into the dependency data of the subtask, such as Figure 6 shown.

[0109] As can be seen, the embodiment of the present invention adopts a differentiated processing strategy for different numbers of similarity vectors. When there is only one similarity vector, the similarity vector is directly converted into the dependency data of the subtask, simplifying the processing flow and improving retrieval efficiency. When there are multiple similarity vectors, a graph convolutional network is used to further analyze, sort, and condense each similarity vector to obtain a similarity score for each similarity vector, thereby screening the similarity vectors most relevant to the subtask to generate the dependency data of the subtask. The scoring mechanism further enhances the rationality and accuracy of the dependency data selection, ensures the quality of the subtask input data, and thus ensures that the user task is executed efficiently and accurately.

[0110] Optionally, a possible implementation method for obtaining the cache score of the context vector is provided below. Figure 4 , Figure 2 The sub-steps of step S110 may include:

[0111] Step S111: Generate a feature vector of the agent based on the description information of the agent.

[0112] In step S112, the context vector, feature vector, and collaborative task graph are input into the graph convolutional network to obtain a cache score corresponding to the context vector.

[0113] In this embodiment of the present invention, the cache device converts the agent's description information into a feature vector through embedding processing. The context vector, feature vector, and collaborative task graph are then fed into a graph convolutional network (GCN). A GCN is a neural network that processes graph-structured data. The GCN learns the context vector, the agent's feature vector, and the collaborative task graph to obtain a cache score corresponding to the context vector.

[0114] As a possible implementation, Figure 7As shown, the output layer of the graph convolutional network is designed to predict the cache score for each subtask. The graph convolutional network learns the representation of each node in the collaborative task graph by performing message passing and aggregation on the graph structure of the collaborative task graph. When the cache device receives multiple context vectors and feature vectors related to the same collaborative task graph, it uses these multiple context vectors and feature vectors as node features and inputs the collaborative task graph as the graph structure into the graph convolutional network.

[0115] Assume that the collaborative task graph is G and the node features are , where n is the number of context vectors, is the k-th context vector, is the feature vector corresponding to the k-th context vector. The processing process of the graph convolutional network is simplified as follows:

[0116]

[0117]

[0118] Where S is the cache score set; is the cache score corresponding to the k-th context vector, which is used to reflect the cache priority or importance of the context information of the subtask in the current context. The higher the score, the more the context information of the subtask should be cached. When the cache score of the context vector is higher than the first threshold, the input data, inference data, and output data of the subtask are cached; It is a graph convolutional network.

[0119] It can be seen that the embodiment of the present invention provides a more accurate reference basis for the formulation of caching strategies by quantifying the attributes of intelligent agents into feature vectors, and combines the context vector, feature vector and collaborative task map to enable the graph convolutional network to deeply analyze the correlation between each intelligent agent in the current task context and its impact on the overall task, thereby realizing more intelligent and precise cache scoring calculations, which not only improves the scientificity and rationality of the caching strategy, but also ensures that important data is cached first, thereby significantly improving the collaboration efficiency and resource utilization level of multiple intelligences.

[0120] Based on the same inventive concept, the basic principles and technical effects of the multi-agent collaborative caching device provided in the embodiment of the present invention are the same as those in the above embodiment. For the sake of brief description, for parts not mentioned in this embodiment, please refer to the corresponding content in the above embodiment.

[0121] Please refer to Figure 8 , Figure 8This is a block diagram of a multi-agent collaborative caching device 300 according to an embodiment of the present invention. The multi-agent collaborative caching device 300 is applied to a cache device, which is communicatively connected to at least one task execution device. Each task execution device is configured with at least one agent. The multi-agent collaborative caching device 300 includes a processing module 301, a scoring module 302, and a caching module 303.

[0122] Processing module 301 is used to generate a context vector based on the input data, reasoning data, and output data of the subtask sent by the task execution device; the subtask is obtained by the task execution device based on the user task split; the reasoning data represents the reasoning process of the intelligent agent in executing the subtask;

[0123] Scoring module 302, configured to determine a cache score corresponding to the context vector based on the context vector, the agent's feature vector, and the collaborative task graph;

[0124] The cache module 303 is configured to cache the input data, inference data, and output data of the subtask when the cache score is higher than a first threshold.

[0125] In summary, the multi-agent collaborative caching device provided by the embodiment of the present invention generates a context vector through the input data, inference data and output data of the subtask, and can fully capture the key information of the current context during the execution of the subtask. The context vector, the feature vector of the agent and the collaborative task map are combined for analysis to determine the cache score, thereby realizing a dynamic and flexible caching mechanism to ensure that important data with a high cache score is cached first. By setting a first threshold to intercept non-important data with a low cache score, the computing and communication overhead is effectively reduced, and the collaborative efficiency and response speed of multiple agents in complex task environments are improved, which not only improves the utilization rate of cache resources, but also enhances the intelligence level of multi-agent collaboration.

[0126] Optionally, the cache module 303 is specifically configured to obtain summary information of the output data and add the input data, inference data and summary information to the cache pool when the cache score is higher than a first threshold and not higher than a second threshold.

[0127] Optionally, the cache module 303 is specifically configured to obtain, when the cache score is higher than a second threshold, association results corresponding to associated subtasks from the output data according to association relationships between multiple subtasks, and add the input data, inference data, and association results to the cache pool.

[0128] Optionally, the processing module 301 is also used to generate a query vector based on the step input of the subtask in the query instruction when a query instruction sent by the task execution device is received; the task execution device determines whether to send the query instruction based on the similarity between the subtask and other subtasks before the intelligent agent executes the subtask; and generates a cache vector corresponding to each data based on the data in the cache pool.

[0129] The scoring module 302 is further configured to determine a similar vector corresponding to the query vector from the cache vectors based on the similarity between the query vector and each cache vector.

[0130] The processing module 301 is further configured to determine the dependency data of the subtask based on the similarity vector; and return the dependency data of the subtask to the task execution device so that the task execution device generates input data of the subtask based on the step input and dependency data of the subtask.

[0131] Optionally, the processing module 301 is specifically used to convert the similarity vector into dependency data of the subtask when there is one similarity vector; when there are multiple similarity vectors, input each similarity vector and the collaborative task graph into the graph convolutional network to obtain the similarity score of each similarity vector, and convert the similarity vector with the highest similarity score into dependency data of the subtask.

[0132] Optionally, the scoring module 302 is specifically used to generate a feature vector of the agent based on the description information of the agent; input the context vector, the feature vector and the collaborative task graph into the graph convolutional network to obtain a cache score corresponding to the context vector.

[0133] Please refer to Figure 9 , a block diagram of a cache device 100 provided in an embodiment of the present invention, is provided. Cache device 100 includes a memory 110, a processor 120, and a communication module 130. Memory 110, processor 120, and communication module 130 are electrically connected to each other, directly or indirectly, to enable data transmission or exchange. For example, these components may be electrically connected via one or more communication buses or signal lines.

[0134] Memory 110 is used to store programs or data. Memory 110 can be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), and electrically erasable programmable read-only memory (EEPROM).

[0135] The processor 120 is used to read / write data or programs stored in the memory 110 and execute corresponding functions. For example, when the computer program stored in the memory 110 is executed by the processor 120, the multi-agent collaborative caching method disclosed in the above embodiments can be implemented.

[0136] The communication module 130 is used to establish a communication connection between the cache device 100 and other communication terminals through a network, and to send and receive data through the network.

[0137] It should be understood that Figure 9 The structure shown is only a schematic diagram of the structure of the cache device 100. The cache device 100 may also include Figure 9 More or fewer components than shown, or with Figure 9 Different configurations shown. Figure 9 Each component shown in the figure can be implemented by hardware, software or a combination thereof.

[0138] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by the processor 120, the multi-agent collaborative caching method disclosed in the above embodiments is implemented.

[0139] An embodiment of the present invention further provides a program product, which, when executed by the processor 120, implements the multi-agent collaborative caching method disclosed in the above embodiments.

[0140] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a portion of code, and the module, program segment or a portion of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or can be implemented using a combination of dedicated hardware and computer instructions.

[0141] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.

[0142] If the functions are implemented as software modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or the portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage media include various media capable of storing program code, such as USB flash drives, mobile hard drives, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical disks.

[0143] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.

Claims

1. A multi-agent collaborative caching method, characterized in that: Applied to a cache device, the cache device is communicatively connected to at least one task execution device, each of the task execution devices is provided with at least one intelligent agent, the method comprising: Generate a context vector based on the input data, reasoning data, and output data of the subtask sent by the task execution device; the subtask is obtained by the task execution device based on the user task splitting; the reasoning data represents the reasoning process of the intelligent agent in executing the subtask; Determining a cache score corresponding to the context vector according to the context vector, the feature vector of the agent, and the collaborative task map; When the cache score is higher than a first threshold, the input data, the inference data, and the output data of the subtask are cached.

2. The multi-agent collaborative caching method according to claim 1, characterized in that: When the cache score is higher than a first threshold, caching the input data, the inference data, and the output data of the subtask includes: When the cache score is higher than the first threshold and not higher than a second threshold, the summary information of the output data is obtained, and the input data, the inference data, and the summary information are added to a cache pool.

3. The multi-agent collaborative caching method according to claim 1, characterized in that: When the cache score is higher than a first threshold, caching the input data, the inference data, and the output data of the subtask includes: When the cache score is higher than a second threshold, the association result corresponding to the associated subtask is obtained from the output data according to the association relationship between the multiple subtasks, and the input data, the inference data and the association result are added to the cache pool.

4. The multi-agent collaborative caching method according to claim 1, characterized in that: Before generating a context vector based on the input data, inference data, and output data of the subtask sent by the task execution device, the method further includes: When receiving a query instruction sent by the task execution device, generating a query vector according to the step input of the subtask in the query instruction; before the agent performs the subtask, the task execution device determines whether to send the query instruction based on the similarity between the subtask and other subtasks; Generate a cache vector corresponding to each data according to the data in the cache pool; Determining a similar vector corresponding to the query vector from the cache vectors according to the similarity between the query vector and each of the cache vectors; determining dependency data of the subtask according to the similarity vector; The dependency data of the subtask is returned to the task execution device, so that the task execution device generates input data of the subtask according to the step input of the subtask and the dependency data.

5. The multi-agent collaborative caching method according to claim 4, characterized in that: The determining the dependency data of the subtask according to the similarity vector includes: When the similarity vector is one, converting the similarity vector into dependency data of the subtask; When there are multiple similarity vectors, each similarity vector and the collaborative task graph are input into a graph convolutional network to obtain a similarity score for each similarity vector, and the similarity vector with the highest similarity score is converted into dependency data of the subtask.

6. The multi-agent collaborative caching method according to claim 1, characterized in that: The determining of a cache score corresponding to the context vector according to the context vector, the feature vector of the agent, and the collaborative task map includes: generating a feature vector of the agent according to the description information of the agent; The context vector, the feature vector and the collaborative task graph are input into a graph convolutional network to obtain a cache score corresponding to the context vector.

7. A multi-agent collaborative caching device, characterized in that: Applied to a cache device, the cache device is communicatively connected to at least one task execution device, each of the task execution devices is provided with at least one intelligent agent, the apparatus comprises: a processing module, configured to generate a context vector based on input data, inference data, and output data of a subtask sent by the task execution device; the subtask is obtained by the task execution device based on user task splitting; and the inference data represents the inference process of the intelligent agent in executing the subtask; A scoring module, configured to determine a cache score corresponding to the context vector based on the context vector, the feature vector of the agent, and the collaborative task map; A cache module is configured to cache the input data, inference data, and output data of the subtask when the cache score is higher than a first threshold.

8. A cache device, characterized in that: It includes a processor and a memory, the memory stores a computer program that can be executed by the processor, and the processor can execute the computer program to implement the multi-agent collaborative caching method described in any one of claims 1-6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the multi-agent collaborative caching method as described in any one of claims 1 to 6.

10. A program product, characterized in that When the program product is executed by a processor, the multi-agent collaborative caching method as described in any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Resource caching method and system based on multi-agent reinforcement learning

    CN119766881A

  • Collaborative task offloading and service caching method based on graph attention multi-agent reinforcement learning

    WO2025050608A1