Task scheduling method and device in cloud-edge collaborative power system and computer device
By employing a round-robin scheduling algorithm in the cloud-edge collaborative power system, task allocation is based on resource utilization, which solves the problem of unbalanced server cluster load and improves task processing efficiency and system stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA SOUTHERN POWER GRID COMPANY
- Filing Date
- 2022-12-09
- Publication Date
- 2026-06-19
AI Technical Summary
Existing task scheduling methods in cloud-edge collaborative power systems lead to uneven load distribution across server clusters, reducing task processing efficiency.
By acquiring the request sequence of power equipment and the resource load value of the edge cluster, a round-robin scheduling algorithm is adopted to allocate computing tasks based on the resource utilization of the cluster. Container instances are created and tasks are assigned until all tasks are assigned.
It improved task processing efficiency, balanced server load, and enhanced the overall system stability and task processing capabilities.
Smart Images

Figure CN115981843B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of power technology, and in particular to a task scheduling method, apparatus, computer equipment, storage medium and computer program product in a cloud-edge collaborative power system. Background Technology
[0002] As the capacity of new energy sources such as wind power and photovoltaics connected to the power system gradually increases, and a large number of distributed power sources, adjustable loads, and energy storage devices are connected to the grid, the power system dispatch and control is shifting from the traditional source-follow-load dynamic mode to a multi-level coordinated control mode of "source-grid-load-storage". This necessitates improving the grid's real-time perception and precise control capabilities over distributed source, load, and storage resources. The two-way interaction between the grid and distributed resources has led to a sharp increase in the frequency and amount of information exchange, placing higher demands on the power dispatch system's wide-area data transmission and real-time processing and analysis capabilities.
[0003] To address the data analysis and processing capabilities required by new power systems, a two-tiered collaborative power dispatching system combining cloud and edge computing is adopted. This system provides data services at the system edge by integrating network, storage, and computing technologies, effectively improving system operating efficiency. As a solution for the large-scale data and analytical computing needs of power systems, it is currently a hot research and application topic. Completing power system analysis and computation tasks is crucial for significantly improving the level of automatic control, intelligent analysis, autonomous decision-making, and collaborative optimization applications in the power grid. Under large-scale power system computation and analysis tasks, to ensure overall operational stability, it is necessary to ensure that the load on the numerous servers in the cloud-edge system is as balanced as possible. Currently, task scheduling in cloud-edge collaborative power systems typically uses weighted averaging methods. However, weighted averaging can lead to misjudgments of the load on individual servers, resulting in uneven load distribution across the server cluster and reduced task processing efficiency.
[0004] Therefore, current task scheduling methods in cloud-edge collaborative power systems suffer from low task processing efficiency. Summary of the Invention
[0005] Therefore, it is necessary to provide a task scheduling method, device, computer equipment, computer-readable storage medium, and computer program product in a cloud-edge collaborative power system that can improve task processing efficiency in response to the above-mentioned technical problems.
[0006] Firstly, this application provides a task scheduling method in a cloud-edge collaborative power system, the method comprising:
[0007] Obtain the request sequence corresponding to the power equipment in the cloud-edge collaborative power system; the request sequence includes multiple sub-request sequences; each sub-request sequence includes a preset number of power calculation and analysis task requests to be allocated; determine the application container image based on the multiple power calculation and analysis task requests to be allocated;
[0008] The system obtains multiple resource load values corresponding to multiple edge clusters in the cloud-edge collaborative power system, and determines an edge cluster sequence based on the magnitude of the multiple resource load values; the edge cluster sequence includes multiple candidate edge clusters; the multiple candidate edge clusters in the edge cluster sequence are sorted based on the magnitude of the resource load values;
[0009] Based on the target sub-request sequence of the target location in the request sequence, determine the target edge cluster among multiple candidate edge clusters in the edge cluster sequence, create a container instance in the target edge cluster according to the application container image, and assign the target sub-request sequence to the container instance of the corresponding target edge cluster;
[0010] Remove the target sub-request sequence from the request sequence. If there are unassigned sub-request sequences in the removed request sequence, generate a new request sequence based on the unassigned sub-request sequences. Return to the step of obtaining multiple resource load values corresponding to multiple edge clusters in the cloud-edge collaborative power system until all unassigned power calculation and analysis task requests in each sub-request sequence of the request sequence are assigned.
[0011] In one embodiment, obtaining the request sequence sent by power devices in the cloud-edge collaborative power system includes:
[0012] Receive multiple requests for power calculation and analysis tasks to be allocated from power equipment in the cloud-edge collaborative power system;
[0013] Based on the request time of the multiple pending power calculation and analysis task requests, the multiple pending power calculation and analysis task requests are sorted sequentially.
[0014] The preset number is determined based on the ratio of the number of requests for the multiple power calculation and analysis tasks to the preset group number;
[0015] The multiple power calculation and analysis task requests to be assigned are grouped according to the preset number to obtain multiple sub-request sequences, and the request sequence is obtained based on the multiple sub-request sequences.
[0016] In one embodiment, determining the application container image based on the plurality of pending power calculation and analysis task requests includes:
[0017] Based on the calculation type corresponding to each pending power calculation and analysis task request, obtain the corresponding application container image from the application container agent.
[0018] In one embodiment, obtaining multiple resource load values corresponding to multiple edge clusters in the cloud-edge collaborative power system, and determining an edge cluster sequence based on the magnitude of the multiple resource load values, includes:
[0019] Obtain at least one of the processor utilization rate, memory utilization rate, and storage utilization rate corresponding to each edge cluster in the cloud-edge collaborative power system, as well as a utilization rate threshold corresponding to at least one of the processor utilization rate, memory utilization rate, and storage utilization rate;
[0020] Obtain a comparison result of at least one of the processor utilization, memory utilization, and storage utilization of each edge cluster with at least one of the corresponding utilization thresholds;
[0021] Edge clusters whose comparison results are less than the corresponding utilization rate threshold are selected as candidate edge clusters.
[0022] Multiple candidate edge clusters are sorted in ascending order according to at least one of the following: processor utilization, memory utilization, and storage utilization, to obtain an edge cluster sequence.
[0023] In one embodiment, sorting multiple candidate edge clusters in ascending order according to at least one of processor utilization, memory utilization, and storage utilization to obtain an edge cluster sequence includes:
[0024] Obtain the average value of the processor utilization and memory utilization;
[0025] Based on the magnitude of the average value, multiple candidate edge clusters are sorted in ascending order to obtain an edge cluster sequence.
[0026] In one embodiment, determining the corresponding target edge cluster from a plurality of candidate edge clusters in the edge cluster sequence based on the target sub-request sequence of the target location in the request sequence includes:
[0027] The first sub-request sequence in the request sequence is selected as the target sub-request sequence; the average request time of the first sub-request sequence is the minimum in the request sequence.
[0028] The first candidate edge cluster in the edge cluster sequence is selected as the target edge cluster; the resource load value of the first candidate edge cluster is the smallest in the edge cluster sequence.
[0029] Secondly, this application provides a task scheduling device in a cloud-edge collaborative power system, the device comprising:
[0030] The first acquisition module is used to acquire the request sequence corresponding to the power equipment in the cloud-edge collaborative power system; the request sequence includes multiple sub-request sequences; each sub-request sequence includes a preset number of power calculation and analysis task requests to be allocated; and the application container image is determined based on the multiple power calculation and analysis task requests to be allocated.
[0031] The second acquisition module is used to acquire multiple resource load values corresponding to multiple edge clusters in the cloud-edge collaborative power system, and determine an edge cluster sequence based on the magnitude of the multiple resource load values; the edge cluster sequence includes multiple candidate edge clusters; the multiple candidate edge clusters in the edge cluster sequence are sorted based on the magnitude of the resource load values.
[0032] The allocation module is used to determine the target edge cluster among multiple candidate edge clusters in the edge cluster sequence according to the target sub-request sequence of the target location in the request sequence, create a container instance in the target edge cluster according to the application container image, and allocate the target sub-request sequence to the container instance of the corresponding target edge cluster.
[0033] The return module is used to remove the target sub-request sequence from the request sequence. If there are unassigned sub-request sequences in the removed request sequence, a new request sequence is generated based on the unassigned sub-request sequences. The step of obtaining multiple resource load values corresponding to multiple edge clusters in the cloud-edge collaborative power system is returned until all the unassigned power calculation and analysis task requests in each sub-request sequence of the request sequence are assigned.
[0034] Thirdly, this application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described method.
[0035] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method.
[0036] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described method.
[0037] The task scheduling method, device, computer equipment, storage medium, and computer program product in the aforementioned cloud-edge collaborative power system obtains the request sequence corresponding to the power equipment in the cloud-edge collaborative power system. It determines the edge cluster sequence based on the magnitude of multiple resource load values corresponding to multiple edge clusters, identifies the target edge cluster from the edge cluster sequence based on the target sub-request sequence at the target location in the request sequence, creates a container instance within it, and allocates the target sub-request sequence to the container instance. If there are unallocated sub-request sequences remaining in the request sequence after removing the target sub-request sequence, a new request sequence is generated based on these unallocated sub-request sequences. The process then returns to the step of obtaining multiple resource load values corresponding to multiple edge clusters in the cloud-edge collaborative power system, until all pending power calculation and analysis task requests in the request sequence are allocated. Compared to the traditional weighted average allocation method, this scheme improves task processing efficiency by using a round-robin scheduling algorithm to allocate computing tasks based on the cluster's resource utilization. Attached Figure Description
[0038] Figure 1 This is an application environment diagram of a task scheduling method in a cloud-edge collaborative power system in one embodiment;
[0039] Figure 2 This is a flowchart illustrating a task scheduling method in a cloud-edge collaborative power system in one embodiment.
[0040] Figure 3 A flowchart illustrating the task scheduling method in a cloud-edge collaborative power system in another embodiment;
[0041] Figure 4 This is a structural block diagram of a task scheduling device in a cloud-edge collaborative power system in one embodiment;
[0042] Figure 5 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0043] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0044] The task scheduling method in the cloud-edge collaborative power system provided in this application embodiment can be applied to, for example... Figure 1In the application environment shown, edge cluster 102 communicates with cloud server 104 via a network, and cloud server 104 can also connect to power equipment. A data storage system can store the data that cloud server 104 needs to process. The data storage system can be integrated on cloud server 104 or placed on other network servers. Cloud server 104, edge cluster 102, and power equipment constitute a cloud-edge collaborative power system. Cloud server 104 can obtain the request sequence corresponding to power equipment, determine the application container image based on multiple unassigned power calculation and analysis tasks, and determine the edge cluster sequence based on multiple resource load values corresponding to multiple edge clusters 102. Based on the target sub-request sequence at the target position in the request sequence, and based on the resource load value of each edge cluster in the edge cluster sequence and the position of each sub-request sequence in the request sequence, it cyclically allocates each sub-request sequence in the request sequence until all unassigned tasks are allocated. Both edge cluster 102 and cloud server 104 can be implemented using independent servers or server clusters composed of multiple servers.
[0045] In one embodiment, such as Figure 2 As shown, a task scheduling method for a cloud-edge collaborative power system is provided, which is then applied to... Figure 1 Taking a cloud server as an example, the explanation includes the following steps:
[0046] Step S202: Obtain the request sequence corresponding to the power equipment in the cloud-edge collaborative power system; the request sequence includes multiple sub-request sequences; each sub-request sequence includes a preset number of power calculation and analysis task requests to be allocated; determine the application container image based on the multiple power calculation and analysis task requests to be allocated.
[0047] The cloud-edge collaborative power system can include power devices, edge clusters, and cloud servers. The power devices in this system generate corresponding analysis and computing tasks, which the cloud server needs to schedule and allocate. This system can include multiple power devices, each capable of generating one or more analysis and computing tasks. When a power device needs to perform an analysis or computing task, it can send a request for an assigned power analysis or computing task to the cloud server. The cloud server can receive multiple requests for assigned power analysis or computing tasks from the power devices in the system. It can combine these requests into a request sequence and further group them into sub-request sequences. After generating the corresponding request sequence, the cloud server can determine the appropriate application container image, such as a Docker container image, based on the computation type of the assigned power analysis or computing tasks.
[0048] Step S204: Obtain multiple resource load values corresponding to multiple edge clusters in the cloud-edge collaborative power system, and determine the edge cluster sequence based on the magnitude of the multiple resource load values; the edge cluster sequence includes multiple candidate edge clusters; the multiple candidate edge clusters in the edge cluster sequence are sorted based on the magnitude of the resource load values.
[0049] The cloud-edge collaborative power system comprises multiple edge clusters, each with a corresponding resource load value. This resource load value is determined based on the hardware utilization of the edge cluster, and increases with the number of computational and analytical tasks it handles. The cloud server can obtain multiple resource load values corresponding to these edge clusters and determine an edge cluster sequence based on their magnitude. For example, the cloud server can identify multiple candidate edge clusters from the existing clusters based on their resource load values and form an edge cluster sequence. Furthermore, the cloud server can sort the candidate edge clusters within the sequence, for example, based on their resource load values. Therefore, when allocating power computational and analytical tasks, the allocation method for each task can be determined based on the position of the candidate edge clusters within the edge cluster sequence.
[0050] Step S206: Based on the target sub-request sequence of the target location in the request sequence, determine the target edge cluster among multiple candidate edge clusters in the edge cluster sequence, create a container instance in the target edge cluster based on the application container image, and assign the target sub-request sequence to the container instance of the corresponding target edge cluster.
[0051] The aforementioned request sequence includes multiple sub-request sequences. The cloud server can select a target sub-request sequence and assign corresponding target edge clusters to the multiple pending power calculation and analysis tasks within that sequence. Specifically, the cloud server can determine the target edge cluster from multiple candidate edge clusters based on the target position of the target sub-request sequence within the request sequence and its corresponding position within the edge cluster sequence. After determining the target edge cluster, the cloud server can create container instances within the target edge cluster based on the aforementioned application container image and assign the target sub-request sequence to these container instances. Thus, the power calculation and analysis tasks corresponding to each request in the target sub-request sequence can be computed within the container instances of the target edge cluster. For example, power system calculation and analysis tasks can be performed using Docker containers within the target edge cluster.
[0052] Step S208: Remove the target sub-request sequence from the request sequence. If there are unassigned sub-request sequences in the removed request sequence, generate a new request sequence based on the unassigned sub-request sequences. Return to the step of obtaining multiple resource load values corresponding to multiple edge clusters in the cloud-edge collaborative power system, until all the unassigned power calculation and analysis task requests in each sub-request sequence of the request sequence are assigned.
[0053] The aforementioned request sequence includes multiple sub-request sequences. Once a target sub-request sequence is assigned to its corresponding target edge cluster, the cloud server can remove it from the request sequence. The cloud server can then detect whether any unassigned sub-request sequences exist within the removed sequence. If so, the cloud server can generate a new request sequence based on the unassigned sub-request sequences, for example, by combining multiple pending power calculation and analysis task requests from the unassigned sub-request sequences into a new request sequence. Furthermore, since the target edge cluster is assigned computing tasks, its load resource value will change. Therefore, the cloud server can return to the steps described above—obtaining the resource load values corresponding to multiple edge clusters in the cloud-edge collaborative power system—based on this new request sequence, recalculate the resource load of multiple edge clusters, determine a new edge cluster sequence, and perform the next round of allocation based on the new request sequence and the new edge cluster sequence. This process continues until all pending power calculation and analysis task requests have been allocated, at which point the cloud server can terminate the allocation process. In other words, the cloud server can perform round-robin scheduling and allocation of multiple pending power calculation and analysis task requests.
[0054] In the aforementioned task scheduling method for the cloud-edge collaborative power system, the following steps are taken: First, the request sequence corresponding to the power equipment in the cloud-edge collaborative power system is obtained. Then, an edge cluster sequence is determined based on the magnitude of multiple resource load values corresponding to multiple edge clusters. Next, based on the target sub-request sequence at the target location in the request sequence, a target edge cluster is determined from the edge cluster sequence, and a container instance is created within it. The target sub-request sequence is then allocated to this container instance. If unallocated sub-request sequences remain in the request sequence after removing the target sub-request sequence, a new request sequence is generated based on these unallocated sub-request sequences. The process then returns to the step of obtaining multiple resource load values corresponding to multiple edge clusters in the cloud-edge collaborative power system, until all pending power calculation and analysis task requests in the request sequence are allocated. Compared to the traditional weighted average allocation method, this scheme improves task processing efficiency by using a round-robin scheduling algorithm that allocates computational tasks based on the cluster's resource utilization.
[0055] In one embodiment, obtaining a request sequence sent by power devices in a cloud-edge collaborative power system includes: receiving multiple pending power calculation and analysis task requests sent by power devices in the cloud-edge collaborative power system; sequentially sorting the multiple pending power calculation and analysis task requests according to their request times; determining a preset number based on the ratio of the number of multiple pending power calculation and analysis task requests to a preset group number; grouping the multiple pending power calculation and analysis task requests according to the preset number to obtain multiple sub-request sequences; and obtaining a request sequence based on the multiple sub-request sequences.
[0056] In this embodiment, the cloud server can classify and combine multiple requests sent by power devices into a request sequence. Specifically, multiple power devices in the aforementioned cloud-edge collaborative power system can send multiple requests for power calculation and analysis tasks to the cloud server. Each power calculation and analysis task request may have a different request time. The cloud server can then sort these multiple requests based on their request times, for example, sorting them from earliest to latest, placing the earliest request first and the latest request last. This results in an original request sequence composed of multiple sorted requests for power calculation and analysis tasks. The cloud server can also group these multiple requests. For example, the cloud server can determine the preset number of each group based on the ratio of the number of requests to the preset number of groups. The cloud server can then group these requests according to the preset number, resulting in multiple sub-request sequences. The number of requests in each sub-request sequence can be a preset number, allowing the cloud server to obtain the aforementioned request sequence from these multiple sub-request sequences.
[0057] Specifically, the aforementioned power equipment can be power equipment in a dispatching and control system. After receiving multiple pending power calculation and analysis task requests initiated by the power equipment, the cloud server can sort the currently generated multiple pending power calculation and analysis task requests according to the request time sequence to obtain the original request sequence: T = {T1, T2, ..., T...} Nt}, where T Nt This represents the Nt-th pending power calculation and analysis task request. The cloud server can start with the earliest requested calculation and select a preset set of tasks of number N0, i.e., the above sub-request sequence. The formula for calculating N0 is as follows: N0 = [N...] t / N]. Where N tThis represents the total number of pending power calculation and analysis task requests. Specifically, N0 represents the number of pending power calculation and analysis task requests in each sub-request sequence. The cloud server can convert the original request sequence into a request sequence composed of task sets, as shown below:
[0058] Among them, T a Represents the request sequence, T1,…,T Nt This is a list of pending power calculation and analysis task requests sorted by request time.
[0059] In this embodiment, the cloud server can divide multiple pending power calculation and analysis task requests into multiple sub-request sequences based on the request time, and combine the multiple sub-request sequences into a request sequence. Thus, the cloud server can allocate the pending power calculation and analysis task requests in each sub-request sequence based on the request sequence, thereby improving the efficiency of task scheduling.
[0060] In one embodiment, determining the application container image based on multiple pending power calculation and analysis task requests includes: obtaining the corresponding application container image from the application container agent based on the calculation type corresponding to each pending power calculation and analysis task request.
[0061] In this embodiment, the aforementioned power calculation and analysis task requests to be allocated have corresponding calculation types. The cloud server can obtain the calculation type corresponding to each power calculation and analysis task request to be allocated, and obtain the corresponding application container image from the application container agent according to the calculation type of each power calculation and analysis task request to be allocated. Specifically, the aforementioned application container image can be a Docker container image. The analysis and calculation tasks in the cloud-edge collaborative power dispatching system can be completed by Docker containers. The container image can be packaged by the cloud server. Both the cloud and edge systems can run containers for calculation and analysis. Power dispatching-related calculation and analysis requests from the cloud or edge are first sent to the Docker agent. The Docker agent selects the corresponding Docker container image according to the calculation type of the power calculation and analysis task request, and dynamically creates container instances on the allocated server cluster. After the calculation is completed in the container instance of the server cluster, the calculation result is returned, and the resources occupied by the container are released.
[0062] In this embodiment, the cloud server can determine the corresponding application container image based on the calculation type of the power calculation and analysis task request to be allocated, and perform the power calculation and analysis task calculation based on the container instance corresponding to the application container image, thereby improving the scheduling efficiency of power calculation and analysis tasks.
[0063] In one embodiment, obtaining multiple resource load values corresponding to multiple edge clusters in a cloud-edge collaborative power system, and determining an edge cluster sequence based on the magnitude of the multiple resource load values, includes: obtaining at least one of processor utilization, memory utilization, and storage utilization corresponding to each edge cluster in the cloud-edge collaborative power system, and a utilization threshold corresponding to at least one of processor utilization, memory utilization, and storage utilization; obtaining a comparison result between at least one of processor utilization, memory utilization, and storage utilization corresponding to each edge cluster and at least one of the corresponding utilization thresholds; selecting edge clusters whose at least one comparison result is less than the corresponding utilization threshold as candidate edge clusters; and sorting the multiple candidate edge clusters in ascending order according to at least one of processor utilization, memory utilization, and storage utilization to obtain an edge cluster sequence.
[0064] In this embodiment, the cloud server can determine the resource load value of each edge cluster by detecting the hardware utilization rate of the edge clusters. For example, the cloud server can obtain at least one of the processor utilization rate, memory utilization rate, and storage utilization rate corresponding to each edge cluster in the cloud-edge collaborative power system, and obtain the utilization rate threshold corresponding to the above-mentioned at least one hardware utilization rate. Each of the above-mentioned hardware utilization rates represents a resource load value, and the utilization rate threshold corresponding to each hardware utilization rate can be set according to actual conditions. The cloud server can compare the obtained hardware utilization rate with the corresponding utilization rate threshold to obtain at least one comparison result. For example, the cloud server compares the processor utilization rate with the processor utilization rate threshold, the memory utilization rate with the memory utilization rate threshold, and the storage utilization rate with the storage utilization rate threshold to obtain at least one comparison result. The cloud server can consider edge clusters whose comparison results are less than the corresponding utilization rate threshold as candidate edge clusters. When there are multiple comparison results, the cloud server can only determine the edge cluster corresponding to a comparison result as a candidate edge cluster when it detects that each comparison result is less than the corresponding utilization rate threshold.
[0065] Specifically, since the aforementioned power calculation and analysis tasks primarily utilize CPU (central processing unit), memory, and storage devices, the cloud server can obtain the resource utilization rates of each edge cluster. The cloud server can set preset utilization thresholds for each computing resource, allowing it to select qualified candidate edge clusters. In other words, the cloud server can consider edge clusters with resource utilization rates below the set thresholds as low-load states, thus enabling task allocation. Based on this judgment, the cloud server can obtain an edge cluster sequence, denoted as D. The judgment formula for each candidate edge cluster can be as follows: A i =(C i,1<θ i,1 )∩(C i,2 <θ i,2 )∩(C i,3 <θ i,3 ), where A i The determination principle for the i-th edge cluster; C i,1 Let C be the CPU utilization of the i-th edge cluster; i,2 Let C be the memory utilization of the i-th edge cluster; i,3 Let θ be the storage utilization of the i-th edge cluster; i,1 Let θ be the CPU utilization threshold for the i-th edge cluster; i,2 Let θ be the memory utilization threshold for the i-th edge cluster; i,1 Let be the storage utilization threshold for the i-th edge cluster. That is, the cloud server can consider edge clusters that meet the above judgment formula as candidate edge clusters.
[0066] After obtaining multiple candidate edge clusters, the cloud server can sort these clusters in ascending order based on at least one of processor utilization, memory utilization, and storage utilization to obtain an edge cluster sequence. In other words, the cloud server sorts the candidate edge clusters according to the hardware utilization rate selected as the criterion for judging them. For example, in some embodiments, the hardware utilization rate selected as the criterion can be processor utilization and memory utilization. The cloud server can obtain the average value of processor utilization and memory utilization, and sort the candidate edge clusters in ascending order based on the magnitude of the average value, for example, sorting them from smallest to largest to obtain the edge cluster sequence.
[0067] Specifically, the identified candidate edge clusters can form a sequence D. The cloud server can count the number of edge clusters contained in sequence D, denoted as N, and sort sequence D. Specifically, the cloud servers can be sorted in ascending order of average CPU and memory utilization. The formula for calculating the average utilization is as follows: C i,avr =(C i,1 +C i,2 ) / 2. Where C i,avr Let $\frac{i}{i}$ be the average CPU and memory utilization of the $i$-th edge cluster. The cloud server can then sort multiple candidate edge clusters according to these average utilizations, resulting in a sequence $D' = {S1, S2, ..., S}$. N}, which is the aforementioned edge cluster sequence. Where S1, S2, ..., S N The candidate edge clusters are sorted, and their resource load values increase sequentially, with S1 having the smallest resource load value. N The resource load value is the highest.
[0068] Through the above embodiments, the cloud server can determine qualified candidate edge clusters based on the hardware utilization of each edge cluster, and sort multiple candidate edge clusters to obtain an edge cluster sequence. Therefore, the cloud server can allocate pending power calculation and analysis task requests based on the edge cluster sequence, improving the allocation efficiency of power calculation and analysis tasks.
[0069] In one embodiment, determining the corresponding target edge cluster from multiple candidate edge clusters in the edge cluster sequence based on the target sub-request sequence of the target location in the request sequence includes: obtaining the first sub-request sequence in the request sequence as the target sub-request sequence; the average request time of the first sub-request sequence is the minimum in the request sequence; obtaining the first candidate edge cluster in the edge cluster sequence as the target edge cluster; the resource load value of the first candidate edge cluster is the minimum in the edge cluster sequence.
[0070] In this embodiment, the cloud server can allocate pending power calculation and analysis task requests based on the aforementioned request sequence and edge cluster sequence. The request sequence may include multiple sub-request sequences, and the cloud server can select the first sub-request sequence as the target sub-request sequence. Since the pending power calculation and analysis task requests in the request sequence are ordered according to their request time, the average request time in the first sub-request sequence is the lowest in the entire request sequence. The cloud server can also select the first candidate edge cluster in the aforementioned edge cluster sequence as the target edge cluster. Since the candidate edge clusters in the aforementioned edge cluster sequence are ordered in ascending order according to their resource load values, the first candidate edge cluster has the lowest resource load value. Therefore, the cloud server can allocate multiple pending power calculation and analysis task requests from the first sub-request sequence to the target edge cluster.
[0071] Furthermore, after the aforementioned target sub-request sequence is allocated, the target edge cluster can allocate computing resources such as CPU and memory to the requested tasks. The resource load value of the target edge cluster will change accordingly. The cloud server can remove the allocated target sub-request sequence from the request sequence and return to the step of determining the edge cluster sequence. The low-load edge clusters are reordered, and a new request sequence is determined based on the remaining unallocated power calculation and analysis task requests. The remaining unallocated power calculation and analysis tasks are then allocated until all tasks in the request sequence are allocated.
[0072] Through this embodiment, the cloud server can allocate the target edge cluster with the lowest current resource load value to the target sub-request sequence with an earlier request time based on the position of the candidate edge cluster in the edge cluster sequence and the position of the sub-request sequence in the request sequence, thereby improving the scheduling and allocation efficiency of power computing and analysis task requests.
[0073] In one embodiment, such as Figure 3 As shown, Figure 3 A flowchart illustrating a task scheduling method in a cloud-edge collaborative power system, as shown in another embodiment. In this embodiment, the cloud server can, as... Figure 3 This approach coordinates the conflict between computational reliability and server resource balancing in a cloud-edge collaborative power dispatching system, addressing the diverse scheduling timescale requirements. Cloud servers can utilize Docker containers to perform computational analysis tasks within the power system, enabling unified management of server resources. The cloud server, focusing on resource utilization and aiming for load balancing, calculates and sorts server resource utilization within the cloud-edge collaborative system. Computational tasks are grouped according to time tags, and tasks in the currently assigned task group are sequentially allocated to servers sorted by resource utilization. This process is repeated multiple times until all computational analysis tasks are completed.
[0074] Specifically, the cloud server can set certain thresholds for the computing resources primarily related to task processing: CPU, memory, and storage. It can then select candidate edge clusters that meet the requirements; edge clusters with resource utilization rates below the set thresholds are considered low-load and can be used for task allocation, resulting in an original edge cluster sequence. The cloud server can also count the number of edge clusters in the original edge cluster sequence, denoted as N, and sort the candidate edge clusters. Given the relatively abundant storage on the server, the cloud server can sort them according to their average CPU and memory utilization rates from lowest to highest, forming the aforementioned edge cluster sequence. The cloud server can also sort the pending computational analysis tasks generated by the scheduling and control system according to their request time sequence. Starting with the earliest requested computation, a fixed number of tasks (N0) is selected. The original multiple pending power computational analysis task requests are transformed into a sequence of task sets, resulting in a request sequence containing multiple sub-request sequences. The first sub-request sequence in the request sequence is assigned to the first edge cluster in the edge cluster sequence. After completion, the assigned task set is removed from the request sequence. After the edge clusters have allocated computing resources such as CPU and memory to the requested tasks, the cloud server can return to the above steps of selecting candidate edge clusters that meet the requirements, reorder the low-load edge clusters, and allocate the remaining task set in the request sequence until all tasks in the task sequence have been allocated.
[0075] Through the above embodiments, the cloud server improves task processing efficiency by allocating computing tasks based on cluster resource utilization using a round-robin scheduling algorithm. Furthermore, by using Docker containers for power analysis computing tasks, with resource utilization as the core and load balancing as the goal, multiple round-robin allocations of tasks meet the big data analysis computing needs of large-scale charging facility collaborative control. This achieves good load balancing of the cloud-edge collaborative system servers with relatively low allocation algorithm resource consumption, while also ensuring the reliability of power system analysis computing tasks and improving the overall security and reliability of the cloud-edge collaborative system.
[0076] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0077] Based on the same inventive concept, this application also provides a task scheduling device for a cloud-edge collaborative power system for implementing the task scheduling method in the cloud-edge collaborative power system described above. The solution provided by this device is similar to the solution described in the above method. Therefore, the specific limitations of one or more embodiments of the task scheduling device in the cloud-edge collaborative power system provided below can be found in the limitations of the task scheduling method in the cloud-edge collaborative power system described above, and will not be repeated here.
[0078] In one embodiment, such as Figure 4 As shown, a task scheduling device for a cloud-edge collaborative power system is provided, comprising: a first acquisition module 500, a second acquisition module 502, an allocation module 504, and a return module 506, wherein:
[0079] The first acquisition module 500 is used to acquire the request sequence corresponding to the power equipment in the cloud-edge collaborative power system; the request sequence includes multiple sub-request sequences; each sub-request sequence includes a preset number of power calculation and analysis task requests to be allocated; and the application container image is determined based on the multiple power calculation and analysis task requests to be allocated.
[0080] The second acquisition module 502 is used to acquire multiple resource load values corresponding to multiple edge clusters in the cloud-edge collaborative power system, and determine the edge cluster sequence based on the size of the multiple resource load values; the edge cluster sequence includes multiple candidate edge clusters; the multiple candidate edge clusters in the edge cluster sequence are sorted based on the size of the resource load values.
[0081] The allocation module 504 is used to determine the target edge cluster from multiple candidate edge clusters in the edge cluster sequence based on the target sub-request sequence at the target location in the request sequence, create a container instance in the target edge cluster based on the application container image, and allocate the target sub-request sequence to the container instance of the corresponding target edge cluster.
[0082] Return module 506 is used to remove the target sub-request sequence from the request sequence. If there are unassigned sub-request sequences in the removed request sequence, a new request sequence is generated based on the unassigned sub-request sequences. Return the steps of obtaining multiple resource load values corresponding to multiple edge clusters in the cloud-edge collaborative power system until all the unassigned power calculation and analysis task requests in each sub-request sequence in the request sequence are assigned.
[0083] In one embodiment, the first acquisition module 500 is specifically configured to receive multiple pending power calculation and analysis task requests sent by power devices in a cloud-edge collaborative power system; sort the multiple pending power calculation and analysis task requests in order according to their request times; determine a preset number based on the ratio of the number of multiple pending power calculation and analysis task requests to a preset group number; group the multiple pending power calculation and analysis task requests according to the preset number to obtain multiple sub-request sequences; and obtain a request sequence based on the multiple sub-request sequences.
[0084] In one embodiment, the first acquisition module 500 is specifically used to acquire the corresponding application container image from the application container agent according to the calculation type corresponding to each power calculation and analysis task request to be allocated.
[0085] In one embodiment, the second acquisition module 502 is specifically used to acquire at least one of the processor utilization rate, memory utilization rate, and storage utilization rate corresponding to each edge cluster in the cloud-edge collaborative power system, and a utilization rate threshold corresponding to at least one of the processor utilization rate, memory utilization rate, and storage utilization rate; acquire a comparison result between at least one of the processor utilization rate, memory utilization rate, and storage utilization rate corresponding to each edge cluster and at least one of the corresponding utilization rate thresholds; select edge clusters whose at least one comparison result is less than the corresponding utilization rate threshold as candidate edge clusters; and sort multiple candidate edge clusters in ascending order according to at least one of the processor utilization rate, memory utilization rate, and storage utilization rate to obtain an edge cluster sequence.
[0086] In one embodiment, the second acquisition module 502 is specifically used to acquire the average value of processor utilization and memory utilization; and sort multiple candidate edge clusters in ascending order according to the magnitude of the average value to obtain an edge cluster sequence.
[0087] In one embodiment, the allocation module 504 is specifically used to obtain the first sub-request sequence in the request sequence as the target sub-request sequence; the average request time of the first sub-request sequence is the minimum in the request sequence; obtain the first candidate edge cluster in the edge cluster sequence as the target edge cluster; the resource load value of the first candidate edge cluster is the minimum in the edge cluster sequence.
[0088] The modules in the task scheduling device of the aforementioned cloud-edge collaborative power system can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.
[0089] In one embodiment, a computer device is provided, which may be a cloud server, and its internal structure diagram may be as follows: Figure 5 As shown, the computer device includes a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a task scheduling method in a cloud-edge collaborative power system. The display unit of the computer device forms a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.
[0090] Those skilled in the art will understand that Figure 5The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0091] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the task scheduling method in the cloud-edge collaborative power system described above.
[0092] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the task scheduling method described above in a cloud-edge collaborative power system.
[0093] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the task scheduling method described above in a cloud-edge collaborative power system.
[0094] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0095] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, 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 many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0096] The technical features of the above embodiments can be combined in any way. For the sake of brevity, 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.
[0097] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for task scheduling in a cloud-edge collaborative power system, characterized in that, The method includes: The system receives multiple pending power calculation and analysis task requests sent by power devices in a cloud-edge collaborative power system; sorts the multiple pending power calculation and analysis task requests according to their request times to obtain sorted multiple pending power calculation and analysis task requests; determines a preset number based on the ratio of the number of multiple pending power calculation and analysis task requests to a preset group number; groups the sorted multiple pending power calculation and analysis task requests according to the preset number to obtain multiple sub-request sequences; obtains a request sequence based on the multiple sub-request sequences; and determines an application container image based on the multiple pending power calculation and analysis task requests. The system obtains multiple resource load values corresponding to multiple edge clusters in the cloud-edge collaborative power system, and determines an edge cluster sequence based on the magnitude of the multiple resource load values; the edge cluster sequence includes multiple candidate edge clusters; the multiple candidate edge clusters in the edge cluster sequence are sorted based on the magnitude of the resource load values; Based on the target sub-request sequence at the target location in the request sequence, determine the corresponding target edge cluster among multiple candidate edge clusters in the edge cluster sequence. Create a container instance in the target edge cluster according to the application container image, and allocate the target sub-request sequence to the container instance of the corresponding target edge cluster. Based on the container instance of the target edge cluster, calculate the power calculation and analysis task corresponding to the power calculation and analysis task request to be allocated in the target sub-request sequence, and release the resources occupied by the container instance of the target edge cluster after the calculation is completed. Remove the target sub-request sequence from the request sequence. If there are unassigned sub-request sequences in the removed request sequence, generate a new request sequence based on the unassigned sub-request sequences. Return to the step of obtaining multiple resource load values corresponding to multiple edge clusters in the cloud-edge collaborative power system until all unassigned power calculation and analysis task requests in each sub-request sequence of the request sequence are assigned.
2. The method of claim 1, wherein, The step of determining the application container image based on the multiple pending power calculation and analysis task requests includes: Based on the calculation type corresponding to each pending power calculation and analysis task request, obtain the corresponding application container image from the application container agent.
3. The method of claim 1, wherein, The step of obtaining multiple resource load values corresponding to multiple edge clusters in the cloud-edge collaborative power system, and determining the edge cluster sequence based on the magnitude of the multiple resource load values, includes: Obtain at least one of the processor utilization rate, memory utilization rate, and storage utilization rate corresponding to each edge cluster in the cloud-edge collaborative power system, as well as a utilization rate threshold corresponding to at least one of the processor utilization rate, memory utilization rate, and storage utilization rate; Obtain a comparison result of at least one of the processor utilization, memory utilization, and storage utilization of each edge cluster with at least one of the corresponding utilization thresholds; Edge clusters whose comparison results are less than the corresponding utilization rate threshold are selected as candidate edge clusters. Multiple candidate edge clusters are sorted in ascending order according to at least one of the following: processor utilization, memory utilization, and storage utilization, to obtain an edge cluster sequence.
4. The method of claim 3, wherein, The step of sorting multiple candidate edge clusters in ascending order according to at least one of processor utilization, memory utilization, and storage utilization to obtain an edge cluster sequence includes: Obtain the average value of the processor utilization and memory utilization; Based on the magnitude of the average value, multiple candidate edge clusters are sorted in ascending order to obtain an edge cluster sequence.
5. The method of claim 1, wherein, The step of determining the corresponding target edge cluster from multiple candidate edge clusters in the edge cluster sequence based on the target sub-request sequence of the target location in the request sequence includes: The first sub-request sequence in the request sequence is selected as the target sub-request sequence; the average request time of the first sub-request sequence is the minimum in the request sequence. The first candidate edge cluster in the edge cluster sequence is selected as the target edge cluster; the resource load value of the first candidate edge cluster is the smallest in the edge cluster sequence. 6.A task scheduling device in a cloud-edge collaborative power system, characterized in that, The device includes: The first acquisition module is used to receive multiple pending power calculation and analysis task requests sent by power devices in the cloud-edge collaborative power system; sort the multiple pending power calculation and analysis task requests according to their request times to obtain sorted multiple pending power calculation and analysis task requests; determine a preset number based on the ratio of the number of multiple pending power calculation and analysis task requests to a preset group number; group the sorted multiple pending power calculation and analysis task requests according to the preset number to obtain multiple sub-request sequences; obtain a request sequence based on the multiple sub-request sequences; and determine an application container image based on the multiple pending power calculation and analysis task requests. The second acquisition module is used to acquire multiple resource load values corresponding to multiple edge clusters in the cloud-edge collaborative power system, and determine an edge cluster sequence based on the magnitude of the multiple resource load values; the edge cluster sequence includes multiple candidate edge clusters; the multiple candidate edge clusters in the edge cluster sequence are sorted based on the magnitude of the resource load values. The allocation module is used to determine the target edge cluster from multiple candidate edge clusters in the edge cluster sequence based on the target sub-request sequence at the target location in the request sequence; create a container instance in the target edge cluster based on the application container image; allocate the target sub-request sequence to the container instance of the corresponding target edge cluster; calculate the power calculation and analysis task corresponding to the power calculation and analysis task request to be allocated in the target sub-request sequence based on the container instance of the target edge cluster; and release the resources occupied by the container instance of the target edge cluster after the calculation is completed. The return module is used to remove the target sub-request sequence from the request sequence. If there are unassigned sub-request sequences in the removed request sequence, a new request sequence is generated based on the unassigned sub-request sequences. The step of obtaining multiple resource load values corresponding to multiple edge clusters in the cloud-edge collaborative power system is returned until all the unassigned power calculation and analysis task requests in each sub-request sequence of the request sequence are assigned.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having stored thereon a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.
9. A computer program product comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Data processing method and system
CN114640681A
Power distribution internet of things side equipment power task on-line scheduling method
CN115437771A