Independent task dynamic scheduling method based on cloud computing
By using an independent task dynamic scheduling method coordinated and coordinated by the sorter and scheduler in the cloud computing system, the problem of insufficient real-time task scheduling in the existing technology is solved, and efficient, real-time and load balancing of task scheduling is achieved.
Patent Information
- Application Number
- CN202411548935.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2025-03-11
AI Technical Summary
When pursuing execution efficiency and load balancing, the task scheduling methods in existing cloud computing systems ignore the real-time nature of task scheduling and do not fully consider the characteristics of independent tasks and the working status of the host processor.
A cloud-based independent task dynamic scheduling method is adopted. Through the coordination and cooperation between the sorter and the scheduler, the task list is updated in real time, the sorting priority coefficient is calculated based on the time priority and weight of the task, and the tasks are reordered and allocated through the scheduler to ensure the real-time and efficiency of task scheduling.
It improves the real-time nature of task response, reduces task hunger, ensures task scheduling execution efficiency and load balancing, and adapts to the urgency and processing capabilities of various tasks.
Smart Images

Figure CN119597417A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of cloud computing scheduling, and in particular to a method for dynamic scheduling of independent tasks based on cloud computing. Background Art
[0002] Cloud computing systems have a large number of processors and a variety of task types, and their data centers are always facing massive amounts of data and application tasks. Due to the complex structure and heavy workload of cloud computing systems, the study of task scheduling issues has high value in academic and practical applications.
[0003] At present, there are three most common task scheduling methods: ① First Come First Served (FCFS) algorithm, which assigns the first arriving task to an idle host processor. Although this method is a dynamic scheduling algorithm, it ignores the characteristics of the task and the host processing power. ② Priority Scheduling Algorithm (PSA), which sets a priority for each independent task. The higher the priority, the more urgent the task is, and the earlier it is executed. This method only considers the urgency of the task. There are preemptive and non-preemptive types. It is suitable for real-time operating systems and can flexibly adjust the preference for various task processes. However, when there are a steady stream of high-priority tasks incoming, starvation is prone to occur. ③ Traditional scheduling algorithms, such as MCT (minimum completion time), Min-Min and Suffrage. MCT assigns each task to the processor in any order and completes the task with the shortest completion time of the task. This results in some tasks being assigned to processors that do not have the shortest execution time. The Min-Min heuristic method calculates the minimum completion time set of each task on all processors at the beginning. Among all tasks, the task with the shortest total task completion time is selected and assigned to the labeled processor. The idea of the suffrage heuristic method is that if a specific processor is not assigned to that processor, a better scheduling result can be generated by assigning the processor to the task that is the most "painful" in terms of "expected completion time". For each task, its suffrage value is defined as the difference between its best MCT and its suboptimal MCT. Tasks with higher suffrage values are given priority. The above traditional scheduling algorithm is a static scheduling algorithm. These static scheduling algorithms require information about all tasks before scheduling. However, actual tasks are more often submitted one after another in intervals. This feature makes the static scheduling method unfriendly to real-time effects. Summary of the invention
[0004] The technical problem to be solved by the embodiments of the present invention is to provide a method for dynamic scheduling of independent tasks based on cloud computing, which can correct the problem in the static scheduling algorithm that too much energy is placed on execution efficiency and load balancing while ignoring the important issue of real-time task scheduling, and also fully consider the characteristics of each independent task and the working status of the host processor.
[0005] In order to solve the above technical problems, an embodiment of the present invention provides a method for dynamic scheduling of independent tasks based on cloud computing, comprising the following steps: S1: The user submits the task to the cloud computing system according to the standard; S2: Use the sequencer to read the task; S3: sort and update the tasks read in the sorter, and update to obtain a task list; S4: Obtain the first m tasks in the task list to the scheduler and reorder them; S5: Establish a host list, obtain a local task sublist and the host list through the scheduler, and allocate tasks in the local task sublist.
[0006] Wherein, the S2 further comprises the steps of: S21: After the user submits the task, the operation status of the cloud computing system is searched to determine the number of nodes Node_F and Node_U in the free list and the occupied list in the system; S22: If the free list is not empty, the number of Node_F in the free list is reduced by 1, the number of Node_U in the occupied list is increased by 1, and a number ID is assigned to the task; S23: If the free list is empty and the occupied list is full, it means that the number of waiting tasks in the cloud computing system has been saturated, and the task is rejected and a prompt message is returned to the user; S24: For a task that has been successfully submitted, if the task is completed or an abnormality occurs in the scheduling of the task, the number of nodes Node_U in the occupied list is reduced by 1, and the number of nodes Node_F in the free list is increased by 1.
[0007] Wherein, the S3 further comprises the steps of: S31: Read the submitted tasks into the task list of the sequencer; S32: Calculate the time priority of task i at time t and the priority coefficient of task i at time t , update the task sorting in the task list.
[0008] Wherein, the S32 further comprises the steps of: S321: Calculate the waiting time of task i at time t based on the submission time of task i:
[0009] in, Indicates the time the current task i has been waiting. represents the time when the current task i is submitted, and t represents the current time; S322: Calculate the time priority according to the execution time and waiting time of task i:
[0010] in, represents the time priority of task i at time t, represents the execution time weight of the task, represents the waiting time weight of the task, represents the execution time of task i on the standard host; S323: Calculate the sorting priority coefficient of task i according to the time priority and task weight of task i;
[0011] in, represents the sorting priority coefficient of task i at time t, represents the task weight of task i; S324: Based on the running time of each task stored in the database, the sorter calculates the sorting priority coefficient of each task. After that, sort the tasks in descending order according to the priority coefficients, and update the task list [ ].
[0012] Wherein, the S4 further comprises the steps of: S41: Get task list [ ]; if the amount of tasks in the task list is greater than the specified threshold m, the first m tasks in the task list are taken to the scheduler; if the amount of tasks in the task list is less than the specified threshold m, all tasks in the task list are taken to the scheduler; S42: reordering the acquired tasks through the scheduler; The order of the m tasks is shuffled, and then re-arranged according to the length of the m tasks, and k sub-lists are obtained by sorting. The amount of tasks in each list is : [ ] [ ] . . . . [ ] The above k sublists are the k local task sublists after the scheduler reorders the tasks; S43: Obtain a host list through the scheduler, and divide the z hosts of the system into k host lists from high to low based on the differences in network bandwidth and processors of different hosts and the differences in processing capabilities of the hosts: [ ] [ ] . . . . [ ] Each host list has the number of hosts The hosts in the same list have similar processing capabilities for tasks.
[0013] Wherein, the S5 further comprises the steps of: S51: Obtain the local task sublist and the host list through the scheduler to form a corresponding relationship; S52: If the local task sublist is not empty, select the task that takes the longest time in the sublist and assign it to the host with the shortest remaining completion time in the corresponding host list, and return to S4.1; S53: If some local task sublists are empty, the tasks in the non-empty sublists are added to the empty sublists one by one, until some sublists are empty and other sublists are the last tasks, and the corresponding hosts complete the remaining tasks.
[0014] The step S6 is also included, and the step S6 includes the following steps: S61: Establish a database for storing tasks that have been run by the system, recording the running time of the tasks and the computing power of the host; S62: The database sets a storage time of Day for the stored task. If the same task is executed within this Day, the inventory time of the task is updated to Day. If the task is not revisited within this Day, the task is deleted from the database. S63: The scheduler sorts the hosts according to their computing capabilities and divides them into k host lists.
[0015] The implementation of the embodiments of the present invention has the following beneficial effects: ① The present invention utilizes the mutual cooperation between the sorter and the scheduler, which does not affect the execution efficiency and load balancing of task scheduling, while continuously sorting and updating the sorting list according to the tasks submitted by the user, greatly improving the real-time performance of the task response.
[0016] ② Optimize the sorting method of tasks in the sorter in parallel, taking into account both the time priority of the tasks and the weight of each task (task urgency). While ensuring the real-time performance of the sorter, the weight of each task can also be flexibly adjusted.
[0017] ③ Based on the existing sorter, during the sorting process, the sorting priority coefficient of each task is obtained through a simple mathematical formula. When a steady stream of high-priority tasks are submitted, the corresponding sorting priority coefficient is generated in combination with the time priority of the task, and the task starvation phenomenon is greatly reduced.
[0018] ④ In the scheduler, the tasks are re-sorted according to their length and divided into several local task sub-lists. At the same time, the host list is also sorted according to the host processor and network environment. Each host corresponds to a corresponding local task sub-list, which improves the execution efficiency of task scheduling. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 It is a schematic diagram of task scheduling in the present invention; Figure 2 It is a schematic diagram of the task scheduling process of the present invention. DETAILED DESCRIPTION
[0020] In order to make the objectives, technical solutions and advantages of the present invention more clear, the present invention will be further described in detail below with reference to the accompanying drawings.
[0021] Combination Figure 1 , Figure 2 As shown, a method for dynamic scheduling of independent tasks based on cloud computing according to an embodiment of the present invention is implemented by the following method.
[0022] S1: The user submits tasks to the cloud computing system in a standard submission manner; S2: The sequencer reads the task; S21: After the task is submitted, the operation status of the cloud computing system is first retrieved to determine the number of nodes Node_F and Node_U in the free list and the occupied list in the system; S22: If the free list is not empty, the number of Node_F in the free list is reduced by 1, the number of Node_U in the occupied list is increased by 1, and a number ID is assigned to the task; If the free list is empty and the occupied list is full, it means that the number of waiting tasks in the cloud computing system is saturated, then the task is rejected and a prompt message is returned to the user; 2.3: For tasks that have been successfully submitted, if the task is completed or an abnormal situation occurs in the scheduling of the task, the number of nodes Node_U in the occupied list will be reduced by 1, and the number of nodes Node_F in the free list will be increased by 1; the total number of free lists and occupied lists in the system is set by the user, and the total number is the maximum value of the total number of waiting tasks and running tasks in the cloud computing system.
[0023] S3: The sorting method of the sorter for tasks; S31: Read the successfully submitted tasks into the task list of the sequencer; S32: Calculate the time priority of task i at time t using a simple mathematical formula and the priority coefficient of task i at time t , update the task order in the task list; S321: Calculate the waiting time of task i at time t based on the submission time of task i:
[0024] in, Indicates the time the current task i has been waiting. represents the time when the current task i is submitted, and t represents the current time; S322: Calculate the time priority according to the execution time and waiting time of task i:
[0025] in, represents the time priority of task i at time t, represents the execution time weight of the task, represents the waiting time weight of the task, represents the execution time of task i on the standard host; S33: Calculate the sorting priority coefficient of task i according to the time priority and task weight of task i;
[0026] in, represents the sorting priority coefficient of task i at time t, represents the task weight (task urgency) of task i; S34: The system database stores the running time of each task, and the sorter calculates the sorting priority coefficient of each task based on it. After that, sort the tasks in descending order according to the priority coefficients, and update the task list [ ]; S4: Coordination between scheduler and sequencer; S41: Get task list [ ]; (1) If the number of tasks in the task list is greater than the specified threshold m, the first m tasks in the task list are taken to the scheduler; (2) If the number of tasks in the task list is less than the specified threshold m, all tasks in the task list are obtained and put into the scheduler; S42: The scheduler reorders the acquired tasks; The order of the m tasks is shuffled, and then re-arranged according to the length of the m tasks, and k sub-lists are obtained by sorting. The amount of tasks in each list is : [ ] [ ] . . . . [ ] The above k sublists are the k local task sublists after the scheduler reorders the tasks; S43: The scheduler obtains the host list: Based on the differences in network bandwidth and processors of different hosts, the system's z hosts are divided into k host lists from high to low according to the host processing capabilities: [ ] [ ] . . . . [ ] Each host list has the number of hosts The hosts in the same list have similar processing capabilities for tasks; S5: The scheduler's method of allocating tasks; S51: The scheduler obtains the local task sublist and the host list to form a corresponding relationship, that is, the task in the j-th local task sublist and the j-th host list form a corresponding relationship; S52: If the local task sublist is not empty, the longest time-consuming task is selected from the sublist and assigned to the host with the shortest remaining completion time in the corresponding host list, and the process returns to step 4.1; S53: If some local task sublists are empty, the tasks in the sublists that are not empty are added to the empty sublists one by one, until some sublists are empty and the other sublists are the last tasks, and the corresponding hosts complete the remaining tasks; S6: Establishment of database of cloud computing system; S61: The amount of tasks in the cloud computing system is so large that most of the tasks executed in a certain period of time are tasks that have been executed by the system before. Therefore, a database is established to store the tasks that have been executed by the system, record the running time of the tasks and the computing power of the host; S62: The database in this system sets a storage time of Day for the stored tasks. If the same task is executed within this Day, the inventory time of the task is updated to Day. If the task is not revisited within this Day, the task is deleted from the database (the storage time D can be set by the user according to the system storage capacity and task volume); S63: The hosts stored in the database of this system are relative values of their computing power relative to the standard hosts (the computing power of each host is different due to different computing units and host network bandwidths). The scheduler then sorts the hosts according to their computing power and divides them into k host lists.
[0027] The implementation of the present invention has the following advantages: ① The present invention utilizes the coordination and cooperation of the sorter and the scheduler. The sorter continuously performs initial sorting on the task list through newly submitted tasks, and the scheduler obtains the tasks in the sorter and re-sorts them, thereby ensuring the execution efficiency of task scheduling and improving the real-time performance of task scheduling.
[0028] ② The present invention optimizes the sorting method of tasks in the sorter in parallel by taking into full account the running time priority and urgency of the tasks, and calculating the sorting priority coefficient of the tasks through a concise mathematical formula; reducing the starvation phenomenon of tasks to a certain extent, making task scheduling more reasonable.
[0029] ③ In the present invention, the scheduler re-sorts the tasks according to the length of the jobs and divides them into k local task sub-lists, sorts the hosts according to different execution capabilities and divides them into k host lists, and allocates tasks in the task list and the host list accordingly, thereby improving the execution efficiency of the tasks.
[0030] The above disclosure is only a preferred embodiment of the present invention, which certainly cannot be used to limit the scope of the present invention. Therefore, equivalent changes made according to the claims of the present invention are still within the scope of the present invention.
Claims
1. A method for dynamic scheduling of independent tasks based on cloud computing, characterized in that: The following steps are involved: S1: The user submits the task to the cloud computing system according to the standard; S2: Use the sequencer to read the task; S3: sort and update the tasks read in the sorter, and update to obtain a task list; S4: Obtain the first m tasks in the task list to the scheduler and reorder them; S5: Establish a host list, obtain a local task sublist and the host list through the scheduler, and allocate tasks in the local task sublist.
2. The independent task dynamic scheduling method based on cloud computing according to claim 1 is characterized in that: The S2 further comprises the steps of: S21: After the user submits the task, the operation status of the cloud computing system is searched to determine the number of nodes Node_F and Node_U in the free list and the occupied list in the system; S22: If the free list is not empty, the number of Node_F in the free list is reduced by 1, the number of Node_U in the occupied list is increased by 1, and a number ID is assigned to the task; S23: If the free list is empty and the occupied list is full, it means that the number of waiting tasks in the cloud computing system has been saturated, and the task is rejected and a prompt message is returned to the user; S24: For a task that has been successfully submitted, if the task is completed or an abnormality occurs in the scheduling of the task, the number of nodes Node_U in the occupied list is reduced by 1, and the number of nodes Node_F in the free list is increased by 1.
3. The independent task dynamic scheduling method based on cloud computing according to claim 1 is characterized in that: The S3 further comprises the steps of: S31: Read the submitted tasks into the task list of the sequencer; S32: Calculate the time priority of task i at time t and the priority coefficient of task i at time t , update the task sorting in the task list.
4. The independent task dynamic scheduling method based on cloud computing according to claim 3 is characterized in that: The S32 further comprises the steps of: S321: Calculate the waiting time of task i at time t based on the submission time of task i: in, Indicates the time the current task i has been waiting. represents the time when the current task i is submitted, and t represents the current time; S322: Calculate the time priority according to the execution time and waiting time of task i: in, represents the time priority of task i at time t, represents the execution time weight of the task, represents the waiting time weight of the task, represents the execution time of task i on the standard host; S323: Calculate the sorting priority coefficient of task i according to the time priority and task weight of task i; in, represents the sorting priority coefficient of task i at time t, represents the task weight of task i; S324: Based on the running time of each task stored in the database, the sorter calculates the sorting priority coefficient of each task. After that, sort the tasks in descending order according to the priority coefficients, and update the task list [ ].
5. The independent task dynamic scheduling method based on cloud computing according to claim 4 is characterized in that: The S4 further comprises the steps of: S41: Get task list [ ]; if the amount of tasks in the task list is greater than the specified threshold m, the first m tasks in the task list are taken to the scheduler; if the amount of tasks in the task list is less than the specified threshold m, all tasks in the task list are taken to the scheduler; S42: reordering the acquired tasks through the scheduler; The order of the m tasks is shuffled, and then re-arranged according to the length of the m tasks, and k sub-lists are obtained by sorting. The amount of tasks in each list is : [ ] [ ] . . . . [ ] The above k sublists are the k local task sublists after the scheduler reorders the tasks; S43: Obtain a host list through the scheduler, and divide the z hosts of the system into k host lists from high to low based on the differences in network bandwidth and processors of different hosts and the differences in processing capabilities of the hosts: [ ] [ ] . . . . [ ] Each host list has the number of hosts The hosts in the same list have similar processing capabilities for tasks.
6. The independent task dynamic scheduling method based on cloud computing according to claim 5 is characterized in that: The S5 further comprises the steps of: S51: Obtain the local task sublist and the host list through the scheduler to form a corresponding relationship; S52: If the local task sublist is not empty, select the task that takes the longest time in the sublist and assign it to the host with the shortest remaining completion time in the corresponding host list, and return to S4.1; S53: If some local task sublists are empty, the tasks in the non-empty sublists are added to the empty sublists one by one, until some sublists are empty and other sublists are the last tasks, and the corresponding hosts complete the remaining tasks.
7. The independent task dynamic scheduling method based on cloud computing according to any one of claims 1 to 6, characterized in that: The step of S6 is also included, wherein S6 includes the steps of: S61: Establish a database for storing tasks that have been run by the system, recording the running time of the tasks and the computing power of the host; S62: The database sets a storage time of Day for the stored task. If the same task is executed within this Day, the inventory time of the task is updated to Day. If the task is not revisited within this Day, the task is deleted from the database. S63: The scheduler sorts the hosts according to their computing capabilities and divides them into k host lists.