Task scheduling method and device, medium and product
By receiving task information, agent modeling and dynamic task allocation, the problems of low resource utilization and insufficient execution efficiency in multi-agent systems are solved, and efficient and stable task scheduling is achieved.
Patent Information
- Application Number
- CN202510849043.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-24
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2045-06-24
AI Technical Summary
In the prior art, reinforcement learning methods require a large amount of resources and are difficult to coordinate with multiple agents. In actual application of game theory methods, the agent information is insufficient, and the model adaptation is slow, which affects the system efficiency and stability.
By receiving task information, the agent model is carried out to determine the capability portrait of each agent, the tasks are sorted, and tasks are dynamically allocated according to the operating system scheduling algorithm, maximizing resource utilization and optimizing task execution performance.
Implement efficient and stable task scheduling of multi-agent systems in complex environments, improve resource utilization and optimize task execution performance.
Smart Images

Figure CN120353561A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular, to a task scheduling method, device, medium and product. Background Art
[0002] Task scheduling in a multi-agent system achieves an optimal execution effect by reasonably allocating tasks to each agent, mainly divided into static scheduling and dynamic scheduling. Among them, deep learning and reinforcement learning methods such as Deep Q-Network, Deep Deterministic Policy Gradient, etc. have been applied to multi-agent task scheduling, which can adjust the scheduling strategy in a dynamic environment to improve system efficiency.
[0003] However, reinforcement learning methods require a large amount of training data and computing resources, and it is difficult to effectively coordinate the strategies of multiple agents in multi-agent cooperation. There are also game theory-based methods that take each agent as a game participant to adopt strategies to maximize its utility. However, game theory and mechanism design mostly assume that the system environment is static or changes slowly. In practical applications, agents may not be able to obtain all the information of the environment, resulting in the game model being unable to quickly adapt to the changing environment, affecting system efficiency and stability.
[0004] In view of the above, how to solve the problems in current task scheduling that reinforcement learning requires a large amount of resources and it is difficult to coordinate multiple agents, and the game theory method has insufficient agent information, slow model adaptation, and affects system efficiency and stability in practical applications is an urgent problem for those skilled in the art. Summary of the Invention
[0005] The present invention provides a task scheduling method, device, medium and product to solve the problems in current task scheduling that reinforcement learning requires a large amount of resources and it is difficult to coordinate multiple agents, and the game theory method has insufficient agent information, slow model adaptation, and affects system efficiency and stability.
[0006] The present invention provides a task scheduling method applied to a heterogeneous multi-agent system; the method includes: Receiving a plurality of tasks and determining corresponding task information; wherein the task information at least includes task priority, deadline and task requirements; Performing agent modeling on the existing multiple agents to determine the ability portraits of each agent; wherein the ability portrait at least includes the task execution ability, current task execution situation and agent resources of the corresponding agent; Broadcasting each task to each agent, and controlling each agent to transmit the corresponding ability portrait to the remaining agents respectively; Sorting each task according to each task information to generate a task sequence; According to the task sequence and the operating system scheduling algorithm, each task is sequentially assigned to the corresponding agent to facilitate the agent to execute the task.
[0007] The present invention also provides an electronic device, including: a memory for storing a computer program; a processor for implementing the steps of any one of the above task scheduling methods when executing the computer program.
[0008] The present invention also provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the steps of any one of the above task scheduling methods are implemented.
[0009] The present invention also provides a computer program product, including a computer program, and when the computer program is executed by a processor, the steps of any one of the above task scheduling methods are implemented.
[0010] The beneficial effects of the present invention are as follows: by receiving tasks and determining the corresponding task information, agent modeling is performed on multiple existing agents to determine the ability portraits of each agent, clarifying the basic information of the tasks to be executed and the task execution capabilities of each agent in the system, thereby constituting the basis for multi-agent collaboration; considering the resource competition and coordination problems in agent task allocation, when performing task scheduling, the tasks are sorted to generate a task sequence, and according to the task sequence, each ability portrait, and the operating system scheduling algorithm, each task is sequentially assigned to the corresponding agent, which can dynamically adjust the task allocation strategy according to the characteristics of the agent and the importance of the task, maximize the resource utilization rate, and optimize the task execution performance, thus meeting the high-efficiency and stable task scheduling requirements of the multi-agent system in complex environments.
[0011] In addition, the present invention also provides a task scheduling device, medium, and product with the same effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the embodiments of the present invention, the drawings required for the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can obtain other drawings based on these drawings without creative efforts.
[0013] Figure 1 It is a flowchart of a task scheduling method provided by an embodiment of the present invention; Figure 2 It is a schematic diagram of the multi-agent task scheduling principle provided by an embodiment of the present invention; Figure 3 It is a schematic diagram of a task scheduling device provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0014] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0015] It should be noted that in the description of the present invention, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. The terms "first", "second", etc. in the present invention are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0016] In order to enable those skilled in the art of the present technology to better understand the solution of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0017] Currently, task scheduling in multi-agent systems achieves optimal execution effects by reasonably allocating tasks to each agent, mainly divided into static scheduling and dynamic scheduling. Static scheduling methods such as genetic algorithms and particle swarm optimization can achieve better results when task and resource information is stable, but they have poor adaptability to dynamic environments. Dynamic scheduling methods consider the characteristics of task and resource information changing over time, and dynamically allocate tasks in combination with monitoring and feedback mechanisms to improve the flexibility and robustness of the system. Deep learning and reinforcement learning methods such as deep Q-network and deep deterministic policy gradient have been applied to multi-agent task scheduling, which can adjust scheduling strategies in dynamic environments to improve system efficiency. However, reinforcement learning methods require a large amount of training data and computing resources, and effectively coordinating the strategies of multiple agents in multi-agent cooperation is still a challenge. Some people also adopt methods based on game theory, regarding each agent as a game participant to adopt strategies to maximize its utility. However, game theory and mechanism design mostly assume that the system environment is static or changes slowly. In practical applications, agents may not be able to obtain all information about the environment, resulting in the game model being unable to quickly adapt to the changing environment, affecting system efficiency and stability. To solve the above problems, the present invention provides a task scheduling method.
[0018] It should be noted that the method provided by the present invention is applied to heterogeneous multi-agent systems. Heterogeneous multi-agent systems are composed of agents with different capabilities, structures and functions, and achieve efficient execution of complex tasks through cooperation and sharing. The task scheduling method will be described in detail below with reference to specific embodiments.
[0019] Figure 1 The flowchart of a task scheduling method provided by an embodiment of the present invention. As Figure 1 shown, the method includes: S10: Receive multiple tasks and determine the corresponding task information.
[0020] Among them, the task information includes at least task priority, deadline, and task requirements.
[0021] First, the system receives multiple tasks and determines the task information corresponding to each task. It can be understood that the tasks that the intelligent agent can handle include but are not limited to understanding and executing user instructions, providing detailed and helpful answers by networking or processing files, and can also handle other types of tasks, which will not be elaborated here.
[0022] It should be noted that the task information includes at least task priority, deadline, and task requirements. Among them, the task priority refers to the priority degree of the current task execution; the deadline is the last allowed time for the task to complete execution; the task requirements refer to the resources required for task execution, including but not limited to physical resources and network resources, etc. Therefore, the task can be represented as , is the i-th task, is the task priority of task i, is the deadline of task i, is the task requirement of task i. In addition, the task information may also contain other content, depending on the specific implementation situation.
[0023] S11: Perform agent modeling on the existing multiple agents to determine the ability portraits of each agent.
[0024] Among them, the ability portrait includes at least the task execution ability, the current task execution situation, and the agent resources of the corresponding agent.
[0025] Furthermore, perform agent modeling on the multiple agents that currently exist in the system to determine the ability portraits of each agent. The agent set is represented as , where is the agent, . It should be noted that agent modeling is a process of describing and abstracting the capabilities and states of each agent. Specifically, it includes ability modeling, which describes various skills, functions, or the ability to handle specific tasks that the agent possesses; state modeling, which describes the current situation or attributes of the agent.
[0026] After completing the agent modeling, an ability profile of the agent is obtained. It should be noted that the ability profile at least includes the task execution ability, the current task execution status, and the agent resources of the corresponding agent. Among them, the task execution ability refers to the functional capabilities and task types that the agent possesses; the current task execution status indicates whether the agent is currently executing a task or is idle; the agent resources represent the available resources that the agent currently has. For example, in a large model training or inference environment, the agent can currently call a graphics processing unit. Therefore, the agent 's ability profile can be expressed as ; is the task execution ability of the agent , is the current task execution status of the agent , is the agent resources of the agent . In addition, the ability profile may also include other contents, depending on the specific implementation situation.
[0027] S12: Broadcast each task to each agent, and control each agent to transmit the corresponding ability profile to the other agents respectively.
[0028] S13: Sort each task according to each task information to generate a task sequence.
[0029] Subsequently, broadcast each task to each agent, and control each agent to transmit its own ability profile to the other agents respectively, so as to facilitate the execution of subsequent tasks. It should be noted that in this embodiment, the specific process of controlling each agent to transmit the corresponding ability profile to the other agents is not limited and depends on the specific implementation situation.
[0030] Furthermore, sort each task according to each task information to generate a task sequence. It should be noted that in this embodiment, the specific task information content involved in task sorting is not limited. For example, task priorities can be used, or deadlines can be used, or task requirements can be determined, or multiple parameters can be combined to sort each task. In addition, the specific order of task sorting in this embodiment is not limited and depends on the specific implementation situation.
[0031] S14: According to the task sequence, each ability profile, and the operating system scheduling algorithm, allocate each task to the corresponding agent in turn, so as to facilitate the agent to execute the task.
[0032] Finally, according to the task sequence, the ability portraits of each agent, and the operating system scheduling algorithm, each task is sequentially assigned to the corresponding agent to facilitate the agent to execute and process the corresponding task. It should be noted that the operating system scheduling algorithm is used to reasonably allocate the agent time to different tasks to improve the system efficiency and response speed. Common algorithms include priority scheduling, round-robin scheduling, and time slice round-robin, etc. In this embodiment, the specific type of the selected operating system scheduling algorithm is not limited and depends on the specific implementation situation.
[0033] In this embodiment, by receiving tasks and determining the corresponding task information, agent modeling is performed on multiple existing agents to determine the ability portraits of each agent, clarifying the basic information of each task to be executed and the task execution capabilities of each agent in the system, thus forming the basis for multi-agent collaboration; considering the resource competition and coordination issues in agent task allocation, when performing task scheduling, the tasks are sorted to generate a task sequence, and according to the task sequence, each ability portrait, and the operating system scheduling algorithm, each task is sequentially assigned to the corresponding agent, which can dynamically adjust the task allocation strategy according to the characteristics of the agent and the importance of the task, maximize the resource utilization rate, and optimize the task execution performance, thereby meeting the efficient and stable task scheduling requirements of the multi-agent system in complex environments.
[0034] Based on the above embodiments, in some embodiments, receiving multiple tasks and determining the corresponding task information includes: S101: Receive multiple tasks and construct a task set.
[0035] S102: Determine the dependency information corresponding to each task.
[0036] Among them, the dependency information represents the sequence and / or restrictive relationship of the corresponding task with the execution of the remaining tasks.
[0037] S103: Construct a directed acyclic graph of the task set according to each dependency information.
[0038] Specifically, when receiving tasks and determining task information, receive multiple tasks and construct a task set , where n is a positive integer. Further determine the dependency information corresponding to each task. It should be noted that the dependency information represents the sequence and / or restrictive relationship of the corresponding task with the execution of the remaining tasks, that is, some tasks need to be executed after other tasks are completed. Finally, construct a directed acyclic graph of the task set according to each dependency information . Among them, , is 's prerequisite task.
[0039] It should be noted that a directed acyclic graph (DAG) is a graphical structure used to represent the dependencies between tasks. Among them, "directed" means that the task dependencies have a sequential order, and some tasks can only be executed after other tasks are completed; "acyclic" means that the task dependencies do not form a cycle, avoiding deadlocks in the dependencies. In this embodiment, by constructing a directed acyclic graph, the system can clearly understand the dependencies between tasks, which helps to reasonably plan the execution order and scheduling strategy of tasks.
[0040] Based on the above embodiment, in some embodiments, controlling each agent to transmit the corresponding ability portrait to the other agents respectively includes: S111: Construct a joint structure of agent ability states according to each ability portrait.
[0041] Among them, the joint structure of agent ability states represents the role abilities and state distributions of all current agents.
[0042] S112: Control each agent to transmit the corresponding task execution situation, agent resources, and the joint structure of agent ability states to the other agents respectively.
[0043] In a specific implementation, when agents exchange their respective ability portraits with each other, it is necessary to construct a joint structure of agent ability states according to each ability portrait. 。
[0044] It should be noted that the joint structure of agent ability states represents the role abilities and state distributions of all current agents, and this structure is an aggregated representation of the ability portraits of all agents. Therefore, when agents exchange their respective ability portraits with each other, it is also necessary to control each agent to transmit the corresponding task execution situation, agent resources, and the joint structure of agent ability states to the other agents respectively.
[0045] In this embodiment, by each agent transmitting the corresponding task execution situation, agent resources, and the joint structure of agent ability states to the other agents respectively, the system can clarify the ability roles of each agent and the overall ability of the current system, so as to facilitate the dynamic optimization of subsequent task planning and the reasonable allocation of resources.
[0046] Based on the above embodiment, in some embodiments, sorting each task according to each task information includes: S121: Sort each task in descending order according to the task priority corresponding to each task to generate an initial task sequence.
[0047] S122: Determine whether there are tasks with the same corresponding task priority in the initial task sequence. If not, go to step S126; if so, go to step S123.
[0048] S123: Determine tasks with the same task priority as the tasks to be adjusted.
[0049] S124: Sort the tasks to be adjusted in ascending order according to the deadline corresponding to each task to be adjusted to generate an adjusted task sequence.
[0050] S125: Update the initial task sequence according to the adjusted task sequence to generate a task sequence.
[0051] S126: Determine the initial task sequence as the task sequence.
[0052] In this embodiment, in order to sort each task, specifically sort each task in descending order according to the task priority corresponding to each task to generate an initial task sequence. Further determine whether there are tasks with the same task priority in the initial task sequence. If it is confirmed that there are no tasks with the same task priority, directly determine the initial task sequence as the task sequence . It can be understood that is the priority sorting of task i, is the task priority of task i.
[0053] If it is confirmed that there are tasks with the same task priority, in order to perform further sorting, specifically determine the tasks with the same task priority as the tasks to be adjusted. Subsequently, sort the tasks to be adjusted in ascending order according to the deadline corresponding to each task to be adjusted to generate an adjusted task sequence. Finally, update the initial task sequence according to the adjusted task sequence, that is, use the arrangement order of each task to be adjusted in the adjusted task sequence to replace the arrangement order of each task to be adjusted in the initial task sequence to generate the final task sequence.
[0054] In this embodiment, sorting each task according to the task priority and deadline of each task to generate a task sequence to be processed can ensure that tasks with higher importance and urgency are processed first, improving the task processing efficiency.
[0055] Figure 2 is a schematic diagram of the multi-agent task scheduling principle provided by the embodiment of the present invention. On the basis of the above embodiment, in some embodiments, as Figure 2 shown, according to the task sequence, each ability profile, and the operating system scheduling algorithm, each task is sequentially assigned to the corresponding agent, including: S131: Determine whether the task has corresponding uncompleted prerequisite tasks and / or predecessor tasks according to the directed acyclic graph; if so, go to step S132; if not, go to step S133.
[0056] S132: Determine that the task does not participate in the scheduling assignment for the time being.
[0057] S133: Determine candidate agents in each agent whose corresponding task execution capabilities are greater than the task requirements of the task.
[0058] S134: Determine the ability redundancy value of each candidate agent according to the task execution capabilities of each candidate agent and the task requirements of the task.
[0059] S135: Determine the candidate agent with the largest corresponding ability redundancy value as the first target agent, and assign the task to the first target agent.
[0060] In this embodiment, in order to implement task allocation, all tasks in the task sequence are specifically traversed, and it is judged whether there are corresponding uncompleted prerequisite tasks and / or predecessor tasks for the task according to the directed acyclic graph. If it is confirmed that the task has corresponding uncompleted prerequisite tasks and / or predecessor tasks, it is considered that the current task cannot be scheduled for execution, and it is determined that the task will not participate in the scheduling allocation for the time being, and the scheduling and allocation of the task can be performed again after a period of time.
[0061] If it is confirmed that the task has no corresponding uncompleted prerequisite tasks and predecessor tasks, it is considered that the current task can be scheduled for execution. Specifically, candidate agents whose corresponding task execution capabilities are greater than the task requirements of the task are determined in each agent, that is , is the task execution capability of the candidate agent , is the currently schedulable task 's task requirements.
[0062] Finally, according to the task execution capabilities of each candidate agent and the task requirements of the task, the ability redundancy value of each candidate agent is determined, that is ; The candidate agent with the largest corresponding ability redundancy value is determined as the first target agent, so as to assign the task to the first target agent. The formula is as follows: ; In this embodiment, through the modeling of task dependencies and the detection of scheduling logic, logical conflicts and resource competition in task execution can be effectively avoided, ensuring the feasibility of task planning; at the same time, the matching mechanism based on the agent ability profile can dynamically adjust the task allocation strategy according to the characteristics of the agent, maximizing resource utilization and optimizing task execution performance.
[0063] Based on the above embodiments, in some embodiments, after sequentially assigning each task to the corresponding agent according to the task sequence, each ability profile, and the operating system scheduling algorithm, it further includes: S136: Receive the task status, task progress, task execution time, and resource consumption data fed back by each agent according to the time slice period.
[0064] S137: Determine the estimated task completion time for each task corresponding to each agent according to the task execution capabilities of each agent and the task requirements of the task being executed.
[0065] S138: Update the joint structure of agent capabilities according to each resource consumption data.
[0066] In order to monitor the task execution situation, after successively allocating each task to the corresponding agent according to the task sequence, each ability profile, and the operating system scheduling algorithm, it is also necessary to receive the task status, task progress, task execution time, and resource consumption data feedback by each agent according to the time slice cycle.
[0067] It should be noted that in this embodiment, the specific size of the time slice cycle is not limited and is determined according to the specific implementation situation. In addition, the task status is the phased status of the task in the life cycle; the task progress is the execution percentage or the number of execution rounds of the task; the task execution time is the duration for which the task has been executed by the agent; and the resource consumption data is the actual resources consumed by the agent during the execution of the task.
[0068] Furthermore, according to the task execution capabilities of each agent and the task requirements of the task being executed , determine the estimated task completion time for each task corresponding to each agent. The formula is as follows: ; where is the estimated task completion time of task .
[0069] Finally, update the joint structure of agent capabilities according to each resource consumption data. The formula is as follows: ; where is the updated joint structure of agent capabilities, is the joint structure of agent capabilities before update, is the resource consumption data.
[0070] In this way, by monitoring the task execution situation and updating the joint structure of agent capabilities, the system can better understand the current situation of each agent, so as to facilitate possible new task allocation and adjustment of existing tasks in the future.
[0071] In order to detect task conflicts of agents, based on the above embodiments, in some embodiments, the method further includes: S141: When an agent is assigned multiple tasks, determine the sum of the task requirements of each task under the agent.
[0072] S142: Determine whether the sum of task requirements is greater than the task execution ability of the agent; if so, proceed to step S143; if not, end.
[0073] S143: Confirm that there is a current task conflict for the agent, and end the task processing process of the agent.
[0074] Specifically, when the agent is assigned multiple tasks, determine the sum of the task requirements of each task under the agent. It should be noted that in this embodiment, the number of tasks assigned to the agent is not limited and depends on the specific implementation situation. It should also be noted that when the agent is assigned multiple tasks, it does not necessarily need to execute the tasks simultaneously. Each task may be scheduled and assigned to the agent at different times, but all need to occupy the task execution ability of the agent.
[0075] Furthermore, determine whether the sum of task requirements is greater than the task execution ability of the agent. Taking the example where the agent is assigned two tasks: ; Among them, is the sum of the task requirements of task and task , is the task execution ability of the agent.
[0076] If it is confirmed that the sum of task requirements is not greater than the task execution ability of the agent, return 0 to indicate that there is no current task conflict for the agent. If it is confirmed that the sum of task requirements is greater than the task execution ability of the agent, return 1 to indicate that there is a current task conflict for the agent, and end the task processing process of the agent. In this way, the conflict detection of the agent's task execution is realized.
[0077] In some embodiments, if it is confirmed that there is a current task conflict for the agent, the method further includes: S144: Determine the last assigned task among each task under the agent as the task to be migrated.
[0078] S145: Determine candidate agents among the other agents whose corresponding task execution ability is greater than the task requirements of the task to be migrated.
[0079] S146: Determine the ability redundancy value of each candidate agent according to the task execution ability of each candidate agent and the task requirements of the task to be migrated.
[0080] S147: Determine the candidate agent with the largest corresponding ability redundancy value as the second target agent, and assign the task to the second target agent.
[0081] In this embodiment, if it is confirmed that there is a task conflict for the agent currently, it is also necessary to reallocate the conflicting tasks. Specifically, the last allocated task among the tasks of the agent is determined as the task to be migrated. For example, for the tasks of the agent and the task , the task is the task to be migrated.
[0082] Further, among the other agents, candidate agents whose corresponding task execution capabilities are greater than the task requirements of the task to be migrated are determined, that is , is the candidate agent 's task execution capability, is the task requirement of the task to be migrated . According to the task execution capabilities of the candidate agents and the task requirements of the task to be migrated, the ability redundancy values of the candidate agents are determined, that is . Finally, the candidate agent with the largest corresponding ability redundancy value is determined as the second target agent to allocate the task to the second target agent. The formula is specifically as follows: ; In this embodiment, a conflict feedback mechanism is introduced, and through monitoring and adjustment strategies, the dynamic optimization of task planning and the reasonable allocation of agent resources are achieved, significantly improving the adaptability and efficiency of task scheduling.
[0083] In order to determine the task completion status, based on the above embodiment, in some embodiments, after sequentially allocating each task to the corresponding agent according to the task sequence, each ability profile, and the operating system scheduling algorithm, it further includes: S151: Monitor the task execution time corresponding to each agent.
[0084] S152: Determine the remaining task execution time of each agent according to the task execution time of each agent and the task expected completion time.
[0085] S153: Determine whether the remaining task execution time of each agent is not greater than 0; if so, go to step S154; if not, return to step S151.
[0086] S154: Confirm that the task execution of the corresponding agent is completed, and output a prompt message indicating that the task of the corresponding agent is completed.
[0087] Specifically, after completing the task scheduling and allocation, it is also necessary to monitor the task execution time corresponding to each agent . According to the task execution time of each agent and the task expected completion time , determine the remaining execution time of each agent's task. The specific formula is as follows: ; where is the remaining execution time of the agent's task.
[0088] Subsequently, determine whether the remaining execution time of each agent's task is not greater than 0. If it is confirmed that the remaining execution time of the agent's task is greater than 0, it is confirmed that the task of the corresponding agent is not completed, and return to the step of monitoring the task execution time of each agent. If it is confirmed that the remaining execution time of the agent's task is not greater than 0, it is confirmed that the task execution of the corresponding agent is completed, and a prompt message indicating the completion of the corresponding agent's task is output.
[0089] In addition, in some embodiments, after confirming the task completion, it is also necessary to recycle the agent resources. Therefore, after confirming the completion of the task execution of the corresponding agent, it further includes: S155: Update the task completion status of all agents. S156: Recycle the resources occupied by the agent whose task execution is completed into the agent-capability status joint structure.
[0090] Specifically, first update the task completion status of all agents, and then recycle the resources occupied by the agent whose task execution is completed into the agent-capability status joint structure, as follows: ; where is the agent-capability status joint structure after resource recycling, is the agent-capability status joint structure before resource recycling; is the agent resource recycled this time, which is the same as the task requirement size of the corresponding completed task.
[0091] In summary, after completing the task allocation, the task completion status is determined in real time and the corresponding agent resources are recycled, so as to facilitate the allocation of new tasks and improve the flexibility of task planning and the optimal utilization of agent resources.
[0092] Based on the above embodiments, in some embodiments, after confirming the completion of the task execution of the corresponding agent, it further includes: S157: Determine the deadline, the expected task completion time, and the remaining execution time of the uncompleted tasks; S158: Determine the urgency of the uncompleted tasks according to the corresponding deadline and the remaining execution time; S159: Determine the new task priority of the uncompleted tasks according to the corresponding urgency and the expected task completion time, and return to step S13.
[0093] In this embodiment, after confirming that the task execution of the corresponding agent is completed, it is also necessary to adjust the order of the tasks that are still not completed in the current task sequence. Specifically, determine the deadline, the expected task completion time, and the remaining task execution time corresponding to the uncompleted tasks; determine the urgency of the uncompleted tasks according to the corresponding deadline and the remaining task execution time; determine the new task priority of the uncompleted tasks according to the corresponding urgency and the expected task completion time. The specific formula is as follows: ; Wherein, is the new task priority of the uncompleted task ; is the weight; is the urgency of the task , specifically, it is the difference between the deadline of the task and the remaining task execution time ; is the expected task completion time of the task .
[0094] In this embodiment, by dynamically adjusting the task priority, the scheduler can comprehensively consider the task urgency and resource matching degree in the next round of allocation, improving the task processing efficiency.
[0095] Based on the above embodiment, in some embodiments, the method further includes: S161: When the agent completes the corresponding task, control the agent to share the corresponding agent resources with the other agents.
[0096] S162: Control the agent to generate the task execution strategy used when executing the corresponding task, and share the task execution strategy with the other agents.
[0097] Specifically, when the agent completes the corresponding task, in order to improve the processing efficiency of the other tasks, in this embodiment, it is also necessary to control the agent to share the corresponding agent resources with the other agents. At the same time, control the agent to generate the task execution strategy used when executing the corresponding task, and share the task execution strategy with the other agents. In this way, the other agents can use the shared agent resources and task execution strategies to process their own tasks, greatly improving the task processing efficiency.
[0098] In addition, since the agents have the ability to monitor and provide feedback, they can monitor the status of the entire system and the task execution of other agents in real time. Therefore, when an agent completes its corresponding task, once it detects any anomalies or potential problems among the agents in the system, the agent can quickly provide feedback information, enabling the system to make dynamic adjustments and optimizations. For example, if an agent discovers during monitoring that another agent's task execution is delayed, it can immediately report this situation, prompting the system to re-schedule the tasks to ensure the smooth completion of the overall task. This monitoring and feedback mechanism endows the system with the ability of self-regulation, improving the stability and efficiency of the system operation.
[0099] Secondly, after completing the main tasks, the agents can utilize their idle time to execute other tasks or auxiliary tasks. These idle-time tasks are designed to make full use of the agents' own capabilities and resources to avoid idle states. By executing idle-time tasks, the agents can not only stay active but also provide additional support and services to the system. For example, after an agent finishes its main task of data processing, it can use its idle time to perform preprocessing or cleaning of the data, providing better data resources for subsequent tasks. This full utilization of idle-time resources enables the system to respond more flexibly to various changes and requirements, enhancing the overall performance of the system.
[0100] Through the description of the above implementation manners, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation manner.
[0101] Figure 3 The figure is a schematic diagram of a task scheduling device provided for an embodiment of the present invention. The device is applied to a heterogeneous multi-agent system; as Figure 3 shown, the device includes: A receiving module 10, configured to receive a plurality of tasks and determine corresponding task information; wherein the task information includes at least task priority, deadline, and task requirements; A modeling module 11, configured to perform agent modeling on the existing plurality of agents to determine the ability profiles of each agent; wherein the ability profile includes at least the task execution ability, current task execution status, and agent resources of the corresponding agent; A broadcasting module 12, configured to broadcast each task to each agent and control each agent to transmit the corresponding ability profile to the remaining agents respectively; A sorting module 13, configured to sort each task according to each task information to generate a task sequence; The scheduling module 14 is used to sequentially allocate each task to the corresponding intelligent agent according to the task sequence, each capability profile, and the operating system scheduling algorithm, so as to facilitate the intelligent agent to execute the task.
[0102] In some embodiments, the receiving module 10 includes: The first receiving sub-module is used to receive multiple tasks and construct a task set; The first determining sub-module is used to determine the dependency information corresponding to each task; wherein, the dependency information represents the sequence and / or restrictive relationship of the corresponding task and the execution of the remaining tasks; The first constructing sub-module is used to construct a directed acyclic graph of the task set according to each dependency information.
[0103] In some embodiments, the broadcasting module 12 includes: The second constructing sub-module is used to construct a joint structure of intelligent agent capability states according to each capability profile; wherein, the joint structure of intelligent agent capability states represents the role capabilities and state distributions of all current intelligent agents; The first control sub-module is used to control each intelligent agent to transmit the corresponding task execution situation, intelligent agent resources, and the joint structure of intelligent agent capability states to the remaining intelligent agents respectively.
[0104] In some embodiments, the sorting module 13 includes: The first sorting sub-module is used to sort each task in descending order according to the task priority corresponding to each task to generate an initial task sequence; The first judging sub-module is used to judge whether there are tasks with the same corresponding task priority in the initial task sequence; if not, the initial task sequence is determined as the task sequence; if so, the tasks with the same corresponding task priority are determined as the tasks to be adjusted; The second sorting sub-module is used to sort each task to be adjusted in ascending order according to the deadline corresponding to each task to be adjusted to generate an adjusted task sequence; The first updating sub-module is used to update the initial task sequence according to the adjusted task sequence to generate a task sequence.
[0105] In some embodiments, the scheduling module 14 includes: The second judging sub-module is used to judge whether there are corresponding uncompleted prerequisite tasks and / or predecessor tasks for the task according to the directed acyclic graph; if so, it is determined that the task does not participate in the scheduling allocation temporarily; if not, candidate intelligent agents whose corresponding task execution capabilities are greater than the task requirements of the task are determined among the intelligent agents; The second determining sub-module is used to determine the capability redundancy value of each candidate intelligent agent according to the task execution capabilities of each candidate intelligent agent and the task requirements of the task. A third determination sub-module, configured to determine the first target agent as the candidate agent with the largest corresponding ability redundancy value, and assign the task to the first target agent.
[0106] In some embodiments, it further includes: A second receiving sub-module, configured to receive the task status, task progress, task execution time, and resource consumption data fed back by each agent according to the time slice cycle; A fourth determination sub-module, configured to determine the estimated task completion time of each task corresponding to each agent according to the task execution ability of each agent and the task requirements of the task being executed; A second update sub-module, configured to update the agent ability status joint structure according to each resource consumption data.
[0107] In some embodiments, it further includes: A fifth determination sub-module, configured to determine the sum of the task requirements of each task under the agent when the agent is assigned multiple tasks; A third judgment sub-module, configured to judge whether the sum of the task requirements is greater than the task execution ability of the agent; if so, confirm that there is a task conflict for the agent currently, and end the task processing process of the agent.
[0108] In some embodiments, it further includes: A sixth determination sub-module, configured to determine the last assigned task among each task under the agent as the task to be migrated; A seventh determination sub-module, configured to determine candidate agents among the other agents whose corresponding task execution ability is greater than the task requirements of the task to be migrated; An eighth determination sub-module, configured to determine the ability redundancy value of each candidate agent according to the task execution ability of each candidate agent and the task requirements of the task to be migrated; A ninth determination sub-module, configured to determine the candidate agent with the largest corresponding ability redundancy value as the second target agent, and assign the task to the second target agent.
[0109] In some embodiments, it further includes: A monitoring sub-module, configured to monitor the task execution time corresponding to each agent; A tenth determination sub-module, configured to determine the remaining task execution time of each agent according to the task execution time and the estimated task completion time of each agent; A fourth judgment sub-module, configured to judge whether the remaining task execution time of each agent is not greater than 0; if so, confirm that the task execution of the corresponding agent is completed, and output a prompt message indicating that the task of the corresponding agent is completed; if not, trigger the monitoring sub-module.
[0110] In some embodiments, it further includes: The third update sub-module is used to update the task completion status of all agents; The resource recycling sub-module is used to recycle the resources occupied by the agents that have completed the task execution into the agent capability status joint structure.
[0111] In some embodiments, it further includes: The eleventh determination sub-module is used to determine the deadline, the expected task completion time, and the remaining task execution time corresponding to the unfinished tasks; The twelfth determination sub-module is used to determine the urgency of the unfinished tasks according to the corresponding deadline and the remaining task execution time; The thirteenth determination sub-module is used to determine the new task priorities of the unfinished tasks according to the corresponding urgency and the expected task completion time, and return to the step of sorting each task according to each task information.
[0112] In some embodiments, it further includes: The second control sub-module is used to control the agent to share the corresponding agent resources with the remaining agents after the agent completes the corresponding task; The third control sub-module is used to control the agent to generate a task execution strategy used when executing the corresponding task, and share the task execution strategy with the remaining agents.
[0113] For the description of the features in the corresponding embodiments of the task scheduling device, reference can be made to the relevant descriptions in the corresponding embodiments of the task scheduling method, which will not be elaborated here one by one.
[0114] An embodiment of the present invention further provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above embodiments of the task scheduling method.
[0115] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps in any one of the above embodiments of the task scheduling method when running.
[0116] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: USB flash drives, read-only memories (ROM for short), random access memories (RAM for short), mobile hard disks, magnetic disks, or optical discs and other various media that can store computer programs.
[0117] An embodiment of the present invention further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, it implements the steps in any of the above-described embodiments of the task scheduling method.
[0118] An embodiment of the present invention further provides another computer program product, including a non-volatile computer-readable storage medium. The non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the steps in any of the above-described embodiments of the task scheduling method.
[0119] Those skilled in the art can further realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described according to their functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Skilled professionals can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0120] The above has introduced in detail a task scheduling method, device, medium, and product provided by the present invention. Specific examples are used herein to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention. It should be noted that for those of ordinary skill in the art in this technical field, without departing from the principle of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the protection scope of the present invention.
Claims
1. A task scheduling method, characterized in that, Applied to a heterogeneous multi-agent system; the method includes: Receiving multiple tasks and determining corresponding task information; wherein, the task information at least includes task priority, deadline, and task requirements; Performing agent modeling on the existing multiple agents to determine the ability profiles of each agent; wherein, the ability profile at least includes the task execution ability, current task execution status, and agent resources corresponding to the agent; Broadcasting each task to each agent, and controlling each agent to respectively transmit the corresponding ability profile to the remaining agents; Sorting each task according to each task information to generate a task sequence; According to the task sequence, each ability profile, and the operating system scheduling algorithm, sequentially allocate each task to the corresponding agent for the agent to execute the task.
2. The task scheduling method according to claim 1, wherein Receiving multiple tasks and determining corresponding task information includes: Receiving multiple tasks and constructing a task set; Determining the dependency information corresponding to each task; wherein, the dependency information represents the sequence and / or restrictive relationship of the corresponding task and the execution of the remaining tasks; Constructing a directed acyclic graph of the task set according to each dependency information.
3. The task scheduling method according to claim 1, wherein Controlling each agent to respectively transmit the corresponding ability profile to the remaining agents includes: Constructing a joint agent ability state structure according to each ability profile; wherein, the joint agent ability state structure represents the role abilities and state distributions of all current agents; Controlling each agent to respectively transmit the corresponding task execution status, the agent resources, and the joint agent ability state structure to the remaining agents.
4. The task scheduling method according to claim 2, wherein Sorting each task according to each task information includes: Sorting each task in descending order according to the task priority corresponding to each task to generate an initial task sequence; Judging whether there are tasks with the same task priority in the initial task sequence; If not, determining the initial task sequence as the task sequence; If so, determining the tasks with the same task priority as the tasks to be adjusted; Sorting each task to be adjusted in ascending order according to the deadline corresponding to each task to be adjusted to generate an adjusted task sequence; Updating the initial task sequence according to the adjusted task sequence to generate the task sequence.
5. The task scheduling method according to claim 4, wherein, According to the task sequence, each ability profile, and the operating system scheduling algorithm, sequentially allocating each task to the corresponding agent includes: Judging whether the task has corresponding uncompleted prerequisite tasks and / or predecessor tasks according to the directed acyclic graph; If so, determining that the task does not participate in scheduling allocation temporarily; If not, determining candidate agents in each agent whose task execution ability is greater than the task requirements of the task; Determining the ability redundancy value of each candidate agent according to the task execution ability of each candidate agent and the task requirements of the task; Determine the candidate agent with the largest ability redundancy value as the first target agent, and allocate the task to the first target agent.
6. The task scheduling method according to claim 1, characterized in that After successively allocating each of the tasks to the corresponding agents according to the task sequence, each of the ability portraits, and the operating system scheduling algorithm, it further includes: Receiving the task status, task progress, task execution time, and resource consumption data fed back by each of the agents according to the time slice period; Determining the estimated task completion time of each agent for the corresponding task according to the task execution ability of each agent and the task requirements of the corresponding task being executed; Updating the agent ability status joint structure according to each of the resource consumption data.
7. The task scheduling method according to claim 1, wherein It further includes: When an agent is assigned multiple tasks, determining the sum of the task requirements of each of the tasks under the agent; Judging whether the sum of the task requirements is greater than the task execution ability of the agent; If so, confirm that there is a task conflict for the agent currently, and end the task processing process of the agent.
8. The task scheduling method according to claim 7, wherein, If it is confirmed that there is a task conflict for the agent currently, it further includes: Determining the last assigned task among each of the tasks under the agent as the task to be migrated; Determining candidate agents among each of the remaining agents whose task execution ability is greater than the task requirements of the task to be migrated; Determining the ability redundancy value of each of the candidate agents according to the task execution ability of each of the candidate agents and the task requirements of the task to be migrated; Determining the candidate agent with the largest ability redundancy value as the second target agent, and allocating the task to the second target agent.
9. The task scheduling method according to claim 6, wherein After successively allocating each of the tasks to the corresponding agents according to the task sequence, each of the ability portraits, and the operating system scheduling algorithm, it further includes: Monitoring the task execution time corresponding to each of the agents; Determining the remaining task execution time of each agent according to the task execution time and the estimated task completion time of each agent; Judging whether the remaining task execution time of each agent is not greater than 0; If so, confirm that the task execution of the corresponding agent is completed, and output a prompt message indicating that the task of the corresponding agent is completed; If not, return to the step of monitoring the task execution time corresponding to each of the agents.
10. The task scheduling method according to claim 9, characterized in that, After confirming that the task execution of the corresponding agent is completed, it further includes: Updating the task completion status of all the agents; Recycling the resources occupied by the agent whose task execution is completed into the agent ability status joint structure.
11. The task scheduling method according to claim 9, wherein After confirming that the task execution of the corresponding agent is completed, it further includes: Determining the deadline, the estimated task completion time, and the remaining task execution time corresponding to the uncompleted task; Determining the urgency of the uncompleted task according to the corresponding deadline and the remaining task execution time; Determine the new task priority of the uncompleted tasks according to the corresponding urgency level and the expected completion time of the tasks, and return to the step of sorting the tasks according to each task information.
12. The task scheduling method according to any one of claims 1 to 11, characterized in that, It further includes: When the agent completes the corresponding task, control the agent to share the corresponding agent resources with the remaining agents; Control the agent to generate a task execution strategy used when executing the corresponding task, and share the task execution strategy with the remaining agents.
13. An electronic device, characterized in that, It includes: A memory for storing computer programs; A processor for implementing the steps of the task scheduling method according to any one of claims 1 to 12 when executing the computer program.
14. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, wherein the computer program, when executed by the processor, implements the steps of the task scheduling method according to any one of claims 1 to 12.
15. A computer program product, comprising a computer program, characterized in that, The computer program, when executed by the processor, implements the steps of the task scheduling method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Unmanned intelligent inspection equipment cooperative scheduling method and system in photovoltaic power generation scene
CN119358998A
Task scheduling method and device, medium and computer program product
CN119376898A
Intelligent task optimization method based on adaptive multi-dimensional dependency graph and dynamic scheduling
CN119512707A
Multi-agent cooperation system
CN119670803A
Social intelligent agent cluster control method and device
CN119922225A
Cited By
Task scheduling method and system based on multi-agent collaboration
CN120723479A
Multi-agent asynchronous collaboration method and system under centralized architecture
CN120952387A
Multi-agent question and answer method for port operation management
CN121434339A
Multi-agent distributed collaborative task decision scheduling optimization method and system
CN122261772A
Multi-agent distributed cooperative task decision scheduling optimization method and system
CN122261772B