Task allocation method and device, electronic equipment, storage medium and program product
Patent Information
- Application Number
- CN202511161010.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-19
- Publication Date
- 2026-09-29
- Estimated Expiration
- 2045-08-19
AI Technical Summary
[0004]本发明实施例提供一种任务分配方法、装置、电子设备、存储介质及程序产品,以解决相关技术中存在智能体的利用率较低的问题
[0023]第六方面,本发明还提供一种计算机程序产品,包括计算机指令,所述计算机指令被处理器执行时实现上述第一方面所述的任务分配方法的步骤。
Smart Images

Figure CN120909736B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, specifically to a task allocation method, apparatus, electronic device, storage medium, and program product. Background Technology
[0002] With the development of agent technology, the collaborative execution of tasks by multiple agents can effectively improve task efficiency. In related technologies, a task is first decomposed into multiple sub-tasks, and then these sub-tasks are assigned to different agents for collaborative execution. However, these technologies do not consider the execution status of sub-tasks when assigning them to agents, resulting in some agents being busy while others are idle, leading to low agent utilization.
[0003] It is evident that the utilization rate of intelligent agents in related technologies is low. Summary of the Invention
[0004] This invention provides a task allocation method, apparatus, electronic device, storage medium, and program product to address the problem of low utilization rate of intelligent agents in related technologies.
[0005] To solve the above problems, the present invention is implemented as follows:
[0006] In a first aspect, embodiments of the present invention provide a task allocation method, including:
[0007] The initial task is broken down into multiple subtasks, and each subtask corresponds to a task type.
[0008] The execution node corresponding to each subtask is determined based on the first mapping relationship and the task type, wherein the first mapping relationship is the mapping relationship between different execution nodes and different task types;
[0009] Determine the first agent corresponding to each subtask. The first agent is either the agent that has not processed the subtask or the agent that has been assigned the longest time since the last subtask. The multiple agents are the agents corresponding to the execution nodes.
[0010] Each subtask is assigned to the corresponding first agent.
[0011] Secondly, embodiments of the present invention also provide a task allocation device, comprising:
[0012] The decomposition module is used to decompose the initial task into multiple subtasks and the task type corresponding to each subtask.
[0013] The first determining module is used to determine the execution node corresponding to each subtask based on the first mapping relationship and the task type, wherein the first mapping relationship is a mapping relationship between different execution nodes and different task types;
[0014] The second determining module is used to determine the first intelligent agent corresponding to each subtask. The first intelligent agent is either the intelligent agent that has not processed the subtask or the intelligent agent that has been assigned the longest time since the last subtask. The multiple intelligent agents are the intelligent agents corresponding to the execution nodes.
[0015] The allocation module is used to allocate each subtask to the corresponding first intelligent agent.
[0016] Thirdly, embodiments of the present invention also provide an electronic device, including a transceiver and a processor.
[0017] The processor is used to decompose the initial task into multiple subtasks and the task type corresponding to each subtask.
[0018] The processor is further configured to determine the execution node corresponding to each subtask based on the first mapping relationship and the task type, wherein the first mapping relationship is a mapping relationship between different execution nodes and different task types;
[0019] The processor is further configured to determine a first agent corresponding to each subtask, wherein the first agent is an agent among a plurality of agents that has not processed a subtask or an agent that has been in the longest time since the last subtask was assigned, and the plurality of agents are agents corresponding to the execution node;
[0020] The processor is further configured to assign each subtask to the corresponding first intelligent agent.
[0021] Fourthly, embodiments of the present invention provide an electronic device, including: a processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, it implements the steps of the task allocation method described in the first aspect.
[0022] Fifthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the task allocation method described in the first aspect.
[0023] In a sixth aspect, the present invention also provides a computer program product, including computer instructions, which, when executed by a processor, implement the steps of the task allocation method described in the first aspect.
[0024] In this embodiment of the invention, the task allocation method includes: decomposing an initial task to obtain multiple subtasks and a task type corresponding to each subtask; determining the execution node corresponding to each subtask based on a first mapping relationship and the task type, wherein the first mapping relationship is a mapping relationship between different execution nodes and different task types; determining a first agent corresponding to each subtask, wherein the first agent is an agent among the multiple agents that has not processed a subtask or an agent that has been inactive for the longest time since the last subtask allocation, and the multiple agents are agents corresponding to the execution node; and allocating each subtask to the corresponding first agent. In this way, by determining the execution node through the task type of the subtask, and then determining the first agent from among the multiple agents corresponding to the execution node, wherein the first agent is an agent among the multiple agents that has not processed a subtask or an agent that has been inactive for the longest time since the last subtask allocation, the number of subtasks allocated to the multiple agents corresponding to the execution node is balanced after each subtask is allocated to the corresponding first agent, avoiding a situation where some agents are busy while others are idle, thereby improving the utilization rate of the agents. Attached Figure Description
[0025] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0026] Figure 1 This is a flowchart of a task allocation method provided in an embodiment of the present invention;
[0027] Figure 2 This is a schematic diagram illustrating the relationship between subtasks and adjacent subtasks provided in an embodiment of the present invention;
[0028] Figure 3 This is one of the schematic diagrams of a two-dimensional intelligent agent array provided in an embodiment of the present invention;
[0029] Figure 4 This is a second schematic diagram of a two-dimensional intelligent agent array provided in an embodiment of the present invention;
[0030] Figure 5 This is a schematic diagram of data transmission provided in an embodiment of the present invention;
[0031] Figure 6 This is a schematic diagram of the intelligent agent platform provided in an embodiment of the present invention;
[0032] Figure 7 This is a structural diagram of a task allocation device provided in an embodiment of the present invention;
[0033] Figure 8 This is a structural diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0034] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0035] Please see Figure 1 , Figure 1 This is a flowchart of a task allocation method provided in an embodiment of the present invention, such as... Figure 1 As shown, it includes the following steps:
[0036] Step 101: Decompose the initial task to obtain multiple subtasks and the task type corresponding to each subtask.
[0037] The initial task mentioned above is a task that needs to be processed collaboratively by multiple agents. By decomposing the initial task into multiple sub-tasks, multiple sub-tasks can be assigned to different agents. Each agent can process one or more sub-tasks, so as to realize the collaborative processing of the initial task by multiple agents.
[0038] The task types mentioned above are subtask task types. Different subtasks can have the same or different task types. Different agents can execute different subtask task types. When assigning a subtask to an agent, it is necessary to consider whether the agent can handle the subtask. Usually, subtask assignment is achieved through the task type of the subtask, so that the assigned agent can handle the subtask.
[0039] Step 102: Determine the execution node corresponding to each subtask based on the first mapping relationship and the task type. The first mapping relationship is the mapping relationship between different execution nodes and different task types.
[0040] The first mapping relationship mentioned above is the mapping relationship between different execution nodes and different task types. After decomposing the initial task and obtaining the task types of the subtasks, the execution node of each subtask can be determined according to the first mapping relationship and the task type. Through the execution node, the subtask can be assigned to an executable agent.
[0041] The first mapping relationship is a mapping relationship created before the initial task is assigned. The execution node is a node that processes subtasks of a specific task type. The execution node corresponds to at least one agent. When the subtasks of the task type corresponding to the execution node are decomposed, the execution node can be quickly determined as the node for task assignment through the first mapping relationship. The execution node then assigns the subtasks to the agents that can execute the subtasks.
[0042] Step 103: Determine the first agent corresponding to each subtask. The first agent is either the agent that has not processed the subtask or the agent that has been assigned the longest time since the last subtask. The multiple agents are the agents corresponding to the execution nodes.
[0043] The aforementioned agents are the agents corresponding to the execution nodes, and each agent can be used to execute the subtasks assigned by the execution nodes. During task allocation, considering the need for load balancing among different agents to avoid situations where some agents are overloaded while others remain idle, tasks should be prioritized for agents that have not yet processed subtasks or the agent whose last subtask allocation was the longest (i.e., the first agent). This aims to achieve a more balanced distribution of subtasks across all agents, ensuring that each agent processes the same or similar number of subtasks within a given timeframe.
[0044] Step 104: Assign each subtask to the corresponding first intelligent agent.
[0045] In this embodiment of the invention, the task allocation method includes: decomposing an initial task to obtain multiple subtasks and a task type corresponding to each subtask; determining the execution node corresponding to each subtask based on a first mapping relationship and the task type, wherein the first mapping relationship is a mapping relationship between different execution nodes and different task types; determining a first agent corresponding to each subtask, wherein the first agent is an agent among the multiple agents that has not processed a subtask or an agent that has been inactive for the longest time since the last subtask allocation, and the multiple agents are agents corresponding to the execution node; and allocating each subtask to the corresponding first agent. In this way, by determining the execution node through the task type of the subtask, and then determining the first agent from among the multiple agents corresponding to the execution node, wherein the first agent is an agent among the multiple agents that has not processed a subtask or an agent that has been inactive for the longest time since the last subtask allocation, the number of subtasks allocated to the multiple agents corresponding to the execution node is balanced after each subtask is allocated to the corresponding first agent, avoiding a situation where some agents are busy while others are idle, thereby improving the utilization rate of the agents.
[0046] In one embodiment, the decomposition of the initial task into multiple sub-tasks and the task type corresponding to each sub-task includes:
[0047] The initial task is decomposed to obtain multiple subtasks, and each subtask has a corresponding task type and position code. The position code of each subtask is used to represent the execution order. The position codes of two adjacent subtasks in the multiple subtasks may be the same or different.
[0048] The step of determining the first intelligent agent corresponding to each subtask includes:
[0049] If a second mapping relationship exists in the first preset mapping relationship set corresponding to the location code of the first subtask, the first agent corresponding to the location code is determined based on the second mapping relationship. The second mapping relationship is the mapping relationship between the location codes of different subtasks and different agents. The first subtask is one of the multiple subtasks.
[0050] It should be noted that the multiple subtasks obtained from the initial task decomposition have an execution order. When multiple agents collaboratively execute the initial task, the execution order among the subtasks needs to be considered, and the different subtasks are executed sequentially. The positional encoding mentioned above represents the relative position of the subtasks within the initial task, and the execution order can be determined through the positional encoding of each subtask.
[0051] The aforementioned first preset mapping relationship set pre-stores multiple second mapping relationships, which are mapping relationships between location codes and agents. Thus, after determining the location code of a subtask, the first preset mapping relationship set is used to determine if a corresponding second mapping relationship exists. If it does, the first agent is quickly determined directly through the second mapping relationship, eliminating the need to select the first agent from multiple agents in the execution node, effectively improving allocation efficiency.
[0052] The first preset mapping relationship set includes only the second mapping relationship corresponding to some position codes. When allocating sub-tasks, it is necessary to first determine whether there is a mapping relationship corresponding to the position code in the first preset mapping relationship set through the position code. If it exists, the first agent is directly determined through the second mapping relationship. If it does not exist, the first agent is determined from multiple agents.
[0053] In this embodiment of the invention, if a second mapping relationship exists in the first preset mapping relationship set corresponding to the location code of a first subtask, the first agent corresponding to the location code is determined based on the second mapping relationship. The second mapping relationship is a mapping relationship between the location codes corresponding to different subtasks and different agents, and the first subtask is one of the multiple subtasks. Thus, by determining whether a second mapping relationship exists for the location code through the first preset mapping relationship set, and if it exists, the first agent is quickly determined directly through the second mapping relationship, without needing to determine the first agent from multiple agents in the execution node, effectively improving allocation efficiency.
[0054] If no second mapping relationship corresponding to the position code exists in the first preset mapping relationship set, it is necessary to determine the first intelligent agent from among the multiple intelligent agents corresponding to the execution node. Specifically, determining the first intelligent agent corresponding to each subtask further includes:
[0055] If there is no second mapping relationship corresponding to the position code of the first subtask in the first preset mapping relationship set, multiple intelligent agents corresponding to the first execution node of the first subtask are determined based on the third mapping relationship. The third mapping relationship is the mapping relationship between different execution nodes and different intelligent agents.
[0056] The first agent corresponding to the first subtask is determined from the plurality of agents.
[0057] In this embodiment of the invention, if there is no second mapping relationship corresponding to the position code of the first subtask in the first preset mapping relationship set, multiple agents corresponding to the first execution node of the first subtask are determined based on the third mapping relationship, and then the first agent is determined from the multiple agents, thereby realizing the allocation of agents to the subtask.
[0058] The aforementioned third mapping relationship is a pre-established mapping relationship between execution nodes and agents. First, the execution node is determined by the task type. Then, multiple agents corresponding to one execution node are determined through the third mapping relationship. At this point, multiple agents can be used to execute subtasks of that task type. Finally, the agent that has not processed any subtasks or the agent that has been assigned the longest since its last subtask is selected as the first agent to achieve agent load balancing.
[0059] In one embodiment, after determining the first agent corresponding to the first subtask from the plurality of agents, the method further includes:
[0060] The second mapping relationship is constructed based on the location encoding of the first subtask and the first agent;
[0061] Add the second mapping relationship to the first preset mapping relationship set.
[0062] It should be noted that the relationships between adjacent subtasks obtained from the initial task decomposition are different; they can have sequential or parallel relationships. For example, ... Figure 2 As shown, subtasks 1 and 2 are sequential, while subtasks 3 and 4 are parallel. Specifically, in the sequential relationship, the preceding subtask executes before the following subtask, and their position codes differ. In the parallel relationship, the two subtasks should be considered as a single entity requiring synchronous execution, and their position codes are identical. Based on this, this invention proposes a first preset mapping relationship set for task allocation to subtasks with parallel relationships.
[0063] Specifically, after determining the first agent from multiple agents each time, a second mapping relationship is constructed between the position code of the subtask in the initial task and the first agent, and added to the first preset mapping relationship set. In this way, if the subtask is a serial task, it will not affect the allocation of other subtasks; if the subtask is a parallel task, when allocating parallel subtasks with a parallel relationship to this subtask, since the parallel subtasks have the same position code as this subtask, the second mapping relationship can be directly obtained from the first preset mapping relationship set. The first agent is then determined through the second mapping relationship. At this time, both the parallel subtask and this subtask are assigned to the same agent, allowing the parallel task to be executed as a whole to satisfy the execution order of multiple initial tasks.
[0064] In one embodiment, determining the first agent corresponding to the first subtask from the plurality of agents includes:
[0065] Obtain an array of agents corresponding to the plurality of agents. The array of agents includes a first partition and / or a second partition. The plurality of subtasks are arranged sequentially in the first partition or the second partition. The first partition includes the identifiers of agents that have processed subtasks, and the second partition includes the identifiers of agents that have not processed subtasks.
[0066] If the agent array includes the second partition, the agent corresponding to the first identifier in the second partition is set as the first agent, the identifier of the first agent in the second partition is deleted, and the identifier of the first agent is added to the last position of the first partition; and / or, if the agent array does not include the second partition, the agent corresponding to the first identifier in the first partition is set as the first agent, and the identifier of the first agent is moved to the last position of the first partition.
[0067] The aforementioned agent array is used to represent the allocation of subtasks among different agents. The identifiers of multiple agents are arranged sequentially in the agent array; the earlier an agent appears in the array, the longer the time interval since the last subtask allocation. This agent array allows for the rapid identification of the agent with the longest time elapsed since the last subtask allocation.
[0068] The structure of the two-dimensional agent array is as follows: Figure 3 As shown, when creating a two-dimensional intelligent agent array, parameters such as the intelligent agent identifier, the intelligent agent's subtask processing time, and the intelligent agent's processing speed ranking can be obtained for each intelligent agent. Multiple intelligent agents are ranked using these parameters. The intelligent agent identifier can be the intelligent agent's name, specifically the name used by the intelligent agent on the blockchain; the intelligent agent's task processing time is the timestamp of the intelligent agent's last task execution; this field is 0 when the intelligent agent is first added to the blockchain; the intelligent agent's processing speed ranking changes dynamically. Initially, it is sorted by the execution time of the availability detection task; subsequently, it is ranked according to the processing speed of each intelligent agent within a certain period. For example, the intelligent agent processing speed ranking is initially sorted by the execution time of the availability detection task, meaning the shorter the availability detection task execution time, the faster the intelligent agent's processing speed, and the higher the ranking. After each task is completed, a ranking update is triggered, and the ranking is based on the task completion time; that is, the faster the processing speed, the higher the ranking.
[0069] Furthermore, when allocating subtasks based on the agent array, they are sequentially assigned to different agents. In this case, the agent array includes a first partition and a second partition, such as... Figure 4 As shown, the first partition includes the identifiers corresponding to agents that have processed subtasks, and the second partition includes the identifiers corresponding to agents that have not processed subtasks. When assigning subtasks, they are preferentially assigned to agents corresponding to the identifiers in the second partition. After all agents have been assigned subtasks, only the first partition contains the identifiers corresponding to the agents. Then, the subtasks are assigned to different agents according to the order of the identifiers corresponding to the agents in the first partition.
[0070] In this embodiment of the invention, an agent array corresponding to the plurality of agents is obtained. The agent array includes a first partition and / or a second partition. The plurality of subtasks are arranged sequentially in the first partition or the second partition. The first partition includes identifiers corresponding to agents that have processed subtasks, and the second partition includes identifiers corresponding to agents that have not processed subtasks. When the agent array includes the second partition, the agent corresponding to the first identifier in the second partition is set as the first agent, the identifier of the first agent in the second partition is deleted, and the identifier of the first agent is added to the last position of the first partition. And / or, when the agent array does not include the second partition, the agent corresponding to the first identifier in the first partition is set as the first agent, and the identifier of the first agent is moved to the last position of the first partition. In this way, by using the agent array, agents that have not processed subtasks or agents that have been away from the last subtask allocation the longest are selected as the first agent, thereby achieving load balancing during subtask allocation.
[0071] Specifically, subtask allocation can take several forms.
[0072] Scenario 1: The number of tasks to be assigned to the agent is 1.
[0073] In scenario one, where no concurrent tasks are assigned, the agent identifier at the first position in the two-dimensional agent array can be returned to the task scheduling service. This means the first agent is designated as the primary agent handling the subtask. Subsequently, this agent identifier is moved to the end of the two-dimensional agent array, making the agent previously in the second position the first. This ensures that the agent with the longest time elapsed since the last subtask assignment is always placed at the first position in the two-dimensional agent array.
[0074] Scenario 2: There are multiple tasks to be assigned to agents, and some agents in the two-dimensional agent array have not processed any subtasks.
[0075] For scenario two, the two-dimensional agent array contains a first partition and a second partition. In this case, if the number of subtasks to be assigned to agents is less than or equal to the number of agent identifiers that have not processed any tasks, then a subtask is assigned to the agent corresponding to each identifier in the second partition in order from front to back. Subsequently, these agents are moved to the end of the first partition of the two-dimensional agent array.
[0076] If the total number of agent identifiers in the two-dimensional agent array is greater than or equal to the number of subtasks to be assigned to agents, and the number of subtasks to be assigned to agents is greater than the number of agent identifiers that have not processed any tasks, then a subtask is assigned to the agent corresponding to each identifier in the second partition; other subtasks to be processed are assigned to the agents corresponding to the identifiers in the first partition according to their sorting order. Then these agents are moved sequentially to the end of the first partition in the two-dimensional agent array.
[0077] If the total number of agent identifiers in the two-dimensional agent array is less than the number of subtasks to be assigned to agents, then the number of concurrent subtasks far exceeds the number of agents. In this case, one subtask is assigned to all agents, the relative order of the agent identifiers in the two-dimensional agent array remains unchanged, and all are placed in the first partition. Subsequently, other subtasks to be processed are assigned a subtask to the agent corresponding to the identifier in the first partition according to the sorting order; these agents are then moved sequentially to the end of the two-dimensional agent array.
[0078] Scenario 3: There are multiple tasks to be assigned to agents, and there are no agents in the two-dimensional agent array that have not processed any subtasks.
[0079] For scenario three, if the total number of agent identifiers in the two-dimensional agent array is greater than or equal to the number of subtasks to be assigned to the agents, then a subtask is assigned to the agent corresponding to each identifier in order of arrangement. These agents are then moved sequentially to the end of the two-dimensional agent array.
[0080] If the total number of agent identifiers in the two-dimensional agent array is less than the number of tasks to be assigned to agents, then the number of concurrent subtasks far exceeds the number of agents. In this case, a subtask is assigned to all agents, the relative order of the agent identifiers in the two-dimensional agent array remains unchanged, and all agents are placed in the first partition. Subsequently, other subtasks to be processed are assigned a subtask to the agent corresponding to the identifier in the first partition according to the sorting order; these agents are then moved sequentially to the end of the two-dimensional agent array.
[0081] In one embodiment, assigning each subtask to the corresponding first agent includes:
[0082] Send the identifiers of the first subtask and the agent corresponding to the second subtask to the first agent corresponding to the first subtask. The second subtask is a subtask executed after the first subtask. The agent identifier corresponding to the second subtask is used to indicate that after the first agent corresponding to the first subtask executes the first subtask, the execution result is sent to the agent corresponding to the agent identifier.
[0083] It should be noted that there is an execution order among the multiple subtasks. The result of the previous subtask needs to be sent to the agent of the next subtask to achieve data transfer, thereby enabling multi-agent collaborative processing of the initial task. In related technologies, the data transfer process is as follows: Figure 5 As shown, agent A and agent B are agents that process adjacent subtasks. Agent A needs to send the execution result to the task scheduling service device first, and then the task scheduling device forwards the execution result to agent B. The process is long and the data transmission efficiency is low.
[0084] In this embodiment of the invention, the identifiers of the first subtask and the agent corresponding to the second subtask are sent to the first agent corresponding to the first subtask. The second subtask is a subtask executed after the first subtask. The agent identifier corresponding to the second subtask is used to indicate that after the first agent corresponding to the first subtask executes the first subtask, the execution result is sent to the agent corresponding to the agent identifier. In this way, it is not necessary to forward the execution result through the task scheduling service device, which can effectively improve the data transmission efficiency.
[0085] In one embodiment, the method further includes:
[0086] Receive agent information from the second agent, which is an agent that has not processed the subtask;
[0087] The second intelligent agent is detected by nodes in the blockchain, and the detection result is obtained;
[0088] If the detection result indicates that the second agent is a normally functioning agent, the first agent type corresponding to the second agent is obtained;
[0089] If a fourth mapping relationship corresponding to the first agent type exists in the second preset mapping relationship set, a second execution node corresponding to the first agent type is determined based on the fourth mapping relationship, and agent information of the second agent is sent to the second execution node. The mapping relationships included in the second preset mapping relationship set are mapping relationships between different agent types and different execution nodes; and / or, if the fourth mapping relationship corresponding to the first agent type does not exist in the second preset mapping relationship set, a third execution node is randomly obtained based on the on-chain order of nodes in the blockchain, agent information of the second agent is sent to the third execution node, the fourth mapping relationship between the third execution node and the first agent type is established, and the fourth mapping relationship is added to the second preset mapping relationship set.
[0090] It should be noted that the above task allocation method is applied to, for example, Figure 6The intelligent agent platform shown here mainly includes the underlying blockchain and its smart contracts, the upper-layer intelligent agent platform and its registered intelligent agents, intelligent agent task scheduling service, and intelligent task allocation service.
[0091] Blockchain and its smart contracts mainly provide on-chain smart agent verification and smart agent availability verification. Smart contracts automatically generate sub-smart contracts based on smart agent type. The smart agent platform verifies the on-chain smart agents through blockchain and its smart contracts. After verification, tasks can be assigned to smart agents.
[0092] The task invocation service is used to receive tasks, parse tasks, and schedule tasks. It obtains information about which agents will execute one or more tasks through the task allocation service, and finally returns the results of multi-agent collaborative processing to the caller.
[0093] The task allocation service is primarily used to determine which agent should be assigned to a task. It sorts multiple agents on the execution node using two-dimensional agent data, with the agent ranked first receiving priority. The service can also initiate calls to the next agent for a task based on the agent's registered address in the blockchain, reducing data transmission and improving task execution efficiency.
[0094] Based on such Figure 6 The intelligent agent platform shown requires that the intelligent agent and the task be put on the blockchain before task allocation. Before putting the intelligent agent and the task on the blockchain, the organization to which the intelligent agent belongs and the intelligent agent contract also need to be put on the blockchain so that the blockchain nodes can verify the intelligent agent put on the blockchain.
[0095] The on-chain process for the organizations to which the intelligent agents belong includes the following steps: 1.1 The organizations to which the intelligent agents belong join the consortium blockchain. The administrator configures the necessary information for each organization on the operating platform corresponding to the consortium blockchain management node, and distributes the configuration and consortium blockchain code to each organization. 1.2 Each organization deploys the same consortium blockchain code with different configuration parameters on its own server, completing the consortium blockchain construction. 1.3 If more organizations to which the intelligent agents belong join the consortium blockchain later, steps 1.1 and 1.2 are repeated to allow them to join. After joining the consortium blockchain, the data in the current snapshot is synchronized. Once synchronization is complete, the organization becomes a normal node, receiving data and participating in the consensus process.
[0096] The aforementioned smart contract mainly includes metadata, an agent detection contract function, a smart agent grouping smart contract creation contract function, and a grouped smart agent task allocation contract. The agent detection contract function is used to detect the availability of smart agents. When a smart agent is added to the blockchain, it provides data structures such as the agent calling method (interface), input parameters, and return results. The main execution steps of this contract are: 1. Construct parameters based on the input parameter list; 2. Call the corresponding smart agent according to the agent calling method; 3. After receiving the return result, compare it with the expected return result structure. If it meets the requirements, the smart contract detection is successful; otherwise, the detection fails; 4. The agent detection contract function packages the successfully detected smart agent information and publishes it to the blockchain for consensus. After successful consensus, the smart agent can receive and execute subtasks. Thus, the agent monitoring contract function receives the smart agent information of a second smart agent (which has not yet processed subtasks); the second smart agent is detected by nodes in the blockchain to obtain the detection result.
[0097] Additionally, the creation contract function of the smart agent grouping smart contract is used to assign groups to smart agents after the availability test of the on-chain smart agents is successful. The main steps of this contract execution are: 1. Obtain the smart agent type of the on-chain smart agent that has successfully passed the availability test; 2. Check the second preset mapping relationship set between smart agent types and execution nodes stored in the blockchain. If a fourth mapping relationship for the first smart agent type exists in the second preset mapping relationship set, then determine the second execution node corresponding to the first smart agent type based on the fourth mapping relationship, and send the smart agent information of the second smart agent to the second execution node (i.e., if the key of the mapping relationship contains the smart agent type of the on-chain smart agent, then add the smart agent information of the smart agent to the value corresponding to the key, i.e., the smart agent group corresponding to the second execution node). Subsequently, the execution node can assign subtasks to the smart agent in the smart agent group. If no fourth mapping relationship exists, it means that a new type of smart agent has been published on the chain. At this time, proceed to the next step 3; 3. The new type of smart agent is published on the chain. That is, if there is no fourth mapping relationship corresponding to the first smart agent type in the second preset mapping relationship set, a new fourth mapping relationship needs to be created so that the new type of smart agent can be assigned subtasks. Specifically, the new type (type) and the fourth mapping relationship (Map) formed by the desired blockchain execution nodes (generally rotated according to the order in which consortium blockchain members are added to the chain) are packaged into a block and published to the blockchain for consensus. If consensus is successful, each blockchain node records the Map content into its local Map (if it is the first time a smart agent is added to the entire chain, there is no local Map structure at this time, so this Map can be used as a local Map for storage). The new type (type) is encoded into the group smart agent task allocation contract, and the contract is distributed to the second execution node of the blockchain. After receiving it, the second execution node can execute the group smart agent task allocation contract to provide the task scheduling service with information on candidate smart agents for task execution.
[0098] The aforementioned grouped agent task allocation contract is used to receive tasks to be processed and assign corresponding agents to complete the task processing. The core algorithm of this contract is the longest idle and fastest response task allocation algorithm, which effectively balances the user's need for rapid task processing with the task balance among multiple agents of the same task type, avoiding overly busy or underutilized agents and maintaining the healthy and orderly development of the agent ecosystem. Specifically, in this invention, subtask allocation can be achieved using a two-dimensional agent array.
[0099] In this embodiment of the invention, the system receives agent information of a second agent, which is an agent that has not processed any subtasks; the second agent is detected by nodes in the blockchain to obtain a detection result; if the detection result indicates that the second agent is a normally used agent, the system obtains a first agent type corresponding to the second agent; if a fourth mapping relationship corresponding to the first agent type exists in a second preset mapping relationship set, a second execution node corresponding to the first agent type is determined based on the fourth mapping relationship, and the agent information of the second agent is sent to the second execution node; the mapping relationships included in the second preset mapping relationship set are mapping relationships between different agent types and different execution nodes; and / or, if the fourth mapping relationship corresponding to the first agent type does not exist in the second preset mapping relationship set, a third execution node is randomly obtained based on the on-chain order of nodes in the blockchain, the agent information of the second agent is sent to the third execution node, the fourth mapping relationship between the third execution node and the first agent type is established, and the fourth mapping relationship is added to the second preset mapping relationship set. In this way, by detecting the agent information of the second agent and putting the second agent on the chain through the second preset mapping relationship set, the subtasks obtained by decomposition can be assigned to the second agent on the chain.
[0100] The aforementioned second intelligent agent can be an intelligent agent published to the blockchain by a consortium member to receive and execute relevant tasks. The intelligent agent's information includes data structure information such as interface, input parameters, and return results, as well as intelligent agent type information (the types of tasks the intelligent agent can execute). The intelligent agent's information is packaged into blocks and published to the blockchain. After consensus is reached, it is stored in various nodes of the blockchain. Subsequently, the smart contracts on each node of the blockchain begin execution. First, the intelligent agent detection contract function is executed; after the intelligent agent availability detection is successful, the intelligent agent grouping smart contract creation contract is executed; after the intelligent agents are grouped, the second intelligent agent is included in the task allocation list of the second execution node through the grouped intelligent agent task allocation contract, and the sorting order of tasks received by the intelligent agent is calculated according to the contract to provide task execution candidate intelligent agent information to the task scheduling service.
[0101] The intelligent agent platform can query information related to each intelligent agent in the blockchain at any time, such as availability, number of tasks executed, and task execution time.
[0102] In some implementations, the initial task may be that the requester sends the task to the task processing platform, the task processing platform packages the task into blocks, publishes them to the blockchain, and after consensus, stores them in various nodes of the blockchain.
[0103] Please see Figure 7 , Figure 7 This is a structural diagram of a task allocation device provided in an embodiment of the present invention, as shown below. Figure 7 As shown, the task allocation device 700 includes:
[0104] The decomposition module 701 is used to decompose the initial task into multiple subtasks and the task type corresponding to each subtask.
[0105] The first determining module 702 is used to determine the execution node corresponding to each subtask based on the first mapping relationship and the task type, wherein the first mapping relationship is a mapping relationship between different execution nodes and different task types;
[0106] The second determining module 703 is used to determine the first intelligent agent corresponding to each subtask. The first intelligent agent is the intelligent agent that has not processed the subtask or the intelligent agent that has been assigned the longest time since the last subtask. The multiple intelligent agents are the intelligent agents corresponding to the execution nodes.
[0107] The allocation module 704 is used to allocate each subtask to the corresponding first intelligent agent.
[0108] In one embodiment, the decomposition module 701 includes:
[0109] The decomposition submodule is used to decompose the initial task to obtain the multiple subtasks, as well as the task type and position code corresponding to each subtask. The position code of each subtask is used to represent the execution order. The position codes of two adjacent subtasks in the multiple subtasks are the same or different.
[0110] The second determining module 703 includes:
[0111] The first determining submodule is used to determine the first agent corresponding to the location code based on the second mapping relationship when there is a second mapping relationship corresponding to the location code of the first subtask in the first preset mapping relationship set. The second mapping relationship is the mapping relationship between the location codes corresponding to different subtasks and different agents, and the first subtask is one of the multiple subtasks.
[0112] In one embodiment, the second determining module 703 further includes:
[0113] The second determining submodule is used to determine multiple intelligent agents corresponding to the first execution node of the first subtask based on a third mapping relationship when there is no second mapping relationship corresponding to the position code of the first subtask in the first preset mapping relationship set. The third mapping relationship is a mapping relationship between different execution nodes and different intelligent agents.
[0114] The third determining submodule is used to determine the first intelligent agent corresponding to the first subtask from the plurality of intelligent agents.
[0115] In one embodiment, the task allocation device 700 further includes:
[0116] The construction module is used to construct the second mapping relationship based on the location encoding of the first subtask and the first agent;
[0117] An add module is used to add the second mapping relationship to the first preset mapping relationship set.
[0118] In one embodiment, the third determining submodule includes:
[0119] An acquisition unit is used to acquire an array of intelligent agents corresponding to the plurality of intelligent agents. The array of intelligent agents includes a first partition and / or a second partition. The plurality of subtasks are arranged sequentially in the first partition or the second partition. The first partition includes the identifiers of intelligent agents that have processed subtasks, and the second partition includes the identifiers of intelligent agents that have not processed subtasks.
[0120] The first setting unit is configured to, when the agent array includes the second partition, set the agent corresponding to the first identifier in the second partition as the first agent, delete the identifier of the first agent in the second partition, and add the identifier of the first agent to the last position of the first partition; and / or, when the agent array does not include the second partition, set the agent corresponding to the first identifier in the first partition as the first agent, and move the identifier of the first agent to the last position of the first partition.
[0121] In one embodiment, the allocation module 704 includes:
[0122] The allocation submodule is used to send the identifiers of the first subtask and the agent corresponding to the second subtask to the first agent corresponding to the first subtask. The second subtask is a subtask executed after the first subtask. The agent identifier corresponding to the second subtask is used to indicate that after the first agent corresponding to the first subtask executes the first subtask, the execution result will be sent to the agent corresponding to the agent identifier.
[0123] In one embodiment, the task allocation device 700 further includes:
[0124] A receiving module is used to receive agent information of a second agent, wherein the second agent is an agent that has not processed a subtask;
[0125] The detection module is used to detect the second intelligent agent through nodes in the blockchain and obtain the detection results;
[0126] The acquisition module is used to acquire the first agent type corresponding to the second agent when the detection result indicates that the second agent is a normally used agent.
[0127] The processing module is configured to: if a fourth mapping relationship corresponding to the first agent type exists in the second preset mapping relationship set, determine a second execution node corresponding to the first agent type based on the fourth mapping relationship, and send the agent information of the second agent to the second execution node; wherein the mapping relationships included in the second preset mapping relationship set are mapping relationships between different agent types and different execution nodes; and / or, if the fourth mapping relationship corresponding to the first agent type does not exist in the second preset mapping relationship set, randomly obtain a third execution node based on the on-chain order of nodes in the blockchain, send the agent information of the second agent to the third execution node, establish the fourth mapping relationship between the third execution node and the first agent type, and add the fourth mapping relationship to the second preset mapping relationship set.
[0128] The task allocation device provided in this embodiment of the invention is capable of achieving the above. Figure 1 The various processes and technical features of the embodiments of the task allocation method shown correspond one-to-one and can achieve the same technical effect. To avoid repetition, they will not be described again here.
[0129] It should be noted that the task allocation device in the embodiments of the present invention can be a device, or it can be a component, integrated circuit, or chip in an electronic device.
[0130] This invention also provides an electronic device, including: a processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the above-described functionality. Figure 1 The various processes of the task allocation method embodiment shown can achieve the same technical effect, and will not be described again here to avoid repetition.
[0131] For details, see Figure 8 As shown, this embodiment of the invention also provides an electronic device, including a bus 801, a transceiver 802, an antenna 803, a bus interface 804, a processor 805, and a memory 806.
[0132] The processor 805 is used to decompose the initial task into multiple subtasks and the task type corresponding to each subtask.
[0133] The processor 805 is further configured to determine the execution node corresponding to each subtask based on the first mapping relationship and the task type, wherein the first mapping relationship is a mapping relationship between different execution nodes and different task types;
[0134] The processor 805 is further configured to determine a first agent corresponding to each subtask, wherein the first agent is an agent among a plurality of agents that has not processed a subtask or an agent that has been in the longest time since the last subtask was assigned, and the plurality of agents are agents corresponding to the execution node.
[0135] The processor 805 is further configured to assign each subtask to the corresponding first intelligent agent.
[0136] In one embodiment, the decomposition of the initial task into multiple sub-tasks and the task type corresponding to each sub-task includes:
[0137] The initial task is decomposed to obtain multiple subtasks, and each subtask has a corresponding task type and position code. The position code of each subtask is used to represent the execution order. The position codes of two adjacent subtasks in the multiple subtasks may be the same or different.
[0138] The step of determining the first intelligent agent corresponding to each subtask includes:
[0139] If a second mapping relationship exists in the first preset mapping relationship set corresponding to the location code of the first subtask, the first agent corresponding to the location code is determined based on the second mapping relationship. The second mapping relationship is the mapping relationship between the location codes of different subtasks and different agents. The first subtask is one of the multiple subtasks.
[0140] In one embodiment, determining the first agent corresponding to each subtask further includes:
[0141] If there is no second mapping relationship corresponding to the position code of the first subtask in the first preset mapping relationship set, multiple intelligent agents corresponding to the first execution node of the first subtask are determined based on the third mapping relationship. The third mapping relationship is the mapping relationship between different execution nodes and different intelligent agents.
[0142] The first agent corresponding to the first subtask is determined from the plurality of agents.
[0143] In one embodiment, the processor 805 is further configured to construct the second mapping relationship based on the location encoding of the first subtask and the first intelligent agent;
[0144] The processor 805 is further configured to add the second mapping relationship to the first preset mapping relationship set.
[0145] In one embodiment, determining the first agent corresponding to the first subtask from the plurality of agents includes:
[0146] Obtain an array of agents corresponding to the plurality of agents. The array of agents includes a first partition and / or a second partition. The plurality of subtasks are arranged sequentially in the first partition or the second partition. The first partition includes the identifiers of agents that have processed subtasks, and the second partition includes the identifiers of agents that have not processed subtasks.
[0147] If the agent array includes the second partition, the agent corresponding to the first identifier in the second partition is set as the first agent, the identifier of the first agent in the second partition is deleted, and the identifier of the first agent is added to the last position of the first partition; and / or, if the agent array does not include the second partition, the agent corresponding to the first identifier in the first partition is set as the first agent, and the identifier of the first agent is moved to the last position of the first partition.
[0148] In one embodiment, assigning each subtask to the corresponding first agent includes:
[0149] Send the identifiers of the first subtask and the agent corresponding to the second subtask to the first agent corresponding to the first subtask. The second subtask is a subtask executed after the first subtask. The agent identifier corresponding to the second subtask is used to indicate that after the first agent corresponding to the first subtask executes the first subtask, the execution result is sent to the agent corresponding to the agent identifier.
[0150] In one embodiment, the transceiver 802 is used to receive agent information of a second agent, wherein the second agent is an agent that has not processed a subtask;
[0151] The processor 805 is also used to detect the second intelligent agent through nodes in the blockchain and obtain detection results;
[0152] The transceiver 802 is further configured to, when the detection result indicates that the second agent is a normally functioning agent, obtain the first agent type corresponding to the second agent;
[0153] The processor 805 is further configured to, when a fourth mapping relationship corresponding to the first agent type exists in the second preset mapping relationship set, determine a second execution node corresponding to the first agent type based on the fourth mapping relationship, and send agent information of the second agent to the second execution node, wherein the mapping relationships included in the second preset mapping relationship set are mapping relationships between different agent types and different execution nodes; and / or, when the fourth mapping relationship corresponding to the first agent type does not exist in the second preset mapping relationship set, randomly obtain a third execution node based on the on-chain order of nodes in the blockchain, send agent information of the second agent to the third execution node, establish the fourth mapping relationship between the third execution node and the first agent type, and add the fourth mapping relationship to the second preset mapping relationship set.
[0154] exist Figure 8 In this document, a bus architecture (represented by bus 801) is used. Bus 801 can include any number of interconnected buses and bridges, linking various circuits including one or more processors represented by processor 805 and memory represented by memory 806. Bus 801 can also link various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. Bus interface 804 provides an interface between bus 801 and transceiver 802. Transceiver 802 can be a single element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices over a transmission medium. Data processed by processor 805 is transmitted over a wireless medium via antenna 803, which further receives data and transmits data to processor 805.
[0155] The processor 805 manages the bus 801 and handles general processing, and also provides various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. The memory 806 can be used to store data used by the processor 805 during operation.
[0156] Optionally, the processor 805 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or a graphics processing unit (GPU).
[0157] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, performs the above-described functions. Figure 1 The various processes corresponding to the task allocation method embodiments achieve the same technical effect, and will not be described again here to avoid repetition. The computer-readable storage medium mentioned includes, for example, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0158] The present invention also provides a computer program product, including computer instructions that, when executed by a processor, implement the above-described... Figure 1 The various processes of the corresponding task allocation method embodiments can achieve the same technical effect, and will not be described again here to avoid repetition.
[0159] In the embodiments of this invention, the terms "first," "second," etc., are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or devices. Additionally, the use of "and / or" in this application indicates at least one of the connected objects, such as A and / or B and / or C, representing eight possibilities: A alone, B alone, C alone, both A and B present, both B and C present, both A and C present, and A, B, and C present.
[0160] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0161] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or second terminal device, etc.) to execute the methods of the various embodiments of this application.
[0162] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A task allocation method, characterized in that, include: The initial task is broken down into multiple subtasks, and each subtask corresponds to a task type. The execution node corresponding to each subtask is determined based on the first mapping relationship and the task type, wherein the first mapping relationship is the mapping relationship between different execution nodes and different task types; Determine the first agent corresponding to each subtask. The first agent is either the agent that has not processed the subtask or the agent that has been assigned the longest time since the last subtask. The multiple agents are the agents corresponding to the execution nodes. Each subtask is assigned to the corresponding first agent; The process of decomposing the initial task into multiple sub-tasks and the corresponding task type for each sub-task includes: The initial task is decomposed to obtain multiple subtasks, and each subtask has a corresponding task type and position code. The position code of each subtask is used to represent the execution order. The position codes of two adjacent subtasks in the multiple subtasks may be the same or different. The step of determining the first intelligent agent corresponding to each subtask includes: If a second mapping relationship exists in the first preset mapping relationship set, corresponding to the location code of the first subtask, the first agent corresponding to the location code is determined based on the second mapping relationship. The second mapping relationship is the mapping relationship between the location codes of different subtasks and different agents. The first subtask is one of the multiple subtasks. The step of determining the first intelligent agent corresponding to each subtask further includes: If there is no second mapping relationship corresponding to the position code of the first subtask in the first preset mapping relationship set, multiple intelligent agents corresponding to the first execution node of the first subtask are determined based on the third mapping relationship. The third mapping relationship is the mapping relationship between different execution nodes and different intelligent agents. The first agent corresponding to the first subtask is determined from the plurality of agents.
2. The method as described in claim 1, characterized in that, After determining the first agent corresponding to the first subtask from the plurality of agents, the method further includes: The second mapping relationship is constructed based on the location encoding of the first subtask and the first agent; Add the second mapping relationship to the first preset mapping relationship set.
3. The method as described in claim 1, characterized in that, Determining the first intelligent agent corresponding to the first subtask from the plurality of intelligent agents includes: Obtain an array of agents corresponding to the plurality of agents. The array of agents includes a first partition and / or a second partition. The plurality of subtasks are arranged sequentially in the first partition or the second partition. The first partition includes the identifiers of agents that have processed subtasks, and the second partition includes the identifiers of agents that have not processed subtasks. If the agent array includes the second partition, the agent corresponding to the first identifier in the second partition is set as the first agent, the identifier of the first agent in the second partition is deleted, and the identifier of the first agent is added to the last position of the first partition; and / or, if the agent array does not include the second partition, the agent corresponding to the first identifier in the first partition is set as the first agent, and the identifier of the first agent is moved to the last position of the first partition.
4. The method according to any one of claims 1 to 3, characterized in that, Assigning each subtask to the corresponding first agent includes: Send the identifiers of the first subtask and the agent corresponding to the second subtask to the first agent corresponding to the first subtask. The second subtask is a subtask executed after the first subtask. The agent identifier corresponding to the second subtask is used to indicate that after the first agent corresponding to the first subtask executes the first subtask, the execution result is sent to the agent corresponding to the agent identifier.
5. The method according to any one of claims 1 to 3, characterized in that, The method further includes: Receive agent information from the second agent, which is an agent that has not processed the subtask; The second intelligent agent is detected by nodes in the blockchain, and the detection result is obtained; If the detection result indicates that the second agent is a normally functioning agent, the first agent type corresponding to the second agent is obtained; If a fourth mapping relationship corresponding to the first agent type exists in the second preset mapping relationship set, a second execution node corresponding to the first agent type is determined based on the fourth mapping relationship, and agent information of the second agent is sent to the second execution node. The mapping relationships included in the second preset mapping relationship set are mapping relationships between different agent types and different execution nodes; and / or, if the fourth mapping relationship corresponding to the first agent type does not exist in the second preset mapping relationship set, a third execution node is randomly obtained based on the on-chain order of nodes in the blockchain, agent information of the second agent is sent to the third execution node, the fourth mapping relationship between the third execution node and the first agent type is established, and the fourth mapping relationship is added to the second preset mapping relationship set.
6. A task allocation device, characterized in that, include: The decomposition module is used to decompose the initial task into multiple subtasks and the task type corresponding to each subtask. The first determining module is used to determine the execution node corresponding to each subtask based on the first mapping relationship and the task type, wherein the first mapping relationship is a mapping relationship between different execution nodes and different task types; The second determining module is used to determine the first intelligent agent corresponding to each subtask. The first intelligent agent is either the intelligent agent that has not processed the subtask or the intelligent agent that has been assigned the longest time since the last subtask. The multiple intelligent agents are the intelligent agents corresponding to the execution nodes. An allocation module is used to allocate each subtask to the corresponding first intelligent agent; The decomposition module includes: The decomposition submodule is used to decompose the initial task to obtain the multiple subtasks, as well as the task type and position code corresponding to each subtask. The position code of each subtask is used to represent the execution order. The position codes of two adjacent subtasks in the multiple subtasks are the same or different. The second determining module includes: The first determining submodule is used to determine the first agent corresponding to the location code based on the second mapping relationship when there is a second mapping relationship corresponding to the location code of the first subtask in the first preset mapping relationship set. The second mapping relationship is the mapping relationship between the location codes corresponding to different subtasks and different agents. The first subtask is one of the multiple subtasks. The second determining module further includes: The second determining submodule is used to determine multiple intelligent agents corresponding to the first execution node of the first subtask based on a third mapping relationship when there is no second mapping relationship corresponding to the position code of the first subtask in the first preset mapping relationship set. The third mapping relationship is a mapping relationship between different execution nodes and different intelligent agents. The third determining submodule is used to determine the first intelligent agent corresponding to the first subtask from the plurality of intelligent agents.
7. An electronic device, characterized in that, Including transceivers and processors, The processor is used to decompose the initial task into multiple subtasks and the task type corresponding to each subtask. The processor is further configured to determine the execution node corresponding to each subtask based on the first mapping relationship and the task type, wherein the first mapping relationship is a mapping relationship between different execution nodes and different task types; The processor is further configured to determine a first agent corresponding to each subtask, wherein the first agent is an agent among a plurality of agents that has not processed a subtask or an agent that has been in the longest time since the last subtask was assigned, and the plurality of agents are agents corresponding to the execution node. The processor is further configured to assign each subtask to the corresponding first intelligent agent; The process of decomposing the initial task into multiple sub-tasks and the corresponding task type for each sub-task includes: The initial task is decomposed to obtain multiple subtasks, and each subtask has a corresponding task type and position code. The position code of each subtask is used to represent the execution order. The position codes of two adjacent subtasks in the multiple subtasks may be the same or different. The step of determining the first intelligent agent corresponding to each subtask includes: If a second mapping relationship exists in the first preset mapping relationship set, corresponding to the location code of the first subtask, the first agent corresponding to the location code is determined based on the second mapping relationship. The second mapping relationship is the mapping relationship between the location codes of different subtasks and different agents. The first subtask is one of the multiple subtasks. The step of determining the first intelligent agent corresponding to each subtask further includes: If there is no second mapping relationship corresponding to the position code of the first subtask in the first preset mapping relationship set, multiple intelligent agents corresponding to the first execution node of the first subtask are determined based on the third mapping relationship. The third mapping relationship is the mapping relationship between different execution nodes and different intelligent agents. The first agent corresponding to the first subtask is determined from the plurality of agents.
8. An electronic device, characterized in that, include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the steps of the task allocation method as described in any one of claims 1 to 5.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the task allocation method as described in any one of claims 1 to 5.
10. A computer program product, characterized in that, It includes computer instructions that, when executed by a processor, implement the steps of the task allocation method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Dialogue method, model training method and equipment
CN118689972A
Data sharing system and method for realizing multi-agent interaction
CN120277143A