Multi-agent parallel scheduling method, apparatus, equipment and storage medium

By acquiring task metadata and file modification range information for batch division, the conflict and efficiency issues in multi-agent parallel execution of code modification tasks are resolved, and continuous updating and orderly advancement of task status are achieved, thereby improving scheduling efficiency and reliability.

CN123114671APending Publication Date: 2026-11-17CTRIP TRAVEL NETWORK TECH SHANGHAI0
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611331368.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-28
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing multi-agent parallel execution of code modification tasks is prone to code resource overwriting and conflicts, and the task scheduling efficiency and execution state management capabilities are insufficient.

Method used

By acquiring the task metadata, executable tasks that meet the dependency conditions are identified, and batches are divided according to the file modification range information to ensure that the file modification ranges of different tasks in the same parallel execution batch do not overlap. Multiple agents are called to execute the tasks in parallel, and the task status is updated according to the execution results until the task scheduling termination condition is met.

Benefits of technology

It improves the scheduling efficiency and reliability of multi-task parallel execution, reduces the risk of file modification conflicts, and realizes continuous updating and orderly progress of task status.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123114671A_ABST
    Figure CN123114671A_ABST
Patent Text Reader

Abstract

This invention discloses a multi-agent parallel scheduling method, apparatus, device, and storage medium. The method includes: acquiring task metadata for multiple tasks, including task status, dependent task information, and file modification range information; determining executable tasks that meet dependency conditions based on the task status and dependent task information; dividing tasks into batches based on the file modification range information of the executable tasks to determine at least one parallel execution batch, wherein the file modification ranges of different tasks within the same parallel execution batch do not overlap; respectively invoking multiple agents corresponding to multiple tasks in the parallel execution batch to execute the multiple tasks in parallel, and updating the task status based on the execution results; re-determining executable tasks based on the updated task status and dividing batches again, until the task scheduling termination condition is met. This invention can improve the efficiency of multi-task parallel scheduling and reduce file conflicts during parallel code modification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus, device and storage medium for parallel scheduling of multiple intelligent agents. Background Technology

[0002] As software systems continue to grow in scale, the software development process is increasingly adopting standardized and modular development methods to improve the efficiency of the connection between requirements analysis, technical design, and code implementation. In scenarios where artificial intelligence technology is applied to software development, AI agents can perform operations such as code analysis, code generation, and code modification based on requirements documents, technical design documents, and task descriptions, thereby participating in the specific implementation work of the software development process.

[0003] In some implementations, a software change can be broken down into multiple development tasks, each executed by one or more agents. For development tasks without any prior relationship, multiple agents can be invoked in parallel to reduce overall implementation time; for development tasks with prior relationships, they need to be executed in a specific order. Existing software development tools and multi-agent execution frameworks typically provide the ability to execute tasks by multiple agents, but the relationships between tasks, the execution order, and the mutual influence between code modifications need to be handled by the developers or execution control logic.

[0004] In scenarios where multiple agents execute code modification tasks in parallel, different tasks may involve the same code resources. When multiple agents simultaneously modify overlapping code resources, issues such as modification overwriting, inconsistencies in content, or difficulty in determining the code state may arise. Furthermore, as the number of tasks increases, the scheduling complexity also increases due to factors such as task execution order, the scale of parallel execution, and the management of abnormal states during execution. Existing task scheduling mechanisms typically focus on scheduling general computing or service tasks, and there is still room for further optimization in terms of task collaboration, concurrency safety control, and execution state management capabilities for AI agents participating in software code implementation.

[0005] Therefore, how to improve the task scheduling efficiency, execution reliability, and task state management capabilities in the process of multi-agent participation in software code implementation is a technical problem that needs to be solved by those skilled in the art. Summary of the Invention

[0006] To address the problems in the prior art, the present invention aims to provide a multi-agent parallel scheduling method, apparatus, device, and storage medium to solve the problems in the prior art where multi-agent parallel execution of code modification tasks easily leads to code resource modification overwriting and conflicts, as well as insufficient task scheduling efficiency and execution state management capabilities.

[0007] The first aspect of this disclosure provides a multi-agent parallel scheduling method, which includes: Retrieve task metadata for multiple tasks, including task status, dependent task information, and file modification scope information; Based on the task status and dependent task information, determine the executable tasks that meet the dependency conditions; Based on the file modification range information of the executable tasks, the executable tasks are divided into batches to determine at least one parallel execution batch, wherein the file modification ranges of different tasks in the same parallel execution batch do not overlap. For multiple tasks in a batch that are executed in parallel, multiple agents corresponding to the multiple tasks are invoked to execute the multiple tasks in parallel, and the task status of the multiple tasks is updated according to the execution results of the multiple agents. Based on the updated task status, re-execute the steps to determine executable tasks that meet the dependency conditions based on the task status and dependent task information, until the task scheduling termination condition is met.

[0008] In some implementations, the task metadata also includes a task identifier, a task title, a task description, and task implementation constraint information, which includes task execution items, prohibited items, and task completion standards.

[0009] In some implementations, for multiple tasks in a batch of parallel execution, multiple agents corresponding to the multiple tasks are invoked to execute the multiple tasks in parallel, including: Each agent is provided with a task description, file modification scope information, and task completion criteria corresponding to its own task, enabling multiple agents to execute their respective tasks based on independent execution contexts, and restricting their code modifications to the file modification scope of their respective tasks.

[0010] In some implementations, it also includes: Obtain the actual set of modified files generated after the agent executes the task, and compare the actual set of modified files with the file modification range information of the corresponding task; when the actual set of modified files contains files that are not declared in the file modification range information, generate file modification range exception information, and suspend the corresponding task or trigger a re-batch division based on the file modification range exception information.

[0011] In some implementations, the task status includes a pending state, an in-process state, a paused state, and a completed state. After the execution results corresponding to the parallel execution batch are returned, the task status of each task is updated according to the execution results of each task. Specifically, tasks that have been completed and meet the task completion criteria of the corresponding task are updated to the completed state, while tasks that have not been completed and need to be temporarily stopped are updated to the paused state.

[0012] In some implementations, the multi-agent parallel scheduling method further includes: When the task status of any task is updated to the paused state, the scheduling of subsequent tasks that depend on any task is stopped; upon receiving an intervention instruction for any task or updated task metadata, the task status of any task is readjusted to the pending state, so that any task can participate in the determination of executable tasks when re-executing the steps of determining executable tasks that meet the dependency conditions based on the task status and dependent task information.

[0013] In some implementations, the multi-agent parallel scheduling method further includes: When a code archiving operation is triggered, the system determines whether there are any incomplete tasks based on the task status of each task. If there are no incomplete tasks, the code archiving operation is allowed to be executed. If there are incomplete tasks, an archiving confirmation message is generated, and the system determines whether to execute the code archiving operation based on the received archiving confirmation message.

[0014] In some implementations, the file modification scope information includes multiple file paths; before batch division, the multiple file paths are normalized, and the intersection between the file modification scopes of different tasks is determined based on the normalized file paths.

[0015] In some implementations, batching executable tasks to determine at least one batch for parallel execution further includes: The scheduling priority of a task is determined based on its dependencies, and tasks are selected from the executable tasks to be added to the parallel execution batch according to the scheduling priority.

[0016] In some implementations, scheduling priority is determined based on the number of successor tasks in the dependency relationship or the path length of the dependency path in which the task is located.

[0017] In some implementations, batching the executable tasks to determine at least one batch for parallel execution further includes: Obtain the preset maximum concurrency; when the number of executable tasks whose file modification ranges do not overlap is greater than the maximum concurrency, select tasks with higher priority and a number equal to the maximum concurrency from the executable tasks according to scheduling priority to form a parallel execution batch.

[0018] In some implementations, the multi-agent parallel scheduling method further includes: When there are incomplete tasks and it is impossible to determine executable tasks that meet the dependency conditions, analyze the dependencies between the incomplete tasks and determine the cause of task scheduling blockage based on the analysis results; among them, the cause of task scheduling blockage includes at least one of circular dependency and non-existent dependent tasks.

[0019] A second aspect of this disclosure provides a multi-agent parallel scheduling apparatus, comprising: The metadata acquisition module is used to acquire task metadata for multiple tasks. Task metadata includes task status, dependent task information, and file modification scope information. The executable task determination module is used to determine executable tasks that meet the dependency conditions based on the task status and dependent task information. The batch partitioning module is used to partition executable tasks into batches based on the file modification range information of the executable tasks, so as to determine at least one batch for parallel execution, wherein the file modification ranges of different tasks in the same batch for parallel execution do not overlap. The parallel execution and state update module is used to call multiple agents corresponding to multiple tasks in a batch of parallel execution to execute multiple tasks in parallel, and update the task state of multiple tasks based on the execution results of multiple agents. The cyclic scheduling control module is used to control the executable task determination module to re-execute the operation of determining executable tasks that meet the dependency conditions based on the updated task status and dependent task information, until the task scheduling termination condition is met.

[0020] A third aspect of this disclosure provides an electronic device, characterized in that it includes: a processor; and a memory storing executable instructions of the processor; wherein the processor is configured to execute the multi-agent parallel scheduling method of any of the above embodiments by executing the executable instructions.

[0021] The fourth aspect of this disclosure provides a computer-readable storage medium for storing a program that, when executed, implements the multi-agent parallel scheduling method of any of the above embodiments.

[0022] The multi-agent parallel scheduling method, apparatus, device, and storage medium proposed in this disclosure have the following advantages: By acquiring the task status, dependent task information, and file modification range information of multiple tasks, and determining the executable tasks that meet the dependency conditions based on the task status and dependent task information, tasks with execution conditions can be identified during task execution. This overcomes the problem of low efficiency in determining the task execution order when there are execution dependencies between multiple tasks, thereby improving the orderliness and execution efficiency of multi-task scheduling.

[0023] By dividing the batch according to the file modification range information of the executable tasks, and ensuring that the file modification ranges of different tasks in the same parallel execution batch do not overlap, we can further identify tasks that can be executed in parallel based on the determination of task execution dependencies. This overcomes the problem of file modification conflicts that may occur when multiple tasks are executed in parallel, thereby reducing the risk of conflicts during parallel code modification and improving the reliability of multi-task parallel execution.

[0024] By calling multiple agents to execute tasks in parallel for each task in a batch, and updating the task status of the corresponding tasks based on the execution results of the agents, the task batch division result can be converted into parallel execution of multiple agents. The task status can be continuously updated using the execution results, overcoming the problem of insufficient connection between the execution results of multiple agents and subsequent task scheduling. This forms a continuous scheduling process between task determination, batch division, parallel execution and status update, thereby improving the scheduling efficiency of parallel execution of multiple agents.

[0025] By re-executing the steps for determining executable tasks based on the updated task status, and continuously performing batch partitioning and parallel execution of agents until the task scheduling termination condition is met, the update of the task status can continuously affect the determination of the execution conditions of subsequent tasks. This overcomes the problem of low efficiency in the advancement of subsequent tasks during multi-task execution, thereby realizing the cyclical scheduling of multiple tasks according to execution dependencies and improving the overall execution efficiency of multi-tasks.

[0026] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0027] Other features, objects, and advantages of the invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings.

[0028] Figure 1 This is a schematic diagram of the overall process of a multi-agent parallel scheduling method provided in an embodiment of the present invention; Figure 2 This is a schematic diagram illustrating a specific process for parallel task scheduling and batch construction provided in an embodiment of the present invention; Figure 3 A flowchart illustrating the task status update and dimension provided in an embodiment of the present invention; Figure 4 A flowchart illustrating a process for triggering code archiving operations, provided as an embodiment of the present invention; Figure 5 This is a structural block diagram of a multi-agent parallel scheduling device provided in an embodiment of the present invention; Figure 6This is a schematic diagram of a hardware architecture for an electronic device suitable for executing a multi-agent parallel scheduling method, provided as an embodiment of the present invention. Detailed Implementation

[0029] To make the technical solution, the technical problem solved, and the technical effects of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the described embodiments are merely exemplary embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Those skilled in the art can make various modifications and variations to the embodiments without departing from the spirit and scope of the present invention, and all such modifications and variations should be considered to fall within the scope of protection of the present invention.

[0030] Techniques, methods, and apparatus known to those skilled in the art are not discussed in detail where appropriate, but should be considered part of this specification. In all examples shown herein, any specific numerical values ​​or parameters should be interpreted as exemplary only and not as limiting the invention.

[0031] Figure 1 This document presents a flowchart illustrating a multi-agent parallel scheduling method according to an embodiment of the present disclosure. The method can be executed by a multi-agent parallel scheduling system, which can be deployed on a computing device, server, or agent execution environment used for software development. This system is used to schedule multiple tasks and invoke multiple agents to execute the corresponding tasks.

[0032] The multi-agent parallel scheduling method provided in this disclosure can be applied to software code implementation. Multiple tasks can correspond to different code implementation tasks in a software project, and multiple tasks can collectively correspond to a single software change. By processing the task metadata, the execution associations between tasks and the file modification scope corresponding to the tasks can be obtained before task execution.

[0033] like Figure 1 As shown, the multi-agent parallel scheduling method includes, but is not limited to, the following steps: Step 110: Obtain the task metadata for multiple tasks. The task metadata includes task status, dependent task information, and file modification scope information.

[0034] In this embodiment of the disclosure, task metadata is used to describe the current execution status of multiple tasks, the execution relationships between tasks, and the file modification scope of each task. Specifically, task status characterizes the current execution state of a task; dependent task information characterizes the execution relationships between the current task and other tasks; and file modification scope information characterizes the scope of file modifications involved in executing the current task.

[0035] A multi-agent parallel scheduling system can acquire task metadata for multiple tasks and establish associations between each task and its corresponding task status, dependent task information, and file modification scope information.

[0036] Step 120: Based on the task status and dependent task information, determine the executable tasks that meet the dependency conditions.

[0037] In this embodiment of the disclosure, the multi-agent parallel scheduling system analyzes the current execution conditions of multiple tasks based on the acquired task status and dependent task information to determine the executable tasks that meet the dependency conditions.

[0038] Among them, an executable task that meets the dependency conditions refers to a task whose execution depends on having met the required conditions in the current task scheduling state. A multi-agent parallel scheduling system can determine the current completion status of related tasks based on the task status and, in conjunction with the dependency task information, determine whether each task meets the execution conditions.

[0039] Step 120 allows us to identify tasks that currently meet the execution conditions from among multiple tasks, enabling subsequent batch partitioning to target tasks that satisfy the dependency conditions.

[0040] Step 130: Based on the file modification range information of the executable tasks, divide the executable tasks into batches to determine at least one batch for parallel execution, wherein the file modification ranges of different tasks in the same batch for parallel execution do not overlap.

[0041] In this embodiment of the disclosure, the multi-agent parallel scheduling system divides the executable tasks into batches based on the executable tasks determined in step 120 and the corresponding file modification range information.

[0042] Parallel execution batches are used to determine the set of tasks that can be processed in parallel by multiple agents in the same execution phase. When dividing batches, the multi-agent parallel scheduling system determines whether there is an overlap in the file modification ranges between tasks based on the file modification range information corresponding to different executable tasks, and assigns tasks whose file modification ranges do not overlap to the same parallel execution batch.

[0043] For tasks whose file modification scopes overlap, the corresponding tasks can be divided into different parallel execution batches, so that different tasks in the same parallel execution batch do not overlap in the file modification scope.

[0044] Step 140: For multiple tasks in the parallel execution batch, call multiple agents corresponding to the multiple tasks to execute the multiple tasks in parallel, and update the task status of the multiple tasks according to the execution results of the multiple agents.

[0045] In this embodiment of the disclosure, after determining the parallel execution batch, the multi-agent parallel scheduling system calls multiple corresponding agents for the multiple tasks in the parallel execution batch, so that different agents execute the corresponding tasks respectively.

[0046] Each agent can perform corresponding code processing operations according to the assigned task. Different agents can process their assigned tasks separately. Since step 130 has already divided the tasks into batches based on the file modification range information, the file modification ranges of different tasks in the same parallel execution batch do not overlap, thus reducing the possibility of file modification conflicts when multiple agents execute corresponding tasks in parallel.

[0047] After multiple agents execute tasks, the multi-agent parallel scheduling system obtains the execution results of each agent and updates the task status of the corresponding task based on the execution results, so that the task status can reflect the execution status of the task.

[0048] Based on the updated task status, re-execute the steps to determine executable tasks that meet the dependency conditions based on the task status and dependent task information, until the task scheduling termination condition is met.

[0049] In this embodiment of the disclosure, after updating the task status according to the execution result of step 140, the multi-agent parallel scheduling system re-determines the executable tasks according to the updated task status, and performs batch division and agent invocation again for the re-determined executable tasks.

[0050] As task status is updated, tasks that previously did not meet the dependency conditions may now be eligible for execution. These tasks can then be identified as executable during subsequent scheduling and participate in the partitioning of parallel execution batches. Thus, the task scheduling process can continuously advance based on task execution progress.

[0051] The task scheduling termination condition is used to determine whether the parallel scheduling of multiple tasks has ended. When the task scheduling termination condition is met, the parallel scheduling of the current task set ends; when the task scheduling termination condition is not met, the processes of determining executable tasks, batch partitioning, and agent invocation continue.

[0052] Through the above steps, this embodiment of the invention obtains the task status, dependent task information, and file modification range information of multiple tasks, determines the executable tasks that meet the dependency conditions based on the task status and dependent task information, and divides them into batches based on the file modification range information of the executable tasks, so that the file modification ranges of different tasks in the same parallel execution batch do not overlap, and then calls multiple intelligent agents to execute the corresponding tasks in parallel.

[0053] At the same time, the task status is updated based on the execution results of the intelligent agent, and subsequent task scheduling is performed cyclically based on the updated task status.

[0054] Therefore, a continuous processing flow can be formed during task execution, including task determination, batch division, parallel execution, status update, and subsequent scheduling, which improves the scheduling efficiency of multi-task parallel execution and reduces file modification conflicts during parallel code modification.

[0055] In this embodiment of the disclosure, in step 110 above, the task metadata is used to describe the basic information of the task, execution requirements, execution status, and the relationships between tasks. The multi-agent parallel scheduling system can obtain task metadata for multiple tasks from task configuration data, task description data, or other task management data.

[0056] In one implementation, the task metadata also includes a task identifier, a task title, a task description, and task implementation constraints. The task identifier distinguishes different tasks. The task title summarizes the processing objective of the corresponding task. The task description describes the processing content of the corresponding task. The task implementation constraints limit the execution requirements of the task.

[0057] In one implementation, the task execution constraint information includes task execution items, prohibited items, and task completion criteria. Task execution items describe what needs to be completed during task execution. Prohibited items describe what should not be performed during task execution. Task completion criteria determine whether the task has met the completion conditions.

[0058] Among them, task status represents the current execution status of the task. Dependency task information represents the execution dependencies between tasks. File modification scope information represents the scope of file modifications involved in the task execution.

[0059] A multi-agent parallel scheduling system can associate each task's task identifier with its corresponding task status, dependent task information, and file modification scope information. Other task metadata can also be associated with the task identifier. Thus, task metadata can be generated on a task-by-task basis.

[0060] In one implementation, task metadata can be organized in a structured data format. The task metadata for multiple tasks can be stored and retrieved according to a preset data format. The multi-agent parallel scheduling system can parse the retrieved task metadata to obtain the task status, dependent task information, and file modification scope information for each task.

[0061] The file modification scope information can be used to characterize the range of file modifications that may occur during the execution of the corresponding task. Dependency task information can be used to determine whether the corresponding task needs to wait for other tasks. Task status can be used to reflect whether the task is currently in an execution phase that can continue to be scheduled.

[0062] In subsequent steps, the multi-agent parallel scheduling system can determine executable tasks based on task status and dependent task information, and batch-divide these executable tasks based on file modification range information. Task descriptions and task implementation constraints can serve as the task context when agents are subsequently invoked to execute the corresponding tasks. Task completion criteria can be used to determine whether a task is completed based on the agent's execution results.

[0063] In this way, the execution status of tasks, the dependencies between tasks, and the scope of file modifications corresponding to tasks can be organized in the form of task metadata, so that the task scheduling process can be carried out based on unified task data.

[0064] In this embodiment, for step 120 above, the multi-agent parallel scheduling system acquires the task status and dependent task information corresponding to multiple tasks. Based on the task status and dependent task information, the tasks that currently meet the dependency conditions can be determined. The multi-agent parallel scheduling system then identifies the tasks that meet the dependency conditions as executable tasks.

[0065] The task status represents the current execution state of the task. Dependency task information represents the dependencies between the task and other tasks. For a given task, its predecessor tasks can be determined based on its dependency task information, and the current task's dependency status can be used to determine whether the current task meets the dependency conditions.

[0066] In one implementation, a task can be determined to satisfy the dependency condition if it has no dependent tasks. When a task has dependent tasks, the determination can be made based on the task status of the dependent tasks. If all dependent tasks have been completed, the current task can be determined to satisfy the dependency condition. Otherwise, the current task can be temporarily not determined as an executable task.

[0067] The multi-agent parallel scheduling system can traverse multiple tasks and perform the aforementioned judgments on each task, thereby selecting the executable tasks that currently meet the dependency conditions from the multiple tasks. The executable tasks can then be used as the processing objects for batch partitioning in the subsequent step 130.

[0068] In one implementation, task status can be used to reflect whether a task has been completed. A multi-agent parallel scheduling system can determine the current completion status of relevant tasks based on the task status of each task, and determine whether the corresponding task meets the dependency conditions by combining the dependent task information.

[0069] For example, for task T2, if the dependency information indicates that task T2 depends on task T1, the multi-agent parallel scheduling system can obtain the task state of task T1. When task T1 is in a completed state, it can be determined that task T2 meets the dependency condition and task T2 is identified as an executable task. When task T1 is not yet completed, task T2 can be temporarily not identified as an executable task.

[0070] In one implementation, when there are incomplete tasks and it is impossible to determine executable tasks that meet the dependency conditions, the multi-agent parallel scheduling system can analyze the dependencies between incomplete tasks and determine the cause of task scheduling blockage based on the analysis results.

[0071] Among them, the reasons for task scheduling blocking include at least one of circular dependencies and the absence of dependent tasks.

[0072] When a circular dependency is detected, it can be determined that at least two incomplete tasks form a mutual dependency relationship, preventing either task from satisfying the dependency condition. When a non-existent dependent task is detected, it can be determined that the task's dependency points to a non-existent task, causing the corresponding task to fail to satisfy the dependency condition. The determined reasons for task scheduling blockage can be used to characterize why the current task cannot continue.

[0073] In one implementation, a multi-agent parallel scheduling system can construct task dependencies based on the dependencies between tasks. Task dependencies can be used to determine the preceding and subsequent tasks of a given task. The multi-agent parallel scheduling system can then determine the dependency conditions of tasks based on these task dependencies.

[0074] After identifying executable tasks, the multi-agent parallel scheduling system can pass the executable tasks to step 130 for batch partitioning based on the file modification range information of the executable tasks. For tasks that do not currently meet the dependency conditions, their task status and dependent task information can be retained, and a new judgment can be made after the task status is updated subsequently.

[0075] For example, in the first round of task scheduling, task T1 has no dependent tasks, task T2 depends on T1, and task T3 depends on T2. ​​If T1 meets the dependency condition, it can be determined as an executable task, while T2 and T3 are not yet determined as executable tasks. After T1 completes execution and updates its task status, step 120 can be re-executed. At this time, the dependency condition of T2 is met, and T2 can be determined as an executable task. With the completion of T2, T3 can also be determined as an executable task in subsequent scheduling processes.

[0076] Therefore, step 120 determines the executable tasks that currently meet the dependency conditions based on the task status and dependent task information, and provides the determination result to the subsequent step 130, so that the execution dependencies between tasks can be passed to the subsequent batch partitioning process. When the task status is updated, step 120 can be re-executed based on the updated task status, thereby continuously determining the executable tasks that meet the dependency conditions.

[0077] In this embodiment of the disclosure, regarding step 130 above, after determining the executable tasks in step 120, the multi-agent parallel scheduling system obtains the file modification range information corresponding to each executable task, and divides the executable tasks into batches according to the file modification range information to determine the parallel execution batches. The parallel execution batches are used to determine the set of tasks that can be executed in parallel in the same execution phase.

[0078] The file modification range information is used to characterize the range of file modifications involved in the execution of the corresponding task. The multi-agent parallel scheduling system can compare the file modification ranges corresponding to different executable tasks and determine whether different tasks can be assigned to the same parallel execution batch based on the comparison results.

[0079] In one implementation, a multi-agent parallel scheduling system can process executable tasks sequentially. For the currently processed executable task, its file modification range information can be compared with the file modification range information of existing tasks in the current parallel execution batch.

[0080] If the file modification scope of the current task does not overlap with the file modification scope of any existing task in the current parallel execution batch, the current task can be added to the parallel execution batch. If there is overlap, the current task can be left unadded to the current parallel execution batch and processed in a subsequent batch.

[0081] This ensures that the file modification ranges of different tasks in the same parallel execution batch do not overlap, thus providing constraints on the file modification range for the parallel execution of multiple tasks in the same parallel execution batch.

[0082] In one implementation, the file modification range information includes multiple file paths. A multi-agent parallel scheduling system can determine the file modification range for each task based on these multiple file paths, and then perform an intersection judgment based on the file modification ranges of different tasks.

[0083] Before batch partitioning, multiple file paths can be normalized, and the intersection of file modification ranges for different tasks can be determined based on the normalized file paths. Path normalization converts file paths with different representations but pointing to the same file into a unified form, facilitating comparison of file modification ranges.

[0084] For example, when different tasks use different representations of file paths, a multi-agent parallel scheduling system can first process the file paths uniformly, and then determine whether there are identical file paths between different tasks based on the processed file paths.

[0085] In one implementation, the multi-agent parallel scheduling system can also determine the scheduling priority of tasks based on the dependencies between tasks, and select tasks from executable tasks to add to the parallel execution batch according to the scheduling priority.

[0086] Scheduling priority is used to determine the processing order of multiple executable tasks during batch partitioning. A multi-agent parallel scheduling system can process executable tasks sequentially according to scheduling priority and determine whether a task should be added to the current parallel execution batch based on the file modification scope corresponding to each task.

[0087] In one implementation, the scheduling priority is determined based on the number of successor tasks in the dependency relationship or the path length of the dependency path in which the task resides. Tasks with more successor tasks in the dependency relationship can have a higher scheduling priority; for tasks located in a longer dependency path, the scheduling priority can also be determined based on their position in the dependency relationship.

[0088] In one implementation, the multi-agent parallel scheduling system can also acquire a preset maximum concurrency. The maximum concurrency is used to limit the number of tasks that can be executed simultaneously in the same parallel execution batch.

[0089] When the number of executable tasks that can be assigned to the same parallel execution batch exceeds the maximum concurrency, the multi-agent parallel scheduling system can select tasks with higher priority and a number equal to the maximum concurrency from the executable tasks according to scheduling priorities to form a parallel execution batch. Executable tasks that are not selected can continue to participate in task selection during subsequent batch partitioning processes.

[0090] By setting a maximum concurrency, the number of tasks in the same batch of parallel execution can be limited, thus matching the number of parallel tasks with available computing resources.

[0091] In one implementation, batch partitioning can be performed continuously based on the file modification scope of the executable task and the scheduling priority until the parallel execution batch to which the corresponding executable task belongs is determined. Each parallel execution batch can then proceed to step 140 for execution in a predetermined order.

[0092] For example, if there are three executable tasks T1, T2, and T3, and the file modification ranges of T1 and T2 do not overlap, while the file modification ranges of T2 and T3 do overlap, then T1 and T2 can be assigned to the same parallel execution batch, and T3 can be reserved for a later batch. If the number of tasks that can be assigned to the same parallel execution batch is greater than the maximum concurrency, then the appropriate number of tasks can be selected to enter the current parallel execution batch according to the scheduling priority.

[0093] Therefore, step 130 divides the executable tasks into batches based on the file modification range information of the executable tasks, so that the file modification ranges of different tasks in the same parallel execution batch do not overlap, and further provides a task set for step 140 to call the corresponding multiple agents to execute multiple tasks in parallel for multiple tasks in the parallel execution batch.

[0094] In this embodiment of the disclosure, for step 140 above, after determining the parallel execution batch in step 130, the multi-agent parallel scheduling system calls multiple agents corresponding to the multiple tasks in the parallel execution batch, so that the multiple agents execute the corresponding tasks respectively.

[0095] In one implementation, the multi-agent parallel scheduling system provides each agent with a task description, file modification range information, and task completion criteria corresponding to its respective task, enabling the agents to execute their respective tasks based on independent execution contexts and restricting their code modifications to the file modification range of the corresponding task.

[0096] The task description provides the corresponding agent with the task's processing objective and content. The file modification scope information indicates the permissible file range for modification during task execution. The task completion criteria determine whether the corresponding task has met preset completion conditions. Different agents are assigned to different tasks and can independently execute their respective tasks based on the task information they receive.

[0097] Independent execution contexts can be used to hold task information, execution processes, and tool invocation states for different agents performing corresponding tasks. Different agents can handle their respective tasks within their own execution contexts without needing to share the same execution context.

[0098] In one implementation, the agent can access code resources corresponding to a task and perform code reading, code modification, or other code processing operations according to the task description. When executing a task, the agent can restrict code modifications to the file modification scope of the corresponding task. Since step 130 has already divided the tasks in the same parallel execution batch according to the file modification scope information, the file modification scopes of different tasks in the same parallel execution batch do not overlap, thus providing isolation conditions in terms of file modification scope for multiple agents to execute corresponding tasks in parallel.

[0099] In one implementation, the multi-agent parallel scheduling system can simultaneously initiate agent calls for multiple tasks within a parallel execution batch after determining the batch. Each agent can execute its corresponding task independently. The multi-agent parallel scheduling system can wait for the multiple agents to return their execution results, and then perform subsequent processing after obtaining the execution results corresponding to the multiple agents in the parallel execution batch.

[0100] The execution results can include information characterizing the execution status of the corresponding task. A multi-agent parallel scheduling system can determine the execution status of the corresponding task based on the execution results of each agent, and update the task status accordingly.

[0101] In one implementation, the task status includes a pending state, an in-process state, a paused state, and a completed state.

[0102] When a task is identified as a task in the current parallel execution batch and begins execution by the corresponding agent, its task status can be updated based on the task's execution progress. When the corresponding agent completes task execution and the task meets the corresponding completion criteria, the corresponding task can be updated to a completed state.

[0103] In one implementation, after the execution results corresponding to the batch of parallel executions are returned, the task status of each task is updated according to the execution results of each task. Tasks that have been completed and meet the task completion criteria of the corresponding task are updated to a completed status, while tasks that have not been completed and need to be temporarily stopped are updated to a paused status.

[0104] For tasks that are incomplete and need to be temporarily suspended, their task status can be updated to paused. Tasks in a paused state can be temporarily excluded from subsequent scheduling as completed tasks, thus preventing other tasks that depend on this task from entering the subsequent execution phase before the task is completed.

[0105] In one implementation, when the task status of any task is updated to a paused state, scheduling of subsequent tasks that depend on that task can be stopped. Upon receiving an intervention instruction for any task or updated task metadata, the task status of that task can be readjusted to a pending state, allowing that task to re-participate in batch partitioning.

[0106] Intervention commands can be used to instruct paused tasks to be reprocessed. Updated task metadata can reflect adjustments to task execution conditions or task content. After a task's status is readjusted to a pending state, its dependency conditions can be re-determined based on the task status and dependent task information in subsequent processes.

[0107] In one implementation, the multi-agent parallel scheduling system can also obtain the actual set of modified files generated after the agents execute tasks, and compare the actual set of modified files with the file modification range information of the corresponding task.

[0108] When the actual set of modified files includes files not declared in the file modification range information, a file modification range exception can be generated. The multi-agent parallel scheduling system can then pause the corresponding task or trigger a re-batch partitioning based on this exception.

[0109] By examining the actual set of modified files, the actual file modifications made by the agent can be correlated with the file modification range declared in the task, thereby further verifying the file modification range during task execution.

[0110] In this embodiment of the disclosure, after multiple agents complete their corresponding tasks, the multi-agent parallel scheduling system can obtain the execution results of each agent and update the task status of the corresponding task based on the execution results of the multiple agents. The updated task status is then used to re-execute step 120.

[0111] Therefore, step 140 converts the parallel execution batch determined in step 130 into the actual parallel execution process of multiple agents, and feeds back the execution results generated by the multiple agents to the task status, so that the task execution results can serve as the basis for determining executable tasks in the subsequent step 120.

[0112] In this embodiment of the disclosure, after completing the tasks in the current parallel execution batch, the task state of the corresponding task can be updated based on the execution results of multiple agents. The updated task state is used to reflect the current execution status of the task and serves as input for re-determining executable tasks.

[0113] In one implementation, step 120 is re-executed based on the updated task status. Specifically, the current task status of each task can be retrieved again, and the task that currently meets the dependency conditions can be determined by combining the dependency task information corresponding to each task.

[0114] For completed tasks, their completion status can be determined based on their task status. For tasks that are not yet completed, their dependency conditions can be reassessed based on the current status of their dependent tasks. When all dependent tasks corresponding to a given task have been completed, that task can be identified as an executable task that meets the dependency conditions.

[0115] Furthermore, the newly determined executable tasks can continue to execute step 130 above, dividing them into batches based on the file modification scope information of the executable tasks, and then calling the corresponding agents to execute the corresponding tasks through step 140. The execution results generated by the agents are then used to update the task status of the corresponding tasks.

[0116] In one implementation, when the re-determined executable task is not empty, steps 130 and 140 can continue to be executed. After the agent executes and updates the task state, step 120 is executed again based on the updated task state, thus forming a loop between task state updates and re-determining executable tasks.

[0117] When the task scheduling termination condition is met, step 120 can be stopped from being re-executed. The task scheduling termination condition indicates that the scheduling of multiple tasks has reached its end.

[0118] Therefore, based on the updated task status, the steps of determining executable tasks that meet the dependency conditions based on the task status and dependent task information are re-executed, so that the status corresponding to the completed tasks can be used for the determination of subsequent executable tasks. Through the repeated execution of steps 120, 130 and 140, the scheduling of multiple tasks is gradually completed.

[0119] In one implementation, the multi-agent parallel scheduling system can also determine whether there are any incomplete tasks based on the task status of each task when a code archiving operation is triggered. If there are no incomplete tasks, the code archiving operation can be allowed. If there are incomplete tasks, archiving confirmation information can be generated, and the system can determine whether to execute the code archiving operation based on the received archiving confirmation result.

[0120] like Figure 2As shown, this disclosure provides a processing flow that divides batches based on dependency conditions and file modification scope, and executes tasks within a batch in parallel by multiple agents. This processing flow can serve as a specific implementation of the aforementioned multi-agent parallel scheduling method. The following description, in conjunction with the dependencies and writes data in the task metadata, illustrates this processing flow.

[0121] Step 210: Determine the current task set.

[0122] In this embodiment, the multi-agent parallel scheduling system acquires multiple tasks currently to be scheduled and determines the current task set based on the task metadata corresponding to each task. Tasks in the current task set may have corresponding task identifiers, task states, dependent task information, and file modification scope information.

[0123] In one implementation, initially, none of the tasks in the current task set are completed. The multi-agent parallel scheduling system can initialize the set of completed tasks to an empty set and continuously update the set of completed tasks based on the execution results of subsequent tasks.

[0124] For example, the current task set includes tasks T1, T2, T3, and T4. Initially, none of the tasks are in a completed state, and the completed set can be represented as: Completed = A multi-agent parallel scheduling system can determine the subsequent executable tasks based on the current task set and the completed task set.

[0125] Step 220: Filter executable tasks based on dependency task information.

[0126] In this embodiment of the disclosure, the multi-agent parallel scheduling system selects tasks that meet the dependency conditions from the current task set based on the dependency task information corresponding to each task, and determines the tasks that meet the dependency conditions as executable tasks.

[0127] For task T, its set of dependent tasks can be determined based on the task's dependencies. When dependencies(T) When Completed, it can be determined that task T meets the dependency conditions and task T is determined to be an executable task.

[0128] When a task has no dependent tasks, its dependencies can be an empty set. In this case, it can be determined that the task meets the dependency conditions. For example: T1.dependencies=[], T2.dependencies=[T1], T3.dependencies=[T2].

[0129] In the initial state, Completed= Therefore, T1 satisfies T1.dependencies Tasks that are "Completed" can be identified as executable tasks; tasks that depend on T2 and T3 are not yet completed are not yet identified as executable tasks.

[0130] Through the above processing, the dependencies between tasks can be transformed into execution conditions for whether the current task can enter the subsequent batch division.

[0131] Step 230: Construct the current parallel execution batch based on the file modification range.

[0132] In this embodiment of the disclosure, the multi-agent parallel scheduling system determines the file modification range based on the writes corresponding to each executable task for the executable tasks determined in step 220, and constructs the current parallel execution batch accordingly.

[0133] When constructing the current parallel execution batch, a set of files already used in the batch can be maintained to record the scope of file modifications corresponding to tasks that have been added to the current parallel execution batch.

[0134] For the currently processed executable task, we can determine if writes(T) ∩ BatchWrites = ; When the above intersection is empty, the current task can be added to the current parallel execution batch, and its writes can be added to BatchWrites.

[0135] When the above intersection is not empty, the current task can be temporarily not added to the current parallel execution batch, and the task can be postponed to a later batch for processing.

[0136] For example, executable tasks include: T1.writes=[src / a.ts,src / b.ts], T2.writes=[src / c.ts], T3.writes=[src / b.ts,src / d.ts].

[0137] When the current batch is empty, T1 can be added to the current parallel execution batch first, forming BatchWrites={src / a.ts,src / b.ts}.

[0138] When continuing to process T2, T2.writes∩BatchWrites= .

[0139] Therefore, T2 can be added to the current parallel execution batch and updated: BatchWrites={src / a.ts,src / b.ts,src / c.ts} While continuing to process T3, T3.writes ∩ BatchWrites ≠ ; There is overlap between src / b.ts, so T3 can be postponed to the next batch.

[0140] This ensures that the file modification scope of different tasks in the same concurrent execution batch does not overlap.

[0141] Step 240: Call multiple agents to execute in parallel for the current batch of parallel execution.

[0142] In this embodiment of the disclosure, after determining the current parallel execution batch, the multi-agent parallel scheduling system calls the corresponding agent for each task in the current parallel execution batch.

[0143] For example, if the current batches to be executed in parallel include T1 and T2, the multi-agent parallel scheduling system can be started separately: subAgent-1→T1 subAgent-2→T2 Among them, subAgent-1 is used to execute task T1, and subAgent-2 is used to execute task T2.

[0144] In one implementation, the multi-agent parallel scheduling system can provide the corresponding agents with task descriptions, file modification range information, and task completion criteria, enabling different agents to execute corresponding tasks based on their own independent execution contexts.

[0145] For example, subAgent-1:

[0146] Task:T1

[0147] Context: The task context corresponding to T1

[0148] Writes:T1.writes

[0149] subAgent-2:

[0150] Task:T2

[0151] Context: The task context corresponding to T2

[0152] Writes:T2.writes

[0153] Different agents can read and modify the code resources involved in their respective tasks and independently generate corresponding execution results. Since the tasks in the current parallel execution batch have no overlap in their writes after the file modification range judgment in step 230, different agents can execute their respective tasks concurrently.

[0154] Step 250: Simultaneously obtain the execution results of multiple agents.

[0155] In this embodiment of the disclosure, after the multi-agent parallel scheduling system starts multiple agents in the current parallel execution batch, it can synchronously wait for each agent to return the corresponding execution result.

[0156] For example, when the current batch of concurrent executions includes T1 and T2, the multi-agent parallel scheduling system can wait: Result(T1) Result(T2) After all batches return, the current batches executed in parallel are then processed uniformly.

[0157] In one implementation, the execution result is used to characterize the execution status of the corresponding task. The multi-agent parallel scheduling system can obtain the execution results of subAgent-1 and subAgent-2 respectively, and associate the execution results with the corresponding tasks.

[0158] Step 260: Update the task status and completed set based on the execution results.

[0159] In this embodiment of the disclosure, after obtaining the execution results of each agent in the current parallel execution batch, the multi-agent parallel scheduling system updates the task status of the corresponding task according to each execution result.

[0160] In one implementation, when all tasks in the current parallel execution batch have been completed and meet the task completion criteria for the corresponding task, the task status of the corresponding task can be updated to the completed status, and the corresponding task can be added to the completed set.

[0161] For example, if the current batch includes T1 and T2, and both tasks have completed, then the following can be updated: T1.status=completed T2.status=completed The task is then added to the completed set: Completed={T1,T2}. The updated completed set is used to determine the executable tasks for the next round.

[0162] In this embodiment of the disclosure, after the tasks in the current parallel execution batch are completed and the task status is updated, step 270 is executed, in which the multi-agent parallel scheduling system determines whether all tasks in the current task set have been completed.

[0163] When there are incomplete tasks, the multi-agent parallel scheduling system returns to step 220 and re-selects executable tasks that meet the dependency conditions based on the updated completed set.

[0164] For example, with T1.dependencies=[], T2.dependencies=[T1], and T3.dependencies=[T2], after the first batch of T1 is completed: Completed={T1} When step 220 is re-executed, T2.dependencies satisfy {T1} Completed.

[0165] Therefore, T2 can be identified as the next executable task.

[0166] Once T2 is complete, further updates can be made: Completed={T1,T2} If step 220 is executed again at this point, it can be determined that T3 satisfies the dependency condition.

[0167] Therefore, by continuously updating the completed set and re-selecting executable tasks, subsequent tasks can be gradually entered into subsequent parallel execution batches according to their dependencies.

[0168] The scheduling process for the current task set can be terminated when all tasks in the current task set have been completed.

[0169] Through steps 210 to 270 above, firstly, executable tasks that meet the dependency conditions are selected from the current task set based on dependencies. Then, the executable tasks are batched based on writes, and the corresponding subAgents are called to execute tasks in parallel within the same batch. After synchronously obtaining the execution results and updating the task status and completed set, subsequent executable tasks are re-selected based on the updated completed set. This forms a data flow processing process based on dependency condition selection and file modification range constraints, as well as cyclic scheduling driven by batch execution results.

[0170] Figure 3 A schematic diagram of a task state machine provided for embodiments of this disclosure. For example... Figure 3As shown, a task state machine is used to describe the state changes of a task during multi-agent parallel scheduling. Tasks can transition between different task states based on their scheduling status and execution results. The following section combines... Figure 3 This section explains the specific transition process of the task status.

[0171] Step 310: Determine the initial state of the task.

[0172] In this embodiment of the disclosure, after a task enters the scheduling process, it can be set to a pending state. The pending state is used to indicate that the task is in a waiting state for execution.

[0173] Step 320: Update the pending task to an in-process status.

[0174] When a task in the pending state meets the execution conditions and is assigned to a batch for parallel execution, its state can be updated to the in_progress state. The in_progress state indicates that the task is currently executing.

[0175] Step 330: Update the task status based on the task execution progress.

[0176] When a task is completed and meets the corresponding task completion criteria, its state can be updated from "in_progress" to "completed". When a task is not yet complete and needs to be temporarily stopped, its state can be updated from "in_progress" to "paused".

[0177] Step 340: Reactivate the paused task.

[0178] In one implementation, when a task in the paused state receives an intervention instruction or updated task metadata, its state can be readjusted to the pending state so that the task can re-participate in subsequent batch divisions.

[0179] When a task that has been readjusted to the pending state meets the execution conditions again and is assigned to a batch for parallel execution, the task status can be updated to the in_progress state, and the corresponding task can continue to be executed.

[0180] Therefore, the task status can be changed according to the task scheduling and execution, and the update of the task status reflects the current execution stage of the task.

[0181] Figure 4 This is a flowchart illustrating the pre-archiving progress access control system provided for embodiments of this disclosure. (For example...) Figure 4As shown, the pre-archiving progress gate is disabled to determine whether to enter the archiving process based on the completion status of the current task before performing code archiving operations. The following is combined with... Figure 4 This section explains the specific processing procedure for the access control system before archiving.

[0182] Step 410: Trigger code archiving operation.

[0183] In this embodiment of the disclosure, the code archiving operation can be initiated by triggering sdd-archive. After detecting that sdd-archive has been triggered, the multi-agent parallel scheduling system can enter the pre-archiving progress gate process.

[0184] Step 420: Obtain task status statistics.

[0185] In this embodiment of the disclosure, the multi-agent parallel scheduling system reads tasks.md, obtains the task status corresponding to multiple tasks, and determines the completion status of the current task based on the task status.

[0186] For example, task status statistics can be represented as: 2 / 2, 2 completed, 0 in progress, 0 pending execution.

[0187] Wherein, 2 / 2 means that the current total number of tasks is 2 and the number of completed tasks is 2; 2 completed means that there are 2 completed tasks; 0 executing means that there are no tasks in execution; 0 pending means that there are no tasks in pending execution.

[0188] Step 430: Determine if there are any unfinished tasks.

[0189] In this embodiment of the disclosure, the multi-agent parallel scheduling system determines whether there are any unfinished tasks based on the acquired task status statistics.

[0190] If there are no unfinished tasks, you can proceed directly to step 431 to execute the code archiving process.

[0191] When there are incomplete tasks, step 432 can be executed to generate archive confirmation information and provide the user with confirmation options.

[0192] Step 440: Determine whether to perform code archiving based on the archiving confirmation result.

[0193] In the event of unfinished tasks, the multi-agent parallel scheduling system can display a confirmation dialog box and wait for the user to make a selection.

[0194] Upon receiving a confirmation instruction, the code archiving process can proceed directly.

[0195] When a cancellation command is received, step 450 can be executed to terminate the current code archiving operation and set the archiving status isArchived to false. For example, when the task status statistics indicate that there is one incomplete task, a confirmation prompt can be displayed: "There is one incomplete task. Continue archiving?".

[0196] If the user confirms, the code archiving operation can continue; if the user cancels, the code archiving operation will be terminated.

[0197] Therefore, after triggering sdd-archive, the task status in tasks.md can be read first to determine if there are any incomplete tasks. Then, based on the determination result, the code archiving process can be directly entered or the user can be asked for confirmation, thereby establishing a connection between the code archiving operation and the current task completion status.

[0198] In this disclosure, a multi-agent parallel scheduling apparatus is also provided. The multi-agent parallel scheduling apparatus can be deployed on a server, a computing device, or a computing system for performing multi-agent parallel scheduling, and is used to execute the aforementioned multi-agent parallel scheduling method.

[0199] like Figure 5 As shown, the multi-agent parallel scheduling device 500 includes: a metadata acquisition module 510, an executable task determination module 520, a batch partitioning module 530, a parallel execution and state update module 540, and a cyclic scheduling control module 550.

[0200] The metadata acquisition module 510 is used to acquire task metadata for multiple tasks. The task metadata includes task status, dependent task information, and file modification scope information.

[0201] The executable task determination module 520 is used to determine executable tasks that meet the dependency conditions based on the task status and dependent task information.

[0202] The batch partitioning module 530 is used to partition executable tasks into batches based on the file modification range information of executable tasks, so as to determine at least one batch for parallel execution, wherein the file modification ranges of different tasks in the same batch for parallel execution do not overlap.

[0203] The parallel execution and state update module 540 is used to call multiple agents corresponding to multiple tasks in a batch of parallel execution to execute multiple tasks in parallel, and update the task state of multiple tasks according to the execution results of multiple agents.

[0204] The cyclic scheduling control module 550 is used to control the executable task determination module 520 to re-execute the operation of determining executable tasks that meet the dependency conditions based on the task status and dependent task information, until the task scheduling termination condition is met.

[0205] In this embodiment, the task metadata acquired by the metadata acquisition module 510 can be used as processing input for the executable task determination module 520 and the batch partitioning module 530. The executable tasks determined by the executable task determination module 520 can be passed to the batch partitioning module 530. The parallel execution batches determined by the batch partitioning module 530 can be passed to the parallel execution and state update module 540. After updating the task state according to the agent's execution result, the parallel execution and state update module 540 can provide the updated task state to the cyclic scheduling control module 550, which then controls the re-determination and scheduling of subsequent tasks.

[0206] In one implementation, the task metadata acquired by the metadata acquisition module 510 also includes a task identifier, a task title, a task description, and task implementation constraint information. The task implementation constraint information includes task execution items, prohibited items, and task completion standards. The task identifier can be used to distinguish different tasks, the task title and task description can be used to characterize the processing content of the task, and the task implementation constraint information can be used to limit the task's execution requirements and task completion conditions.

[0207] In one implementation, the file modification range information includes multiple file paths. The metadata acquisition module 510 can acquire the multiple file paths corresponding to the task. Before the batch partitioning module 530 performs batch partitioning, the batch partitioning module 530 can perform path normalization processing on the multiple file paths and determine the intersection between the file modification ranges of different tasks based on the normalized file paths. By normalizing the file paths, different path representations can be unified, thereby facilitating the determination of whether there is an intersection between the file modification ranges of different tasks.

[0208] In one implementation, the batch partitioning module 530 is further configured to determine the scheduling priority of tasks based on their dependencies, and select tasks from the executable tasks to add to the parallel execution batch according to the scheduling priority. The scheduling priority can be determined based on the number of successor tasks in the dependency relationship or the path length of the dependency path where the task is located. Thus, the batch partitioning module 530 can determine the order in which tasks enter the parallel execution batch based on the dependencies between tasks, while satisfying the file modification scope constraint.

[0209] In one implementation, the batch partitioning module 530 is also used to obtain a preset maximum concurrency. When the number of executable tasks whose file modification ranges do not overlap is greater than the maximum concurrency, the batch partitioning module 530 selects tasks with higher priority from the executable tasks according to scheduling priority, and whose number is equal to the maximum concurrency, to form a parallel execution batch. By setting the maximum concurrency, the number of tasks in the same parallel execution batch can be limited, so that the number of parallel execution tasks matches the available computing resources.

[0210] In one implementation, the parallel execution and state update module 540 is further configured to provide multiple agents with task descriptions, file modification scope information, and task completion criteria corresponding to their respective tasks, so that the multiple agents can execute their corresponding tasks based on mutually independent execution contexts and restrict their respective code modifications to the file modification scope of the corresponding task.

[0211] In one implementation, the parallel execution and state update module 540 is further configured to obtain the actual set of modified files generated after the agent performs the task, and compare the actual set of modified files with the file modification range information of the corresponding task. When the actual set of modified files contains files not declared in the file modification range information, the parallel execution and state update module 540 can generate file modification range exception information, and suspend the corresponding task or trigger a re-batch division based on the file modification range exception information.

[0212] In one implementation, the task status includes a pending state, an in-process state, a paused state, and a completed state. The parallel execution and status update module 540 can update the task status of each task according to its execution result after the execution result of the parallel execution batch is returned. Specifically, tasks that have completed execution and meet the corresponding task completion criteria are updated to a completed state, while tasks that are not completed and need to be temporarily suspended are updated to a paused state.

[0213] In one implementation, when the task status of any task is updated to a paused state, the cyclic scheduling control module 550 stops scheduling subsequent tasks that depend on that task. Upon receiving an intervention instruction for any task or updated task metadata, the cyclic scheduling control module 550 can readjust the task status of any task to a pending state, so that any task can participate in the determination of executable tasks when re-executing the operation of determining executable tasks that meet the dependency conditions based on the task status and dependent task information.

[0214] In one implementation, when there are incomplete tasks and executable tasks that meet the dependency conditions cannot be determined, the executable task determination module 520 can further analyze the dependencies between the incomplete tasks and determine the cause of task scheduling blocking based on the analysis results. The cause of task scheduling blocking includes at least one of circular dependency and the absence of dependent tasks.

[0215] In one implementation, the cyclic scheduling control module 550 is further configured to determine whether there are any incomplete tasks based on the task status of each task when a code archiving operation is triggered. If there are no incomplete tasks, the cyclic scheduling control module 550 allows the code archiving operation to be executed. If there are incomplete tasks, the cyclic scheduling control module 550 generates archiving confirmation information and determines whether to execute the code archiving operation based on the received archiving confirmation result.

[0216] Each of the above modules can be implemented by an independent processing unit or by different functional components within the same processing unit, depending on the actual application requirements. Data between the modules can be transferred according to the task scheduling process to achieve the correlation processing between task metadata acquisition, executable task determination, batch partitioning, parallel execution of agents, task status updates, and cyclic scheduling.

[0217] It should be noted that the metadata acquisition module 510, the executable task determination module 520, the batch partitioning module 530, the parallel execution and status update module 540, and the loop scheduling control module 550 mentioned above correspond to the implementation process of the corresponding steps in the method embodiment. Their functions, processing flow and application scenarios can be found in the corresponding method embodiment, and will not be repeated here.

[0218] Those skilled in the art will understand that the various embodiments of this disclosure can be implemented as systems, methods, apparatuses, electronic devices, or computer program products. Therefore, the various modules, units, apparatuses, or platforms in this disclosure can be implemented in a completely hardware manner, a completely software manner (including firmware, executable program instructions stored in memory, microcode, etc.), or a hardware-software co-implementation manner, and used to perform corresponding data processing operations.

[0219] Based on the same inventive concept, this disclosure also provides an electronic device, which includes: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the method described above by executing the executable instructions. Since the principle by which this electronic device embodiment solves the problem is similar to that of the above method embodiments, the implementation of this electronic device embodiment can refer to the implementation of the above method embodiments, and repeated details will not be described again.

[0220] Based on the same inventive concept, this disclosure also provides an electronic device, which is described below with reference to... Figure 6 This description pertains to an electronic device 600 according to an embodiment of the present disclosure. The electronic device 600 includes a processor (processing unit) 610 and a memory (storage unit) 620 for storing executable instructions of the processor. In specific industrial applications, the electronic device 600 may be embodied as…

[0221] like Figure 6 As shown, the electronic device 600 is presented in the form of a general-purpose computing device. The components of the electronic device 600 may include, but are not limited to: at least one processing unit 610, at least one storage unit 620, a bus 630 connecting different system components (including storage unit 620 and processing unit 610), a display unit 640, etc.

[0222] The storage unit stores program code, which can be executed by the processing unit 610 to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure. For example, the processing unit 610 can perform the above-described steps. Figure 1 The steps of the method shown.

[0223] Storage unit 620 may include readable media in the form of volatile storage units, such as random access memory (RAM) 621 and / or cache memory 622, and may further include read-only memory (ROM) 623.

[0224] Storage unit 620 may also include a program / utility 624 having a set (at least one) of program modules 625, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.

[0225] Bus 630 can represent one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus architectures. Electronic device 600 can also communicate with one or more external devices 670 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable user interaction with electronic device 600, and / or with any device that enables electronic device 600 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed through input / output (I / O) interface 650. Furthermore, electronic device 600 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 660. As shown, network adapter 660 communicates with other modules of electronic device 600 via bus 630. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0226] In some embodiments, this disclosure also provides a computer program product, which includes a computer program that, when executed by a processor, implements the above-described multi-agent parallel scheduling method.

[0227] In some embodiments, this disclosure also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described multi-agent parallel scheduling method.

[0228] Computer-readable storage media can be readable signal media or readable storage media. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), USB flash drive, portable hard disk, optical storage device, magnetic storage device, or any suitable combination of the foregoing.

[0229] Furthermore, computer-readable storage media may also include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof.

[0230] A readable signal medium can be any readable medium other than a readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. Optionally, program code contained on a computer-readable storage medium can be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0231] In practical implementation, program code for performing the operations of this disclosure can be written in any combination of one or more programming languages. These programming languages ​​include object-oriented programming languages—such as Java and C++—as well as conventional procedural programming languages—such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device.

[0232] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0233] Furthermore, although the steps of the method in this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.

[0234] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the appended claims.

Claims

1. A multi-agent parallel scheduling method, characterized in that, include: Obtain task metadata for multiple tasks, including task status, dependent task information, and file modification scope information; Based on the task status and dependent task information, determine the executable tasks that meet the dependency conditions; Based on the file modification range information of the executable task, the executable task is divided into batches to determine at least one parallel execution batch, wherein the file modification ranges of different tasks in the same parallel execution batch do not overlap; For multiple tasks in the parallel execution batch, multiple agents corresponding to the multiple tasks are invoked to execute the multiple tasks in parallel, and the task status of the multiple tasks is updated according to the execution results of the multiple agents; Based on the updated task status, the step of determining executable tasks that meet the dependency conditions based on the task status and dependent task information is re-executed until the task scheduling termination condition is met.

2. The multi-agent parallel scheduling method according to claim 1, wherein, The task metadata also includes task identifier, task title, task description, and task implementation constraint information, which includes task execution items, prohibited items, and task completion standards.

3. The multi-agent parallel scheduling method according to claim 2, wherein, The step of calling multiple agents corresponding to the multiple tasks in the parallel execution batch to execute the multiple tasks in parallel includes: Each of the multiple intelligent agents is provided with a task description, file modification scope information, and task completion criteria corresponding to its respective task, so that the multiple intelligent agents can execute the corresponding tasks based on mutually independent execution contexts and restrict their respective code modifications to the file modification scope of the corresponding task.

4. The multi-agent parallel scheduling method according to claim 3, wherein, The multi-agent parallel scheduling method also includes: Obtain the actual set of modified files generated after the agent performs the task, and compare the actual set of modified files with the file modification range information of the corresponding task; When the actual set of modified files contains files that are not declared by the file modification range information, a file modification range exception is generated, and the corresponding task is suspended or a new batch division is triggered based on the file modification range exception information.

5. The multi-agent parallel scheduling method of claim 2, wherein, The task status includes pending execution, in execution, paused, and completed status. After the execution results corresponding to the parallel execution batch are returned, the task status of each task is updated according to the execution results of each task. Tasks that have been completed and meet the task completion criteria are updated to the completed status, while tasks that have not been completed and need to be temporarily stopped are updated to the paused status.

6. The multi-agent parallel scheduling method according to claim 5, wherein, Also includes: When the task status of any task is updated to the paused state, the scheduling of subsequent tasks that depend on that task is stopped. Upon receiving an intervention instruction or updated task metadata for any of the tasks, the task status of any of the tasks is readjusted to the pending execution status, so that any of the tasks can participate in the determination of executable tasks when re-executing the step of determining executable tasks that meet the dependency conditions based on the task status and dependent task information.

7. The multi-agent parallel scheduling method according to claim 5, wherein, The multi-agent parallel scheduling method also includes: When the code archiving operation is triggered, it is determined whether there are any unfinished tasks based on the task status of each task; The code archiving operation is allowed when there are no unfinished tasks. When there are unfinished tasks, an archive confirmation message is generated, and the code archiving operation is determined based on the received archive confirmation result.

8. The multi-agent parallel scheduling method of claim 1, wherein, The file modification scope information includes multiple file paths; Before performing the batch division, the multiple file paths are normalized, and the intersection between the file modification ranges of different tasks is determined based on the normalized file paths.

9. The multi-agent parallel scheduling method of claim 1, wherein, The step of batching the executable task to determine at least one concurrent execution batch further includes: The scheduling priority of a task is determined based on its corresponding dependency, and tasks are selected from the executable tasks according to the scheduling priority and added to the parallel execution batch.

10. The multi-agent parallel scheduling method according to claim 9, characterized in that, The scheduling priority is determined based on the number of successor tasks in the dependency relationship or the path length of the dependency path where the task is located.

11. The multi-agent parallel scheduling method of claim 9, wherein, The step of batching the executable task to determine at least one concurrent execution batch further includes: Get the preset maximum concurrency; When the number of executable tasks that satisfy the condition that the file modification ranges have no overlap is greater than the maximum concurrency, tasks with higher priority and a number equal to the maximum concurrency are selected from the executable tasks according to the scheduling priority to form the parallel execution batch.

12. The multi-agent parallel scheduling method of claim 1, wherein, The multi-agent parallel scheduling method also includes: When there are incomplete tasks and it is impossible to determine which executable tasks meet the dependency conditions, analyze the dependency relationships between the incomplete tasks and determine the cause of task scheduling blockage based on the analysis results. The reasons for task scheduling blocking include at least one of circular dependency and non-existent dependent tasks.

13. A multi-agent parallel scheduling apparatus, comprising: include: The metadata acquisition module is used to acquire task metadata for multiple tasks, including task status, dependent task information, and file modification scope information. An executable task determination module is used to determine executable tasks that meet the dependency conditions based on the task status and dependent task information. The batch partitioning module is used to partition the executable tasks into batches based on the file modification range information of the executable tasks, so as to determine at least one parallel execution batch, wherein the file modification ranges of different tasks in the same parallel execution batch do not overlap; The parallel execution and state update module is used to call multiple agents corresponding to the multiple tasks in the parallel execution batch to execute the multiple tasks in parallel, and update the task state of the multiple tasks according to the execution results of the multiple agents. The cyclic scheduling control module is used to control the executable task determination module to re-execute the operation of determining executable tasks that meet the dependency conditions based on the updated task status and dependent task information, until the task scheduling termination condition is met.

14. An electronic device, comprising: include: processor; as well as A memory in which executable instructions of the processor are stored; The processor is configured to execute the multi-agent parallel scheduling method of any one of claims 1 to 12 by executing the executable instructions.

15. A computer readable storage medium for storing a program, characterized in that, When the program is executed, it implements the multi-agent parallel scheduling method as described in any one of claims 1 to 12.