Resource Scheduling Method and Device

By scheduling based on the client's resource occupancy rate on the server side, the task to be calculated is transferred from the client with insufficient resources to the client with sufficient resources, which solves the problem of low hardware resource utilization and achieves more efficient resource utilization.

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

Patent Information

Application Number
CN202010754120.6
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 prior art, each client has different usage rates of hardware resources, which leads to the inability to fully utilize the hardware resources and reduces the utilization rate of hardware resources.

Method used

The source client and the target client are determined on the server side according to the resource occupancy rate of each client received, and send a task acquisition request to the source client. When receiving the to-be-calculated task sent by the source client, the target client to be scheduled is determined based on the to-be-calculated task, and sends the to-be-calculated task to the to-be-calculated target client, so that the target client executes the task and sends the result to the server, and the server finally sends the result to the source client.

Benefits of technology

It realizes that clients with insufficient resources can call the resources of clients with sufficient resources, avoiding resource tightness and improving the utilization rate of overall hardware resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111949399B_ABST
    Figure CN111949399B_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 client and a target client according to the resource occupancy rate sent by each received client; sending a task acquisition request to the source client; receiving the to-be-calculated task sent by the source client, and determining the target client to be scheduled according to the to-be-calculated task; sending the to-be-calculated task to the target client to be scheduled, so that the target client to be scheduled sends the calculation result obtained by executing the to-be-calculated task according to the idle resources to the server; receiving the calculation result, and sending the calculation result to the source client, so that the source client executes the calculation result. The source client with insufficient resources in the present disclosure can call the resources of the target client with sufficient resources, avoiding the situation of resource tension of the source client, realizing the full utilization of the overall hardware resources, and thus improving the utilization rate of the overall hardware 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] VOI (Virtual OS Infrastructure) technology creates system image files on a server, and each terminal device uses its own hardware resources to use the system image files through a network. VOI manages terminal devices through image files and networks. It can be seen that VOI technology can maximize the purpose of centralized data management of terminal devices. At present, VOI technology has been applied in various fields. For example, an Internet cafe implemented through VOI technology can centrally control the user data and information security of each client through a server.

[0003] In related technologies, usually each client uses its own hardware resources to run various tasks. However, there will be such a situation in the above technologies: each user's usage of the client is different, so there will be some clients with low utilization rates of hardware resources, resulting in most resources being idle; while some clients have high utilization rates of hardware resources, and there will be a situation of resource shortage. This will lead to the overall hardware resources not being fully utilized, thereby reducing the utilization rate of hardware resources. 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 hardware resources cannot be fully utilized, thereby reducing the utilization rate of hardware resources. The technical solutions are as follows:

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

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

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

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

[0009] Send the to-be-calculated task to the target client to be scheduled, so that the target client to be scheduled sends the calculation result obtained by executing the to-be-calculated task according to the idle resources to the server;

[0010] Receive the calculation result and send the calculation result to the source client so that the source client executes the calculation result.

[0011] An embodiment of the present disclosure provides a resource scheduling method, which determines a source client and a target client according to the resource occupancy rates sent by each received client, and sends a task acquisition request to the source client. When receiving the to-be-calculated task sent by the source client, it determines the target client to be scheduled according to the to-be-calculated task, and sends the to-be-calculated task to the target client to be scheduled, so that the target client 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 client. In this way, the source client with insufficient resources can call the resources of the target client with sufficient resources, avoiding the situation of resource tension of the source client, realizing the full utilization of the overall hardware resources, and thus improving the utilization rate of the overall hardware resources.

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

[0013] When determining that the resource occupancy rate is greater than or equal to a first preset value, determining the corresponding client as the source client;

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

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

[0016] Determine the remaining resources of each target client;

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

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

[0019] In one embodiment, it further includes:

[0020] When determining 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 clients is greater than or equal to the resources of the to-be-calculated task;

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

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

[0023] Dividing 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 clients;

[0024] Sending each subtask to be calculated to the corresponding target client to be scheduled.

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

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

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

[0028] Determining the ratio of the dominant resource of each task to be calculated to the total resources; the total resources are the sum of the resources of all clients connected to the server;

[0029] Sorting each task to be calculated according to the ratio, and determining the target task to be calculated according to the sorting result;

[0030] The determining the target client to be scheduled according to the task to be calculated includes:

[0031] Determining the target client to be scheduled according to the target task to be calculated.

[0032] 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.

[0033] According to the second aspect of the embodiments of the present disclosure, a resource scheduling method is provided, which is applied to a source client. 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 client to be scheduled according to the task to be calculated, and sends the task to be calculated to the target client to be scheduled, so that the target client to be scheduled sends the calculation result obtained by executing the task to be calculated according to the idle resources to the source client through the server;

[0036] Receiving and executing the calculation result.

[0037] An embodiment of the present disclosure provides a resource scheduling method, which determines a source client and a target client according to the resource occupancy rate sent by each received client, sends a task acquisition request to the source client, and when receiving the task to be calculated sent by the source client, determines the target client to be scheduled according to the task to be calculated, and sends the task to be calculated to the target client to be scheduled, so that the target client 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 client. In this way, the source client with insufficient resources can call the resources of the target client with sufficient resources, avoiding the situation of resource tension of the source client, realizing the full utilization of the overall hardware resources, and thus improving the utilization rate of the overall hardware resources.

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

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

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

[0041] A first receiving module, configured to receive the task to be calculated sent by the source client, and determine the target client 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 client;

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

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

[0044] An embodiment of the present disclosure provides a resource scheduling device, which determines a source client and a target client according to the resource occupancy rate sent by each received client, sends a task acquisition request to the source client, and when receiving the task to be calculated sent by the source client, determines the target client to be scheduled according to the task to be calculated, and sends the task to be calculated to the target client to be scheduled, so that the target client 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 client. In this way, the source client with insufficient resources can call the resources of the target client with sufficient resources, avoiding the situation of resource tension of the source client, realizing the full utilization of the overall hardware resources, and thus improving the utilization rate of the overall hardware resources.

[0045] According to a fourth aspect of the embodiments of the present disclosure, there is provided a resource scheduling device, which is applied to a source client, and the device includes:

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

[0047] A third sending module, configured to send a to-be-calculated task to the server, so that the server determines a target client to be scheduled according to the to-be-calculated task, and sends the to-be-calculated task to the target client to be scheduled, so that the target client to be scheduled sends the calculation result obtained by executing the to-be-calculated task to the source client through the server;

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

[0049] The embodiments of the present disclosure provide a resource scheduling device, which determines a source client and a target client according to the resource occupancy rates sent by each received client, and sends a task acquisition request to the source client. When receiving the to-be-calculated task sent by the source client, it determines the target client to be scheduled according to the to-be-calculated task, and sends the to-be-calculated task to the target client to be scheduled, so that the target client 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 client. In this way, the source client with insufficient resources can call the resources of the target client with sufficient resources, avoiding the situation of resource tension of the source client, realizing the full utilization of the overall hardware resources, and thus improving the utilization rate of the overall hardware 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. Description of the Drawings

[0051] The drawings here are incorporated into the specification and constitute a part of the specification, showing the 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 a flowchart of a resource scheduling method provided by an embodiment of the present disclosure;

[0053] Figure 2 is an architecture diagram of an Internet cafe system based on VOI 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 It is an interaction diagram of a resource scheduling method provided by an embodiment of the present disclosure;

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

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

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

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

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

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

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

[0064] Here, the exemplary embodiments will be described in detail, and the examples are shown in the accompanying drawings. When the following description refers to the accompanying 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, as Figure 1 shown, and the method includes the following steps:

[0066] Step 101, determine a source client and a target client according to the resource occupancy ratios sent by each received client.

[0067] Wherein, the source client is a client with insufficient current resources, the target client is a client with sufficient current resources, and the resource occupancy ratio at least includes one of the CPU (central processing unit) occupancy ratio, GPU (Graphics Processing Unit) occupancy ratio, and memory occupancy ratio.

[0068] For example Figure 2 As shown, it is an architecture diagram of an Internet cafe system based on VOI, including a server and multiple clients. Each client is connected to the server through a network. A resource statistic is configured in each client, and a resource scheduler is configured in the server. During the operation of each client, the resource statistic in the client statistically calculates the real-time resource occupancy rate of the current client and reports the calculated resource occupancy rate to the server, so that the server receives the resource occupancy rates sent by each client and analyzes the resource occupancy rates sent by each client through the resource scheduler. The specific analysis content includes: judging whether the client has abundant resources, moderate resources or insufficient resources according to the resource occupancy rate of the client. If the resources are abundant, it is considered that the resources of the client can allocate the idle part of the resources to other clients while meeting its own needs; if the resources are moderate, it is considered that the resources of the client just meet its own needs and there is no need to allocate resources to other clients, and no processing is done; if the resources are insufficient, it is considered that the resources of the client cannot fully meet its own needs and other resources need to be appropriately allocated to this client.

[0069] It should be noted that when the client reports its own resource occupancy rate to the server, it can report it at a certain period. For example, report the resource occupancy rate 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 a first preset value, the corresponding client is determined as the source client.

[0071] When it is determined that the resource occupancy rate is less than or equal to a second preset value, the corresponding client is determined as the target client; 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 client corresponding to this resource occupancy rate are relatively tense, so the client corresponding to this resource occupancy rate is determined as the source client; 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 client corresponding to this resource occupancy rate are relatively abundant, so the client corresponding to this resource occupancy rate is determined as the target client; 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 client corresponding to this resource occupancy rate are relatively moderate, and at this time, no processing is performed on this client. 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 client is the target client; 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 tense, and this client is the source client; 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 102: Send a task acquisition request to the source client.

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

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

[0076] Step 103: Receive the to-be-calculated task sent by the source client.

[0077] Wherein, the to-be-calculated task includes the resources that the source client needs to call currently.

[0078] Step 104: Determine the target client to be scheduled according to the to-be-calculated task.

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

[0080] Optionally, determining the target client 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 clients; compare the remaining resources of each of the target clients with the resources of the task to be calculated; determine the target client corresponding to the remaining resources being greater than or equal to the resources of the task to be calculated as the target client to be scheduled.

[0082] Exemplarily, when the server receives a task to be calculated sent by the source client, it determines the current remaining resources of each target client, compares the current remaining resources of each target client with the resources of the task to be calculated, determines the target clients whose remaining resources are greater than or equal to the resources of the task to be calculated, and determines the target clients corresponding to the remaining resources being greater than or equal to the resources of the task to be calculated as the target clients to be scheduled. For example, the target clients determined by the server are Client 1 and Client 2 respectively, the source client determined is Client 3, the task to be calculated sent by Client 3 includes a CPU calculation task, the resources required for the CPU calculation task are 30%, the current CPU resource occupancy rate of Client 1 is 45%, the current CPU resource occupancy rate of Client 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 Client 1 are 35%, and the current CPU remaining resources of Client 2 are 20%. Then, by comparing 30% with 35% and 20% respectively, it can be determined that the current CPU remaining resources of Client 1 can meet the task to be calculated, and thus Client 1 is determined as the target client to be scheduled.

[0083] It should be noted that determining the remaining resources of the target client means calculating the remaining resources of each type of resource of the target client, that is, calculating the CPU remaining resources of the target client, calculating the GPU remaining resources of the target client, calculating the memory remaining resources of the target client, etc.; correspondingly, comparing the remaining resources of the target client with the resources of the task to be calculated means comparing the CPU remaining resources of the target client with the CPU resources of the task to be calculated, or comparing the GPU remaining resources of the target client with the GPU resources of the task to be calculated, or comparing the memory remaining resources of the target client with the memory resources of the task to be calculated. That is to say, compare each type of remaining resource of the target client 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, determine whether the sum of the remaining resources of a preset number of the target clients 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 clients is greater than or equal to the resources required for the task to be calculated, determine all of the preset number of the target clients as the target clients 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 client 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 clients, 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, determine all of the target clients corresponding to the added remaining resources as the target clients to be scheduled. For example, the target clients are Client 1 and Client 2 respectively, the determined source client is Client 3, the current CPU resource occupancy rate of Client 1 is 55%, the current CPU resource occupancy rate of Client 2 is 70%, the CPU resources required for the task to be calculated sent by Client 3 is 30%, and the first preset value is 80%. Then, it can be determined that the current remaining CPU resources of Client 1 is 25%, and the current remaining CPU resources of Client 2 is 10%. Then, add up the remaining CPU resources of Client 1 and Client 2 to get the total remaining CPU resources of 35%. Then, compare 35% with 30%, and it can be determined that both Client 1 and Client 2 are the target clients to be scheduled.

[0086] Step 105: Send the task to be calculated to the target clients to be scheduled, so that the target clients to be scheduled send the calculation results obtained by executing the task to be calculated according to the idle resources to the server.

[0087] Exemplarily, when the server determines the target clients to be scheduled, it sends the task to be calculated received from the source client to the target clients to be scheduled, so that when the target clients to be scheduled receive the task to be calculated, they execute the task to be calculated according to their current remaining resources, that is, the idle resources, obtain the calculation results, and send the obtained calculation results 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 the sum of the remaining resources of a preset number of the target clients is greater than or equal to the resources required for the task to be calculated, 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 the target clients; send each of the subtasks to be calculated to the corresponding target clients to be scheduled.

[0089] For example, when the server determines that each remaining resource is less than the resource required for the task to be calculated, and determines that the sum of the remaining resources of a preset number of target clients is greater than or equal to the resource required for the task to be calculated, it indicates that the preset number of target clients 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 clients to obtain a preset number of subtasks to be calculated, and send each subtask to be calculated to the corresponding target client to be scheduled, so that each target client 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 resource required for the first subtask to be calculated is 20% and the CPU resource required for the second subtask to be calculated is 10%, the first subtask to be calculated can be sent to client 1, and the second subtask to be calculated can be sent to client 2, and client 1 and client 2 jointly implement the calculation of the task to be calculated.

[0090] Step 106: Receive the calculation result and send the calculation result to the source client, so that the source client executes the calculation result.

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

[0092] An embodiment of the present disclosure provides a resource scheduling method, which determines a source client and a target client according to the resource occupancy rates sent by each received client, and sends a task acquisition request to the source client. When receiving the to-be-calculated task sent by the source client, it determines the target client to be scheduled according to the to-be-calculated task, and sends the to-be-calculated task to the target client to be scheduled, so that the target client 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 client. In this way, the source client with insufficient resources can call the resources of the target client with sufficient resources, avoiding the situation of resource tension of the source client, realizing the full utilization of the overall hardware resources, and thus improving the utilization rate of the overall hardware resources.

[0093] Further, as Figure 3 shown, before executing step 104, the following steps 107 to 110 are further included:

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

[0095] For example, since the server may receive to-be-calculated tasks sent by multiple source clients, when receiving the to-be-calculated tasks, the server needs to count the number of the to-be-calculated tasks to determine the number of the received to-be-calculated tasks.

[0096] Step 108, when determining 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, it can adopt the DFR (Dominant Resource Fairness) algorithm. The DFR algorithm is designed based on the "max-min" algorithm and supports the scheduling of various types of resources in heterogeneous environments. 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 client, 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 the resources included in task to be calculated 1 are 4 CPU threads and 1 GB of memory, and the resources included in task to be calculated 2 are 1 CPU thread and 4 GB 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 109: 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 clients 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 clients 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 clients connected to the server. For example, when the resource is CPU resources, the total resources are the sum of the CPU resources of all clients connected to the server; when the resource is GPU resources, the total resources are the sum of the GPU resources of all clients connected to the server; when the resource is memory resources, the total resources are the sum of the memory resources of all clients connected to the server.

[0102] Step 110: 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, place the task to be calculated corresponding to the smallest ratio at the front, place the task to be calculated corresponding to the largest ratio at the end, and preferentially allocate resources to the task to be calculated corresponding to the smallest ratio. 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 clients, and the total resources of the three clients 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, preferentially allocate resources to the task to be calculated with the lowest ratio.

[0104] It should be noted that when the number of tasks to be calculated is greater than or equal to two, determining the target client to be scheduled according to the tasks to be calculated is to determine the target client 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 the source client and the target client according to the resource occupancy rates sent by each received client, and sends a task acquisition request to the source client. When receiving the tasks to be calculated sent by the source client, determine the target client to be scheduled according to the tasks to be calculated, and send the tasks to be calculated to the target client to be scheduled, so that the target client to be scheduled sends the calculation results obtained by executing the tasks to be calculated to the server, and the server sends them to the source client. In this way, the source client with insufficient resources can call the resources of the target client with sufficient resources, avoiding the situation of resource tension of the source client, realizing the full utilization of the overall hardware resources, and thus improving the utilization rate of the overall hardware 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 client, as Figure 4 shown, and the method includes the following steps:

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

[0108] Step 402, send the tasks to be calculated to the server, so that the server determines the target client to be scheduled according to the tasks to be calculated, and sends the tasks to be calculated to the target client to be scheduled, so that the target client to be scheduled sends the calculation results obtained by executing the tasks to be calculated according to the idle resources to the source client through the server.

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

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

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

[0112] The embodiments of the present disclosure provide a resource scheduling method, which determines a source client and a target client according to the resource occupancy rates sent by each received client, sends a task acquisition request to the source client, and when receiving the to-be-calculated task sent by the source client, determines the target client to be scheduled according to the to-be-calculated task, and sends the to-be-calculated task to the target client to be scheduled, so that the target client 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 client. In this way, the source client with insufficient resources can call the resources of the target client with sufficient resources, avoiding the situation of resource tension of the source client, realizing the full utilization of the overall hardware resources, and thus improving the utilization rate of the overall hardware resources.

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

[0114] Step 501, the server determines a source client and a target client according to the resource occupancy rates sent by each received client.

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

[0116] Optionally, when it is determined that the resource occupancy rate is greater than or equal to a first preset value, the corresponding client is determined as the source client; when it is determined that the resource occupancy rate is less than or equal to a second preset value, the corresponding client is determined as the target client; 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 client.

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

[0119] Wherein, the task to be calculated includes the resources currently required to be called by the source client.

[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 clients 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 client to be scheduled according to the task to be calculated.

[0122] Optionally, determine the remaining resources of each of the target clients; compare the remaining resources of each of the target clients with the resources of the task to be calculated; determine the target client corresponding to the remaining resources greater than or equal to the resources of the task to be calculated as the target client 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 clients 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 clients is greater than or equal to the resources of the task to be calculated, determine all of the preset number of the target clients as the target clients to be scheduled.

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

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

[0126] Step 506: The target client to be scheduled executes the to-be-calculated task according to the idle resources, obtains the calculation result, and sends the calculation result to the server.

[0127] Step 507: The server sends the calculation result to the source client.

[0128] Step 508: The source client executes the calculation result.

[0129] The embodiment of the present disclosure provides a resource scheduling method, which determines the source client and the target client according to the resource occupancy rate sent by each received client, sends a task acquisition request to the source client, and when receiving the to-be-calculated task sent by the source client, determines the target client to be scheduled according to the to-be-calculated task, and sends the to-be-calculated task to the target client to be scheduled, so that the target client 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 client. In this way, the source client with insufficient resources can call the resources of the target client with sufficient resources, avoiding the situation of resource tension of the source client, realizing the full utilization of the overall hardware resources, and thus improving the utilization rate of the overall hardware resources.

[0130] Based on the resource scheduling method described in the above embodiment, the following is an embodiment of the device of the present disclosure, which can be used to execute the method embodiment of the present disclosure.

[0131] The embodiment of the present disclosure provides a resource scheduling device, as Figure 6a shown. The resource scheduling device 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 client and the target client according to the resource occupancy rate sent by each client.

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

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

[0135] Among them, the to-be-calculated task includes the resources currently required to be called by the source client.

[0136] The second sending module 604 is configured to send the to-be-calculated task to the target client to be scheduled, so that the target client to be scheduled sends the calculation result obtained by executing the to-be-calculated 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 client, so that the source client executes the calculation result.

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

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

[0140] The second determining sub-module 6012 is configured to determine the corresponding client as the target client when determining 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 determining sub-module 6031, a comparison sub-module 6032 and a fourth determining sub-module 6033.

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

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

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

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

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

[0147] The sixth determining sub-module 6035 is configured to determine all of the preset number of the target clients as the target clients to be scheduled when determining that the sum of the remaining resources of the preset number of the target clients 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 sub - dividing module 6041 and a sending sub - module 6042.

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

[0150] The sending sub - module 6042 is used to send each to - be - calculated sub - task to the corresponding target client 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 number 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 it is determined that the number of 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 clients 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 client 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 client and a target client according to the resource occupancy rate sent by each received client, and sends a task acquisition request to the source client. When receiving the to-be-calculated task sent by the source client, it determines the target client to be scheduled according to the to-be-calculated task, and sends the to-be-calculated task to the target client to be scheduled, so that the target client 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 client. In this way, the source client with insufficient resources can call the resources of the target client with sufficient resources, avoiding the situation of resource tension of the source client, realizing the full utilization of the overall hardware resources, and thus improving the utilization rate of the overall hardware 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-calculated task to the server, so that the server determines the target client to be scheduled according to the to-be-calculated task, and sends the to-be-calculated task to the target client to be scheduled, so that the target client to be scheduled sends the calculation result obtained by executing the to-be-calculated task according to the idle resources to the source client through the server.

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

[0164] An embodiment of the present disclosure provides a resource scheduling device, which determines a source client and a target client according to the resource occupancy rate sent by each received client, and sends a task acquisition request to the source client. When receiving the to-be-calculated task sent by the source client, it determines the target client to be scheduled according to the to-be-calculated task, and sends the to-be-calculated task to the target client to be scheduled, so that the target client 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 client. In this way, the source client with insufficient resources can call the resources of the target client with sufficient resources, avoiding the situation of resource tension of the source client, realizing the full utilization of the overall hardware resources, and thus improving the utilization rate of the overall hardware 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, a 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, a 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 here, those skilled in the art will readily think of other implementation manners of the present disclosure. This application aims to cover any variations, uses, or adaptations of the present disclosure. These variations, uses, or adaptations follow the general principles of the present disclosure and include common general 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 client and a target client according to the resource occupancy rates sent by each received client; Send a task acquisition request to the source client; Receive the task to be calculated sent by the source client, and determine the target client 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 client; Send the task to be calculated to the target client to be scheduled, so that the target client to be scheduled sends the calculation result obtained by executing the task to be calculated based on the idle resources to the server; Receive the calculation result, and send the calculation result to the source client, so that the source client executes the calculation result; The determining the source client and the target client according to the resource occupancy rates sent by each client includes: When it is determined that the resource occupancy rate is greater than or equal to a first preset value, determine the corresponding client as the source client; When it is determined that the resource occupancy rate is less than or equal to a second preset value, determine the corresponding client as the target client; wherein, the first preset value is greater than the second preset value; The determining the target client to be scheduled according to the task to be calculated includes: Determine the remaining resources of each target client; Compare the remaining resources of each target client with the resources of the task to be calculated; Determine the target client corresponding to the remaining resources greater than or equal to the resources of the task to be calculated as the target client to be scheduled; When it is determined that each remaining resource 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 clients 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 clients is greater than or equal to the resources of the task to be calculated, determine all the preset number of the target clients as the target clients to be scheduled.

2. The method according to claim 1, characterized in that, The sending the task to be calculated to the target client to be scheduled includes: 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 clients; Send each subtask to be calculated to the corresponding target client to be scheduled.

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

4. The method according to any one of claims 1-3, characterized in that, The resource occupancy rate at least includes 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 client, 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 client to be scheduled according to the to-be-calculated task, and sends the to-be-calculated task to the target client to be scheduled, so that the target client to be scheduled sends the calculation result obtained by executing the to-be-calculated task according to idle resources to the source client 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 client as the source client; when determining that the resource occupancy rate is less than or equal to a second preset value, determining the corresponding client as the target client; wherein, the first preset value is greater than the second preset value; The determining the target client to be scheduled according to the to-be-calculated task includes: Determining the remaining resources of each target client; Comparing the remaining resources of each target client with the resources of the to-be-calculated task; Determining the target client corresponding to the remaining resources greater than or equal to the resources of the to-be-calculated task as the target client 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 clients 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 clients is greater than or equal to the resources of the to-be-calculated task, determining all the preset number of the target clients as the target clients 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 client and a target client according to the resource occupancy rate sent by each client; A first sending module, configured to send a task acquisition request to the source client; A first receiving module, configured to receive the to-be-calculated task sent by the source client, and determine the target client to be scheduled according to the to-be-calculated task; the to-be-calculated task includes the resources currently required to be invoked by the source client; A second sending module, configured to send the to-be-calculated task to the target client to be scheduled, so that the target client to be scheduled sends the calculation result obtained by executing the to-be-calculated task according to idle resources to the server; A second receiving module, configured to receive the calculation result, and send the calculation result to the source client, so that the source client executes the calculation result; The determining the source client and the target client according to the resource occupancy rate sent by each client includes: When determining that the resource occupancy rate is greater than or equal to a first preset value, determining the corresponding client as the source client; When determining that the resource occupancy rate is less than or equal to a second preset value, determining the corresponding client as the target client; wherein, the first preset value is greater than the second preset value; The determining the target client to be scheduled according to the to-be-calculated task includes: Determine the remaining resources of each of the target clients; Compare the remaining resources of each of the target clients with the resources of the task to be calculated; Determine the target clients whose remaining resources are greater than or equal to the resources of the task to be calculated as the target clients 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 clients 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 clients is greater than or equal to the resources of the task to be calculated, determine all of the preset number of the target clients as the target clients to be scheduled.

7. A resource scheduling device, characterized in that, Applied to the source client, the device includes: A third receiving module, configured to receive a task acquisition request sent by the server; A third sending module, configured to send a task to be calculated to the server, so that the server determines the target clients to be scheduled according to the task to be calculated, and sends the task to be calculated to the target clients to be scheduled, so that the target clients to be scheduled send the calculation results obtained by executing the task to be calculated according to the idle resources to the source client 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 client as the source client; when it is determined that the resource occupancy rate is less than or equal to a second preset value, determine the corresponding client as the target client; wherein, the first preset value is greater than the second preset value; The determining the target clients to be scheduled according to the task to be calculated includes: Determine the remaining resources of each of the target clients; Compare the remaining resources of each of the target clients with the resources of the task to be calculated; Determine the target clients whose remaining resources are greater than or equal to the resources of the task to be calculated as the target clients 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 clients 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 clients is greater than or equal to the resources of the task to be calculated, determine all of the preset number of the target clients as the target clients 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

    CN111949398A