Task scheduling method, device, computer equipment and storage medium
By obtaining the current computing power of the edge cluster and selecting the edge cluster with the largest computing power to perform tasks, it solves the problem of inefficient task scheduling in traditional power systems and achieves fast and efficient task allocation.
Patent Information
- Application Number
- CN202410321981.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-20
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2044-03-20
AI Technical Summary
The task scheduling of traditional power systems is not efficient, and it is necessary to collect the operating status of all servers for task allocation, resulting in inefficiency.
By receiving the total computing task, the current cluster computing power of multiple edge clusters is obtained, the edge cluster with the largest computing power is selected as the edge cluster to be selected, and the total computing task is performed by the edge cluster to be selected when the number of computing resources exceeds the preset multiple.
Improve task scheduling efficiency, avoid collecting all server operating status, and quickly determine the overall computing tasks of the to-be-selected edge cluster.
Smart Images

Figure CN118312300B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of power system task scheduling, and in particular to a task scheduling method, apparatus, computer equipment, and storage medium. Background Art
[0002] With the access and use of a large number of smart devices in the power grid, the power system has a large number of diverse computing tasks to execute, which are usually assigned to servers for execution through task scheduling.
[0003] In traditional technology, to ensure load balancing between servers, the power system cloud needs to collect the operating status of all servers and schedule tasks based on the remaining resources of each server. Therefore, task scheduling in traditional technology is inefficient. Summary of the Invention
[0004] Based on this, it is necessary to provide a task scheduling method, device, computer equipment and storage medium that can improve scheduling efficiency in response to the above technical problems.
[0005] In a first aspect, the present application provides a task scheduling method. The method comprises:
[0006] Receiving a total computing task within a preset time period, and determining the required amount of computing resources required for the total computing task;
[0007] Obtain the current cluster computing capabilities of multiple edge clusters and select the edge cluster with the largest current cluster computing capability as the candidate edge cluster;
[0008] In a case where the number of cluster computing resources of the candidate edge cluster is greater than a preset multiple of the required number of computing resources, the candidate edge cluster is used to execute the total computing task.
[0009] In one embodiment, the multiple edge clusters include virtual edge clusters, network-level edge clusters, provincial-level edge clusters, and prefecture-level edge clusters; and obtaining the current cluster computing capabilities of the multiple edge clusters includes:
[0010] For an edge cluster, obtaining an acceleration parameter of the edge cluster and an average remaining resource of servers included in the edge cluster; the acceleration parameter is a central processing unit acceleration parameter corresponding to the best-performing central processing unit among the servers included in the edge cluster;
[0011] The current cluster computing capacity of the edge cluster is obtained by multiplying the average remaining resources by the acceleration parameter.
[0012] In one embodiment, obtaining the average remaining resources of the servers included in the edge cluster includes:
[0013] For each resource including CPU, memory, hard disk and bandwidth, obtain the resource nominal value and resource remaining value;
[0014] The ratio between the resource surplus value corresponding to each server in the edge cluster and the corresponding resource nominal value is used as the resource surplus ratio corresponding to the corresponding server, the cumulative sum of the resource surplus ratios corresponding to each server is used as the total resource surplus ratio of the edge cluster, and the ratio between the total resource surplus ratio and the number of servers included in the edge cluster is used as the average surplus sub-resource;
[0015] The sum of the average remaining sub-resources is used as the average remaining resource of the servers included in the edge cluster.
[0016] In one embodiment, the total computing task includes at least one subtask; and executing the total computing task using the selected edge cluster includes:
[0017] Obtain the current machine computing power of each server in the candidate edge cluster, and determine the execution order of each server in the candidate edge cluster, wherein the execution order is the order in which the current machine computing power of each server in the candidate edge cluster is arranged from largest to smallest;
[0018] Obtain the release times of the subtasks, and control the servers in the selected edge cluster to execute the subtasks corresponding to the release times from earliest to latest according to the task execution order.
[0019] In one embodiment, obtaining the current machine computing capacity of each server in the selected edge cluster includes:
[0020] For each resource including CPU, memory, hard disk and bandwidth, obtain the nominal value and remaining value of the candidate resource;
[0021] The ratio between the remaining value of the candidate resources corresponding to each server in the candidate edge cluster and the corresponding nominal value of the candidate resources is used as the remaining ratio of the candidate resources corresponding to the corresponding server, and the cumulative sum of the remaining ratios of the candidate resources corresponding to the corresponding servers is used as the remaining ratio of the total candidate resources corresponding to the corresponding server;
[0022] The current machine computing capacity of the corresponding server in the candidate edge cluster is obtained by multiplying the candidate total resource remaining ratio by the candidate acceleration parameter of the candidate edge cluster.
[0023] In one embodiment, controlling the servers in the selected edge cluster to execute subtasks corresponding to the publishing times from earliest to latest according to the execution order of the tasks includes:
[0024] In the case that there are unexecuted remaining subtasks in the total computing task, return to the step of obtaining the current machine computing capacity of each server in the candidate edge cluster and continue to execute until the total computing task is fully executed.
[0025] In a second aspect, the present application further provides a task scheduling device. The device comprises:
[0026] A required resource quantity determination module is used to receive the total computing tasks within a preset time period and determine the required computing resource quantity required for the total computing tasks;
[0027] The candidate edge cluster determination module is used to obtain the current cluster computing capabilities of multiple edge clusters and select the edge cluster with the largest current cluster computing capability as the candidate edge cluster;
[0028] The task execution module is configured to execute the total computing task using the candidate edge cluster when the number of cluster computing resources of the candidate edge cluster is greater than a preset multiple of the required computing resource number.
[0029] In a third aspect, the present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any of the above methods when executing the computer program.
[0030] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of any of the above methods when executed by a processor.
[0031] In a fifth aspect, the present application further provides a computer program product, comprising a computer program that implements the steps of any of the above methods when executed by a processor.
[0032] The above-mentioned task scheduling method, device, computer equipment and storage medium, by receiving the total computing task within a preset time period, determine the number of required computing resources required for the total computing task, obtain the current cluster computing capacity of multiple edge clusters, select the edge cluster with the largest current cluster computing capacity as the selected edge cluster, and use the selected edge cluster to perform the total computing task when the number of cluster computing resources of the selected edge cluster is greater than the preset multiple of the required computing resources. Compared with the problem of low efficiency caused by the need to collect the operating status of all servers for task scheduling in traditional technologies, the present application can obtain the current cluster computing capacity of the edge cluster through the edge cluster, assign tasks to the edge cluster, and does not need to obtain all of them through the cloud. It can quickly determine that the selected edge cluster performs the total computing task, thereby improving the efficiency of task scheduling. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0034] Figure 1 is an application environment diagram of a task scheduling method in one embodiment;
[0035] Figure 2 A flowchart of a task scheduling method provided in an embodiment of the present application;
[0036] Figure 3 A schematic diagram of a process for obtaining current cluster computing capabilities of multiple edge clusters in one embodiment;
[0037] Figure 4 A schematic diagram of a process for obtaining average remaining resources of servers included in an edge cluster in one embodiment;
[0038] Figure 5 A schematic diagram of a process for executing a total computing task using a selected edge cluster in one embodiment;
[0039] Figure 6 A schematic diagram of a process for obtaining the current machine computing capacity of each server in a candidate edge cluster in one embodiment;
[0040] Figure 7 This is a structural block diagram of a task scheduling device provided in an embodiment of the present application;
[0041] Figure 8 This is a diagram of the internal structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0043] The task scheduling method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Figure 1The system includes a cloud system, edge clusters, and servers. The cloud system controls the edge clusters, receives total computing tasks, and determines the edge cluster that will execute them. The edge clusters control the servers and distribute the total computing tasks assigned by the cloud system to the servers for execution. The edge clusters include edge cluster 1, edge cluster 2, ..., edge cluster n, and the servers include server 11, server 12, ..., server 1n, server 21, server 22, ..., server 2n, server n1, server n2, ..., server nn.
[0044] In this embodiment, a task scheduling method is provided. This embodiment uses the method applied to a computer device as an example for illustration. It can be understood that the method can also be applied to a server, and can also be applied to a system including a computer device and a server, and is implemented through the interaction between the computer device and the server.
[0045] Figure 2 Schematic diagram of the process of the task scheduling method provided in the embodiment of the present application, the method is applied to a computer device, in one embodiment, such as Figure 2 As shown, the following steps are included:
[0046] S201, receiving the total computing tasks within a preset time period, and determining the required number of computing resources required for the total computing tasks.
[0047] The preset time period can be set manually. For example, the preset time period can be set to 5 minutes. The total computing task is the sum of computing tasks received by the cloud system from various power systems, including distributed energy, electric vehicles, virtual power plants, and microgrids. The specific power system is not limited. The required computing resources required for the total computing task include the required CPU value, required memory value, required hard disk value, and required bandwidth value.
[0048] S202 , obtaining current cluster computing capabilities of multiple edge clusters, and selecting an edge cluster with the largest current cluster computing capability as a candidate edge cluster.
[0049] S203 : When the number of cluster computing resources of the candidate edge cluster is greater than the preset multiple of the required computing resources, the candidate edge cluster is used to execute the total computing task.
[0050] The preset multiplier can be set manually. For example, the preset multiplier is 1.1. The number of cluster computing resources of the candidate edge cluster includes the candidate cluster CPU value, the candidate cluster memory value, the candidate cluster hard disk value, and the candidate cluster bandwidth value.
[0051] In some embodiments, the number of cluster computing resources of the selected edge cluster is greater than a preset multiple of the required computing resources, including:
[0052] The CPU value of the candidate cluster is greater than the required CPU value by a preset multiple, the memory value of the candidate cluster is greater than the required memory value by a preset multiple, the hard disk value of the candidate cluster is greater than the required hard disk value by a preset multiple, and the bandwidth value of the candidate cluster is greater than the required bandwidth value by a preset multiple.
[0053] The task scheduling method provided in this embodiment receives the total computing task within a preset time period, determines the number of required computing resources required for the total computing task, obtains the current cluster computing capabilities of multiple edge clusters, selects the edge cluster with the largest current cluster computing capability as the candidate edge cluster, and uses the candidate edge cluster to execute the total computing task when the number of cluster computing resources of the candidate edge cluster is greater than the preset multiple of the required computing resources. Compared with the traditional technology that requires collecting the operating status of all servers for task scheduling, which leads to low efficiency, this embodiment can obtain the current cluster computing capability of the edge cluster through the edge cluster and assign tasks to the edge cluster without having to obtain all of them through the cloud. It can quickly determine that the candidate edge cluster executes the total computing task, thereby improving the efficiency of task scheduling.
[0054] In one embodiment, multiple edge clusters include virtual edge clusters, network-level edge clusters, provincial-level edge clusters, and prefecture-level edge clusters; wherein, the virtual edge cluster is an edge cluster located around the cloud system, the network-level edge cluster is an edge cluster located in a large region in the hierarchical scheduling of the State Grid, the provincial-level edge cluster is an edge cluster located in a province in the hierarchical scheduling of the State Grid, and the prefecture-level edge cluster is an edge cluster located in a city in the hierarchical scheduling of the State Grid. It should be understood that the distinction between virtual edge clusters, network-level edge clusters, provincial-level edge clusters, and prefecture-level edge clusters lies in the different regions. A flow chart of obtaining the current cluster computing capabilities of multiple edge clusters, such as Figure 3 As shown, including the following:
[0055] S301 , for an edge cluster, obtaining an acceleration parameter of the edge cluster and an average remaining resource of servers included in the edge cluster; the acceleration parameter is an acceleration parameter of a central processing unit (CPU) corresponding to a CPU with the best performance among the servers included in the edge cluster.
[0056] The acceleration parameter is greater than 1 and less than 1.1 and is used in actual applications to adjust the load balancing effect after allocation. The average remaining resources of the servers in the edge cluster are the sum of the average remaining CPU value, average remaining memory value, average remaining hard disk value, and average remaining bandwidth value of the servers in the edge cluster.
[0057] S302 : The current cluster computing capacity of the edge cluster is obtained by multiplying the average remaining resources by the acceleration parameter.
[0058] In this embodiment, the current cluster computing capability of the edge cluster obtained based on the acceleration parameter is more accurate.
[0059] In one embodiment, a flow chart of obtaining the average remaining resources of the servers included in the edge cluster is as follows: Figure 4 As shown, including the following:
[0060] S401, for each resource of CPU, memory, hard disk and bandwidth, obtain the resource nominal value and resource remaining value.
[0061] Among them, the nominal value of the resource is the value marked according to the standard series formulated by the country.
[0062] S402, the ratio between the resource surplus value corresponding to each server in the edge cluster and the corresponding resource nominal value is used as the resource surplus ratio corresponding to the corresponding server, the cumulative sum of the resource surplus ratios corresponding to each server is used as the total resource surplus ratio of the edge cluster, and the ratio between the total resource surplus ratio and the number of servers included in the edge cluster is used as the average remaining sub-resource.
[0063] The average remaining sub-resources include the average remaining CPU value, the average remaining memory value, the average remaining hard disk value, and the average remaining bandwidth value.
[0064] Taking the average remaining sub-resource as the average remaining memory value as an example, the average remaining memory value is
[0065] ,in, is the number of servers contained in edge cluster i, j represents the jth server in edge cluster i, is the nominal memory value corresponding to the jth server in edge cluster i, is the remaining memory value corresponding to the j-th server in edge cluster i.
[0066] S403: The sum of the average remaining sub-resources is used as the average remaining resource of the servers included in the edge cluster.
[0067] In this embodiment, the average remaining resources of the servers included in the edge cluster determined based on the resource nominal values and resource remaining values of the servers included in the edge cluster are more accurate.
[0068] In one embodiment, the total computing task includes at least one subtask; a flow chart of using the selected edge cluster to execute the total computing task is as follows: Figure 5 As shown, including the following:
[0069] S501, obtain the current machine computing power of each server in the edge cluster to be selected, and determine the execution task order of each server in the edge cluster to be selected. The execution task order is to arrange the current machine computing power of each server in the edge cluster to be selected in the corresponding order from large to small.
[0070] S502 , obtaining the release time of the subtasks, and controlling the servers in the selected edge cluster to execute the subtasks corresponding to the release time from earliest to latest according to the order of executing the tasks.
[0071] Specifically, each server in the selected edge cluster executes a subtask.
[0072] In this embodiment, the method for executing the total computing task by the selected edge cluster is clarified, and the server with large computing power is used to execute the subtasks with early release time first, thereby avoiding confusion and improving task scheduling efficiency.
[0073] In one embodiment, a flow chart of obtaining the current machine computing capacity of each server in the selected edge cluster is shown as follows: Figure 6 As shown, including the following:
[0074] S601 , for each resource among CPU, memory, hard disk and bandwidth, obtain the nominal value and remaining value of the candidate resource.
[0075] S602, the ratio between the remaining value of the candidate resources corresponding to each server in the candidate edge cluster and the corresponding nominal value of the candidate resources is used as the remaining ratio of the candidate resources corresponding to the corresponding server, and the cumulative sum of the remaining ratios of the candidate resources corresponding to the corresponding server is used as the remaining ratio of the total candidate resources corresponding to the corresponding server.
[0076] S603 : Multiply the remaining ratio of the total resources to be selected by the acceleration parameter to be selected of the edge cluster to be selected to obtain the current machine computing capacity of the corresponding server in the edge cluster to be selected.
[0077] Taking edge cluster i as an example, the current computing power of server p in the edge cluster is
[0078] ,in, is the current machine computing power of server p, is the acceleration parameter of edge cluster i, 、 、 and are the CPU nominal value, memory nominal value, hard disk nominal value and bandwidth nominal value of the server p to be selected, 、 、 and They are the candidate remaining CPU value, candidate remaining memory value, candidate remaining hard disk value, and candidate remaining bandwidth value of server p respectively.
[0079] In this embodiment, the calculation method of the current machine computing power of each server in the candidate edge cluster is clarified to help determine the execution order of each server in the candidate edge cluster, thereby improving task scheduling efficiency.
[0080] In one embodiment, after controlling the servers in the selected edge cluster to execute subtasks corresponding to the publishing times from earliest to latest according to the order of executing tasks, the process includes:
[0081] If there are unexecuted remaining subtasks in the total computing task, return to the step of obtaining the current machine computing capacity of each server in the candidate edge cluster and continue executing until the total computing task is fully executed.
[0082] In this embodiment, the method of performing task scheduling when there are unexecuted remaining subtasks in the total computing task is clarified, which can ensure the execution effect of task scheduling.
[0083] Here, the task scheduling method provided by the present application is described in detail by way of a specific embodiment. The implementation process of the task scheduling method includes:
[0084] The cloud system receives the computing tasks uploaded by each power system within a preset time period to obtain the total computing task, and determines the required CPU value, required memory value, required hard disk value, and required bandwidth value required for the total computing task;
[0085] Get the current cluster computing capacity of the virtual edge cluster, network-level edge cluster, provincial-level edge cluster, and prefecture-level edge cluster. Specifically, the acquisition method is to use the following formula
[0086] ,
[0087] in, is the current cluster computing capacity of edge cluster i, is the acceleration parameter of edge cluster i, is the number of servers contained in edge cluster i, j represents the jth server in edge cluster i, 、 、 and are the CPU nominal value, memory nominal value, hard disk nominal value, and bandwidth nominal value corresponding to the jth server in edge cluster i, respectively. 、 、 and are the remaining CPU value, remaining memory value, remaining hard disk value, and remaining bandwidth value corresponding to the jth server in edge cluster i, respectively;
[0088] Select the edge cluster with the largest current cluster computing power as the candidate edge cluster, obtain the candidate cluster CPU value, candidate cluster memory value, candidate cluster hard disk value and candidate cluster bandwidth value of the candidate edge cluster, and when the candidate cluster CPU value is greater than the preset multiple of the required CPU value, the candidate cluster memory value is greater than the preset multiple of the required memory value, the candidate cluster hard disk value is greater than the preset multiple of the required hard disk value and the candidate cluster bandwidth value is greater than the preset multiple of the required bandwidth value, obtain the current machine computing power of each server in the candidate edge cluster. Specifically, the acquisition method is through the following formula
[0089] ,
[0090] in, is the current machine computing power of server p, is the selected acceleration parameter of the edge cluster, 、 、 and are the CPU nominal value, memory nominal value, hard disk nominal value and bandwidth nominal value of the server p to be selected, 、 、 and The remaining values of CPU, memory, hard disk, and bandwidth to be selected for server p are respectively;
[0091] Arrange the current machine computing power of each server in the candidate edge cluster from large to small to obtain the execution task order of each server in the candidate edge cluster, obtain the release time of the subtask, and control the servers in the candidate edge cluster to execute the subtasks corresponding to the release time from early to late according to the execution task order. If there are remaining unexecuted subtasks in the total computing task, return to the step of obtaining the current machine computing power of each server in the candidate edge cluster and continue executing until all the total computing tasks are completed.
[0092] The task scheduling method provided in this embodiment obtains the current cluster computing capacity of the edge cluster through the edge cluster, and can allocate tasks to the edge cluster without having to obtain all of them through the cloud. It can quickly determine the edge cluster to be selected to perform the total computing task, and clarify the way in which the edge cluster to be selected performs the total computing task. The server with large current machine computing capacity is used to execute the subtasks with early release time first, avoiding confusion and improving task scheduling efficiency.
[0093] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0094] Based on the same inventive concept, embodiments of the present application also provide a task scheduling device for implementing the aforementioned task scheduling method. The implementation solution provided by this device is similar to the implementation solution described in the aforementioned method. Therefore, the specific limitations in one or more of the following task scheduling device embodiments can be found in the above-mentioned limitations on the task scheduling method and will not be further elaborated here.
[0095] See also Figure 7 , Figure 7 This is a structural block diagram of a task scheduling device provided in an embodiment of the present application. The device 700 includes: a required resource quantity determination module 701, a candidate edge cluster determination module 702, and a task execution module 703, wherein:
[0096] The required resource quantity determination module 701 is used to receive the total computing tasks within a preset time period and determine the required computing resource quantity required for the total computing tasks;
[0097] The candidate edge cluster determination module 702 is configured to obtain current cluster computing capabilities of multiple edge clusters and select the edge cluster with the largest current cluster computing capability as the candidate edge cluster;
[0098] The task execution module 703 is configured to execute the total computing task using the candidate edge cluster when the number of cluster computing resources of the candidate edge cluster is greater than a preset multiple of the required computing resources.
[0099] The task scheduling device provided in this embodiment receives the total computing tasks within a preset time period through a required resource quantity determination module, determines the required number of computing resources required for the total computing task, obtains the current cluster computing capabilities of multiple edge clusters through a candidate edge cluster determination module, selects the edge cluster with the largest current cluster computing capability as the candidate edge cluster, and uses the candidate edge cluster to execute the total computing task when the number of cluster computing resources of the candidate edge cluster is greater than a preset multiple of the required number of computing resources through a task execution module. Compared with the problem of low efficiency caused by the need to collect the operating status of all servers for task scheduling in traditional technologies, this embodiment can obtain the current cluster computing capabilities of the edge cluster through the edge cluster and assign tasks to the edge cluster without having to obtain all of them through the cloud. It can quickly determine the candidate edge cluster to execute the total computing task, thereby improving the efficiency of task scheduling.
[0100] Optionally, the multiple edge clusters include a virtual edge cluster, a network-level edge cluster, a provincial-level edge cluster, and a prefecture-level edge cluster; the candidate edge cluster determination module 702 includes:
[0101] An average remaining resource acquisition unit is used to acquire, for an edge cluster, an acceleration parameter of the edge cluster and an average remaining resource of the servers included in the edge cluster; the acceleration parameter is an acceleration parameter of a central processing unit corresponding to the best-performing central processing unit among the servers included in the edge cluster;
[0102] The cluster computing capacity acquisition unit is used to obtain the current cluster computing capacity of the edge cluster by multiplying the average remaining resources by the acceleration parameter.
[0103] Optionally, the average remaining resource acquisition unit includes:
[0104] The resource data acquisition subunit is used to obtain the resource nominal value and resource remaining value for each resource including CPU, memory, hard disk and bandwidth;
[0105] The average remaining sub-resource acquisition sub-unit is used to use the ratio between the resource remaining value corresponding to each server in the edge cluster and the corresponding resource nominal value as the resource remaining ratio corresponding to the corresponding server, and the cumulative sum of the resource remaining ratios corresponding to each server as the total resource remaining ratio of the edge cluster, and the ratio between the total resource remaining ratio and the number of servers included in the edge cluster as the average remaining sub-resource;
[0106] The average remaining resource acquisition subunit is used to use the sum of the average remaining sub-resources as the average remaining resources of the servers included in the edge cluster.
[0107] Optionally, the total computing task includes at least one subtask; the task execution module 703 includes:
[0108] A task execution order determination unit is used to obtain the current machine computing power of each server in the candidate edge cluster and determine the execution order of each server in the candidate edge cluster. The execution order is to arrange the current machine computing power of each server in the candidate edge cluster in a corresponding order from large to small.
[0109] The task execution unit is used to obtain the release time of the subtask and control the servers in the selected edge cluster to execute the subtasks corresponding to the release time from the earliest to the latest according to the order of task execution.
[0110] Optionally, the task execution sequence determination unit includes:
[0111] The candidate resource data acquisition subunit is used to obtain the candidate resource nominal value and the candidate resource remaining value for each resource among CPU, memory, hard disk and bandwidth;
[0112] The subunit for obtaining the remaining ratio of the total resources to be selected is used to take the ratio between the remaining value of the resources to be selected corresponding to each server in the edge cluster to the corresponding nominal value of the resources to be selected as the remaining ratio of the resources to be selected corresponding to the corresponding server, and take the cumulative sum of the remaining ratios of the resources to be selected corresponding to the corresponding server as the remaining ratio of the total resources to be selected corresponding to the corresponding server;
[0113] The machine computing capacity acquisition subunit is used to obtain the current machine computing capacity of the corresponding server in the candidate edge cluster by multiplying the candidate total resource remaining ratio by the candidate acceleration parameter of the candidate edge cluster.
[0114] Optionally, the task execution module 703 includes:
[0115] The remaining subtask execution unit is used to return to the step of obtaining the current machine computing capacity of each server in the selected edge cluster and continue to execute until the total computing task is fully executed when there are remaining unexecuted subtasks in the total computing task.
[0116] Each module in the task scheduling device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0117] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 8As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O) and a communication interface. The processor, memory and input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store data such as total computing tasks. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a task scheduling method is implemented.
[0118] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0119] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the steps of the task scheduling method provided in the above embodiment are implemented:
[0120] Receive the total computing tasks within a preset time period and determine the required number of computing resources required for the total computing tasks;
[0121] Obtain the current cluster computing capabilities of multiple edge clusters and select the edge cluster with the largest current cluster computing capability as the candidate edge cluster;
[0122] When the number of cluster computing resources of the candidate edge cluster is greater than the preset multiple of the required computing resources, the candidate edge cluster is used to perform the total computing task.
[0123] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0124] Multiple edge clusters include virtual edge clusters, network-level edge clusters, provincial-level edge clusters, and prefecture-level edge clusters;
[0125] For an edge cluster, obtain an acceleration parameter of the edge cluster and an average remaining resource of the servers included in the edge cluster; the acceleration parameter is the CPU acceleration parameter corresponding to the best-performing CPU among the servers included in the edge cluster;
[0126] The current cluster computing capacity of the edge cluster is obtained by multiplying the average remaining resources by the acceleration parameter.
[0127] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0128] For each resource including CPU, memory, hard disk and bandwidth, obtain the resource nominal value and resource remaining value;
[0129] The ratio between the resource surplus value corresponding to each server in the edge cluster and the corresponding resource nominal value is used as the resource surplus ratio corresponding to the corresponding server, the cumulative sum of the resource surplus ratios corresponding to each server is used as the total resource surplus ratio of the edge cluster, and the ratio between the total resource surplus ratio and the number of servers included in the edge cluster is used as the average surplus sub-resource;
[0130] The sum of the average remaining sub-resources is used as the average remaining resource of the servers included in the edge cluster.
[0131] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0132] The total computing task includes at least one subtask;
[0133] Obtain the current machine computing power of each server in the candidate edge cluster, and determine the execution order of each server in the candidate edge cluster. The execution order is to arrange the current machine computing power of each server in the candidate edge cluster in the order from largest to smallest.
[0134] Get the release time of the subtask, and control the servers in the selected edge cluster to execute the subtasks corresponding to the release time from the earliest to the latest according to the order of task execution.
[0135] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0136] For each resource including CPU, memory, hard disk and bandwidth, obtain the nominal value and remaining value of the candidate resource;
[0137] The ratio between the remaining value of the candidate resources corresponding to each server in the candidate edge cluster and the corresponding nominal value of the candidate resources is used as the remaining ratio of the candidate resources corresponding to the corresponding server, and the cumulative sum of the remaining ratios of the candidate resources corresponding to the corresponding servers is used as the remaining ratio of the total candidate resources corresponding to the corresponding server;
[0138] The current machine computing capacity of the corresponding server in the candidate edge cluster is obtained by multiplying the remaining ratio of the candidate total resources by the candidate acceleration parameter of the candidate edge cluster.
[0139] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0140] If there are unexecuted remaining subtasks in the total computing task, return to the step of obtaining the current machine computing capacity of each server in the candidate edge cluster and continue executing until the total computing task is fully executed.
[0141] The implementation principle and technical effects of the above embodiment are similar to those of the above method embodiment and will not be repeated here.
[0142] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the task scheduling method provided in the above embodiment are implemented:
[0143] Receive the total computing tasks within a preset time period and determine the required number of computing resources required for the total computing tasks;
[0144] Obtain the current cluster computing capabilities of multiple edge clusters and select the edge cluster with the largest current cluster computing capability as the candidate edge cluster;
[0145] When the number of cluster computing resources of the candidate edge cluster is greater than the preset multiple of the required computing resources, the candidate edge cluster is used to perform the total computing task.
[0146] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0147] Multiple edge clusters include virtual edge clusters, network-level edge clusters, provincial-level edge clusters, and prefecture-level edge clusters;
[0148] For an edge cluster, obtain an acceleration parameter of the edge cluster and an average remaining resource of the servers included in the edge cluster; the acceleration parameter is the CPU acceleration parameter corresponding to the best-performing CPU among the servers included in the edge cluster;
[0149] The current cluster computing capacity of the edge cluster is obtained by multiplying the average remaining resources by the acceleration parameter.
[0150] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0151] For each resource including CPU, memory, hard disk and bandwidth, obtain the resource nominal value and resource remaining value;
[0152] The ratio between the resource surplus value corresponding to each server in the edge cluster and the corresponding resource nominal value is used as the resource surplus ratio corresponding to the corresponding server, the cumulative sum of the resource surplus ratios corresponding to each server is used as the total resource surplus ratio of the edge cluster, and the ratio between the total resource surplus ratio and the number of servers included in the edge cluster is used as the average surplus sub-resource;
[0153] The sum of the average remaining sub-resources is used as the average remaining resource of the servers included in the edge cluster.
[0154] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0155] The total computing task includes at least one subtask;
[0156] Obtain the current machine computing power of each server in the candidate edge cluster, and determine the execution order of each server in the candidate edge cluster. The execution order is to arrange the current machine computing power of each server in the candidate edge cluster in the order from largest to smallest.
[0157] Get the release time of the subtask, and control the servers in the selected edge cluster to execute the subtasks corresponding to the release time from the earliest to the latest according to the order of task execution.
[0158] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0159] For each resource including CPU, memory, hard disk and bandwidth, obtain the nominal value and remaining value of the candidate resource;
[0160] The ratio between the remaining value of the candidate resources corresponding to each server in the candidate edge cluster and the corresponding nominal value of the candidate resources is used as the remaining ratio of the candidate resources corresponding to the corresponding server, and the cumulative sum of the remaining ratios of the candidate resources corresponding to the corresponding servers is used as the remaining ratio of the total candidate resources corresponding to the corresponding server;
[0161] The current machine computing capacity of the corresponding server in the candidate edge cluster is obtained by multiplying the remaining ratio of the candidate total resources by the candidate acceleration parameter of the candidate edge cluster.
[0162] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0163] If there are unexecuted remaining subtasks in the total computing task, return to the step of obtaining the current machine computing capacity of each server in the candidate edge cluster and continue executing until the total computing task is fully executed.
[0164] The implementation principle and technical effects of the above embodiment are similar to those of the above method embodiment and will not be repeated here.
[0165] In one embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the steps of the task scheduling method provided in the above embodiment are implemented:
[0166] Receive the total computing tasks within a preset time period and determine the required number of computing resources required for the total computing tasks;
[0167] Obtain the current cluster computing capabilities of multiple edge clusters and select the edge cluster with the largest current cluster computing capability as the candidate edge cluster;
[0168] When the number of cluster computing resources of the candidate edge cluster is greater than the preset multiple of the required computing resources, the candidate edge cluster is used to perform the total computing task.
[0169] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0170] Multiple edge clusters include virtual edge clusters, network-level edge clusters, provincial-level edge clusters, and prefecture-level edge clusters;
[0171] For an edge cluster, obtain an acceleration parameter of the edge cluster and an average remaining resource of the servers included in the edge cluster; the acceleration parameter is the CPU acceleration parameter corresponding to the best-performing CPU among the servers included in the edge cluster;
[0172] The current cluster computing capacity of the edge cluster is obtained by multiplying the average remaining resources by the acceleration parameter.
[0173] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0174] For each resource including CPU, memory, hard disk and bandwidth, obtain the resource nominal value and resource remaining value;
[0175] The ratio between the resource surplus value corresponding to each server in the edge cluster and the corresponding resource nominal value is used as the resource surplus ratio corresponding to the corresponding server, the cumulative sum of the resource surplus ratios corresponding to each server is used as the total resource surplus ratio of the edge cluster, and the ratio between the total resource surplus ratio and the number of servers included in the edge cluster is used as the average surplus sub-resource;
[0176] The sum of the average remaining sub-resources is used as the average remaining resource of the servers included in the edge cluster.
[0177] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0178] The total computing task includes at least one subtask;
[0179] Obtain the current machine computing power of each server in the candidate edge cluster, and determine the execution order of each server in the candidate edge cluster. The execution order is to arrange the current machine computing power of each server in the candidate edge cluster in the order from largest to smallest.
[0180] Get the release time of the subtask, and control the servers in the selected edge cluster to execute the subtasks corresponding to the release time from the earliest to the latest according to the order of task execution.
[0181] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0182] For each resource including CPU, memory, hard disk and bandwidth, obtain the nominal value and remaining value of the candidate resource;
[0183] The ratio between the remaining value of the candidate resources corresponding to each server in the candidate edge cluster and the corresponding nominal value of the candidate resources is used as the remaining ratio of the candidate resources corresponding to the corresponding server, and the cumulative sum of the remaining ratios of the candidate resources corresponding to the corresponding servers is used as the remaining ratio of the total candidate resources corresponding to the corresponding server;
[0184] The current machine computing capacity of the corresponding server in the candidate edge cluster is obtained by multiplying the remaining ratio of the candidate total resources by the candidate acceleration parameter of the candidate edge cluster.
[0185] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0186] If there are unexecuted remaining subtasks in the total computing task, return to the step of obtaining the current machine computing capacity of each server in the candidate edge cluster and continue executing until the total computing task is fully executed.
[0187] The implementation principle and technical effects of the above embodiment are similar to those of the above method embodiment and will not be repeated here.
[0188] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), data processing logic devices based on quantum computing, and the like.
[0189] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0190] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A task scheduling method, characterized in that: The method comprises: Receiving a total computing task within a preset time period, and determining the required amount of computing resources required for the total computing task; Obtain the current cluster computing capabilities of multiple edge clusters and select the edge cluster with the largest current cluster computing capability as the candidate edge cluster; When the number of cluster computing resources of the candidate edge cluster is greater than a preset multiple of the required computing resource number, using the candidate edge cluster to perform the total computing task; The multiple edge clusters include virtual edge clusters, network-level edge clusters, provincial-level edge clusters, and prefecture-level edge clusters; and obtaining the current cluster computing capabilities of the multiple edge clusters includes: For an edge cluster, obtaining an acceleration parameter of the edge cluster and an average remaining resource of servers included in the edge cluster; the acceleration parameter is a central processing unit acceleration parameter corresponding to the best-performing central processing unit among the servers included in the edge cluster; Multiplying the average remaining resources by the acceleration parameter to obtain the current cluster computing capacity of the edge cluster; The obtaining of the average remaining resources of the servers included in the edge cluster includes: For each resource including CPU, memory, hard disk and bandwidth, obtain the resource nominal value and resource remaining value; The ratio between the resource surplus value corresponding to each server in the edge cluster and the corresponding resource nominal value is used as the resource surplus ratio corresponding to the corresponding server, the cumulative sum of the resource surplus ratios corresponding to each server is used as the total resource surplus ratio of the edge cluster, and the ratio between the total resource surplus ratio and the number of servers included in the edge cluster is used as the average surplus sub-resource; The sum of the average remaining sub-resources is used as the average remaining resource of the servers included in the edge cluster.
2. The method according to claim 1, characterized in that The total computing task includes at least one subtask; and performing the total computing task using the selected edge cluster includes: Obtain the current machine computing power of each server in the candidate edge cluster, and determine the execution order of each server in the candidate edge cluster, wherein the execution order is the order in which the current machine computing power of each server in the candidate edge cluster is arranged from largest to smallest; Obtain the release times of the subtasks, and control the servers in the selected edge cluster to execute the subtasks corresponding to the release times from earliest to latest according to the task execution order.
3. The method according to claim 2, characterized in that The obtaining of the current machine computing capacity of each server in the selected edge cluster includes: For each resource including CPU, memory, hard disk and bandwidth, obtain the nominal value and remaining value of the candidate resource; The ratio between the remaining value of the candidate resources corresponding to each server in the candidate edge cluster and the corresponding nominal value of the candidate resources is used as the remaining ratio of the candidate resources corresponding to the corresponding server, and the cumulative sum of the remaining ratios of the candidate resources corresponding to the corresponding servers is used as the remaining ratio of the total candidate resources corresponding to the corresponding server; The current machine computing capacity of the corresponding server in the candidate edge cluster is obtained by multiplying the candidate total resource remaining ratio by the candidate acceleration parameter of the candidate edge cluster.
4. The method according to claim 2, characterized in that After controlling the servers in the selected edge cluster to execute subtasks corresponding to the publishing times from earliest to latest according to the execution order of the tasks, the method includes: In the case that there are unexecuted remaining subtasks in the total computing task, return to the step of obtaining the current machine computing capacity of each server in the candidate edge cluster and continue to execute until the total computing task is fully executed.
5. A task scheduling device, characterized in that: The device comprises: A required resource quantity determination module is used to receive the total computing tasks within a preset time period and determine the required computing resource quantity required for the total computing tasks; A candidate edge cluster determination module is configured to obtain the current cluster computing capabilities of multiple edge clusters and select the edge cluster with the largest current cluster computing capability as the candidate edge cluster; the multiple edge clusters include virtual edge clusters, network-level edge clusters, provincial-level edge clusters, and prefecture-level edge clusters; A task execution module, configured to execute the total computing task using the edge cluster to be selected when the number of cluster computing resources of the edge cluster to be selected is greater than a preset multiple of the number of required computing resources; The module for determining the edge cluster to be selected includes: An average remaining resource acquisition unit is configured to acquire, for an edge cluster, an acceleration parameter of the edge cluster and an average remaining resource of the servers included in the edge cluster; the acceleration parameter is a CPU acceleration parameter corresponding to the CPU with the best performance among the servers included in the edge cluster; a cluster computing capability acquisition unit, configured to obtain a current cluster computing capability of the edge cluster by multiplying the average remaining resources by the acceleration parameter; Average remaining resource acquisition unit, including: The resource data acquisition subunit is used to obtain the resource nominal value and resource remaining value for each resource including CPU, memory, hard disk and bandwidth; an average remaining sub-resource acquisition sub-unit, configured to use the ratio between the resource remaining value corresponding to each server in the edge cluster and the corresponding resource nominal value as the resource remaining ratio corresponding to the corresponding server, use the cumulative sum of the resource remaining ratios corresponding to each server as the total resource remaining ratio of the edge cluster, and use the ratio between the total resource remaining ratio and the number of servers included in the edge cluster as the average remaining sub-resource; The average remaining resource acquisition subunit is configured to use the sum of the average remaining sub-resources as the average remaining resources of the servers included in the edge cluster.
6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
8. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Task scheduling method and device, computer equipment and storage medium
CN117950833A