A task scheduling method and device based on a cloud service environment workflow
By constructing linked lists and directed acyclic graphs in cloud computing services, the execution order and time of tasks are determined, resource allocation is optimized, and the problems of resource consumption and task completion time are solved, achieving more efficient resource utilization and shorter task execution time.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NAT IND INFORMATION SECURITY DEV RES CENT
- Filing Date
- 2022-03-09
- Publication Date
- 2026-04-14
AI Technical Summary
How to optimize resource allocation in cloud computing services to reduce resource consumption and shorten task completion time.
By constructing linked lists and directed acyclic graphs, the execution order and time of tasks are determined, and execution resources are allocated with the goal of minimizing the total execution time of all tasks. The use of linked lists and directed acyclic graphs to determine the execution order and time of tasks achieves reasonable resource scheduling.
It improves the efficient utilization of resources in cloud computing services, reduces resource consumption, and lowers the total execution time of tasks.
Smart Images

Figure CN114691323B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of cloud technology, and in particular to a task scheduling method and apparatus based on cloud service environment workflow. Background Technology
[0002] Cloud computing services solve the problem of local server deployment for users. They provide a vast pool of computing resources that can be used to execute tasks over the internet, effectively alleviating the limitations of personal computers' processing and storage capabilities. However, cloud computing is not a panacea; one challenge is optimizing resource allocation between cloud providers and users. While technologies exist to distribute tasks of varying complexity and computational load across cloud servers spanning vast geographical areas, achieving lower resource consumption and faster task completion times remains a subject of exploration. Summary of the Invention
[0003] This invention provides a task scheduling method and apparatus based on cloud service environment workflow, which can reduce cloud computing resource consumption, improve computing energy efficiency, and reduce total project time.
[0004] This invention provides a task scheduling method based on a cloud service environment workflow, comprising:
[0005] Identify multiple tasks and construct corresponding linked lists based on each task;
[0006] A directed acyclic graph is formed based on each linked list, wherein the directed acyclic graph records labels used to identify the dependencies between tasks, and tasks with the same label are stored in the same linked list.
[0007] The execution order of the task and the execution time of the task are determined based on the directed acyclic graph.
[0008] Allocate execution resources to the task with the goal of minimizing the total time to execute all tasks.
[0009] In some examples, determining the execution time of the task includes:
[0010] Break this task down into multiple subtasks;
[0011] Determine the dependencies between the subtasks;
[0012] The execution time of the task is determined based on the dependencies between the subtasks.
[0013] In some examples, determining the execution time of the task also includes:
[0014] Determine the number of reachable tasks for each task and construct an reachability matrix;
[0015] Based on the reachability matrix, a time matrix is constructed using the completion time of the resource and the execution time of the task within that resource, wherein the expected completion time of the task is recorded in the time matrix.
[0016] In some examples, allocating execution resources to a task with the goal of minimizing the total time to execute all tasks includes:
[0017] Based on the execution order of the tasks, the task with the longest maximum completion time in the linked list is allocated resources.
[0018] In some examples, if the maximum completion time for tasks in the linked list is the same, resources are allocated to the task with the minimum completion time.
[0019] If the minimum completion time for tasks in the linked list is the same, the task with the highest reachability will be allocated resources.
[0020] In some examples, allocating execution resources to a task with the goal of minimizing the total time to execute all tasks also includes:
[0021] For each linked list, select the task with the longest expected execution time and assign it to the resource with the shortest execution time.
[0022] In some examples, after allocating execution resources to a task with the goal of minimizing the total time to execute all tasks, the task scheduling method further includes removing the task from the linked list after the task has been completed.
[0023] This application also proposes a task scheduling device based on cloud service environment workflow, including a processor configured as follows:
[0024] Identify multiple tasks and construct corresponding linked lists based on each task;
[0025] A directed acyclic graph is formed based on each linked list, wherein the directed acyclic graph records labels used to identify the dependencies between tasks, and tasks with the same label are stored in the same linked list.
[0026] The execution order of the task and the execution time of the task are determined based on the directed acyclic graph.
[0027] Allocate execution resources to the task with the goal of minimizing the total time to execute all tasks.
[0028] This application also proposes a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps described in the various embodiments of this application.
[0029] This invention utilizes linked lists and directed acyclic graphs to determine the execution order and execution time of a task. This enables reasonable resource scheduling based on task dependencies, thereby improving the resource utilization efficiency of cloud computing services and reducing resource consumption.
[0030] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0031] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0032] Figure 1 This is a basic flowchart of an embodiment of the present invention. Detailed Implementation
[0033] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0034] This invention relates to a workflow-based task scheduling method in a cloud service environment, particularly concerning the allocation of a large number of interdependent tasks in a heterogeneous network environment. This method breaks down and calculates the overall task to reduce resource consumption and save computation time. The invention provides a workflow-based task scheduling method in a cloud service environment, such as... Figure 1 As shown, it includes the following steps:
[0035] In step S101, multiple tasks are identified, and corresponding linked lists are constructed based on each task. In some examples, determining the execution time of a task includes: splitting the task into multiple subtasks; determining the dependencies between the subtasks; and determining the execution time of the task based on the dependencies between the subtasks. Specifically, in this application, a task is split into multiple subtasks during processing, and each subtask is allocated appropriate computing resources for execution. The completion time of such a task is determined by calculating the completion of all its subtasks. These subtasks may be inherently independent or interdependent. If the tasks are independent, they can be executed at any time by allocating executable resources. However, for subtasks with dependencies, such as those requiring the result of one subtask as input for the next, these tasks need to be executed sequentially. Based on this, in this example, for multiple tasks, the dependencies between tasks and the dependencies between the subtasks of the task can be determined. For subtasks without dependencies, parallel execution can be used to complete them, thereby executing multiple tasks at the same time and improving resource utilization.
[0036] In step S102, a directed acyclic graph (DAG) is formed based on each linked list. The DAG records labels used to identify dependencies between tasks, and tasks with the same label are stored in the same linked list. In this example, the runtime of each task is calculated on the DAG, and then global tasks are assigned. This example constructs a DAG to represent the dependencies between tasks and shows the dependencies between them. All tasks are assigned a label number, where the label number represents the depth of the task dependency. All tasks are stored according to their label numbers, and tasks with the same label number are stored in the same linked list.
[0037] In step S103, the execution order of the task is determined according to the directed acyclic graph, and the execution time of the task is determined.
[0038] In step S104, execution resources are allocated to the task with the goal of minimizing the total execution time of all tasks. Specifically, the task with the shortest maximum execution time among all tasks can be given the maximum resources, thereby minimizing the execution time of the selected task.
[0039] This invention utilizes linked lists and directed acyclic graphs to determine the execution order and execution time of a task. This enables reasonable resource scheduling based on task dependencies, thereby improving the resource utilization efficiency of cloud computing services and reducing resource consumption.
[0040] In some examples, determining the execution time of the task also includes:
[0041] Determine the number of reachable tasks for each task and construct an reachability matrix;
[0042] Based on the reachability matrix, a time matrix is constructed using the completion time of the resource and the execution time of the task within that resource, wherein the expected completion time of the task is recorded in the time matrix.
[0043] Specifically, the method in this application categorizes tasks into their smallest individual parts by calculating parameters such as task relevance, minimum estimated completion time, maximum estimated completion time, and reachability. Then, a reachability matrix is constructed based on the number of reachable tasks for each task, and the expected completion time of tasks in the resource pool is calculated as follows:
[0044] The expected completion time of a task in the resource pool = the time spent allocating computing resources + the execution time of the task within that resource.
[0045] Construct a time matrix based on the expected completion time of each task.
[0046] In some examples, allocating execution resources to a task with the goal of minimizing the total execution time of all tasks involves allocating resources based on the task's execution order, choosing the task with the longest maximum completion time in the linked list. In this example, the runtime of each task is calculated on a directed acyclic graph, and then global task allocation is performed, assigning the task with the shortest maximum execution time among all tasks the maximum resources, thus minimizing the execution time of the selected task.
[0047] In some examples, if the maximum completion time for tasks in the linked list is the same, resources are allocated to the task with the minimum completion time. If the minimum completion time for tasks in the linked list is also the same, resources are allocated to the task with the highest reachability. Specifically, the sorted tasks are allocated resources and run in the following order: longest maximum completion time, smallest minimum completion time when maximum completion times are the same, and highest reachability when both maximum and minimum completion times are the same.
[0048] In some examples, allocating execution resources to a task with the goal of minimizing the total time to execute all tasks also includes: selecting the task with the longest expected execution time from each list and allocating that task to the resource with the shortest execution time.
[0049] Specifically, in each linked list, the task with the longest expected completion time is selected. If multiple tasks have the same longest expected completion time, the task with the shortest expected completion time is selected. If multiple tasks have the same longest and shortest expected completion times, the task with the highest reachability is selected. Next, the selected task is assigned to the resource with the shortest execution time. If many resources have the shortest execution time, the task is assigned to the resource with the shortest completion time.
[0050] If the selected task has no prerequisite tasks, the task is assigned to the resource with the shortest execution time and removed from the list. If there are multiple resources with the shortest execution time, the task is assigned to the resource with the shortest completion time for the last task.
[0051] If the selected task has prerequisite tasks, find the longest execution time among all the prerequisite tasks to be executed, and then find the resource span with the shortest execution time for that task. If the longest execution time is greater than or equal to the shortest resource span, allocate resources and complete the task; otherwise, query again until a task that meets the conditions appears. If none of the tasks meet the conditions in the end, select the unassigned task with the longest completion time and allocate resources to it.
[0052] In some examples, after allocating execution resources to a task with the goal of minimizing the total execution time of all tasks, the task scheduling method further includes removing the task from the linked list after its completion. Specifically, completed tasks can be removed from the list, and other processes can continue until all tasks are completed.
[0053] The method presented in this application can improve the resource utilization efficiency of cloud computing services and reduce resource consumption. It can also reduce the total task execution time of cloud computing services, thus improving time efficiency. Furthermore, the method presented in this application outperforms common scheduling algorithms such as HEFT, PETS, and FCFS.
[0054] This application also proposes a task scheduling device based on cloud service environment workflow, including a processor configured as follows:
[0055] Identify multiple tasks and construct corresponding linked lists based on each task;
[0056] A directed acyclic graph is formed based on each linked list, wherein the directed acyclic graph records labels used to identify the dependencies between tasks, and tasks with the same label are stored in the same linked list.
[0057] The execution order of the task and the execution time of the task are determined based on the directed acyclic graph.
[0058] Allocate execution resources to the task with the goal of minimizing the total time to execute all tasks.
[0059] This application also proposes a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps described in the various embodiments of this application.
[0060] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0061] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0062] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0063] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims. All of these forms are within the protection scope of the present invention.
Claims
1. A task scheduling method based on cloud service environment workflow, characterized in that, include: Identify multiple tasks and construct corresponding linked lists based on each task; A directed acyclic graph is formed based on each linked list. The directed acyclic graph records labels used to identify the dependencies between tasks. Tasks with the same label are stored in the same linked list. All tasks are assigned a label number, where the label number represents the depth of task dependency. All tasks are stored according to the label number, and tasks with the same label number are stored in the same linked list. The execution order of the task and the execution time of the task are determined based on the directed acyclic graph. Allocate execution resources to the task with the goal of minimizing the total time to execute all tasks; Determining the execution time of this task also includes: Determine the number of reachable tasks for each task and construct an reachability matrix; Based on the reachability matrix, a time matrix is constructed using the completion time of the resource and the execution time of the task within that resource, wherein the time matrix records the expected completion time of the task; To minimize the total time required to execute all tasks, the execution resources allocated to this task include: Based on the execution order of the tasks, the task with the longest maximum completion time in the linked list is allocated resources.
2. The task scheduling method based on cloud service environment workflow as described in claim 1, characterized in that, Determining the execution time of this task includes: Break this task down into multiple subtasks; Determine the dependencies between the subtasks; The execution time of the task is determined based on the dependencies between the subtasks.
3. The task scheduling method based on cloud service environment workflow as described in claim 1, characterized in that, If the maximum completion time for tasks in the linked list is the same, the task with the minimum completion time is allocated resources. If the minimum completion time for tasks in the linked list is the same, the task with the highest reachability will be allocated resources.
4. The task scheduling method based on cloud service environment workflow as described in claim 1, characterized in that, Allocating execution resources to this task with the goal of minimizing the total time for executing all tasks also includes: For each linked list, select the task with the longest expected execution time and assign it to the resource with the shortest execution time.
5. The task scheduling method based on cloud service environment workflow as described in claim 1, characterized in that, After allocating execution resources to a task with the goal of minimizing the total time for executing all tasks, the task scheduling method further includes: deleting the task from the linked list after the task is completed.
6. A task scheduling device based on cloud service environment workflow, characterized in that, Includes a processor, which is configured as follows: Identify multiple tasks and construct corresponding linked lists based on each task; A directed acyclic graph is formed based on each linked list. The directed acyclic graph records labels used to identify the dependencies between tasks. Tasks with the same label are stored in the same linked list. All tasks are assigned a label number, where the label number represents the depth of task dependency. All tasks are stored according to the label number, and tasks with the same label number are stored in the same linked list. The execution order of the task and the execution time of the task are determined based on the directed acyclic graph. Allocate execution resources to the task with the goal of minimizing the total time to execute all tasks; Determining the execution time of this task also includes: Determine the number of reachable tasks for each task and construct an reachability matrix; Based on the reachability matrix, a time matrix is constructed using the completion time of the resource and the execution time of the task within that resource, wherein the time matrix records the expected completion time of the task; To minimize the total time required to execute all tasks, the execution resources allocated to this task include: Based on the execution order of the tasks, the task with the longest maximum completion time in the linked list is allocated resources.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Task optimized-scheduling method in data center on basis of critical paths of workflow
CN104239141A