Task scheduling method and device

By designing a task scheduling method on the virtual machine, obtaining and adjusting the priority and virtual running time of tasks, the problem of uneven scheduling of high-priority tasks and low-priority tasks in the existing technology is solved, and efficient resource utilization and fair task scheduling are achieved.

CN114327843BActive Publication Date: 2025-05-16HUAWEI TECH CO LTD

Patent Information

Application Number
CN202011053405.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-29
Publication Date
2025-05-16
Estimated Expiration
2040-09-29

AI Technical Summary

Technical Problem

In the prior art, the task scheduler on the virtual machine cannot meet the priority scheduling of high-priority tasks and the fair scheduling of low-priority tasks, resulting in low resource utilization and low-priority tasks hunger.

Method used

Design a task scheduling method, by obtaining the priority of tasks to be executed by virtual machines, determining the highest priority tasks, and adjusting them according to the virtual run time, ensuring priority execution of high-priority tasks, and at the same time achieving fair scheduling of tasks within the same priority group.

Benefits of technology

The priority scheduling of high-priority tasks on the virtual machine and the fair scheduling of same-priority tasks are realized, which improves resource utilization and avoids the hunger of low-priority tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114327843B_ABST
    Figure CN114327843B_ABST
Patent Text Reader

Abstract

The present application provides a task scheduling method and device. When scheduling tasks to be executed by a first target virtual machine, the scheduler first obtains at least one task with the highest priority in the queue of tasks to be executed by the first target virtual machine to ensure that the task with the highest priority is executed first, and then further determines the first task with the shortest virtual running time among the at least one task with the highest priority, and finally controls the first target virtual machine to execute the first task, thereby ensuring fair scheduling of tasks among at least one task with the same priority. Therefore, the present application enables the scheduler to ensure that high-priority tasks are scheduled first and that fairness is met when scheduling tasks on the first target virtual machine.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a task scheduling method and device. Background Art

[0002] In the computer field, virtual machine technology allows a server to execute multiple operating systems at the same time. Each operating system can be used as a virtual machine and executed in an independent environment without affecting each other. Therefore, more and more service providers provide virtual machine services, and users can use the computing services provided by the service provider's virtual machines. For service providers, since virtual machines used by different users can be executed on the same server, the utilization rate of the servers deployed by the service provider is greatly improved. At the same time, when users use the virtual machines provided by the service provider, they usually apply for virtual machine resources according to the peak amount of computing required, and the service provider will also divide the server resources according to the peak amount of computing to different virtual machines. However, in actual use, users usually do not use all the virtual machine resources they apply for, resulting in low utilization of the virtual machine resources allocated by the server to each user.

[0003] Therefore, in order to make more reasonable use of the limited resources on the server, in the prior art, the service provider can execute tasks of different users in the same virtual machine resource allocated to the user. Since the task types and priorities of different users are different, a scheduler can be set in the server to uniformly manage and schedule the tasks that need to be executed in the virtual machine resources. ①. In one implementation, the scheduler manages the tasks executed in the virtual machine through a completely fair scheduling strategy, wherein the scheduler allocates different execution times to all tasks executed in the virtual machine according to the priority weight value of each task, so as to ensure that all tasks are executed. However, this scheduler can only ensure that tasks with higher priorities are allocated more execution time, but cannot guarantee priority scheduling of tasks with higher priorities, nor can it guarantee that high-priority tasks preempt the execution of low-priority tasks. ②. In another implementation, the scheduler manages the tasks executed in the virtual machine through a real-time scheduler strategy, wherein the scheduler first executes the first task that enters the queue among the highest priority tasks according to the priorities of all tasks, or executes multiple tasks with the highest priority in turn. However, this scheduler can only execute lower priority tasks after higher priority tasks have been executed. Therefore, it cannot guarantee the fairness of scheduling tasks of the same priority, and cannot solve the problem of low priority task starvation caused by scheduling.

[0004] In summary, in the prior art, both the completely fair scheduling strategy and the real-time scheduler strategy have their own shortcomings. When different types of tasks can be executed on a virtual machine, it is impossible to simultaneously meet the fairness of scheduling high-priority tasks and ensuring that low-priority tasks are also scheduled. Therefore, how to design a scheduler that can be used to schedule tasks of different priorities executed on a virtual machine while also meeting the fairness of scheduling is a technical problem that urgently needs to be solved in this field. Summary of the invention

[0005] The present application provides a task scheduling method and device, so that a scheduler can ensure that high-priority tasks are scheduled first and that fairness is met when scheduling tasks with the same priority level when scheduling tasks to be executed by a virtual machine.

[0006] A first aspect of the present application provides a task scheduling method, which is used for a scheduler to meet the priority requirements of the scheduled tasks while ensuring fair scheduling of the tasks when scheduling tasks to be executed by a first target virtual machine.

[0007] Among them, when scheduling the tasks to be executed by the first target virtual machine, the scheduler first obtains at least one task with the highest priority in the queue of tasks to be executed by the first target virtual machine to ensure that the task with the highest priority is executed first, and then further determines the first task with the shortest virtual running time among the at least one task with the highest priority, and finally controls the first target virtual machine to execute the first task, thereby ensuring fair scheduling of tasks among at least one task with the same priority. That is to say, this embodiment enables the scheduler to ensure that high-priority tasks are scheduled first and satisfy fairness in scheduling tasks with the same priority when scheduling tasks on the first target virtual machine.

[0008] In an embodiment of the first aspect of the present application, a scheduler as an execution subject can schedule multiple virtual machines at the same time, and when the scheduler schedules a task to be executed by a first target virtual machine among multiple virtual machines, it can be achieved by controlling the first scheduler of the first target virtual machine. For example, the scheduler can determine the priority of multiple tasks to be executed by the first target virtual machine through the queue of tasks to be executed stored in the first scheduler. For another example, when the scheduler controls the first target virtual machine to execute the first task, it can specifically adjust the order of the queue of tasks to be executed in the first scheduler to adjust the first task to the front of the queue of tasks to be executed.

[0009] For at least one task with the highest priority among the tasks to be executed by the first target virtual machine determined by the scheduler, the present application provides at least the following three specific implementation methods:

[0010] In a first method provided in an embodiment of the first aspect of the present application, based on the first target virtual machine's queue of tasks to be executed stored in the first scheduler, the scheduler can obtain all tasks in the queue of tasks to be executed from the first scheduler when determining at least one task with the highest priority, and then determine the priorities corresponding to all tasks, and finally determine at least one task with the highest priority.

[0011] In the second method provided in an embodiment of the first aspect of the present application, when the first scheduler schedules the tasks to be executed of the first target virtual machine, in addition to storing all the tasks to be executed, the priorities of all the tasks in the queue are also recorded, for example, in a table. Then, when the scheduler determines the priorities of the tasks to be executed of the first target virtual machine, it can directly obtain the priorities corresponding to all tasks from the table without obtaining each task itself, thereby reducing the amount of calculation and improving efficiency.

[0012] In the third method provided by an embodiment of the first aspect of the present application, when the first scheduler schedules the tasks to be executed of the first target virtual machine, it can set multiple different queues to store tasks, and the priorities of the queues stored in each queue are different. Then, when the scheduler determines at least one task with the highest priority among the tasks to be executed by the first target virtual machine, it can directly obtain the at least one task from the queue with the highest priority stored in the first scheduler without processing tasks of other priorities on other queues, which can also reduce the amount of calculation and improve efficiency.

[0013] The second aspect of the present application provides a task scheduling method, which is used for a scheduler to schedule a first target virtual machine to perform a task. When the priority of a task in the first target virtual machine's to-be-executed task queue is adjusted, the scheduler adjusts the virtual running time of the task according to the priority of the task after the priority adjustment, so as to achieve the preemption of the currently executing task of the first target virtual machine by the high-priority task, so as to meet the dynamic scheduling of the first target virtual machine to execute the task.

[0014] Among them, assuming that the first target virtual machine is executing the third task, if at this time the priority of the second task in the tasks to be executed by the first target virtual machine is adjusted, for example, from the second priority to the first priority, then according to the minimum virtual machine running time of at least one task with the same first priority to be executed by the first target virtual machine, the virtual running time of the second task is adjusted, for example, from the first virtual running time to the second virtual running time. Finally, when the priority of the second task is higher than the priority of the third task, the scheduler immediately controls the first target virtual machine to execute the second task, thereby realizing the preemptive execution of the second task on the task currently executed by the first target virtual machine, and realizing dynamic scheduling of tasks.

[0015] In an embodiment of the second aspect of the present application, when the scheduler adjusts the virtual runtime of the second task, the goal of the adjustment is to adjust the adjusted second virtual runtime to be greater than the smallest virtual runtime of at least one task corresponding to the first priority among all the tasks to be executed in the first target virtual machine. In other words, the virtual runtime of the second task is adjusted so that its virtual runtime is as small as possible, but cannot be less than the smallest virtual runtime of the task with the same priority.

[0016] In an embodiment of the second aspect of the present application, the scheduler determines that the priority of the second task needs to be adjusted based on the instruction information sent by the user, so that after the user adjusts the to-be-executed tasks of the first target virtual machine through the scheduler, the scheduler can adjust the virtual running time of the task, thereby realizing dynamic adjustment of the task by the user, enriching the application scenarios, and improving the user experience.

[0017] In an embodiment of the second aspect of the present application, when the scheduler adjusts the virtual running time of the second task, it specifically adds the first virtual running time Ta of the second task before adjustment to the smallest virtual running time minB in the same priority level, and then subtracts the minimum value of the virtual running time in at least one task corresponding to the second priority level, which is recorded as minA. That is, the first virtual running time is adjusted to the second virtual running time through the formula second virtual running time = (Ta-minA) + minB, so that the adjusted second virtual running time in the task corresponding to the first priority level is slightly larger than the minimum value of the virtual running time in at least one task of the first priority level.

[0018] The third aspect of the present application provides a task scheduling method, which is applied to a scheduler when scheduling tasks in a first target virtual machine. When there are low-priority tasks in the waiting-to-run task queue of the first target virtual machine that have not been executed, the low-priority tasks can be actively migrated to other virtual machines (recorded as second target virtual machines) for execution, thereby preventing the starvation problem of low-priority tasks caused by the priority scheduling of high-priority tasks when the first target virtual machine executes tasks of multiple priorities.

[0019] Among them, when the scheduler executes the fourth task in the first target virtual machine, it simultaneously obtains the time recording information of the fourth task in the first scheduler of the first target virtual machine, and judges whether the fifth task with a lower priority has a starvation problem based on the time recording information. After the time recording information meets the preset conditions, the first scheduler of the first target virtual machine is controlled to send the fifth task to the second scheduler of the second target virtual machine, so that the second target virtual machine executes the fifth task, thereby realizing the scheduling of the fifth task between different virtual machines, so that the fifth task will not stay in the to-be-executed queue of the first scheduler due to its low priority, thereby preventing the occurrence of starvation problems.

[0020] More specifically, the time recording information provided by this application may include at least the following two possible implementations:

[0021] In an embodiment of the third aspect of the present application, one possible implementation of the time recording information is: it can be used to record the execution time of the fourth task that has been executed by the first target virtual machine, and the preset condition can be that the execution time of the fourth task is less than the first threshold. Among them, it can prevent the fifth task with a lower priority from being executed due to the higher priority of the fourth task, which will cause the starvation problem of the fifth task. Therefore, the scheduler can determine that the execution time of the fourth task is greater than the first threshold and meets the preset condition, and then schedule the second target virtual machine to execute the fifth task.

[0022] In an embodiment of the third aspect of the present application, another possible implementation of the time recording information is: used to record the waiting time of the fifth task in the to-be-executed task queue of the first scheduler, and the preset condition may be that the waiting time of the fifth task is greater than the second threshold. Similarly, in order to prevent the starvation problem of the fifth task, the scheduler may determine that the waiting time of the fifth task is greater than the second threshold and satisfies the preset condition, and then schedule the second target virtual machine to execute the fifth task.

[0023] Optionally, when the scheduler schedules the second target virtual machine to perform the fifth task, the second target virtual machine may be selected with reference to certain criteria.

[0024] For example, in an embodiment of the third aspect of the present application, the second target virtual machine can be determined in the following order: give priority to idle virtual machines in the cloud server, then select virtual machines with lower task priority and lighter load on the scheduling queue of the virtual machines in the cloud server, and finally select virtual machines with lower task priority but heavier load on the scheduling queue of the virtual machines in the cloud server / virtual machines with higher task priority but lighter load on the scheduling queue of the virtual machines in the server.

[0025] For example, in another embodiment of the third aspect of the present application, the second target virtual machine can also be a virtual machine specially set up in the cloud server, which is dedicated to executing tasks scheduled by the scheduler from other virtual machines in the scenario of preventing starvation problems, and when not scheduled by the scheduler, the virtual machine will not execute other tasks.

[0026] The fourth aspect of the present application provides a task scheduling device, which can be used to execute the task scheduling method of the first aspect of the present application, and the device includes: an acquisition module, a priority determination module, a virtual run time determination module and a control module. Among them, the acquisition module is used to obtain the priorities of multiple tasks to be executed by the first target virtual machine; the priority determination module is used to determine at least one task with the highest priority among the multiple tasks; the virtual run time determination module is used to determine the first task with the smallest virtual run time from at least one task; and the control module is used to control the first target virtual machine to execute the first task.

[0027] In an embodiment of the fourth aspect of the present application, the acquisition module is specifically used to determine the priorities of multiple tasks to be executed by the first target virtual machine based on the queue of tasks to be executed stored by the first scheduler in the first target virtual machine.

[0028] In an embodiment of the fourth aspect of the present application, the acquisition module is specifically used to traverse the priorities of all tasks in the queue of tasks to be executed stored by the first scheduler, and determine at least one task with the highest priority from the queue of tasks to be executed.

[0029] In an embodiment of the fourth aspect of the present application, the acquisition module is specifically used to determine at least one task with the highest priority among multiple tasks through the priority record information stored in the first scheduler; wherein the priority record information is used to record the priorities of all tasks on the queue of tasks to be executed by the first scheduler.

[0030] In an embodiment of the fourth aspect of the present application, the acquisition module is specifically used to determine at least one task with the highest priority based on the tasks in the queue corresponding to the highest priority stored in the first scheduler; wherein the first scheduler stores the tasks to be executed through multiple queues, and each queue corresponds to a different priority.

[0031] The fifth aspect of the present application provides a task priority adjustment device, which can be used to execute the task scheduling method provided in the second aspect of the present application, and the device includes: an acquisition module, a virtual runtime adjustment module, and a control module. Among them, the acquisition module is used to obtain the minimum virtual runtime corresponding to at least one task of the first target virtual machine to be executed with the same priority as the first priority when the priority of the second task to be executed by the first target virtual machine is adjusted from the second priority to the first priority; the virtual runtime adjustment module is used to adjust the first virtual runtime corresponding to the second task to the second virtual runtime according to the minimum virtual runtime; the control module is used to control the first target virtual machine to execute the second task when the first priority is higher than the priority of the third task being executed by the first target virtual machine.

[0032] In an embodiment of the fifth aspect of the present application, the second virtual running time is greater than the smallest virtual running time of the virtual running time of at least one task of the first priority in the queue of tasks to be executed stored in the first scheduler of the first target virtual machine.

[0033] In an embodiment of the fifth aspect of the present application, the task scheduling device further includes: a receiving module, configured to receive indication information, and determine, based on the indication information, that the priority of the second task is adjusted from the second priority to the first priority.

[0034] In an embodiment of the fifth aspect of the present application, the virtual time adjustment module is specifically used to add the minimum virtual running time to the first virtual running time, and then subtract the minimum virtual running time of the virtual running time of at least one task corresponding to the first priority in the task queue to be executed, to obtain the second virtual running time.

[0035] The sixth aspect of the present application provides a task scheduling device, which can be used to execute the task scheduling method provided in the third aspect of the present application, and the device includes: an acquisition module and a control module. The acquisition module is used to acquire the time recording information stored by the first scheduler of the first target virtual machine; the time recording information is used to record the execution time of the fourth task, and the fourth task corresponds to the third priority, or the time recording information is used to record the waiting time of the fifth task in the queue of tasks to be executed stored in the first scheduler, and the priority corresponding to the fifth task is lower than the third priority; the control module is used to control the first scheduler of the first target virtual machine to send the fifth task to the second scheduler of the second target virtual machine when the time recording information meets the preset conditions, so that the second target virtual machine executes the fifth task.

[0036] In an embodiment of the sixth aspect of the present application, when the time recording information is used to record the execution time of the fourth task, the preset condition includes: the execution time of the fourth task is greater than the first threshold.

[0037] In an embodiment of the sixth aspect of the present application, when the time recording information records the waiting time of the fifth task in the to-be-executed task queue of the first scheduler, the preset condition includes: the waiting time is greater than the second threshold.

[0038] In an embodiment of the sixth aspect of the present application, the second target virtual machine is an idle virtual machine among the multiple virtual machines deployed on the host where the first target virtual machine is located; or, the second target virtual machine is a virtual machine among the multiple virtual machines deployed on the host whose load is less than a third threshold; or, the second target virtual machine is a scheduler for executing tasks of a fourth priority among the multiple virtual machines deployed on the host, wherein the fourth priority is lower than the third priority.

[0039] In an embodiment of the sixth aspect of the present application, the second target virtual machine is a scheduler dedicated to executing the fifth task when the time recording information meets a preset condition.

[0040] A seventh aspect of the present application provides an electronic device, including: a processor and a communication interface.

[0041] The communication interface is used to realize the connection and communication between the communication device and the peripheral device.

[0042] The processor is used to implement the method described in any one of the first aspect, the second aspect or the third aspect.

[0043] As a possible design, the above-mentioned communication device also includes: a memory.

[0044] The memory is used to store a computer program, and the processor executes the computer program stored in the memory, so that the device performs the method described in any one of the first aspect, the second aspect or the third aspect.

[0045] An eighth aspect of the present application provides a chip, including: a processor and a communication interface;

[0046] The communication interface is used to realize communication with other devices;

[0047] The processor is used to read instructions to implement the method as described in any one of the first aspect, the second aspect or the third aspect.

[0048] In a ninth aspect, the present application provides a computer program product, which includes a computer program code. When the computer program code is executed by a computer, the computer executes the method described in any one of the first, second or third aspects above. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 A schematic diagram of the application scenario of this application;

[0050] Figure 2 A schematic diagram of the structure of a cloud server using a virtual machine structure;

[0051] Figure 3 A schematic diagram of a module for scheduling virtual machines in a cloud server;

[0052] Figure 4 This is a schematic diagram of the working principle of the completely fair scheduler;

[0053] Figure 5 This is a schematic diagram of the working principle of the real-time scheduler;

[0054] Figure 6 A schematic diagram of the structure of a cloud server used in a task scheduling method provided in this application;

[0055] Figure 7 A deployment diagram of a cloud server cluster provided for this application;

[0056] Figure 8 A flowchart of an embodiment of a task scheduling method provided by the present application;

[0057] Fig. 9 A schematic diagram of the scheduling process in the task scheduling method provided in this application;

[0058] Fig.10 A flowchart of an embodiment of a task scheduling method provided by the present application;

[0059] Fig.11 A schematic diagram of the scheduling process in the task scheduling method provided in this application;

[0060] Fig.12 A flowchart of an embodiment of a task scheduling method provided by the present application;

[0061] Fig.13 A flowchart of an embodiment of a task scheduling method provided by the present application;

[0062] Fig.14 A schematic diagram of the scheduling process in the task scheduling method provided in this application;

[0063] Fig.15 A structural diagram of an embodiment of a task scheduling device provided by the present application;

[0064] Fig.16 A structural diagram of an embodiment of a task scheduling device provided by the present application;

[0065] Fig.17 A structural diagram of an embodiment of a task scheduling device provided by the present application;

[0066] Fig.18A schematic structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0067] Figure 1 Schematic diagram of the application scenario of the present application, wherein the present application is applied in the hybrid deployment field of the data center, for example, in Figure 1 In the scenario shown, the cloud computing service provider can set up multiple cloud servers 3 in the Internet 2, and the cloud servers 3 provide computing services. When the terminal device 1 used by the user needs certain computing resources, it can directly use, apply to, or pay a certain fee to the supplier to obtain the cloud computing service provided by the cloud server 3. For example, when the terminal device 1 used by the user performs a large computing task such as gene sequencing, it may take several days to calculate only by relying on the computing power provided by the CPU of the terminal device 1, which is inefficient. At this time, the user can use the computing resources (such as CPU) of the cloud server 3 to perform the computing task of gene sequencing, so that the terminal device 1 can obtain the calculation results of gene sequencing in a few minutes or less, thereby enabling the user to obtain higher computing efficiency. At the same time, using the server 3 set up in the Internet 2 for computing can also allow the user to use more computing resources without the need to specially install or upgrade the terminal device 1 used, and also reduce the economic cost of the user's computing. Since the computing resources used by the user are provided by the cloud server 3 set up by the supplier on the network side, this scenario of using network resources for computing can also be called "cloud computing".

[0068] As a supplier of cloud server 3, in order to save resources and reduce costs, multiple virtual machines can be set up on one cloud server 3 through virtual machine technology to provide computing resources to different users. Among them, virtual machine technology refers to a complete computer system with complete hardware system functions that is simulated by software and executed in each independent environment. For example, Figure 2 A schematic diagram of the structure of a cloud server using a virtual machine structure is shown in FIG. Figure 1 Taking the cloud server 3 in the scenario shown as an example, the provider installs an operating system (the operating system may also be called a host operating system (host OS), such as Linux, etc.) based on the system resources (e.g., CPU, memory, hard disk, etc.) of the cloud server 3, and different virtual machines can be executed in the operating system. Figure 1The three terminal devices 11-13 shown provide computing services. The computing resources requested by terminal device 11 can account for 30% of the CPU computing power in the system resources of cloud server 3, the computing resources requested by terminal device 12 can account for 50% of the CPU computing power in the system resources of cloud server 3, and the computing resources requested by terminal device 13 can account for 20% of the CPU computing power in the system resources of cloud server 3. The provider divides the system resources of cloud server 3 into three parts according to the computing amount required by the three terminal devices in proportion, and executes a virtual machine in each of the three parts of the system resources, which are recorded as virtual machines 1-3. Finally, terminal device 11 can use virtual machine 1 provided by cloud server 3 for computing, terminal device 12 can use virtual machine 2 provided by cloud server 3 for computing, and terminal device 13 can use virtual machine 3 provided by cloud server 3 for computing. In cloud server 3, each user can operate the corresponding virtual machine just like using a physical machine, and each virtual machine uses its corresponding part of the system resources for execution without affecting each other.

[0069] However, in actual use, when using the virtual machine provided by the cloud server 3 through the terminal device 1, the user usually does not consider the utilization rate of resources, but applies for computing resources based on the maximum peak value of the required computing amount, resulting in Figure 2 In the cloud server 3 shown, most of the system resources allocated to the virtual machines are not used and are often idle. Some industry research data show that the utilization rate of the CPU in the system resources is below 20%, while the cost of the CPU accounts for more than 40% of the hardware cost of the single board of the cloud server 3. Therefore, in order to improve the utilization rate of the system resources of the cloud server 3 and save the number of cloud servers 3 set up in the Internet 2, the provider of the cloud server 3 can use the idle resources allocated to users to provide services to other users. For example, in Figure 2 In the cloud server shown, when 50% of the system resources requested by virtual machine 2 are idle, they can be allocated to virtual machine 4 for use. For users using virtual machines 2 and 4, each of them applies to the provider for 50% of the system resources of cloud server 3. For the provider side, it can be understood that the same system resources are used to simultaneously meet the system resources requested by virtual machines 2 and 4, thereby improving the utilization efficiency of the system resources of cloud server 3 by sharing resources.

[0070] At the same time, the cloud server can also schedule tasks executed in each virtual machine, thereby achieving more reasonable utilization of virtual machine resources. Figure 3 A schematic diagram of a module for scheduling virtual machines in a cloud server, such as Figure 3The figure shows a scheduler set in a cloud server, wherein the cloud server may include a main scheduler and a periodic scheduler. The main scheduler is used to directly schedule tasks, and the periodic scheduler is executed at a fixed frequency and is used to periodically schedule tasks. The combination of the two can constitute the core scheduler of the cloud server, which can also be called a generic scheduler. Figure 3 In the scenario shown, the core scheduler of the cloud server schedules any virtual machine set in the cloud server as an example, where it is assumed that the tasks to be executed in the virtual machine being scheduled by the core scheduler are task 1-task N. The core scheduler first calls the completely fair scheduler (CFS), RRS (round-robin) or first in, first out (FIFO) and other scheduler classes through step ①, and each scheduler class can schedule tasks according to different scheduling rules. After the scheduler class obtains the N tasks to be executed by the virtual machine through step ②, it determines to schedule the virtual machine to execute a certain target task according to the corresponding scheduling rule, and then the core scheduler instructs the virtual machine through step ③ in a context switching manner, the target task to be executed in step ④, thereby realizing the scheduling of the execution order of the tasks executed by the virtual machine.

[0071] More specifically, the existing scheduler classes can be divided into at least two different types: completely fair scheduler (CFS) and real-time scheduler (RR, FIFO or Deadline, etc.), which are described below respectively.

[0072] Figure 4 The following is a schematic diagram of the working principle of the completely fair scheduler. When the core scheduler calls the CFS scheduler class to schedule tasks 1, 2, and 3 to be executed by the virtual machine, the CFS scheduler class first divides the execution time of the virtual machine into different continuous time slices according to the time axis, for example Figure 4 Time slice 1, time slice 2, etc. Then, in each time slice, the three tasks are assigned execution time according to the weight of each task to ensure that each task will be executed within the time period composed of consecutive time slices, ensuring the fairness of scheduling. For example, the CFS scheduler class can calculate the time allocated to each task in the time slice by the formula "time slice length * task weight / sum of all task weights in the scheduling queue where the task is located".

[0073] from Figure 4It can be seen that when the completely fair scheduler class schedules multiple tasks executed by the virtual machine, it takes fairness as the principle to ensure that each task can be executed, but it can only ensure that tasks with higher weights get more execution time than tasks with lower weights. When different scheduled tasks belong to different priorities (the higher the priority, the higher the weight, and the lower the priority, the lower the weight), it is impossible to schedule high-priority tasks to be executed first, nor can it ensure that high-priority tasks can preempt the execution time of low-priority tasks being executed.

[0074] Figure 5 The following is a schematic diagram of the working principle of the real-time scheduler. When the core scheduler calls the real-time scheduler class to schedule the tasks to be executed by the virtual machine, all tasks can be added to a linked list in order of priority. For example, Figure 5 The linked list shown in the figure has a higher priority in the downward direction and a lower priority in the upward direction. Assuming that the tasks to be executed by the virtual machine at this time include high-priority task A, medium-priority tasks B1 and B2, and low-priority tasks C1 and C2, when the FIFIO scheduler class schedules the above tasks, the task that first enters the execution state will first obtain the CPU and other computing resources of the virtual machine, and will occupy the resources until the task enters the sleep state. For example, task A will be executed after entering the queue, and tasks B1, B2, C1 and C2 may not be able to obtain execution time. This problem of low-priority tasks not being able to obtain execution time is also called the "starvation problem". When scheduling the above tasks, the RR scheduler class can schedule tasks with the same priority to share the resources of the virtual machine by taking turns to execute them. For example, the RR scheduler can schedule the virtual machine to take turns to execute the medium-priority tasks B1 and B2 of the virtual machine's scheduler to ensure fair execution of tasks with the same priority, but it may also cause starvation problems for tasks with lower priorities.

[0075] from Figure 5 It can be seen that the real-time scheduler class is based on priority and gives priority to the execution of tasks with higher priority to ensure the requirements of task priority. However, when scheduling high-priority tasks, it will cause starvation problems for low-priority tasks and cannot guarantee the fair execution requirements of low-priority tasks.

[0076] In summary, among the existing scheduler classes, the completely fair scheduler can only guarantee fairness but cannot schedule tasks of different priorities differently; the real-time scheduler can only schedule tasks of different priorities but cannot schedule fairly, resulting in the starvation problem of low-priority tasks. Figure 2In the application scenario of mixed deployment of virtual machines where different virtual machines share system resources, it is not possible to simply use the existing scheduler class to ensure that high-priority tasks are scheduled first and low-priority tasks are scheduled fairly. Therefore, how to design a scheduler that can be used to schedule tasks of different priorities executed on mixed-deployment virtual machines while also ensuring scheduling fairness is a technical problem that needs to be solved in this field.

[0077] Therefore, the present application provides a task scheduling method and device, so that when scheduling tasks to be executed by a virtual machine, the scheduler can ensure that high-priority tasks are scheduled to be executed by the virtual machine first, and can also satisfy the fairness of the virtual machine when scheduling tasks with the same priority. The technical solution of the present application is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.

[0078] Figure 6 A schematic diagram of the structure of a cloud server applied by a task scheduling method provided in this application, wherein the method provided in this application can be Figure 6 Specifically, Figure 6 In the cloud server shown, different types of virtual machines can be deployed, and the types of virtual machines include at least: on-demand virtual machine (OVM) and elastic virtual machine (EVM). Among them, OVM can also be called a non-oversold virtual machine. The computing power of the vCPU of OVM is basically consistent with that of the physical machine CPU, which is suitable for processing tasks that are sensitive to both computing and latency; EVM can also be called an oversold virtual machine or a shared virtual machine. It is a computing instance that can be preempted and is suitable for processing tasks in batch processing and business scenarios with fault-tolerant mechanisms. Then in Figure 6 In the cloud server shown, an operating system can be installed on the system resources of the host of the cloud server, and the scheduler executed in the operating system can be used to schedule the tasks to be executed by each virtual machine. At the same time, in order to schedule tasks of different priorities, a virtual machine identification module is also set in the operating system of the cloud server to mark the priority of the tasks to be executed by each virtual machine. In addition, a scheduler can be set in each virtual machine to schedule the tasks to be executed by each virtual machine. Figure 6 The cloud server shown in the figure takes an OVM virtual machine and an EVM virtual machine as examples to illustrate that different types of virtual machines are deployed in the cloud server. It can be understood that, Figure 6The cloud server shown can also deploy multiple OVM virtual machines and multiple EVM virtual machines, which are not shown in the figure. Each virtual machine, regardless of its type, is equivalent to an independently executed computer. At this time, the system resources of the cloud server used by the virtual machine, such as the CPU, can be executed in an independent form, and part of the CPU resources in each virtual machine can be called vCPU.

[0079] The cloud server is Figure 6 After the deployment method shown, since OVM virtual machines and EVM virtual machines can be deployed in each cloud server at the same time, for cloud server providers, they do not need to deploy different types of virtual machines through different cloud servers in the cluster, but can implement the following Figure 7 The comprehensive deployment method shown. Figure 7 A deployment diagram of a cloud server cluster provided for this application, wherein the supplier manages cloud server clusters in different regions through a cluster unified scheduling platform, and different types of virtual machines can be deployed on each of the multiple cloud servers included in each region, thereby realizing the deployment of cloud server clusters through a more flexible deployment method, without deploying only one type of virtual machine in each cloud server. In addition, a dynamic resource agent can also be set on each cloud server to count the resource usage of each cloud server, so that the resource information of each cloud server is fed back to the cluster unified scheduler.

[0080] In particular, the task scheduling method provided by this application can be Figure 6 or Figure 7 The scheduler in each cloud server is used to execute. Although different types of virtual machines are deployed in each cloud server and each virtual machine has its own scheduler, the scheduler set on the cloud server can achieve on-demand allocation of OVMs while ensuring the commonality of tasks performed by each OVM virtual machine or EVM virtual machine. The scheduler in each virtual machine stores and schedules the queue of tasks to be executed by the virtual machine. The scheduler on the cloud server can schedule the tasks to be executed by the virtual machine by adjusting the queue of tasks to be executed by the scheduler in the virtual machine.

[0081] The following specific embodiments are used to describe in detail the task scheduling method provided by the present application. The following specific embodiments can be combined with each other and implemented in whole or in part by the same execution subject. The same or similar concepts or processes may not be described in detail in some embodiments. The task scheduling method provided by the present application can be implemented by Figure 6 or Figure 7 Alternatively, it may be executed by a scheduler in the cloud server shown in FIG. Figure 6 or Figure 7 Other devices in other cloud servers are executed, this application only uses Figure 6 The scheduler in the cloud server shown is used as an example as an execution subject to illustrate the process of the task scheduling method, rather than limiting the cloud server structure.

[0082] Embodiment 1

[0083] The task scheduling method provided in the first embodiment of the present application can be used by the scheduler to achieve fair scheduling of tasks while meeting the task priority requirements when scheduling tasks in a virtual machine, that is, scheduling of tasks of different priorities is achieved on the basis of the CFS scheduler, which can be understood as an enhanced CFS scheduling method.

[0084] Figure 8 A flowchart of an embodiment of a task scheduling method provided by the present application is shown in FIG. Figure 8 The task scheduling method shown can be implemented as follows Figure 6 The scheduler in the operating system of the host in the cloud server shown is executed, and is applied to the scenario where the scheduler schedules the tasks to be executed by the first target virtual machine in the cloud server. The first target virtual machine can be any OVM virtual machine or any EVM virtual machine deployed in the cloud server, and the scheduler in the first target virtual machine is recorded as the first scheduler. The first scheduler stores and schedules the tasks to be executed by the first target virtual machine through the task queue. The scheduler as the execution subject can be connected to the first scheduler, obtain the task queue stored in the first scheduler, and adjust the tasks to be executed in the first scheduler to adjust the tasks to be executed by the first target virtual machine. Specifically, the task scheduling method provided in this embodiment includes:

[0085] S101: The scheduler obtains the priorities of all tasks to be executed by the first target virtual machine.

[0086] Specifically, the scheduler first obtains all the tasks currently to be executed by the first target virtual machine and the priorities of all the tasks from the first scheduler of the first target virtual machine through S101. The priorities can be divided in advance or divided by the scheduler according to the type of task. For example, for services that are not sensitive to computing delays, such as gene sequencing and batch services, lower priorities correspond to them; for services that are sensitive to computing delays, such as real-time rendering of online video content, higher priorities correspond to them. Figure 6 In the cloud server shown, the priorities of all tasks can also be uniformly managed by the virtual machine identification module set on the host.

[0087] Combine the following Fig. 9 The example of Fig. 9A schematic diagram of the scheduling process in the task scheduling method provided in the present application, wherein, assuming that when the first scheduler is scheduling the first target virtual machine, the task queue of the first scheduler stores N tasks currently to be executed by the first target virtual machine, namely, task 1, task 2...task N, where N>1. Then in S101, in order to determine the tasks to be executed of the first target virtual machine, the scheduler on the cloud server as the execution subject can first obtain these N tasks and the corresponding priority of each task from the first scheduler of the first target virtual machine. For example, among the N tasks, the tasks with the first priority are task 1, task 2, and task 3; the tasks with the second priority are task 4 and task 5... The embodiment of the present application does not limit the number of priorities of the tasks to be executed by the first target virtual machine, and takes the order of the first priority, the second priority..., etc., from high to low as an example for explanation.

[0088] S102: The scheduler determines at least one task with the highest priority among all tasks.

[0089] Then, the scheduler determines at least one task with the highest priority from all N tasks obtained in S101. Fig. 9 In the example shown, the scheduler determines that the tasks corresponding to the first priority with the highest priority are: Task 1, Task 2, and Task 3.

[0090] Optionally, in a first possible implementation of S102, the scheduler may determine the priorities of all tasks on the to-be-executed task queue by traversing the priorities of all tasks on the to-be-executed task queue stored by the first scheduler, and determine at least one task with the highest priority among all tasks. Optionally, the queue may be a linked list, an array, a tree structure, etc. When the to-be-executed task queue is a red-black tree in a tree structure, the scheduler may traverse the entire red-black tree to obtain at least one task with the highest priority in the red-black tree.

[0091] Alternatively, in a second possible implementation of S102, the scheduler may also store priority record information in a dedicated storage space, and record the priority of each task added to the to-be-executed task queue of the first scheduler through the priority record information. For example, the scheduler may record the correspondence between different tasks and priorities through an array, which may be in the form of "task 1-first priority, task 2-first priority...", etc. Then, in S102, the scheduler may determine at least one task with the highest priority in the to-be-executed task queue of the first scheduler through the priority record information recorded in the storage space.

[0092] Alternatively, in a third possible implementation of S102, a plurality of to-be-executed task queues may be set in the first scheduler, each of which corresponds to a priority, and the queues may also be linked lists, arrays, tree structures, etc. When the to-be-executed task queues are red-black trees in the tree structure, the scheduler may represent to-be-executed task queues corresponding to different priorities through different red-black trees. Fig. 9 In the example shown, the first red-black tree may record tasks 1, 2, and 3 corresponding to the first priority, and the second red-black tree may record tasks 4 and 5 corresponding to the second priority. Then, the scheduler may directly obtain at least one task with the highest priority from the first red-black tree corresponding to the first priority with the highest priority in S102, thereby improving the efficiency of obtaining at least one task with the highest priority in S102.

[0093] S103: The scheduler determines a task with the smallest virtual running time among at least one task, and records it as the first task.

[0094] Subsequently, in S103, the scheduler further determines the first task with the smallest virtual runtime among the at least one task obtained in S102. The virtual runtime may also be referred to as "vruntime", wherein the virtual runtime of each task = the actual execution time of the task * 1024 / the sum of the weights of all tasks to be executed. For example, for tasks 1, 2 and 3 to be executed in the first scheduler, the weights are 1, 2 and 3 respectively, then the sum of the weights of all tasks to be executed is 1+2+3=6. The scheduler measures which task is most worthy of being scheduled by the virtual runtime of each task, wherein in the CFS scheduler, all tasks to be executed can be represented by a red-black tree with the virtual runtime as the key value, then the process with the smaller virtual runtime is closer to the leftmost end of the entire red-black tree, and each time the first scheduler controls the first target virtual machine to execute the task located at the leftmost end of the red-black tree, the virtual runtime of the process is the smallest. Therefore, in this embodiment, after the scheduler determines at least one task with the highest priority through S102, the first task with the smallest virtual runtime can be determined among the at least one task with the highest priority. For example, in the case of Fig. 9 In the example shown, after the scheduler determines the first priority tasks 1, 2 and 3, it determines that the second virtual runtime corresponding to task 2 is the smallest from the first virtual runtime of task 1, the second virtual runtime of task 2 and the third vruntime of task 3, and then selects task 2 as the first task.

[0095] S104: The scheduler controls the first scheduler to schedule the first target virtual machine to execute the first task.

[0096] Finally, in S104, the scheduler controls the first scheduler so that the first scheduler adjusts its task queue, thereby scheduling the first target virtual machine to execute the first task determined in S103. Optionally, the scheduler can adjust the order of tasks in the to-be-executed task queue of the first scheduler by means of context switching, so as to control the first scheduler of the first target virtual machine to first obtain the first task from the to-be-executed task queue and execute it by the processor (vCPU) of the first target virtual machine.

[0097] It is understandable that if Figure 8-9 In the illustrated embodiment, taking the case where there are tasks with multiple priorities on the to-be-executed task queue of the first scheduler as an example, if there is only one priority task on the to-be-executed task queue of the first scheduler, then after S101, the scheduler can directly execute S103, that is, determine the first task with the shortest virtual running time from all the acquired tasks, and control the first target virtual machine to execute the first task through S104.

[0098] In addition, in this embodiment, after the first task is executed, the scheduler will repeat the following steps: Figure 8 The task scheduling method S101 shown in the figure continues to schedule the first target virtual machine to execute the task with the shortest virtual execution time among at least one task with the highest priority in its to-be-executed task queue through the first scheduler, thereby ensuring that the first target virtual machine currently executes the task with the highest priority and that tasks with the same priority can be fairly scheduled. Fig. 9 In the example shown, in this order, the first target virtual machine will execute tasks of the first priority, the second priority, etc. in turn, and when scheduling the same task corresponding to each priority, the selection of the virtual running time is equivalent to adopting the completely fair scheduling strategy of the CFS scheduler, thereby implementing the CFS scheduling strategy.

[0099] In summary, in the task scheduling method provided by this embodiment, when scheduling the first target virtual machine to execute a task, the scheduler first determines at least one task with the highest priority in the task queue to be executed by the first target virtual machine, ensuring that the task with the highest priority is executed first; then, for the at least one task with the highest priority, the first task with the smallest virtual running time is selected for execution, ensuring fairness in scheduling tasks of the same priority. Figure 4 Compared with the completely fair scheduler in the prior art shown in FIG. , it is able to schedule high-priority tasks to be executed first; Figure 5Compared with the real-time scheduler shown in FIG. 1 , it can also ensure that tasks of the same priority are scheduled fairly, so that the scheduler can ensure that high-priority tasks are scheduled first and that the same-priority tasks are scheduled fairly when scheduling tasks on the first target virtual machine. Figure 6 or Figure 7 The virtual machine mixed deployment scheduling scenario is shown.

[0100] Embodiment 2

[0101] The task scheduling method provided in the second embodiment of the present application can be used for the scheduler to schedule tasks. When the priority of the task in the task queue to be executed in the first scheduler of the first target virtual machine is adjusted, the task currently scheduled by the first scheduler to be executed by the first target virtual machine can be preempted, that is, the scheduler can dynamically schedule the tasks of the first target virtual machine to meet the scheduler's scheduling requirements for various different types of tasks.

[0102] Fig.10 A flowchart of an embodiment of a task scheduling method provided by the present application is shown in FIG. Fig.10 The task scheduling method shown can be implemented as follows Figure 6 The scheduler in the operating system of the host in the cloud server shown is executed, and is applied to the scenario where the scheduler schedules the tasks to be executed by the first target virtual machine in the cloud server. The first target virtual machine can be any OVM virtual machine or any EVM virtual machine deployed in the cloud server, and the scheduler in the first target virtual machine is recorded as the first scheduler. The first scheduler stores and schedules the tasks to be executed by the first target virtual machine through the task queue. The method includes:

[0103] S201: When the scheduler determines that the second task in the to-be-executed task queue of the first target virtual machine is adjusted from the second priority to the first priority, the minimum virtual running time of at least one task with the same first priority to be executed by the first target virtual machine is obtained.

[0104] Specifically, when the first scheduler schedules the first target virtual machine to execute a task (the task being executed by the first virtual machine is recorded as the third task), if the first target virtual machine is in the queue of tasks to be executed of the first scheduler at this time, the second task is adjusted from the second priority to the first priority, or the second task is added to the queue of tasks to be executed of the first scheduler, then the scheduler determines through S201 that the priority of the second task to be executed by the first target virtual machine has changed, and determines the minimum virtual running time of at least one task with the same first priority.

[0105] S202: The scheduler adjusts the first virtual runtime corresponding to the second task to the second virtual runtime according to the minimum virtual runtime determined in S201.

[0106] Combine the following Fig.11 The example of Fig.11 A schematic diagram of the scheduling process in the task scheduling method provided in the present application, wherein it is assumed that the first scheduler schedules the N tasks currently to be executed of the first target virtual machine as task 1, task 2...task N, N>1. Then in S201, the scheduler as the execution subject first obtains the task whose priority is adjusted from the second priority to the first priority, recorded as the second task, or it can also obtain the newly added N+1th task and record it as the second task. And further determine the first priority corresponding to the second task, and the first virtual running time corresponding to the second task. Or, optionally, the second task can also be a task added to the first scheduler's queue of tasks to be executed after switching from a sleep state to a wake-up state, then the scheduler can directly obtain the second virtual running time of the newly added second task from the queue of tasks to be executed.

[0107] Subsequently, the scheduler adjusts the first virtual running time of the second task obtained in S201 to the second virtual running time, wherein the purpose of adjusting the virtual running time of the second task is to enable the second task to obtain execution time, so the adjustment of the virtual running time of the second task should be related to the third task currently being executed or the task with the same priority as the second task.

[0108] Specifically, the specific implementation of this embodiment can refer to Fig.12 S2021-S2023 shown, wherein, Fig.12 A flowchart of an embodiment of a task scheduling method provided by the present application is shown in FIG. Fig.12 The method shown in Fig.11 Based on the method shown, after obtaining the second task, the scheduler determines through S2021 whether there are other tasks with the same priority as the second task and corresponding to the first priority in the to-be-executed task queue of the first scheduler. If there are no other tasks with the first priority in the to-be-executed task queue of the first scheduler, S2022 is executed; if there are other tasks with the first priority in the to-be-executed task queue of the first scheduler, S2023 is executed.

[0109] In S2022, if all N tasks in the task queue to be executed are not tasks of the first priority, the scheduler adjusts the first virtual runtime of the second task with reference to the virtual runtime of the third task that the first scheduler is scheduling to execute in the first target virtual machine. Specifically, the adjustment principle can make the second virtual runtime after the adjustment of the first virtual runtime slightly larger than the virtual runtime of the third task. For example, when the first virtual runtime is smaller than the virtual runtime of the third task, the scheduler adds a first variable to the first virtual runtime to obtain the second virtual runtime, so that the second virtual runtime is larger than the virtual runtime of the third task. The variable can be adjusted in real time according to actual conditions.

[0110] In S2023, if there are other tasks of the first priority in the to-be-executed task queue of the first scheduler, illustratively, Fig.11 In the scenario shown, when it is determined that the priority of tasks 1, 2, and 3 run by the target virtual machine scheduled by the first scheduler is the same as that of the second task, and all correspond to the first priority, the scheduler specifically adjusts the second virtual runtime according to the smallest virtual runtime among the determined virtual runtimes of tasks 1-3. Specifically, the adjustment principle can make the second virtual runtime after the adjustment of the first virtual runtime slightly larger than the virtual runtime of the third task. For example, when the first virtual runtime is smaller than the virtual runtime of the third task, the scheduler adds a first variable to the first virtual runtime to obtain the second virtual runtime, so that the second virtual runtime is larger than the smallest virtual runtime among the virtual runtimes of tasks 1-3. The first variable can be adjusted according to actual conditions.

[0111] S203: When the first priority is higher than the priority of the third task being executed by the first target virtual machine, the scheduler controls the first target virtual machine to execute the second task. At this time, the second task corresponds to the second virtual runtime.

[0112] Finally, after the scheduler adjusts the virtual running time of the second task newly added to the queue of tasks to be executed through S202, the first scheduler can be controlled so that the first scheduler schedules the first target virtual machine to execute the second task. In particular, in this step, the scheduler also compares the priority of the task currently being executed by the first scheduler with the priority of the second task, so that when the first priority of the second task is higher than the priority of the third task being executed, the second task preempts the third task.

[0113] Or, alternatively, in Fig.10In the embodiment shown, in another possible implementation of S201, the second task may also be originally in the first scheduler's queue of pending tasks. After the scheduler obtains the second task in S201, it further determines to adjust the priority corresponding to the second task from the second priority to the first priority according to the instruction information sent by the user. Subsequently, in S202, the scheduler specifically adjusts the first virtual running time to the second virtual running time according to the smallest virtual running time of at least one task corresponding to the second priority in the first scheduler's queue of pending tasks. Among them, it is assumed that before the second task adjusts its priority, the corresponding first virtual running time in at least one task corresponding to the second priority is Ta, and the minimum value of the virtual running time in at least one task corresponding to the second priority is recorded as minA; after the second task adjusts its priority, the minimum value of the virtual running time in at least one task corresponding to the first priority is recorded as minB, then the scheduler adjusts the first virtual running time to the second virtual running time through the formula: second virtual running time = (Ta-minA) + minB, and makes the adjusted second virtual running time in the task corresponding to the first priority slightly larger than the minimum value of the virtual running time in at least one task of the first priority. It should be noted that the above formula is only an exemplary description, and the scheduler is not limited to using this method for adjustment in the actual adjustment process.

[0114] In summary, in the task scheduling method provided by the present embodiment, when the scheduler obtains the second task corresponding to the first priority while the first target virtual machine is executing the third task, the first virtual running time of the second task is adjusted to the second virtual running time according to the smallest virtual running time of at least one task corresponding to the first priority in the queue of tasks to be executed of the first target virtual machine or according to the virtual running time of the third task. Finally, when the first priority of the second task is higher than the priority of the third task, the first target virtual machine is controlled to execute the second task, thereby realizing the preemptive execution of the second task newly added to the queue of tasks to be executed of the first target virtual machine. Therefore, the task scheduling method provided by the present embodiment overcomes the problem of Figure 4 The completely fair scheduler shown and Figure 5 The real-time scheduler shown in the figure cannot provide the preemption deficiency, so that when the scheduler runs tasks of multiple priorities on the first target virtual machine, it can realize the preemption of the high-priority task to the low-priority task, which can be applied to the following example Figure 6 or Figure 7 The virtual machine mixed deployment scheduling scenario is shown.

[0115] Embodiment 3

[0116] The task scheduling method provided in the third embodiment of the present application can be used for a scheduler to schedule tasks in a first target virtual machine. When there are low-priority tasks in the queue of tasks to be run stored by the first scheduler of the first target virtual machine that have not been executed, the low-priority tasks can be actively migrated to other virtual machines (recorded as second target virtual machines) for execution, thereby preventing the starvation problem of low-priority tasks caused by the priority scheduling of high-priority tasks when the first virtual machine executes tasks of multiple priorities.

[0117] Fig.13 A flowchart of an embodiment of a task scheduling method provided by the present application is shown in FIG. Fig.13 The task scheduling method shown can be implemented as follows Figure 6 The scheduler in the operating system of the host in the cloud server shown is executed, and is applied to the scenario where the scheduler schedules the tasks to be executed by the first target virtual machine in the cloud server. The first target virtual machine can be any OVM virtual machine or any EVM virtual machine deployed in the cloud server, and the scheduler in the first target virtual machine is recorded as the first scheduler. The first scheduler stores and schedules the tasks to be executed by the first target virtual machine through the task queue. The method includes:

[0118] S301: The scheduler obtains time recording information of the first scheduler when the first target virtual machine executes the fourth task.

[0119] Specifically, when the first target virtual machine executes a task (the task being executed by the first virtual machine is recorded as the fourth task), the scheduler also records the task in the task queue of the first scheduler of the first target virtual machine through time recording information. The S301 can be executed by the scheduler when the clock is interrupted, or when the scheduler schedules a switch, or by setting a timer by the scheduler. Among them, the fourth task corresponds to the third priority. At the same time, in the first scheduler of the first target virtual machine, the queue of tasks to be run stored also includes at least the fifth task, and the priority corresponding to the fifth task is lower than the third priority.

[0120] Optionally, the time recording information may be stored in a storage space within the scheduler, or in a storage space within the first target virtual machine. In one possible implementation, the time recording information is used to record the execution time of the fourth task, or, in another possible implementation, the time recording information is used to record the waiting time of the fifth task in the queue of tasks to be executed.

[0121] Combine the following Fig.14 The example of Fig.14The schematic diagram of the scheduling process in the task scheduling method provided by the present application, wherein it is assumed that the N tasks currently to be executed by the first scheduler are task 1, task 2 ... task N, N>1, and at this time, the first target virtual machine executes the fourth task among the N tasks in the task queue to be executed. Then, in S301, the scheduler can obtain the time record information of the current moment.

[0122] S302: When the time recording information meets the preset condition, the scheduler controls the first scheduler of the first target virtual machine to send the fifth task stored in the first scheduler to the second scheduler of the second target virtual machine, so that the second scheduler controls the second target virtual machine to execute the fifth task.

[0123] Specifically, after the scheduler obtains the time recording information through S301, it determines to schedule the fifth task to the second target virtual machine for execution according to the time recording information. For example, when the time recording information is used to record the execution time of the fourth task that has been executed by the first target virtual machine, the preset condition may be that the execution time of the fourth task is less than the first threshold value (1s). For example, when the fourth task has been executed for 1 second, due to the higher priority of the fourth task, the fifth task with a lower priority has not been executed, which will cause the starvation problem of the fifth task. Therefore, the scheduler may determine that the execution time of the fourth task is greater than the first threshold value and satisfies the preset condition, and then schedule the second target virtual machine to execute the fifth task.

[0124] For another example, when the time recording information is used to record the waiting time of the fifth task in the to-be-executed task queue of the first target virtual machine, the preset condition may be that the waiting time of the fifth task is greater than the second threshold. Similarly, in order to prevent the starvation problem of the fifth task, the scheduler may schedule the second target virtual machine to execute the fifth task after determining that the waiting time of the fifth task is greater than the second threshold and the preset condition is met.

[0125] Furthermore, the second target virtual machine can be any virtual machine in the cloud server, and the scheduler can also determine the second target virtual machine in the cloud server before controlling the second target virtual machine to perform the fifth task in S302. For example, the second target virtual machine can be a virtual machine that is currently in an idle state in the cloud server, so that when the scheduler controls the second target virtual machine to perform the fifth task, it will not affect other tasks running on the second target virtual machine; or, the second target virtual machine can be a virtual machine in the cloud server whose current load is less than the third threshold; so that when the scheduler controls the second target virtual machine to perform the fifth task, the impact on other tasks running on the second target virtual machine is reduced; or, the second target virtual machine can also be a virtual machine deployed by the cloud server specifically for executing the priority corresponding to the fifth task, that is, tasks of different priorities are assigned to different virtual machines for execution in the cloud server, and when the scheduler schedules the fifth task in S302, it selects the virtual machine corresponding to the fourth priority of the fifth task as the second target virtual machine.

[0126] Optionally, when scheduling the fifth task, the scheduler may also determine the second target virtual machine in the following order: give priority to idle virtual machines in the cloud server, then select virtual machines with lower task priority and lighter load on the scheduling queue of virtual machines in the cloud server, and finally select virtual machines with lower task priority but heavier load on the scheduling queue of virtual machines in the cloud server / virtual machines with higher task priority but lighter load on the scheduling queue of virtual machines in the server.

[0127] Optionally, the second target virtual machine may also be a virtual machine specially set up in the cloud server, and the virtual machine is dedicated to Fig.14 In the scenario of preventing the starvation problem shown, the scheduler executes the task scheduled from other virtual machines. Then, in S302, the scheduler may directly control the second target virtual machine to execute the fifth task.

[0128] In summary, in the task scheduling method provided in this embodiment, when the first target virtual machine executes the fourth task, the scheduler also obtains time record information to determine whether the fifth task with a lower priority has a starvation problem, and after the time record information meets the preset conditions, controls the second target virtual machine in the cloud server to execute the fifth task, thereby realizing the scheduling of the fifth task between different target virtual machines, so that the fifth task will not stay in the to-be-executed queue of the first target virtual machine due to its low priority, thereby preventing the occurrence of starvation problems.

[0129] In the above embodiments, the task scheduling method provided by the embodiment of the present application is introduced, and in order to realize the various functions in the task scheduling method provided by the embodiment of the present application, the scheduler as the execution subject may include a hardware structure and / or a software module, and the above functions are realized in the form of a hardware structure, a software module, or a hardware structure plus a software module. Whether a certain function of the above functions is executed in the form of a hardware structure, a software module, or a hardware structure plus a software module depends on the specific application and design constraints of the technical solution.

[0130] For example, Fig.15 A structural diagram of an embodiment of a task scheduling device provided by the present application is shown in FIG. Fig.15 The task scheduling device shown can be used to execute Figure 8 The task scheduling method shown in the figure includes: an acquisition module 1501, a priority determination module 1502, a virtual run time determination module 1503 and a control module 1504. The acquisition module 1501 is used to acquire the priorities of multiple tasks to be executed by the first target virtual machine; the priority determination module 1502 is used to determine at least one task with the highest priority among the multiple tasks; the virtual run time determination module 1503 is used to determine the first task with the smallest virtual run time from at least one task; and the control module 1504 is used to control the first target virtual machine to execute the first task.

[0131] Optionally, the acquisition module 1501 is specifically configured to determine the priorities of multiple tasks to be executed by the first target virtual machine according to a queue of tasks to be executed stored by the first scheduler in the first target virtual machine.

[0132] Optionally, the acquisition module 1501 is specifically configured to traverse the priorities of all tasks in the queue of tasks to be executed stored in the first scheduler, and determine at least one task with the highest priority from the queue of tasks to be executed.

[0133] Optionally, the acquisition module 1501 is specifically used to determine at least one task with the highest priority among multiple tasks through priority record information stored in the first scheduler; wherein the priority record information is used to record the priorities of all tasks on the queue of tasks to be executed by the first scheduler.

[0134] Optionally, the acquisition module 1501 is specifically used to determine at least one task with the highest priority based on the tasks in the queue corresponding to the highest priority stored in the first scheduler; wherein the first scheduler stores the tasks to be executed through multiple queues, and each queue corresponds to a different priority.

[0135] Fig.16 A structural diagram of an embodiment of a task scheduling device provided by the present application is shown in FIG. Fig.16The task scheduling device shown can be used to execute Fig.10 The task scheduling method shown in the figure includes: an acquisition module 1601, a virtual run time adjustment module 1602 and a control module 1603. The acquisition module 1601 is used to acquire the minimum virtual run time corresponding to at least one task of the first target virtual machine to be executed with the same priority as the first priority when the priority of the second task to be executed by the first target virtual machine is adjusted from the second priority to the first priority; the virtual run time adjustment module 1602 is used to adjust the first virtual run time corresponding to the second task to the second virtual run time according to the minimum virtual run time; the control module 1603 is used to control the first target virtual machine to execute the second task when the first priority is higher than the priority of the third task being executed by the first target virtual machine.

[0136] Optionally, the second virtual runtime is greater than the smallest virtual runtime of the virtual runtime of at least one task of the first priority in the to-be-executed task queue stored in the first scheduler of the first target virtual machine.

[0137] Optionally, the task scheduling device further includes: a receiving module 1604, configured to receive indication information, and determine, based on the indication information, that the priority of the second task is adjusted from the second priority to the first priority.

[0138] Optionally, the virtual time adjustment module 1602 is specifically used to add the minimum virtual running time to the first virtual running time, and then subtract the minimum virtual running time of the virtual running time of at least one task corresponding to the first priority in the to-be-executed task queue to obtain the second virtual running time.

[0139] Fig.17 A structural diagram of an embodiment of a task scheduling device provided by the present application is shown in FIG. Fig.17 The task scheduling device shown can be used to execute Fig.13 The task scheduling method shown in the figure includes: an acquisition module 1701 and a control module 1702. The acquisition module 1701 is used to acquire the time recording information stored by the first scheduler of the first target virtual machine; wherein the time recording information is used to record the execution time of the fourth task, and the fourth task corresponds to the third priority, or the time recording information is used to record the waiting time of the fifth task in the queue of tasks to be executed stored in the first scheduler, and the priority corresponding to the fifth task is lower than the third priority; the control module 1702 is used to control the first scheduler of the first target virtual machine to send the fifth task to the second scheduler of the second target virtual machine when the time recording information meets the preset condition, so that the second target virtual machine executes the fifth task.

[0140] Optionally, when the time recording information is used to record the execution time of the fourth task, the preset condition includes: the execution time of the fourth task is greater than a first threshold.

[0141] Optionally, when the time recording information records the waiting time of the fifth task in the to-be-executed task queue of the first scheduler, the preset condition includes: the waiting time is greater than a second threshold.

[0142] Optionally, the second target virtual machine is an idle virtual machine among multiple virtual machines deployed on the host where the first target virtual machine is located; or, the second target virtual machine is a virtual machine among multiple virtual machines deployed on the host whose load is less than a third threshold; or, the second target virtual machine is a scheduler for executing tasks of a fourth priority among multiple virtual machines deployed on the host, wherein the fourth priority is lower than the third priority.

[0143] Optionally, the second target virtual machine is a scheduler dedicated to executing the fifth task when the time recording information meets a preset condition.

[0144] It should be noted that it should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software called by processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. For example, the determination module can be a separately established processing element, or it can be integrated in a chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called and executed by a processing element of the above device. The implementation of other modules is similar. In addition, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element described here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.

[0145] For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more microprocessors (digital signal processors, DSP), or one or more field programmable gate arrays (FPGA), etc. For another example, when a module above is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0146] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.

[0147] Fig.18 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. The electronic device can be used as a scheduler as described in any of the above embodiments of the present application and execute the task scheduling method executed by the scheduler. Fig.18As shown, the communication device 1100 may include: a processor 111 (e.g., a CPU), a transceiver 113; wherein the transceiver 113 is coupled to the processor 111, and the processor 111 controls the transceiver 113. Optionally, the communication device 1100 also includes a memory 112, and the memory 112 may store various instructions for completing various processing functions and implementing the method steps executed by the scheduler in the embodiment of the present application.

[0148] Optionally, the electronic device involved in the embodiment of the present application may further include: a power supply 114, a system bus 115 and a communication interface 116. The transceiver 113 may be integrated in the transceiver of the electronic device, or may be an independent transceiver antenna on the electronic device. The system bus 115 is used to realize the communication connection between components. The above-mentioned communication interface 116 is used to realize the connection and communication between the electronic device and other peripherals.

[0149] In the embodiment of the present application, the processor 111 is used to couple with the memory 112, read and execute instructions in the memory 112, so as to implement the method steps executed by the scheduler in the above method embodiment. The transceiver 113 is coupled with the processor 111, and the processor 111 controls the transceiver 113 to send and receive messages, and its implementation principle and technical effect are similar, which will not be repeated here.

[0150] Should Fig.18 The system bus mentioned in the specification may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The system bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The communication interface is used to realize the communication between the database access device and other devices (such as a client, a read-write library, and a read-only library). The memory may include RAM, and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage.

[0151] Should Fig.18 The processor mentioned in the specification may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.

[0152] Optionally, an embodiment of the present application further provides a readable storage medium, in which instructions are stored, and when the storage medium is executed on a computer, the computer executes the method executed by the scheduler in any of the aforementioned embodiments of the present application.

[0153] Optionally, an embodiment of the present application further provides a chip for executing instructions, wherein the chip is used to execute the method executed by the scheduler in any of the aforementioned embodiments of the present application.

[0154] An embodiment of the present application also provides a program product, which includes a computer program, which is stored in a storage medium. At least one processor can read the computer program from the storage medium, and when the at least one processor executes the computer program, it can implement the method performed by the scheduler in any of the aforementioned embodiments of the present application.

[0155] In the embodiments of the present application, "at least one" refers to one or more, and "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship; in the formula, the character " / " indicates that the previous and next associated objects are in a "division" relationship. "At least one of the following items (items)" or similar expressions thereof refers to any combination of these items, including any combination of single items (items) or plural items (items). For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple. At the same time, the various digital numbers involved in the embodiments of the present application are only for the convenience of description and are not used to limit the scope of the embodiments of the present application. Furthermore, in the embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0156] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A task scheduling method, characterized in that: include: Obtaining priorities of multiple tasks to be executed by the first target virtual machine; determining at least one task with the highest priority among the plurality of tasks; From the at least one task, determining a first task with a minimum virtual running time; Controlling the first target virtual machine to execute the first task; When the first target virtual machine is executing the first task, if the priority of a second task to be executed by the first target virtual machine is adjusted from the second priority to the first priority, obtaining a minimum virtual running time corresponding to at least one task with the same priority as the first priority to be executed by the first target virtual machine; The first virtual runtime corresponding to the second task is added to the minimum virtual runtime, and then the minimum virtual runtime among the virtual runtimes of at least one task of the second priority in the to-be-executed task queue stored by the first scheduler of the first target virtual machine is subtracted to obtain the second virtual runtime; Adjusting the first virtual running time corresponding to the second task to the second virtual running time; When the first priority is higher than the priority of the first task being executed by the first target virtual machine, controlling the first target virtual machine to execute the second task; When the first target virtual machine is executing the first task, if the time recording information meets the preset conditions, the first scheduler of the first target virtual machine is controlled to send the fifth task to the second scheduler of the second target virtual machine, so that the second target virtual machine executes the fifth task; the time recording information is stored in the first scheduler of the first target virtual machine, and is used to record the execution time of the first task being executed, or the time recording information is used to record the waiting time of the fifth task in the queue of tasks to be executed stored in the first scheduler, and the priority corresponding to the fifth task is lower than the priority of the first task being executed.

2. The method according to claim 1, characterized in that The obtaining the priorities of the multiple tasks to be executed by the first target virtual machine includes: The priorities of the multiple tasks to be executed by the first target virtual machine are determined according to the queue of tasks to be executed stored by the first scheduler in the first target virtual machine.

3. The method according to claim 2, characterized in that The determining of at least one task with the highest priority among the multiple tasks includes: The priorities of all tasks on the queue of tasks to be executed stored by the first scheduler are traversed, and at least one task with the highest priority is determined from the queue of tasks to be executed.

4. The method according to claim 2, characterized in that: The determining of at least one task with the highest priority among the multiple tasks includes: At least one task with the highest priority among the multiple tasks is determined through the priority record information stored in the first scheduler; wherein the priority record information is used to record the priorities of all tasks on the queue of tasks to be executed by the first scheduler.

5. The method according to claim 2, characterized in that: The determining of at least one task with the highest priority among the multiple tasks includes: Determine at least one task with the highest priority based on the tasks in the queue corresponding to the highest priority stored in the first scheduler; wherein the first scheduler stores the tasks to be executed through multiple queues, and each queue corresponds to a different priority.

6. The method according to claim 1, characterized in that The second virtual runtime is greater than the smallest virtual runtime of the virtual runtime of at least one task of the first priority in the to-be-executed task queue stored in the first scheduler of the first target virtual machine.

7. The method according to claim 1, characterized in that The obtaining of at least one task with the same priority as the first task to be executed by the first target virtual machine and the minimum virtual running time corresponding to the at least one task further includes: Indication information is received, and according to the indication information, a determination is made to adjust the priority of the second task from the second priority to the first priority.

8. The method according to claim 1, characterized in that: When the time recording information is used to record the execution time of the first task being executed, the preset condition includes: The execution time of the first task being executed is greater than a first threshold.

9. The method according to claim 1, characterized in that: When the time recording information records the waiting time of the fifth task in the to-be-executed task queue of the first scheduler, the preset condition includes: The waiting time is greater than a second threshold.

10. The method according to any one of claims 1, 8-9, characterized in that: The second target virtual machine is an idle virtual machine among the multiple virtual machines deployed on the host where the first target virtual machine is located; or, the second target virtual machine is a virtual machine whose load is less than a third threshold among the multiple virtual machines deployed on the host; or, the second target virtual machine is a scheduler for executing tasks of a fourth priority among the multiple virtual machines deployed on the host, wherein the fourth priority is lower than the priority of the first task being executed.

11. The method according to any one of claims 1, 8-9, characterized in that: The second target virtual machine is a scheduler dedicated to executing the fifth task when the time recording information meets a preset condition.

12. A task scheduling device, characterized in that: include: An acquisition module, used to acquire priorities of multiple tasks to be executed by the first target virtual machine; A priority determination module, used to determine at least one task with the highest priority among the multiple tasks; A virtual runtime determination module, configured to determine a first task having a minimum virtual runtime from among the at least one task; A control module, used for controlling the first target virtual machine to execute the first task; The acquisition module is further configured to, when the first target virtual machine is executing the first task, if the priority of a second task to be executed by the first target virtual machine is adjusted from the second priority to the first priority, acquire a minimum virtual running time corresponding to at least one task to be executed by the first target virtual machine and having the same priority as the first priority; The control module is further configured to add the first virtual running time corresponding to the second task to the minimum virtual running time, and then subtract the minimum virtual running time among the virtual running times of at least one task of the second priority in the to-be-executed task queue stored by the first scheduler of the first target virtual machine, to obtain the second virtual running time; adjusting the first virtual running time corresponding to the second task to the second virtual running time; when the first priority is higher than the priority of the third task being executed by the first target virtual machine, controlling the first target virtual machine to execute the second task; The control module is further configured to, when the first target virtual machine is executing the first task, control the first scheduler of the first target virtual machine to send the fifth task to the second scheduler of the second target virtual machine, so that the second target virtual machine executes the fifth task, if the time recording information meets a preset condition; The time recording information is stored in the first scheduler of the first target virtual machine, and is used to record the execution time of the task being executed, or the time recording information is used to record the waiting time of the fifth task in the queue of tasks to be executed stored in the first scheduler, and the priority corresponding to the fifth task is lower than the priority of the task being executed.

13. The device according to claim 12, characterized in that The acquisition module is specifically used for: The priorities of the multiple tasks to be executed by the first target virtual machine are determined according to the queue of tasks to be executed stored by the first scheduler in the first target virtual machine.

14. The device according to claim 13, characterized in that The acquisition module is specifically used for: The priorities of all tasks on the queue of tasks to be executed stored by the first scheduler are traversed, and at least one task with the highest priority is determined from the queue of tasks to be executed.

15. The device according to claim 13, characterized in that The acquisition module is specifically used for: At least one task with the highest priority among the multiple tasks is determined through the priority record information stored in the first scheduler; wherein the priority record information is used to record the priorities of all tasks on the queue of tasks to be executed by the first scheduler.

16. The device according to claim 13, characterized in that The acquisition module is specifically used for: Determine at least one task with the highest priority based on the tasks in the queue corresponding to the highest priority stored in the first scheduler; wherein the first scheduler stores the tasks to be executed through multiple queues, and each queue corresponds to a different priority.

17. The device according to claim 12, characterized in that The second virtual runtime is greater than the smallest virtual runtime of the virtual runtime of at least one task of the first priority in the to-be-executed task queue stored in the first scheduler of the first target virtual machine.

18. The device according to claim 12, characterized in that Also includes: The receiving module is used to receive indication information and, based on the indication information, determine that the priority of the second task is adjusted from the second priority to the first priority.

19. The device according to claim 12, characterized in that When the time recording information is used to record the execution time of the first task being executed, the preset condition includes: The execution time of the first task being executed is greater than a first threshold.

20. The device according to claim 12, characterized in that When the time recording information records the waiting time of the fifth task in the to-be-executed task queue of the first scheduler, the preset condition includes: The waiting time is greater than a second threshold.

21. The device according to any one of claims 12, 19-20, characterized in that: The second target virtual machine is an idle virtual machine among the multiple virtual machines deployed on the host where the first target virtual machine is located; or, the second target virtual machine is a virtual machine whose load is less than a third threshold among the multiple virtual machines deployed on the host; or, the second target virtual machine is a scheduler for executing tasks of a fourth priority among the multiple virtual machines deployed on the host, wherein the fourth priority is lower than the priority of the first task being executed.

22. The device according to any one of claims 12, 19-20, characterized in that: The second target virtual machine is a scheduler dedicated to executing the fifth task when the time recording information meets a preset condition.

23. An electronic device, characterized in that: include: Processor and communication interface; The communication interface is used to enable the electronic device to communicate with other devices; The processor is configured to implement the method according to any one of claims 1-11.

24. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed, it is used to implement the method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Method and device of determining minimum scheduling granularity

    CN108268310A

  • Virtual machine task scheduling method and electronic device

    CN108595249A

  • A hybrid scheduling method for multi-type time key tasks

    CN109684060A

  • Task scheduling method and device based on cloud computing and computer equipment

    CN111488210A

Cited By

  • Task scheduling method and apparatus

    WO2022068697A1