Resource Scheduling Method and Device

By dynamically scheduling based on the resource occupancy rate of virtual machines in the cloud gaming system, the problem of unbalanced resource utilization is solved, and the full utilization of resources and overall performance is achieved.

CN111949398BActive Publication Date: 2025-06-17XIAN WANXIANG ELECTRONICS TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010752743.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-30
Publication Date
2025-06-17
Estimated Expiration
2040-07-30

AI Technical Summary

Technical Problem

In the operating mode of cloud games, the resource utilization rate of virtual machines is unbalanced, resulting in some virtual machine resources being idle, while some virtual machine resources are insufficient, and the overall resource utilization rate is reduced.

Method used

By determining the source virtual machine and the target virtual machine based on the resource occupancy sent by each virtual machine on the server side, sending a task acquisition request to the source virtual machine with insufficient resources, receiving the task to be calculated and determining the target virtual machine based on the task, sending a task to the target virtual machine to execute and returning the result to the source virtual machine.

Benefits of technology

Dynamic scheduling of resources is realized, the shortage of virtual machine resources is avoided, and the overall resource utilization rate is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111949398B_ABST
    Figure CN111949398B_ABST
Patent Text Reader

Abstract

The present disclosure provides a resource scheduling method and apparatus, relating to the technical field of data processing. The method includes determining a source virtual machine and a target virtual machine according to the resource occupancy rates sent by each received virtual machine; sending a task acquisition request to the source virtual machine; receiving the to-be-computed task sent by the source virtual machine, and determining the target virtual machine to be scheduled according to the to-be-computed task; sending the to-be-computed task to the target virtual machine to be scheduled, so that the target virtual machine to be scheduled sends the computation result obtained by executing the to-be-computed task according to the idle resources to the server; receiving the computation result, and sending the computation result to the source virtual machine, so that the source virtual machine executes the computation result. The source virtual machine with insufficient resources in the present disclosure can call the resources of the target virtual machine with sufficient resources, avoiding the situation of resource tension of the source virtual machine, realizing the full utilization of the overall resources, and thus improving the utilization rate of the overall resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of data processing, and particularly to a resource scheduling method and apparatus. Background Art

[0002] Cloud gaming is a game mode based on cloud computing. On the service side, a cluster server with powerful computing power, rendering, and storage capabilities dynamically creates virtual machines with appropriate configurations according to user needs. In the operating mode of cloud gaming, all games run on virtual machines with appropriate configurations, and the rendered game screens are compressed and transmitted to users through the network. On the virtual machine side, the user's gaming device does not require any high-end processors and graphics cards, and only basic decoding and keyboard / mouse operation capabilities are needed. The offline "cloud Internet cafe" mode emerges relying on cloud gaming and adopts the VDI (Virtual Desktop Infrastructure) mode. In this mode, on the service side, there is a cluster server with powerful computing power, rendering, and storage capabilities. After a user enters the cloud Internet cafe, the user accesses the cluster server through the zero clients provided in the cloud Internet cafe to play games or obtain other application services. As Figure 1 shown, it is an architecture diagram of a cloud Internet cafe system based on VDI, including a server and a cluster server. Multiple virtual machines are configured on the cluster server. Each virtual machine is connected to the server, and each virtual machine corresponds to a zero client. Corresponding resources are pre-configured for all virtual machines, including CPU (central processing unit) resources, GPU (Graphics Processing Unit) resources, and memory resources, etc.

[0003] In related technologies, usually each virtual machine uses its own resources to run various tasks. However, there will be such a situation in the above technologies: the usage situations of virtual machines by each user are different, so there will be some virtual machines with low resource utilization rates, resulting in most resources being idle; while some virtual machines have high resource utilization rates, and there will be a situation of resource shortage. This will lead to the overall resources not being fully utilized, thereby reducing the resource utilization rate. Summary of the Invention

[0004] Embodiments of the present disclosure provide a resource scheduling method and apparatus, which can solve the problem in the prior art that the overall resources cannot be fully utilized, thereby reducing the resource utilization rate. The technical solutions are as follows:

[0005] According to a first aspect of the embodiments of the present disclosure, a resource scheduling method is provided, which is applied to a server. The method includes:

[0006] Determine the source virtual machine and the target virtual machine according to the resource occupancy rate sent by each received virtual machine;

[0007] Send a task acquisition request to the source virtual machine;

[0008] Receive the task to be calculated sent by the source virtual machine, and determine the target virtual machine to be scheduled according to the task to be calculated; the task to be calculated includes the resources currently required to be invoked by the source virtual machine;

[0009] Send the task to be calculated to the target virtual machine to be scheduled, so that the target virtual machine to be scheduled sends the calculation result obtained by executing the task to be calculated to the server;

[0010] Receive the calculation result, and send the calculation result to the source virtual machine, so that the source virtual machine executes the calculation result.

[0011] An embodiment of the present disclosure provides a resource scheduling method, which determines a source virtual machine and a target virtual machine according to the resource occupancy rate sent by each received virtual machine, and sends a task acquisition request to the source virtual machine. When receiving the task to be calculated sent by the source virtual machine, determine the target virtual machine to be scheduled according to the task to be calculated, and send the task to be calculated to the target virtual machine to be scheduled, so that the target virtual machine to be scheduled sends the calculation result obtained by executing the task to be calculated to the server, and the server sends it to the source virtual machine. In this way, the source virtual machine with insufficient resources can call the resources of the target virtual machine with sufficient resources, avoiding the situation of resource tension of the source virtual machine, realizing the full utilization of the overall resources, and thus improving the utilization rate of the overall resources.

[0012] In one embodiment, the determining the source virtual machine and the target virtual machine according to the resource occupancy rate sent by each virtual machine includes:

[0013] When it is determined that the resource occupancy rate is greater than or equal to a first preset value, determine the corresponding virtual machine as the source virtual machine;

[0014] When it is determined that the resource occupancy rate is less than or equal to a second preset value, determine the corresponding virtual machine as the target virtual machine; wherein, the first preset value is greater than the second preset value.

[0015] In one embodiment, the determining the target virtual machine to be scheduled according to the task to be calculated includes:

[0016] Determine the remaining resources of each target virtual machine;

[0017] Compare the remaining resources of each target virtual machine with the resources of the task to be calculated;

[0018] Determine the target virtual machine corresponding to the remaining resources greater than or equal to the resources of the to-be-calculated task as the target virtual machine to be scheduled.

[0019] In one embodiment, it further includes:

[0020] When it is determined that each of the remaining resources is less than the resources of the to-be-calculated task, determine whether the sum of the remaining resources of a preset number of the target virtual machines is greater than or equal to the resources of the to-be-calculated task;

[0021] When it is determined that the sum of the remaining resources of the preset number of the target virtual machines is greater than or equal to the resources of the to-be-calculated task, determine all of the preset number of the target virtual machines as the target virtual machines to be scheduled.

[0022] In one embodiment, the sending the to-be-calculated task to the target virtual machine to be scheduled includes:

[0023] Divide the to-be-calculated task into the preset number of to-be-calculated subtasks according to the remaining resources of the preset number of target virtual machines;

[0024] Send each of the to-be-calculated subtasks to the corresponding target virtual machine to be scheduled.

[0025] In one embodiment, before determining the target virtual machine to be scheduled according to the to-be-calculated task, it further includes:

[0026] Determine the number of the received to-be-calculated tasks;

[0027] When it is determined that the number of the to-be-calculated tasks is greater than or equal to two, determine the dominant resource of each of the to-be-calculated tasks from the resources of each of the to-be-calculated tasks;

[0028] Determine the ratio of the dominant resource of each of the to-be-calculated tasks to the total resources; the total resources are the sum of the resources of all virtual machines connected to the server;

[0029] Sort each of the to-be-calculated tasks according to the ratio and determine the target to-be-calculated task according to the sorting result;

[0030] The determining the target virtual machine to be scheduled according to the to-be-calculated task includes:

[0031] Determine the target virtual machine to be scheduled according to the target to-be-calculated task.

[0032] In one embodiment, the resource occupancy rate includes at least one of a central processing unit (CPU) occupancy rate, a graphics processing unit (GPU) occupancy rate, and a memory occupancy rate.

[0033] According to a second aspect of the embodiments of the present disclosure, a resource scheduling method is provided, which is applied to a source virtual machine. The method includes:

[0034] Receiving a task acquisition request sent by a server;

[0035] Sending a task to be calculated to the server, so that the server determines a target virtual machine to be scheduled according to the task to be calculated, and sends the task to be calculated to the target virtual machine to be scheduled, so that the target virtual machine to be scheduled sends the calculation result obtained by executing the task to be calculated to the source virtual machine through the server;

[0036] Receiving and executing the calculation result.

[0037] The embodiments of the present disclosure provide a resource scheduling method, which determines a source virtual machine and a target virtual machine according to the resource occupancy rates sent by each received virtual machine, and sends a task acquisition request to the source virtual machine. When receiving a task to be calculated sent by the source virtual machine, it determines the target virtual machine to be scheduled according to the task to be calculated, and sends the task to be calculated to the target virtual machine to be scheduled, so that the target virtual machine to be scheduled sends the calculation result obtained by executing the task to be calculated to the server, and the server sends it to the source virtual machine. In this way, the source virtual machine with insufficient resources can call the resources of the target virtual machine with sufficient resources, avoiding the situation of resource tension of the source virtual machine, realizing the full utilization of the overall resources, and thus improving the utilization rate of the overall resources.

[0038] According to a third aspect of the embodiments of the present disclosure, a resource scheduling device is provided, which is applied to a server. The device includes:

[0039] A first determination module, configured to determine a source virtual machine and a target virtual machine according to the resource occupancy rates sent by each virtual machine;

[0040] A first sending module, configured to send a task acquisition request to the source virtual machine;

[0041] A first receiving module, configured to receive the task to be calculated sent by the source virtual machine, and determine the target virtual machine to be scheduled according to the task to be calculated; the task to be calculated includes the resources currently required to be called by the source virtual machine;

[0042] A second sending module, configured to send the task to be calculated to the target virtual machine to be scheduled, so that the target virtual machine to be scheduled sends the calculation result obtained by executing the task to be calculated to the server;

[0043] A second receiving module, configured to receive the calculation result, and send the calculation result to the source virtual machine, so that the source virtual machine executes the calculation result.

[0044] An embodiment of the present disclosure provides a resource scheduling device, which determines a source virtual machine and a target virtual machine according to the resource occupancy rate sent by each received virtual machine, and sends a task acquisition request to the source virtual machine. When receiving the to-be-computed task sent by the source virtual machine, it determines the target virtual machine to be scheduled according to the to-be-computed task, and sends the to-be-computed task to the target virtual machine to be scheduled, so that the target virtual machine to be scheduled sends the computation result obtained by executing the to-be-computed task to the server, and the server sends it to the source virtual machine. In this way, the source virtual machine with insufficient resources can call the resources of the target virtual machine with sufficient resources, avoiding the situation of resource tension of the source virtual machine, realizing the full utilization of the overall resources, and thus improving the utilization rate of the overall resources.

[0045] According to the fourth aspect of the embodiments of the present disclosure, a resource scheduling device is provided, which is applied to a source virtual machine. The device includes:

[0046] A third receiving module, configured to receive a task acquisition request sent by the server;

[0047] A third sending module, configured to send a to-be-computed task to the server, so that the server determines the target virtual machine to be scheduled according to the to-be-computed task, and sends the to-be-computed task to the target virtual machine to be scheduled, so that the target virtual machine to be scheduled sends the computation result obtained by executing the to-be-computed task according to the idle resources to the source virtual machine through the server;

[0048] An execution module, configured to receive and execute the computation result.

[0049] An embodiment of the present disclosure provides a resource scheduling device, which determines a source virtual machine and a target virtual machine according to the resource occupancy rate sent by each received virtual machine, and sends a task acquisition request to the source virtual machine. When receiving the to-be-computed task sent by the source virtual machine, it determines the target virtual machine to be scheduled according to the to-be-computed task, and sends the to-be-computed task to the target virtual machine to be scheduled, so that the target virtual machine to be scheduled sends the computation result obtained by executing the to-be-computed task to the server, and the server sends it to the source virtual machine. In this way, the source virtual machine with insufficient resources can call the resources of the target virtual machine with sufficient resources, avoiding the situation of resource tension of the source virtual machine, realizing the full utilization of the overall resources, and thus improving the utilization rate of the overall resources.

[0050] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure.

[0052] Figure 1 is an architecture diagram of a cloud Internet cafe system based on VDI provided by an embodiment of the present disclosure;

[0053] Figure 2 is a flowchart of a resource scheduling method provided by an embodiment of the present disclosure;

[0054] Figure 3 is a flowchart of a resource scheduling method provided by an embodiment of the present disclosure;

[0055] Figure 4 is a flowchart of a resource scheduling method provided by an embodiment of the present disclosure;

[0056] Figure 5 is an interaction diagram of a resource scheduling method provided by an embodiment of the present disclosure;

[0057] Figure 6a is a schematic structural diagram of a resource scheduling device provided by an embodiment of the present disclosure;

[0058] Figure 6b is a schematic structural diagram of a resource scheduling device provided by an embodiment of the present disclosure;

[0059] Figure 6c is a schematic structural diagram of a resource scheduling device provided by an embodiment of the present disclosure;

[0060] Figure 6d is a schematic structural diagram of a resource scheduling device provided by an embodiment of the present disclosure;

[0061] Figure 6e is a schematic structural diagram of a resource scheduling device provided by an embodiment of the present disclosure;

[0062] Figure 6f is a schematic structural diagram of a resource scheduling device provided by an embodiment of the present disclosure;

[0063] Figure 7 is a schematic structural diagram of a resource scheduling device provided by an embodiment of the present disclosure. Detailed implementation manners

[0064] Here, exemplary embodiments will be described in detail, and examples thereof are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present disclosure. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0065] An embodiment of the present disclosure provides a resource scheduling method, which is applied to a server, such asFigure 2 As shown in the figure, the method includes the following steps:

[0066] Step 201: Determine the source virtual machine and the target virtual machine according to the resource occupancy rates sent by each received virtual machine.

[0067] Among them, the source virtual machine is the virtual machine with insufficient current resources, the target virtual machine is the virtual machine with sufficient current resources, and the resource occupancy rate includes at least one of the CPU occupancy rate, GPU occupancy rate, and memory occupancy rate.

[0068] Exemplarily, as Figure 1 shown, configure a resource statistic in each virtual machine and a resource scheduler in the server. During the operation of each virtual machine, the resource statistic in the virtual machine statistically calculates the real-time resource occupancy rate of the current virtual machine and reports the statistically obtained resource occupancy rate to the server, so that the server receives the resource occupancy rates sent by each virtual machine and analyzes the resource occupancy rates sent by each virtual machine through the resource scheduler. The specific analysis content includes: judging whether the virtual machine has abundant resources, moderate resources, or insufficient resources according to the resource occupancy rate of the virtual machine. If the resources are abundant, it is considered that the resources of the virtual machine can allocate the idle part of the resources to other virtual machines while meeting its own needs; if the resources are moderate, it is considered that the resources of the virtual machine just meet its own needs and there is no need to allocate resources to other virtual machines, and no processing is done; if the resources are insufficient, it is considered that the resources of the virtual machine cannot fully meet its own needs and other resources need to be appropriately allocated to this virtual machine.

[0069] It should be noted that when the virtual machine reports its own resource occupancy rate to the server, it can be reported at a certain period. For example, the resource occupancy rate is reported once every 5 seconds. The specific reporting period can be adjusted according to requirements and is not limited here.

[0070] Optionally, when it is determined that the resource occupancy rate is greater than or equal to the first preset value, determine the corresponding virtual machine as the source virtual machine.

[0071] When it is determined that the resource occupancy rate is less than or equal to the second preset value, determine the corresponding virtual machine as the target virtual machine; where the first preset value is greater than the second preset value.

[0072] For example, the server compares each resource occupancy rate with a first preset value and a second preset value respectively. When it is determined that the resource occupancy rate is greater than or equal to the first preset value, it indicates that the current resources of the virtual machine corresponding to this resource occupancy rate are relatively tight, so the virtual machine corresponding to this resource occupancy rate is determined as the source virtual machine; when it is determined that the resource occupancy rate is less than or equal to the second preset value, it indicates that the current resources of the virtual machine corresponding to this resource occupancy rate are relatively abundant, so the virtual machine corresponding to this resource occupancy rate is determined as the target virtual machine; in addition, when it is determined that the resource occupancy rate is less than the first preset value and greater than the second preset value, it indicates that the current resources of the virtual machine corresponding to this resource occupancy rate are relatively moderate, and at this time, no processing is performed on this virtual machine. For example, the resource occupancy rate is the CPU occupancy rate, the first preset value is 80%, and the second preset value is 50%. If the received current CPU occupancy rate is less than or equal to 50%, it is determined that the current CPU resources are abundant, and this virtual machine is the target virtual machine; if the current CPU occupancy rate is between 50% and 80%, it is determined that the current CPU resources are moderate; if the current CPU occupancy rate is greater than or equal to 80%, it is determined that the current CPU resources are tight, and this virtual machine is the source virtual machine; the judgment methods for other resources, such as GPU resources or memory resources, are similar to those of CPU resources and will not be elaborated here.

[0073] Step 202: Send a task acquisition request to the source virtual machine.

[0074] For example, when the server determines the source virtual machine, it sends a task acquisition request to the source virtual machine, so that when the source virtual machine receives the task acquisition request, it sends the to-be-computed task that needs to be executed currently to the server, and the to-be-computed task includes the resources required for the to-be-computed task.

[0075] It should be noted that the source virtual machines determined by the server may be one or more. When multiple source virtual machines are determined, a task acquisition request needs to be sent to each source virtual machine, so that when each source virtual machine receives the task acquisition request, it sends the to-be-computed task that it needs to execute currently to the server.

[0076] Step 203: Receive the to-be-computed task sent by the source virtual machine.

[0077] Wherein, the to-be-computed task includes the resources that the source virtual machine currently needs to call.

[0078] Step 204: Determine the target virtual machine to be scheduled according to the to-be-computed task.

[0079] For example, when the server receives the to-be-computed task sent by the source virtual machine, it needs to allocate resources for the to-be-computed task, that is, it needs to determine the target virtual machine to be scheduled.

[0080] Optionally, determining the target virtual machine to be scheduled according to the task to be calculated can be achieved in the following manner:

[0081] Determine the remaining resources of each of the target virtual machines; compare the remaining resources of each of the target virtual machines with the resources of the task to be calculated; determine the target virtual machine corresponding to the remaining resources being greater than or equal to the resources of the task to be calculated as the target virtual machine to be scheduled.

[0082] Exemplarily, when the server receives a task to be calculated sent by the source virtual machine, it determines the current remaining resources of each target virtual machine, compares the current remaining resources of each target virtual machine with the resources of the task to be calculated, determines the target virtual machines with remaining resources greater than or equal to the resources of the task to be calculated, and determines the target virtual machines corresponding to the remaining resources being greater than or equal to the resources of the task to be calculated as the target virtual machines to be scheduled. For example, the target virtual machines determined by the server are virtual machine 1 and virtual machine 2 respectively, the determined source virtual machine is virtual machine 3, the task to be calculated sent by virtual machine 3 includes a CPU calculation task, the resources required for the CPU calculation task are 30%, the current CPU resource occupancy rate of virtual machine 1 is 45%, the current CPU resource occupancy rate of virtual machine 2 is 60%, and the first preset value (the highest limit of resource occupancy) is 80%. Then it can be determined that the current CPU remaining resources of virtual machine 1 are 35%, and the current CPU remaining resources of virtual machine 2 are 20%. Then, by comparing 30% with 35% and 20% respectively, it can be determined that the current CPU remaining resources of virtual machine 1 can meet the task to be calculated, and thus virtual machine 1 is determined as the target virtual machine to be scheduled.

[0083] It should be noted that determining the remaining resources of the target virtual machine means calculating the remaining resources of each type of resource of the target virtual machine, that is, calculating the CPU remaining resources of the target virtual machine, calculating the GPU remaining resources of the target virtual machine, calculating the memory remaining resources of the target virtual machine, etc.; correspondingly, comparing the remaining resources of the target virtual machine with the resources of the task to be calculated means comparing the CPU remaining resources of the target virtual machine with the CPU resources of the task to be calculated, or comparing the GPU remaining resources of the target virtual machine with the GPU resources of the task to be calculated, or comparing the memory remaining resources of the target virtual machine with the memory resources of the task to be calculated. That is to say, compare each type of remaining resource of the target virtual machine with the corresponding type of resource of the task to be calculated.

[0084] Further, when it is determined that each of the remaining resources is less than the resources required for the task to be calculated, it is determined whether the sum of the remaining resources of a preset number of the target virtual machines is greater than or equal to the resources required for the task to be calculated; when it is determined that the sum of the remaining resources of the preset number of the target virtual machines is greater than or equal to the resources required for the task to be calculated, all of the preset number of the target virtual machines are determined as the target virtual machines to be scheduled.

[0085] Exemplarily, when it is determined that each of the remaining resources is less than the resources required for the task to be calculated, it indicates that the remaining resources of a single target virtual machine cannot achieve the calculation of the task to be calculated. At this time, it is necessary to add up the remaining resources of a preset number of target virtual machines, compare the sum with the resources required for the task to be calculated, and when it is determined that the sum is greater than or equal to the resources required for the task to be calculated, all of the target virtual machines corresponding to the added remaining resources are determined as the target virtual machines to be scheduled. For example, the target virtual machines are virtual machine 1 and virtual machine 2 respectively, the determined source virtual machine is virtual machine 3, the current CPU resource occupancy rate of virtual machine 1 is 55%, the current CPU resource occupancy rate of virtual machine 2 is 70%, the CPU resources required for the task to be calculated sent by virtual machine 3 is 30%, and the first preset value is 80%. Then, it can be determined that the current CPU remaining resources of virtual machine 1 is 25%, and the current CPU remaining resources of virtual machine 2 is 10%. Then, add up the CPU remaining resources of virtual machine 1 and virtual machine 2 to get the total CPU remaining resources of 35%, and then compare 35% with 30%. It can be determined that both virtual machine 1 and virtual machine 2 are the target virtual machines to be scheduled.

[0086] Step 205: Send the task to be calculated to the target virtual machine to be scheduled, so that the target virtual machine to be scheduled sends the calculation result obtained by executing the task to be calculated according to the idle resources to the server.

[0087] Exemplarily, when the server determines the target virtual machine to be scheduled, it sends the task to be calculated received from the source virtual machine to the target virtual machine to be scheduled, so that when the target virtual machine to be scheduled receives the task to be calculated, it executes the task to be calculated according to its current remaining resources, that is, the idle resources, obtains the calculation result, and sends the obtained calculation result to the server.

[0088] Further, when it is determined that each of the remaining resources is less than the resources required for the task to be calculated, and it is determined that the sum of the remaining resources of a preset number of the target virtual machines is greater than or equal to the resources required for the task to be calculated, the task to be calculated is divided into the preset number of subtasks to be calculated according to the remaining resources of the preset number of the target virtual machines; and each of the subtasks to be calculated is sent to the corresponding target virtual machine to be scheduled.

[0089] For example, when the server determines that each remaining resource is less than the resources required for the task to be calculated, and determines that the sum of the remaining resources of a preset number of target virtual machines is greater than or equal to the resources required for the task to be calculated, it indicates that the preset number of target virtual machines can jointly implement the calculation of the task to be calculated. Therefore, at this time, it is necessary to divide the task to be calculated according to the remaining resources of the preset number of target virtual machines to obtain a preset number of subtasks to be calculated, and send each subtask to be calculated to the corresponding target virtual machine to be scheduled, so that each target virtual machine to be scheduled executes the corresponding subtask to be calculated according to its own remaining resources. Continuing with the example in step 104, the task to be calculated needs to be divided into a first subtask to be calculated and a second subtask to be calculated. For example, if the CPU resources required for the first subtask to be calculated are 20% and the CPU resources required for the second subtask to be calculated are 10%, the first subtask to be calculated can be sent to virtual machine 1, and the second subtask to be calculated can be sent to virtual machine 2, and virtual machine 1 and virtual machine 2 jointly implement the calculation of the task to be calculated.

[0090] Step 206: Receive the calculation result and send the calculation result to the source virtual machine, so that the source virtual machine executes the calculation result.

[0091] For example, when the server receives the calculation result sent by the target virtual machine to be scheduled, it sends the calculation result to the source virtual machine, so that when the source virtual machine receives the calculation result, it executes the calculation result. For example, if the task to be calculated is a display task, the source virtual machine is virtual machine A, and the target virtual machine is virtual machine B, then when the local graphics card resources of virtual machine A are insufficient, the server can allocate 30% of the resources of the graphics card of virtual machine B through scheduling. 30% of the resources of the graphics card of virtual machine B can calculate the display task of virtual machine A to obtain the display result of the D3D (3D acceleration card) core, and then return the display result to virtual machine A through server scheduling. After virtual machine A receives the display result, it finally displays the display result on the local display. That is to say, virtual machine A borrows the remaining graphics card resources of virtual machine B. In this way, on the one hand, it can relieve the resource tension of virtual machine A and improve the user experience; on the other hand, it can also make full use of the remaining resources of virtual machine B. That is to say, the ultimate goal of the present disclosure is to balance the resource occupancy rates of each virtual machine or the vast majority of virtual machines, so that the resource occupancy rate of each virtual machine is within a certain numerical range (for example, 60% - 80%) to ensure that each virtual machine can run normally and stably.

[0092] An embodiment of the present disclosure provides a resource scheduling method, which determines a source virtual machine and a target virtual machine according to the resource occupancy rates sent by each received virtual machine, sends a task acquisition request to the source virtual machine, and when receiving the to-be-calculated task sent by the source virtual machine, determines the target virtual machine to be scheduled according to the to-be-calculated task, and sends the to-be-calculated task to the target virtual machine to be scheduled, so that the target virtual machine to be scheduled sends the calculation result obtained by executing the to-be-calculated task to the server, and the server sends it to the source virtual machine. In this way, the source virtual machine with insufficient resources can call the resources of the target virtual machine with sufficient resources, avoiding the situation of resource tension of the source virtual machine, realizing the full utilization of the overall resources, and thus improving the utilization rate of the overall resources.

[0093] Further, as Figure 3 shown, before executing step 204, the following steps 207 to 210 are further included:

[0094] Step 207, determine the number of the received to-be-calculated tasks.

[0095] Exemplarily, since the server may receive to-be-calculated tasks sent by multiple source virtual machines, when the server receives the to-be-calculated tasks, it is necessary to count the number of the to-be-calculated tasks to determine the number of the received to-be-calculated tasks.

[0096] Step 208, when it is determined that the number of the to-be-calculated tasks is greater than or equal to two, determine the dominant resource of each to-be-calculated task from the resources of each to-be-calculated task.

[0097] For example, when the server determines that the number of tasks to be calculated received is greater than or equal to two, when allocating the tasks to be calculated, the DFR (Dominant Resource Fairness) algorithm can be used. The DFR algorithm is designed based on the "max-min" algorithm and supports the scheduling of various types of resources in a heterogeneous environment. Its basic principle is to provide resources in a fair manner to ensure that each computing framework can receive the resources it needs. The resources are mainly divided into the following three categories, including CPU resources, GPU resources, and memory resources. Different tasks to be calculated have requirements for different types of resources. When the server obtains the resources corresponding to each task to be calculated, for each source virtual machine, it is necessary to determine the dominant resource from the resources of the task to be calculated. For example, there are two tasks to be calculated, namely task to be calculated 1 and task to be calculated 2. Suppose task to be calculated 1 includes 4 CPU threads and 1GB of memory, and task to be calculated 2 includes 1 CPU thread and 4GB of memory. It can be seen that for task to be calculated 1, the thread resource is more important, so the dominant resource of task to be calculated 1 is determined as the CPU occupancy rate; for task to be calculated 2, the memory is more important, so the dominant resource of task to be calculated 2 is determined as the memory occupancy rate.

[0098] Step 209: Determine the ratio of the dominant resource of each task to be calculated to the total resources.

[0099] Wherein, the total resources are the sum of the resources of all virtual machines connected to the server.

[0100] For example, when the server determines the dominant resource of each task to be calculated, it obtains the sum of the resources of all virtual machines connected to the server to get the total resources, and divides the dominant resource of each task to be calculated by the total resources to obtain the ratio of each task to be calculated.

[0101] It should be noted that the total resources refer to the sum of each type of resource of all virtual machines connected to the server. For example, when the resource is CPU resources, the total resources are the sum of the CPU resources of all virtual machines connected to the server; when the resource is GPU resources, the total resources are the sum of the GPU resources of all virtual machines connected to the server; when the resource is memory resources, the total resources are the sum of the memory resources of all virtual machines connected to the server.

[0102] Step 210: Sort each task to be calculated according to the ratio, and determine the target task to be calculated according to the sorting result.

[0103] Exemplarily, when determining the ratio of each task to be calculated, sort each task to be calculated according to the ratio size, arrange the task to be calculated corresponding to the smallest ratio at the front, and arrange the task to be calculated corresponding to the largest ratio at the end. Allocate resources to the task to be calculated corresponding to the smallest ratio first. Therefore, determine the task to be calculated corresponding to the smallest ratio as the target task to be calculated. For example, the server is connected to three virtual machines, and the total resources of the three virtual machines are 10 CPU threads and 20 GB of memory. Assume that the above-mentioned task to be calculated 1 and task to be calculated 2 both need to run. Then the ratio of task to be calculated 1 is 4 / 10 = 0.25, and the ratio of task to be calculated 2 is 4 / 20 = 0.2. Then when allocating resources, it is preferred to allocate resources to task to be calculated 2, that is, to allocate resources to the task to be calculated with the lowest ratio first.

[0104] It should be noted that when the number of tasks to be calculated is greater than or equal to two, determining the target virtual machine to be scheduled according to the task to be calculated is to determine the target virtual machine to be scheduled according to the target task to be calculated.

[0105] The embodiments of the present disclosure provide a resource scheduling method, which determines a source virtual machine and a target virtual machine according to the resource occupancy rate sent by each received virtual machine, and sends a task acquisition request to the source virtual machine. When receiving the task to be calculated sent by the source virtual machine, determine the target virtual machine to be scheduled according to the task to be calculated, and send the task to be calculated to the target virtual machine to be scheduled, so that the target virtual machine to be scheduled sends the calculation result obtained by executing the task to be calculated to the server, and the server sends it to the source virtual machine. In this way, the source virtual machine with insufficient resources can call the resources of the target virtual machine with sufficient resources, avoiding the situation of resource tension of the source virtual machine, realizing the full utilization of the overall resources, and thus improving the utilization rate of the overall resources; in addition, the present disclosure can also sort multiple tasks to be calculated when receiving multiple tasks to be calculated, and determine the target task to be calculated for priority calculation according to the sorting result to ensure the reasonable allocation of resources.

[0106] The embodiments of the present disclosure provide a resource scheduling method, which is applied to a source virtual machine, as Figure 4 shown, the method includes the following steps:

[0107] Step 401, receive a task acquisition request sent by the server.

[0108] Step 402, send a task to be calculated to the server, so that the server determines the target virtual machine to be scheduled according to the task to be calculated, and sends the task to be calculated to the target virtual machine to be scheduled, so that the target virtual machine to be scheduled sends the calculation result obtained by executing the task to be calculated through the server to the source virtual machine.

[0109] Exemplarily, when the source virtual machine receives a task acquisition request sent by the server, it sends the to-be-computed task that needs to be computed currently to the server, so that the server determines the target virtual machine to be scheduled according to the resources required by the to-be-computed task, and sends the to-be-computed task to the target virtual machine to be scheduled. When the target virtual machine to be scheduled receives the to-be-computed task, it executes the to-be-computed task according to its current remaining resources, that is, idle resources, obtains a computation result, and sends the obtained computation result to the server, and the server sends the received computation result to the source virtual machine.

[0110] Step 403, receive and execute the computation result.

[0111] Exemplarily, when the source virtual machine receives the computation result corresponding to the to-be-computed task sent by the server, it executes the computation result. For example, if the to-be-computed task is a display task, the computation result is the display result. When the source virtual machine receives the display result, it displays the display result, and calls the remaining graphics card resources of the target virtual machine to be scheduled, thereby avoiding the problem of resource tension of the source virtual machine.

[0112] The embodiments of the present disclosure provide a resource scheduling method, which determines a source virtual machine and a target virtual machine according to the resource occupancy ratios sent by each virtual machine received, and sends a task acquisition request to the source virtual machine. When receiving the to-be-computed task sent by the source virtual machine, it determines the target virtual machine to be scheduled according to the to-be-computed task, and sends the to-be-computed task to the target virtual machine to be scheduled, so that the target virtual machine to be scheduled sends the computation result obtained by executing the to-be-computed task to the server, and the server sends it to the source virtual machine. In this way, the source virtual machine with insufficient resources can call the resources of the target virtual machine with sufficient resources, avoiding the situation of resource tension of the source virtual machine, realizing the full utilization of the overall resources, and thus improving the utilization rate of the overall resources.

[0113] The embodiments of the present disclosure provide a resource scheduling method, which is applied to a source virtual machine, a target virtual machine and a server, as Figure 5 shown, and the method includes the following steps:

[0114] Step 501, the server determines the source virtual machine and the target virtual machine according to the resource occupancy ratios sent by each virtual machine received.

[0115] Wherein, the source virtual machine is a virtual machine with insufficient current resources, the target virtual machine is a virtual machine with sufficient current resources, and the resource occupancy ratio at least includes one of the central processing unit (CPU) occupancy ratio, the graphics processing unit (GPU) occupancy ratio and the memory occupancy ratio.

[0116] Optionally, when it is determined that the resource occupancy rate is greater than or equal to a first preset value, the corresponding virtual machine is determined as the source virtual machine; when it is determined that the resource occupancy rate is less than or equal to a second preset value, the corresponding virtual machine is determined as the target virtual machine; wherein, the first preset value is greater than the second preset value.

[0117] Step 502, the server sends a task acquisition request to the source virtual machine.

[0118] Step 503, the source virtual machine sends a task to be calculated to the server.

[0119] Wherein, the task to be calculated includes the resources currently required to be invoked by the source virtual machine.

[0120] Furthermore, determine the number of the received tasks to be calculated; when it is determined that the number of the tasks to be calculated is greater than or equal to two, determine the dominant resources of each of the tasks to be calculated from the resources of each of the tasks to be calculated; determine the ratio of the dominant resources of each of the tasks to be calculated to the total resources; the total resources are the sum of the resources of all virtual machines connected to the server; sort each of the tasks to be calculated according to the ratio, and determine the target task to be calculated according to the sorting result.

[0121] Step 504, the server determines the target virtual machine to be scheduled according to the task to be calculated.

[0122] Optionally, determine the remaining resources of each of the target virtual machines; compare the remaining resources of each of the target virtual machines with the resources of the task to be calculated; determine the target virtual machine corresponding to the remaining resources greater than or equal to the resources of the task to be calculated as the target virtual machine to be scheduled.

[0123] Furthermore, when it is determined that each of the remaining resources is less than the resources of the task to be calculated, determine whether the sum of the remaining resources of a preset number of the target virtual machines is greater than or equal to the resources of the task to be calculated; when it is determined that the sum of the remaining resources of the preset number of the target virtual machines is greater than or equal to the resources of the task to be calculated, determine all of the preset number of the target virtual machines as the target virtual machines to be scheduled.

[0124] Step 505, the server sends the task to be calculated to the target virtual machine to be scheduled.

[0125] Optionally, divide the task to be calculated into the preset number of subtasks to be calculated according to the remaining resources of the preset number of target virtual machines; send each of the subtasks to be calculated to the corresponding target virtual machine to be scheduled.

[0126] Step 506: The target virtual machine to be scheduled executes the to-be-computed task according to the idle resources, obtains a computation result, and sends the computation result to the server.

[0127] Step 507: The server sends the computation result to the source virtual machine.

[0128] Step 508: The source virtual machine executes the computation result.

[0129] The embodiments of the present disclosure provide a resource scheduling method. The source virtual machine and the target virtual machine are determined according to the resource occupancy rates sent by each virtual machine received, and a task acquisition request is sent to the source virtual machine. When the to-be-computed task sent by the source virtual machine is received, the target virtual machine to be scheduled is determined according to the to-be-computed task, and the to-be-computed task is sent to the target virtual machine to be scheduled, so that the target virtual machine to be scheduled sends the computation result obtained by executing the to-be-computed task to the server, and the server sends it to the source virtual machine. In this way, the source virtual machine with insufficient resources can call the resources of the target virtual machine with sufficient resources, avoiding the situation of resource tension of the source virtual machine, realizing the full utilization of the overall resources, and thus improving the utilization rate of the overall resources.

[0130] Based on the resource scheduling method described in the above embodiments, the following are embodiments of the apparatus of the present disclosure, which can be used to execute the method embodiments of the present disclosure.

[0131] The embodiments of the present disclosure provide a resource scheduling apparatus, as Figure 6a shown. The resource scheduling apparatus 60 includes: a first determination module 601, a first sending module 602, a first receiving module 603, a second sending module 604, and a second receiving module 605.

[0132] Among them, the first determination module 601 is configured to determine the source virtual machine and the target virtual machine according to the resource occupancy rates sent by each virtual machine.

[0133] The first sending module 602 is configured to send a task acquisition request to the source virtual machine.

[0134] The first receiving module 603 is configured to receive the to-be-computed task sent by the source virtual machine and determine the target virtual machine to be scheduled according to the to-be-computed task.

[0135] Among them, the to-be-computed task includes the resources currently required to be called by the source virtual machine.

[0136] The second sending module 604 is configured to send the to-be-computed task to the target virtual machine to be scheduled, so that the target virtual machine to be scheduled sends the computation result obtained by executing the to-be-computed task according to the idle resources to the server.

[0137] The second receiving module 605 is configured to receive the calculation result and send the calculation result to the source virtual machine, so that the source virtual machine executes the calculation result.

[0138] In one embodiment, as Figure 6b shown, the first determination module 601 includes a first determination sub-module 6011 and a second determination sub-module 6012.

[0139] Among them, the first determination sub-module 6011 is configured to determine the corresponding virtual machine as the source virtual machine when it is determined that the resource occupancy rate is greater than or equal to a first preset value.

[0140] The second determination sub-module 6012 is configured to determine the corresponding virtual machine as the target virtual machine when it is determined that the resource occupancy rate is less than or equal to a second preset value; wherein, the first preset value is greater than the second preset value.

[0141] In one embodiment, as Figure 6c shown, the first receiving module 603 includes a third determination sub-module 6031, a comparison sub-module 6032 and a fourth determination sub-module 6033.

[0142] Among them, the third determination sub-module 6031 is configured to determine the remaining resources of each target virtual machine.

[0143] The comparison sub-module 6032 is configured to compare the remaining resources of each target virtual machine with the resources of the task to be calculated.

[0144] The fourth determination sub-module 6033 is configured to determine the target virtual machine corresponding to the remaining resources greater than or equal to the resources of the task to be calculated as the target virtual machine to be scheduled.

[0145] In one embodiment, as Figure 6d shown, the first receiving module 603 further includes a fifth determination sub-module 6034 and a sixth determination sub-module 6035.

[0146] Among them, the fifth determination sub-module 6034 is configured to determine whether the sum of the remaining resources of a preset number of the target virtual machines is greater than or equal to the resources of the task to be calculated when it is determined that the remaining resources of each are less than the resources of the task to be calculated.

[0147] The sixth determination sub-module 6035 is configured to determine all the target virtual machines of the preset number as the target virtual machines to be scheduled when it is determined that the sum of the remaining resources of the preset number of the target virtual machines is greater than or equal to the resources of the task to be calculated.

[0148] In one embodiment, as Figure 6eAs shown, the second sending module 604 includes a dividing sub-module 6041 and a sending sub-module 6042.

[0149] Among them, the dividing sub-module 6041 is used to divide the to-be-calculated task into the to-be-calculated sub-tasks of the preset quantity according to the remaining resources of the target virtual machines of the preset quantity.

[0150] The sending sub-module 6042 is used to send each to-be-calculated sub-task to the corresponding target virtual machine to be scheduled.

[0151] In one embodiment, as Figure 6f shown, the resource scheduling device 60 further includes a second determination module 606, an acquisition module 607, a third determination module 608 and a fourth determination module 609, and the first receiving module 603 includes a seventh determination sub-module 6034.

[0152] Among them, the second determination module 606 is used to determine the quantity of the received to-be-calculated tasks.

[0153] The acquisition module 607 is used to determine the dominant resource of each to-be-calculated task from the resources of each to-be-calculated task when determining that the quantity of the to-be-calculated tasks is greater than or equal to two.

[0154] The third determination module 608 is used to determine the ratio of the dominant resource of each to-be-calculated task to the total resources.

[0155] Among them, the total resources are the sum of the resources of all virtual machines connected to the server.

[0156] The fourth determination module 609 is used to sort each to-be-calculated task according to the ratio and determine the target to-be-calculated task according to the sorting result.

[0157] The seventh determination sub-module 6034 is used to determine the target virtual machine to be scheduled according to the target to-be-calculated task.

[0158] In one embodiment, the resource occupancy rate includes at least one of the central processing unit (CPU) occupancy rate, the graphics processing unit (GPU) occupancy rate, and the memory occupancy rate.

[0159] An embodiment of the present disclosure provides a resource scheduling device, which determines a source virtual machine and a target virtual machine according to the resource occupancy rates sent by each received virtual machine, and sends a task acquisition request to the source virtual machine. When receiving a to-be-computed task sent by the source virtual machine, it determines the target virtual machine to be scheduled according to the to-be-computed task, and sends the to-be-computed task to the target virtual machine to be scheduled, so that the target virtual machine to be scheduled sends the computation result obtained by executing the to-be-computed task to the server, and the server sends it to the source virtual machine. In this way, the source virtual machine with insufficient resources can call the resources of the target virtual machine with sufficient resources, avoiding the situation of resource tension of the source virtual machine, realizing the full utilization of the overall resources, and thus improving the utilization rate of the overall resources.

[0160] An embodiment of the present disclosure provides a resource scheduling device, as Figure 7 shown, the resource scheduling device 70 includes: a third receiving module 701, a third sending module 702, and an execution module 703.

[0161] Among them, the third receiving module is used to receive the task acquisition request sent by the server.

[0162] The third sending module is used to send the to-be-computed task to the server, so that the server determines the target virtual machine to be scheduled according to the to-be-computed task, and sends the to-be-computed task to the target virtual machine to be scheduled, so that the target virtual machine to be scheduled sends the computation result obtained by executing the to-be-computed task according to the idle resources to the source virtual machine through the server.

[0163] The execution module is used to receive and execute the computation result.

[0164] An embodiment of the present disclosure provides a resource scheduling device, which determines a source virtual machine and a target virtual machine according to the resource occupancy rates sent by each received virtual machine, and sends a task acquisition request to the source virtual machine. When receiving a to-be-computed task sent by the source virtual machine, it determines the target virtual machine to be scheduled according to the to-be-computed task, and sends the to-be-computed task to the target virtual machine to be scheduled, so that the target virtual machine to be scheduled sends the computation result obtained by executing the to-be-computed task to the server, and the server sends it to the source virtual machine. In this way, the source virtual machine with insufficient resources can call the resources of the target virtual machine with sufficient resources, avoiding the situation of resource tension of the source virtual machine, realizing the full utilization of the overall resources, and thus improving the utilization rate of the overall resources.

[0165] Based on the above Figure 1For the resource scheduling method described in the corresponding embodiments, the embodiments of the present disclosure also provide a computer-readable storage medium. For example, a non-transitory computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a CD-ROM, magnetic tape, a floppy disk, and an optical data storage device, etc. Computer instructions are stored on this storage medium for executing the above-mentioned Figure 1 resource scheduling method described in the corresponding embodiments, which will not be elaborated here.

[0166] Based on the above Figure 4 For the resource scheduling method described in the corresponding embodiments, the embodiments of the present disclosure also provide a computer-readable storage medium. For example, a non-transitory computer-readable storage medium may be a read-only memory, a random access memory, a CD-ROM, magnetic tape, a floppy disk, and an optical data storage device, etc. Computer instructions are stored on this storage medium for executing the above-mentioned Figure 4 resource scheduling method described in the corresponding embodiments, which will not be elaborated here.

[0167] Those of ordinary skill in the art can understand that all or part of the steps for implementing the above embodiments can be completed by hardware, or can be completed by instructing relevant hardware through a program. The program can be stored in a computer-readable storage medium. The storage medium mentioned above can be a read-only memory, a magnetic disk, or an optical disc, etc.

[0168] After considering the specification and practicing the disclosure herein, those skilled in the art will readily conceive of other embodiments of the present disclosure. This application is intended to cover any variations, uses, or adaptations of the present disclosure, which follow the general principles of the present disclosure and include known common knowledge or conventional technical means in the technical field not disclosed in the present disclosure. The specification and embodiments are only regarded as exemplary, and the true scope and spirit of the present disclosure are pointed out by the following claims.

Claims

1. A resource scheduling method, characterized in that, Applied to a server, the method includes: Determine a source virtual machine and a target virtual machine according to the resource occupancy rates sent by each received virtual machine; Send a task acquisition request to the source virtual machine; Receive the to-be-computed task sent by the source virtual machine, and determine the target virtual machine to be scheduled according to the to-be-computed task; the to-be-computed task includes the resources currently required to be invoked by the source virtual machine; Send the to-be-computed task to the target virtual machine to be scheduled, so that the target virtual machine to be scheduled sends the computation result obtained by executing the to-be-computed task according to the idle resources to the server; Receive the computation result, and send the computation result to the source virtual machine, so that the source virtual machine executes the computation result; The determining the source virtual machine and the target virtual machine according to the resource occupancy rates sent by each virtual machine includes: When it is determined that the resource occupancy rate is greater than or equal to a first preset value, determine the corresponding virtual machine as the source virtual machine; When it is determined that the resource occupancy rate is less than or equal to a second preset value, determine the corresponding virtual machine as the target virtual machine; wherein, the first preset value is greater than the second preset value; The determining the target virtual machine to be scheduled according to the to-be-computed task includes: Determine the remaining resources of each target virtual machine; Compare the remaining resources of each target virtual machine with the resources of the to-be-computed task; Determine the target virtual machine corresponding to the remaining resources greater than or equal to the resources of the to-be-computed task as the target virtual machine to be scheduled; When it is determined that each of the remaining resources is less than the resources of the to-be-computed task, determine whether the sum of the remaining resources of a preset number of the target virtual machines is greater than or equal to the resources of the to-be-computed task; When it is determined that the sum of the remaining resources of the preset number of the target virtual machines is greater than or equal to the resources of the to-be-computed task, determine all the preset number of the target virtual machines as the target virtual machines to be scheduled.

2. The method according to claim 1, characterized in that, The sending the to-be-computed task to the target virtual machine to be scheduled includes: Divide the to-be-computed task into the preset number of to-be-computed subtasks according to the remaining resources of the preset number of target virtual machines; Send each to-be-computed subtask to the corresponding target virtual machine to be scheduled.

3. The method according to claim 1, characterized in that, Before the determining the target virtual machine to be scheduled according to the to-be-computed task, it further includes: Determine the number of the received to-be-computed tasks; When it is determined that the number of the to-be-computed tasks is greater than or equal to two, determine the dominant resources of each to-be-computed task from the resources of each to-be-computed task; Determine the ratio of the dominant resources of each to-be-computed task to the total resources; the total resources are the sum of the resources of all virtual machines connected to the server; Sort each to-be-computed task according to the ratio, and determine the target to-be-computed task according to the sorting result; The determining the target virtual machine to be scheduled according to the to-be-computed task includes: Determine the target virtual machine to be scheduled according to the target to-be-computed task.

4. The method according to any one of claims 1 - 3, characterized in that, The resource occupancy rate includes at least one of the central processing unit (CPU) occupancy rate, the graphics processing unit (GPU) occupancy rate, and the memory occupancy rate.

5. A resource scheduling method, characterized in that, Applied to the source virtual machine, the method includes: Receiving a task acquisition request sent by the server; Sending a to-be-calculated task to the server, so that the server determines a target virtual machine to be scheduled according to the to-be-calculated task, and sends the to-be-calculated task to the target virtual machine to be scheduled, so that the target virtual machine to be scheduled sends the calculation result obtained by executing the to-be-calculated task according to the idle resources to the source virtual machine through the server; Receiving and executing the calculation result; When determining that the resource occupancy rate is greater than or equal to a first preset value, determining the corresponding virtual machine as the source virtual machine; when determining that the resource occupancy rate is less than or equal to a second preset value, determining the corresponding virtual machine as the target virtual machine; wherein, the first preset value is greater than the second preset value; The determining the target virtual machine to be scheduled according to the to-be-calculated task includes: Determining the remaining resources of each target virtual machine; Comparing the remaining resources of each target virtual machine with the resources of the to-be-calculated task; Determining the target virtual machine corresponding to the remaining resources greater than or equal to the resources of the to-be-calculated task as the target virtual machine to be scheduled; When determining that each of the remaining resources is less than the resources of the to-be-calculated task, determining whether the sum of the remaining resources of a preset number of the target virtual machines is greater than or equal to the resources of the to-be-calculated task; When determining that the sum of the remaining resources of the preset number of the target virtual machines is greater than or equal to the resources of the to-be-calculated task, determining all the preset number of the target virtual machines as the target virtual machines to be scheduled.

6. A resource scheduling device, characterized in that, Applied to the server, the device includes: A first determination module, configured to determine a source virtual machine and a target virtual machine according to the resource occupancy rate sent by each virtual machine; A first sending module, configured to send a task acquisition request to the source virtual machine; A first receiving module, configured to receive the to-be-calculated task sent by the source virtual machine, and determine the target virtual machine to be scheduled according to the to-be-calculated task; the to-be-calculated task includes the resources currently required to be called by the source virtual machine; A second sending module, configured to send the to-be-calculated task to the target virtual machine to be scheduled, so that the target virtual machine to be scheduled sends the calculation result obtained by executing the to-be-calculated task according to the idle resources to the server; A second receiving module, configured to receive the calculation result, and send the calculation result to the source virtual machine, so that the source virtual machine executes the calculation result; The determining the source virtual machine and the target virtual machine according to the resource occupancy rate sent by each virtual machine includes: When determining that the resource occupancy rate is greater than or equal to a first preset value, determining the corresponding virtual machine as the source virtual machine; When determining that the resource occupancy rate is less than or equal to a second preset value, determining the corresponding virtual machine as the target virtual machine; wherein, the first preset value is greater than the second preset value; The determining the target virtual machine to be scheduled according to the to-be-calculated task includes: Determine the remaining resources of each of the target virtual machines; Compare the remaining resources of each of the target virtual machines with the resources of the task to be calculated; Determine the target virtual machines corresponding to the remaining resources greater than or equal to the resources of the task to be calculated as the target virtual machines to be scheduled; When it is determined that each of the remaining resources is less than the resources of the task to be calculated, determine whether the sum of the remaining resources of a preset number of the target virtual machines is greater than or equal to the resources of the task to be calculated; When it is determined that the sum of the remaining resources of the preset number of the target virtual machines is greater than or equal to the resources of the task to be calculated, determine all of the preset number of the target virtual machines as the target virtual machines to be scheduled.

7. A resource scheduling device, characterized in that, Applied to the source virtual machine, the device includes: A third receiving module, configured to receive a task acquisition request sent by a server; A third sending module, configured to send a task to be calculated to the server, so that the server determines the target virtual machines to be scheduled according to the task to be calculated, and sends the task to be calculated to the target virtual machines to be scheduled, so that the target virtual machines to be scheduled send the calculation results obtained by executing the task to be calculated according to the idle resources to the source virtual machine through the server; An execution module, configured to receive and execute the calculation results; When it is determined that the resource occupancy rate is greater than or equal to a first preset value, determine the corresponding virtual machine as the source virtual machine; when it is determined that the resource occupancy rate is less than or equal to a second preset value, determine the corresponding virtual machine as the target virtual machine; wherein, the first preset value is greater than the second preset value; The determining the target virtual machines to be scheduled according to the task to be calculated includes: Determine the remaining resources of each of the target virtual machines; Compare the remaining resources of each of the target virtual machines with the resources of the task to be calculated; Determine the target virtual machines corresponding to the remaining resources greater than or equal to the resources of the task to be calculated as the target virtual machines to be scheduled; When it is determined that each of the remaining resources is less than the resources of the task to be calculated, determine whether the sum of the remaining resources of a preset number of the target virtual machines is greater than or equal to the resources of the task to be calculated; When it is determined that the sum of the remaining resources of the preset number of the target virtual machines is greater than or equal to the resources of the task to be calculated, determine all of the preset number of the target virtual machines as the target virtual machines to be scheduled.

Citation Information

Patent Citations

  • Task scheduling method based on cloud platform, cloud platform and computer storage medium

    CN108563500A

  • Resources scheduling method and device

    CN111949399A