Resource dynamic allocation method and device for setting calculation, terminal equipment and storage medium
By evaluating the urgency and resource requirements of the tuning computing tasks, constructing the state space, and generating the target resource allocation strategy, the problems of low utilization and low real-time performance of tuning computing resources in the new energy environment are solved, and efficient computing resource allocation is achieved.
Patent Information
- Application Number
- CN202510760145.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-09
- Publication Date
- 2025-09-19
AI Technical Summary
The existing tuning calculation method has a static resource allocation mode in the new energy environment, resulting in low computing resource utilization and low real-time performance, which cannot meet the dynamically changing computing task requirements.
By evaluating the urgency of the set computing tasks, determining the task priority, and constructing the initial state space based on the computing resource requirements, the target resource allocation strategy is generated, and computing resources are dynamically allocated with the goal of minimizing completion time and maximizing resource utilization.
It improves the resource utilization and real-time performance of the tuning calculation, ensures that high-priority tasks can be executed in a timely manner, and optimizes the allocation strategy of computing resources.
Smart Images

Figure CN120670157A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of power systems, and in particular to a method, device, terminal equipment and storage medium for dynamic resource allocation of setting calculations. Background Art
[0002] Setting calculation is a core task in the field of power system relay protection. It refers to the process of determining the operating parameters (such as operating current, operating time, and operating voltage) of relay protection devices (such as relays and protection and measurement and control devices) through theoretical calculation based on the power system's operating mode, fault characteristics, and protection device performance. The purpose is to ensure that the protection device can reliably operate (not refuse to operate) in the event of a system fault, while remaining inactive (not malfunctioning) during normal operation or external faults, thereby ensuring the safe and stable operation of the power system.
[0003] With the widespread integration of renewable energy, the operating characteristics of distribution networks have become increasingly complex and uncertain. Traditional setting calculation methods face numerous challenges in this renewable energy environment. Existing relay protection setting calculation methods primarily rely on offline simulation analysis, typically performing setting calculations based on fixed operating conditions. Computing resource allocation is relatively static, often using pre-allocated or fixed computing resources to schedule and execute setting calculation tasks.
[0004] Since the setting calculation of the new energy distribution network involves many computing tasks such as a large amount of data analysis, simulation calculation and parameter optimization, and the load of different computing tasks is different, the computing tasks required for the setting calculation have dynamic changing characteristics. The current pre-allocated or fixed computing resource allocation method cannot dynamically allocate computing resources for computing tasks. It can only wait for the ongoing setting calculation task to be completed before the next setting calculation task can be started, resulting in low resource utilization and long calculation delays, making it difficult to ensure the real-time performance and efficiency of the setting calculation. Summary of the Invention
[0005] The present invention provides a method, apparatus, terminal device and storage medium for dynamic resource allocation of fixed calculations, which can solve the problems of low resource utilization and low real-time performance of current computing resource allocation methods.
[0006] An embodiment of the present invention provides a method for dynamically allocating resources for a set calculation, comprising:
[0007] Obtaining setting calculation tasks for several regional distribution networks and available computing resources of a cloud server for performing the setting calculations; wherein the setting calculation tasks include: several computing subtasks;
[0008] Evaluate the urgency of the set computing task, determine the task priority of each set computing task according to the urgency, and determine the computing resource requirements corresponding to each computing subtask;
[0009] constructing an initial state space according to the set computing task, the task priority, and the computing resource requirement;
[0010] Based on the initial state space and the available computing resources, a target resource allocation strategy is generated with the goal of minimizing completion time and maximizing resource utilization; wherein the target resource allocation strategy includes: the execution order of each computing subtask and the allocated target computing resources.
[0011] Furthermore, the obtaining of setting calculation tasks for several regional distribution networks includes:
[0012] Obtaining fault information of several regional distribution networks within a period of time, and load data of each of the distribution networks within the period of time;
[0013] Using a sliding window, calculating a load fluctuation sequence of the load data within the time period;
[0014] According to the load fluctuation sequence and the fault information, a setting calculation task for each of the regional distribution networks is generated.
[0015] Furthermore, the evaluating the urgency of the setting calculation tasks and determining the task priority of each setting calculation task according to the urgency includes:
[0016] Get pre-built task priority evaluation indicators;
[0017] generating a fuzzy judgment matrix for characterizing the impact degree of a regional distribution network fault according to the task priority evaluation index, the load fluctuation sequence, and the fault information;
[0018] Using the fuzzy analytic hierarchy process, the fuzzy judgment matrix of each of the regional distribution networks is compared to determine the urgency of the setting calculation of each of the regional distribution networks;
[0019] The task priority of the set computing task is determined according to the urgency.
[0020] Furthermore, generating a target resource allocation strategy based on the initial state space and the available computing resources with the goal of minimizing completion time and maximizing resource utilization includes:
[0021] Repeating the strategy optimization operation according to the initial state space and the available computing resources until a target scheduling strategy and a target resource allocation strategy are generated; wherein the target scheduling strategy is used to define the execution order of the plurality of the set computing tasks;
[0022] The strategy optimization operation includes:
[0023] Acquire a state space to be evaluated; wherein, initially, the state space to be evaluated is the initial state space;
[0024] generating an action space for adjusting the execution order of the tuning computing tasks according to the task priorities and computing resource requirements of the tuning computing tasks in the state space to be evaluated, and determining the scheduling strategy to be evaluated according to the action space;
[0025] With the goal of maximizing resource utilization, dynamically allocating the available computing resources according to the scheduling strategy to be evaluated, and generating a resource allocation strategy to be evaluated;
[0026] Calculating the completion time required to execute all the set computing tasks under the resource allocation strategy to be evaluated and the scheduling strategy to be evaluated, and the resource utilization rate of the available computing resources;
[0027] Calculate the reward value of this strategy optimization operation based on the completion time and the resource utilization rate;
[0028] Determining whether the reward value meets a preset threshold;
[0029] If not, a deep deterministic policy gradient algorithm is used to optimize the task priorities of the various tuning computing tasks in the state space to be evaluated based on the completion time and the resource utilization rate, generate an optimized state space, and use the optimized state space as the state space to be evaluated required for the next round of policy optimization operations;
[0030] If so, the scheduling strategy to be evaluated is used as the target scheduling strategy, and the resource allocation strategy to be evaluated is used.
[0031] Furthermore, the computing resource requirements include: resource requirements corresponding to each computing subtask and resource occupancy time;
[0032] The method of dynamically allocating the available computing resources according to the scheduling strategy to be evaluated with the goal of maximizing resource utilization to generate the resource allocation strategy to be evaluated includes:
[0033] Obtaining dependencies between computational subtasks in each set computational task, and determining dependent tasks of each computational subtask;
[0034] According to the plurality of computing subtasks in the plurality of the set computing tasks and the scheduling strategy to be evaluated, the computing subtasks are sorted to construct a subtask sequence;
[0035] Repeating the dynamic resource allocation operation according to the subtask sequence until the resource allocation strategy to be evaluated is generated;
[0036] The dynamic resource allocation operation includes:
[0037] Acquire resources to be allocated; wherein, initially, the resources to be allocated are available computing resources;
[0038] Retrieving a plurality of executable subtasks according to the resources to be allocated and the order of the subtask sequence; wherein the sum of the resource requirements of the plurality of executable subtasks is not greater than the resources to be allocated, and the executable subtasks include: a computing subtask with an unfinished status and no dependent tasks, and a computing subtask with an unfinished status and a dependent task with a completed status;
[0039] Modify the status of the executable subtask to completed, and place it in a preset execution list as an executed subtask, and record the corresponding resource occupation time; initially, the execution list is empty;
[0040] Determine whether all computational subtasks in the subtask sequence are completed;
[0041] If not, calculate the remaining resources after the to-be-allocated resources are allocated, and determine the allocated resources released by the fastest completed executed subtask from the execution list, and use the sum of the allocated resources and the remaining resources as the to-be-allocated resources for the next round of dynamic resource allocation operation;
[0042] If so, the resource allocation strategy to be evaluated is generated according to the execution list.
[0043] Another embodiment of the present invention further provides a device for dynamically allocating resources for a set calculation, comprising:
[0044] A task acquisition module is used to obtain the setting calculation tasks of several regional distribution networks and the available computing resources of the cloud server used to perform the setting calculations; wherein the setting calculation tasks include: several computing subtasks;
[0045] A task evaluation module is used to evaluate the urgency of the setting computing task, determine the task priority of each setting computing task according to the urgency, and determine the computing resource requirements corresponding to each computing subtask;
[0046] A space construction module, configured to construct an initial state space according to the set computing task, the task priority, and the computing resource requirement;
[0047] The resource allocation module is used to generate a target resource allocation strategy based on the initial state space and the available computing resources, with the goal of minimizing completion time and maximizing resource utilization; wherein the target resource allocation strategy includes: the execution order of each computing subtask and the allocated target computing resources.
[0048] Furthermore, the task acquisition module acquires several regional distribution network setting calculation tasks, including:
[0049] Obtaining fault information of several regional distribution networks within a period of time, and load data of each of the distribution networks within the period of time;
[0050] Using a sliding window, calculating a load fluctuation sequence of the load data within the time period;
[0051] According to the load fluctuation sequence and the fault information, a setting calculation task for each of the regional distribution networks is generated.
[0052] Furthermore, the task evaluation module evaluates the urgency of the setting calculation task and determines the task priority of each setting calculation task according to the urgency, including:
[0053] Get pre-built task priority evaluation indicators;
[0054] generating a fuzzy judgment matrix for characterizing the impact degree of a regional distribution network fault according to the task priority evaluation index, the load fluctuation sequence, and the fault information;
[0055] Using the fuzzy analytic hierarchy process, the fuzzy judgment matrix of each of the regional distribution networks is compared to determine the urgency of the setting calculation of each of the regional distribution networks;
[0056] The task priority of the set computing task is determined according to the urgency.
[0057] Another embodiment of the present invention also provides a terminal device, comprising: a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the steps of a method for dynamic resource allocation of a set calculation as described in any one of the above embodiments of the present invention.
[0058] Another embodiment of the present invention also provides a computer-readable storage medium item, including: a stored computer program, which, when the computer program is running, controls the device where the computer-readable storage medium is located to execute the steps of a resource dynamic allocation method for a fixed calculation as described in any one of the above embodiments of the present invention.
[0059] The following beneficial effects are achieved by implementing the present invention:
[0060] The present invention provides a method, apparatus, terminal device, and storage medium for dynamically allocating resources for a set calculation. The method determines the priority of a task based on the urgency of the set calculation task, giving priority to tasks with high priority when subsequently allocating computing resources, thereby meeting the real-time performance of each set calculation. Secondly, considering that different computing subtasks of the set calculation task have different computing resource requirements, the computing resource requirements of each computing subtask are evaluated, so that when subsequently allocating resources, computing resources can be scheduled and allocated based on the computing subtask as a unit. Finally, based on the set calculation task, the task priority, and the computing resource requirements, the constructed initial state space, and the available computing resources of the cloud server, a target resource allocation strategy is generated with the goal of minimizing completion time and maximizing resource utilization. Therefore, by splitting the set calculation task into several computing subtasks, the cloud server can allocate idle computing resources to the low-priority set calculation task when executing the computing subtask with low computing resource requirements in the high-priority set calculation task. Therefore, the present invention can solve the problems of low resource utilization and low real-time performance of current computing resource allocation methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] In order to more clearly illustrate the technical solution of the present application, the following is a brief introduction to the drawings required for use in the implementation. Obviously, the drawings described below are only some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0062] Figure 1 This is a flow chart of a method for dynamically allocating resources for a set calculation provided by one embodiment of the present invention;
[0063] Figure 2 It is a structural diagram of a method for dynamically allocating resources for a set calculation provided by one embodiment of the present invention. DETAILED DESCRIPTION
[0064] To make the objectives, technical solutions, and advantages of this application more clear, the technical solutions in this application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of this application.
[0065] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned figure descriptions are intended to cover non-exclusive inclusions.
[0066] In the description of the embodiments of this application, the technical terms "first" and "second" are used only to distinguish different objects and should not be understood to indicate or imply relative importance or implicitly specify the quantity, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, the meaning of "plurality" is more than two, unless otherwise clearly and specifically defined.
[0067] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0068] In the description of the embodiments of this application, the term "and / or" is simply a description of the association relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent the following three situations: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this document generally indicates that the associated objects are in an "or" relationship.
[0069] In the description of the embodiments of the present application, the terms "multiple" and "several" refer to more than two (including two). Similarly, "multiple groups" refer to more than two groups (including two groups), and "multiple pieces" refer to more than two pieces (including two pieces).
[0070] In the description of the embodiments of the present application, unless otherwise expressly specified or limited, technical terms such as "installed," "connected," "connected," and "fixed" should be understood in a broad sense. For example, they can refer to fixed connections, detachable connections, or integration; mechanical connections or electrical connections; direct connections or indirect connections through an intermediate medium; internal connections between two components or interactions between two components. Those skilled in the art can understand the specific meanings of the above terms in the embodiments of the present application based on specific circumstances.
[0071] See also Figure 1 To address the problems of low resource utilization and poor real-time performance in current computing resource allocation methods, an embodiment of the present invention provides a method for dynamically allocating resources for a fixed computing task, including:
[0072] S1. Obtaining setting calculation tasks for several regional distribution networks and available computing resources of a cloud server for performing the setting calculations; wherein the setting calculation tasks include: several computing subtasks;
[0073] In a preferred embodiment of the present invention, cloud computing has been widely introduced into relay protection setting calculation systems with the development of cloud computing. By sending the setting calculation tasks for each regional distribution network to a cloud server, the powerful computing power of the cloud server is utilized to meet the large amount of computing resources required for setting calculations. Furthermore, the calculation subtasks include data analysis, simulation calculations, parameter optimization, and other operations.
[0074] Preferably, the obtaining of setting calculation tasks for several regional distribution networks includes:
[0075] S11. Obtain fault information of several regional distribution networks within a period of time, and load data of each of the distribution networks within the period of time;
[0076] In a preferred embodiment of the present invention, by deploying data acquisition equipment, including smart meters, sensors and data acquisition terminals, electrical parameters such as voltage, current, power, frequency, as well as load and equipment operating status are collected at key nodes of the regional distribution network (such as substations, distribution lines, and user terminals). The acquisition terminal collects data from each monitoring point in real time according to a set sampling period (such as milliseconds or seconds), and performs preliminary data processing such as data format conversion, time synchronization and data compression through edge computing equipment. The collected operating data is transmitted to the cloud data center of the new energy distribution network through a communication network (such as optical fiber, 5G or wireless private network) and stored in a distributed database. In order to ensure data integrity, a data redundancy storage and verification mechanism is adopted to mark missing data and abnormal data, form regional distribution network operation data, and perform time series sorting for subsequent analysis and processing.
[0077] It should be noted that the voltage, current, power, frequency, load and equipment status are read from the new energy distribution network operation data and sorted according to timestamps to ensure time continuity. The mean filtering method is used to smooth the new energy distribution network operation data. The mean of the new energy distribution network operation data in the window is calculated within the set sliding window range, and the data value of the window center point is replaced by the mean value to reduce the impact of high-frequency noise on the data. For missing values, interpolation is used to fill them. Based on the known data points at adjacent moments, the estimated values of the missing data points are calculated using linear interpolation or spline interpolation methods, and added to the original new energy distribution network operation data;
[0078] The density clustering method is used to detect anomalies in the cleaned new energy distribution network operation data. The local outlier factor is calculated based on the density distribution of data points. The data points in the low-density area are marked as outliers, and the abnormal data points are eliminated for correction to obtain the cleaned new energy distribution network operation data.
[0079] S12. Calculate the load fluctuation sequence of the load data within the time period using a sliding window;
[0080] In a preferred embodiment of the present invention, a sliding window method is used to analyze the cleaned new energy distribution network operation data, calculate the short-term load change rate according to the set time window, extract the load fluctuation characteristics, obtain the load change rate sequence, and perform normalization processing.
[0081] It should be noted that time series data such as voltage, current, power and load fluctuation are extracted from the cleaned new energy distribution network operation data and arranged in chronological order.
[0082] Set the size and step size of the sliding window. The window size is selected according to the load fluctuation characteristics of the new energy distribution network. For example, it is set to several seconds or several minutes based on the historical load change trend. The step size is generally 1 / 2 or 1 / 3 of the window size to ensure the consistency of coverage. The time series data is traversed using the sliding window method. The time series data points in each window are used to calculate the short-term load change rate of the time period and analyze the load fluctuation. During the calculation process, abnormal points are eliminated, and the short-term change rate is smoothed using the moving average or weighted average method to reduce sudden interference. The short-term load change rates calculated in all windows are stored in chronological order to form a complete load change rate sequence, and then standardized. The minimum-maximum normalization method is used to map the load change rate to a fixed range to eliminate the dimension effect and improve consistency.
[0083] S13. Generate setting calculation tasks for each of the regional distribution networks based on the load fluctuation sequence and the fault information.
[0084] In a preferred embodiment of the present invention, a cluster analysis method is first used to identify load variation patterns, and fault information such as fault signals, severe load fluctuations, and equipment replacement events are combined to generate setting calculation tasks.
[0085] It should be noted that a cluster analysis method, such as K-means clustering, is selected to perform pattern classification on the normalized load fluctuation sequence. First, the number of cluster centers is determined, and then the distance or density relationship between each data point and the cluster center is iteratively calculated to classify different load fluctuation patterns.
[0086] Based on the clustering results, the typical load fluctuation pattern is compared with the operation data of the new energy distribution network to identify the normal operation mode and abnormal mode. In addition, the fault information such as fault signals, sudden load fluctuations, equipment replacement logs, etc. is combined to
[0087] Using methods such as pattern matching, time series similarity measurement (such as DTW dynamic time warping), and association rule mining (such as the Apriori algorithm), the load fluctuation pattern is matched with the operation data of the new energy distribution network to identify whether the current operating status is consistent with the known load fluctuation pattern, determine whether abnormal fluctuations or faults occur, and trigger the corresponding setting calculation tasks accordingly.
[0088] S2. Evaluate the urgency of the setting computing task, determine the task priority of each setting computing task according to the urgency, and determine the computing resource requirement corresponding to each computing subtask;
[0089] In a preferred embodiment of the present invention, task priority is assessed by pre-establishing a task priority evaluation index. Furthermore, a resource requirement data table is constructed based on the computing resources and duration occupied by different computing subtasks during the execution of historically scheduled computing tasks. Based on the computing subtasks included in each scheduled computing task, the computing resource requirements corresponding to each computing subtask are determined from the resource requirement data table.
[0090] Specifically, the construction of task priority evaluation indicators first classifies historical fault data of the distribution network, including load fluctuation patterns, fault signals, equipment replacement events, etc., using a combination of rule-based methods and cluster analysis to classify the historical fault data into sudden load fluctuations, fault events, equipment replacement events, and compound events to determine the scope of impact on task scheduling.
[0091] The impact of various events on the set computing tasks was analyzed. In combination with operational data from the new energy distribution network, key factors for task priority assessment, such as task urgency, computing resource requirements, historical processing latency, and fault impact range, were identified through the analytic hierarchy process, fuzzy comprehensive evaluation, and weighted comprehensive scoring methods. Task priority evaluation indicators were defined, and specific indicator parameters, such as fault impact level, load variation, and task computational complexity, were summarized through factor analysis and cluster analysis to construct a task priority evaluation indicator system. All evaluation indicators were categorized and organized into a set, ensuring that each indicator had a quantifiable measurement method to support subsequent task priority calculations.
[0092] Preferably, the evaluating the urgency of the setting calculation tasks and determining the task priority of each setting calculation task according to the urgency includes:
[0093] S21. Obtain pre-built task priority evaluation indicators;
[0094] S22. Generating a fuzzy judgment matrix for characterizing the impact degree of a regional distribution network fault according to the task priority evaluation index, the load fluctuation sequence, and the fault information;
[0095] S23, using the fuzzy analytic hierarchy process to compare the fuzzy judgment matrices of the regional distribution networks and determine the urgency of the setting calculation of the regional distribution networks;
[0096] S24. Determine the task priority of the setting calculation task according to the urgency.
[0097] In a preferred embodiment of the present invention, based on the constructed task priority evaluation index, the fuzzy hierarchical analysis method is used to calculate the weight of each evaluation index. First, a fuzzy judgment matrix for comparing indicators in pairs is established, and the importance of different evaluation indicators is relatively scored to generate an initial fuzzy judgment matrix. The consistency ratio of the initial fuzzy judgment matrix is calculated and its consistency is evaluated. If it exceeds the set tolerance threshold (the preset tolerance threshold is usually set according to experience or standards, and 0.1 or 0.2 is generally taken as the upper limit of the acceptable consistency ratio of the initial fuzzy judgment matrix), the scoring data is adjusted and recalculated until the consistency ratio meets the requirements, thereby obtaining the optimized evaluation index weights;
[0098] Using the calculated evaluation indicator weights, through a rule engine, time series analysis, and event correlation analysis methods, based on event triggering information (such as load fluctuation patterns, fault signals, equipment replacement events, etc.), the evaluation indicator values corresponding to the tasks are extracted. The task priority scores are calculated based on the weights and normalized. The urgency threshold is set (the urgency threshold is set based on the task response time requirements and business impact, such as high priority greater than 0.8, medium priority 0.5 to 0.8, and low priority less than 0.5). Tasks are divided into high priority, medium priority, and low priority categories based on their priority scores to ensure that the urgency of the tasks is properly matched with the computing resources.
[0099] S3. Constructing an initial state space according to the set computing task, the task priority, and the computing resource requirement;
[0100] In a preferred embodiment of the present invention, each calculation subtask in the setting calculation task and the task priority are used as characteristics of each setting calculation task, and each characteristic of the setting calculation task is constructed as a corresponding state variable, and an initial state space is constructed according to several state variables of each setting calculation.
[0101] Specifically, a unique identifier is defined for each computing subtask. State variables for each computing subtask are constructed in the form of an array based on the unique identifier, computing resource requirements, execution status, and dependencies. Initially, all execution states are pending. Task priorities are mapped to state variables using numerical values. For example, if "priority": 2, "urgent" is set to 1, "high" is set to 2, "medium" is set to 3, and "low" is set to 4.
[0102] S4. Generate a target resource allocation strategy based on the initial state space and the available computing resources, with the goal of minimizing completion time and maximizing resource utilization; wherein the target resource allocation strategy includes: the execution order of each computing subtask and the allocated target computing resources.
[0103] Preferably, generating a target resource allocation strategy based on the initial state space and the available computing resources with the goal of minimizing completion time and maximizing resource utilization includes:
[0104] S41. Repeating the strategy optimization operation according to the initial state space and the available computing resources until a target scheduling strategy and a target resource allocation strategy are generated; wherein the target scheduling strategy is used to define the execution order of the plurality of the set computing tasks;
[0105] The strategy optimization operation includes:
[0106] S42, obtaining a state space to be evaluated; wherein, initially, the state space to be evaluated is the initial state space;
[0107] S43, generating an action space for adjusting the execution order of the setting computing tasks according to the task priority and computing resource requirements of each setting computing task in the state space to be evaluated, and determining the scheduling strategy to be evaluated according to the action space;
[0108] S44, with the goal of maximizing resource utilization, dynamically allocating the available computing resources according to the scheduling strategy to be evaluated, and generating a resource allocation strategy to be evaluated;
[0109] S45. Calculate the completion time required to execute all set computing tasks under the resource allocation strategy to be evaluated and the scheduling strategy to be evaluated, and the resource utilization rate of the available computing resources;
[0110] S46. Calculate the reward value of this strategy optimization operation based on the completion time and the resource utilization rate;
[0111] S47, determining whether the reward value meets a preset threshold;
[0112] If not, then using a deep deterministic policy gradient algorithm to optimize the task priorities of the various set computing tasks in the state space to be evaluated based on the completion time and the resource utilization, generate an optimized state space, and use the optimized state space as the state space to be evaluated required for the next round of policy optimization operations;
[0113] S49: If yes, use the scheduling strategy to be evaluated as the target scheduling strategy and allocate the resource to be evaluated.
[0114] In a preferred embodiment of the present invention, the action space of task scheduling is obtained by setting the scheduling decision for adjusting the task execution order, and the reward function is defined according to the task completion time and computing resource utilization, and the task scheduling strategy is adjusted through continuous iteration.
[0115] Specifically, a reward function is set based on task performance, such as task completion time and computing resource utilization. Based on the calculated reward value, the deep deterministic policy gradient algorithm adjusts the task priorities of each set of computing tasks through backpropagation, thereby gradually improving the quality of scheduling decisions. Through repeated iterations, the task scheduling strategy is continuously optimized until the reward value stabilizes and meets the preset reward convergence threshold (preset threshold).
[0116] Preferably, the computing resource requirements include: resource requirements corresponding to each computing subtask and resource occupancy time;
[0117] The method of dynamically allocating the available computing resources according to the scheduling strategy to be evaluated with the goal of maximizing resource utilization to generate the resource allocation strategy to be evaluated includes:
[0118] S431, obtaining the dependency relationship between the calculation subtasks in each set calculation task, and determining the dependent tasks of each calculation subtask;
[0119] S432: Sort the computing subtasks in the set computing tasks and the scheduling strategy to be evaluated to construct a subtask sequence;
[0120] S433: Repeat the dynamic resource allocation operation according to the subtask sequence until the resource allocation strategy to be evaluated is generated;
[0121] The dynamic resource allocation operation includes:
[0122] S434. Acquire resources to be allocated; wherein, initially, the resources to be allocated are available computing resources;
[0123] S435. Retrieving a plurality of executable subtasks based on the resources to be allocated and the order of the subtask sequence; wherein the sum of resource requirements of the plurality of executable subtasks is not greater than the resources to be allocated, and the executable subtasks include: a computing subtask with an unfinished status and no dependent tasks, and a computing subtask with an unfinished status and a dependent task with a completed status;
[0124] S436: Modify the status of the executable subtask to completed, place it in a preset execution list as an executed subtask, and record the corresponding resource occupation time; initially, the execution list is empty;
[0125] S437, determining whether the status of all computing subtasks in the subtask sequence are completed;
[0126] If not, calculate the remaining resources after the to-be-allocated resources are allocated, and determine the allocated resources released by the fastest completed executed subtask from the execution list, and use the sum of the allocated resources and the remaining resources as the to-be-allocated resources for the next round of dynamic resource allocation operations;
[0127] S439: If yes, generate the resource allocation strategy to be evaluated according to the execution list.
[0128] In a preferred embodiment of the present invention, the elastic resource pool provided by the cloud server, namely the serverless computing instance library, is used to dynamically allocate serverless computing resources (available computing resources) to obtain a set computing resource allocation strategy.
[0129] Specifically, based on the task scheduling policy and the computing resource requirements of the computing subtasks within the specified computing task, the system evaluates the computing resources required for each task and generates computing resource request information, which includes the required instance type, estimated usage duration, and parallelism requirements. The system then queries the available serverless computing instance pool. Based on the computing resource request information, the system searches the available serverless computing instance library according to the execution time limit and resource requirements of the computing subtasks to obtain an instance type that meets the requirements.
[0130] Then, with the goal of maximizing resource utilization, multi-objective optimization can be performed based on factors such as computing power, cost, and availability to determine the resource allocation plan, reasonably allocate computing instances, and generate a resource allocation strategy.
[0131] Furthermore, the cloud server can also calculate the need to expand or reduce instances based on task load, latency requirements, and resource utilization, and generate scaling adjustments. It should be noted that task load, computing resource utilization, and latency requirements are monitored in real time, and historical scaling of computing instances is recorded. Time series forecasting methods (such as ARIMA and LSTM) are used to analyze task load trends and predict future resource demand peaks and troughs. Based on current computing resource utilization, it is calculated whether task requirements are met and whether it is within the set optimal utilization range (such as 70%-90%). If resource utilization is below a minimum threshold (such as 70%), the number of available computing instances is calculated, and instances with low load or long periods of idle time are prioritized for scaling down. If resource utilization is above a maximum threshold (such as 90%) or task latency exceeds the limit, the number of new computing instances required is calculated, and the optimal computing instance types (such as CPU / GPU specifications) are matched. The impact of different scaling strategies, such as scheduled scaling, predictive scaling, and adaptive scaling, is compared to select the optimal scaling adjustment solution.
[0132] Furthermore, in this embodiment, the Monte Carlo simulation method is used to analyze the setting calculation process, calculate the protection setting parameters, and obtain the setting calculation results.
[0133] Based on the operation data of the new energy distribution network, a simulation model for setting calculation is established. The Monte Carlo method is used to randomly sample the fault current, short-circuit resistance and load level to generate simulation input data.
[0134] It should be noted that based on the operating data of the new energy distribution network, key parameters including voltage, current, power, frequency, topology, load distribution, etc. are extracted to determine the operating boundaries and constraints. Fault scenarios are set in the simulation model, and the fault types to be analyzed are selected, including single-phase short circuit, two-phase short circuit, three-phase short circuit, etc. In combination with the equipment characteristics, the range of values for fault current, short-circuit resistance and load level are defined to construct a simulation model for setting calculations;
[0135] Based on the set probability distribution, random number generation is used to generate a set of sample data for fault current, short-circuit resistance, and load level. Using the Monte Carlo method, multiple rounds of random sampling are performed. In each round of sampling, a value is independently extracted from the probability distribution of each variable to form a complete set of simulation input parameters. The sampling process is repeated until the data size meets the simulation requirements and the sample covers the range of possible operating conditions. Formatting is performed to meet the input requirements of the simulation calculation and generate the final simulation input data. The generated simulation input data is preprocessed, including removing outliers, normalizing, and converting the data format to meet the input requirements of the simulation calculation and ensure a reasonable data distribution. Finally, the preprocessed simulation input data is input into the simulation model for the setting calculation to provide input data support for subsequent simulation calculations.
[0136] In a serverless computing environment, parallel simulation calculations are performed on the simulation input data to obtain the relay protection action behavior under different working conditions and output the simulation calculation result set.
[0137] It should be noted that in a serverless computing environment, computing resources are initialized, operating parameters of computing nodes are configured, and simulation models and preprocessed simulation input data are loaded. Based on the scale and computing requirements of the simulation task, the simulation input data is divided into multiple subtasks. Using a parallel computing strategy, these subtasks are assigned to different serverless computing instances for execution. A simulation program is run on each computing instance to perform numerical calculations on the input fault current, short-circuit resistance, and load level, simulating the relay protection response process, including the protection device's start-up time, tripping behavior, and delay characteristics. The operating status of each computing instance is monitored, and relay protection action data returned by different computing instances is collected and organized. Simulation results for each operating condition are aggregated according to a pre-set format. The computing status of all computing instances is checked to confirm that all tasks have been completed. The obtained simulation results are stored in a distributed database, forming a complete set of simulation results for subsequent analysis and optimization.
[0138] Perform statistical analysis on the simulation calculation result set, calculate the fault detection error and action time distribution indicators, output the analysis results, and optimize and adjust the protection setting parameters to obtain the setting calculation results.
[0139] It should be noted that relay protection action data is extracted from the simulation calculation result set, including key parameters such as fault detection records, protection device start-up time, and tripping time. For the fault detection situation, the fault detection accuracy, false detection rate, and missed detection rate of the simulation calculation are statistically calculated, and the fault detection error is calculated. By statistically analyzing the relay protection start-up time and tripping time under different working conditions, the average action time and standard deviation of each time point are calculated. By identifying the maximum and minimum action times under extreme working conditions, the action time distribution curve is constructed and the extreme response situation is evaluated. Based on the statistical analysis results, the existing protection setting parameters are evaluated, and the parameter settings that may cause the protection to malfunction or refuse to operate are identified. The setting strategy is adjusted using the optimization algorithm to optimize the protection setting parameters. The optimized protection setting parameters are input into the setting calculation model, and the optimization effect is recalculated and verified to ensure that the setting calculation results meet the operating requirements. The final setting calculation results are stored in the database for subsequent application.
[0140] In summary, the present embodiment provides a method for dynamically allocating resources for a set calculation. By determining the priority of a task based on the urgency of the set calculation task, the method prioritizes the tasks with higher priority when subsequently allocating computing resources, thereby meeting the real-time performance of each set calculation. Secondly, considering that different computing subtasks of the set calculation task have different computing resource requirements, the computing resource requirements of each computing subtask are evaluated, so that when subsequently allocating resources, the computing resources can be scheduled and allocated based on the computing subtask as a unit. Finally, based on the set calculation task, the task priority, and the computing resource requirements, the constructed initial state space, and the available computing resources of the cloud server, a target resource allocation strategy is generated with the goal of minimizing completion time and maximizing resource utilization. Therefore, by splitting the set calculation task into several computing subtasks, the cloud server can allocate idle computing resources to the set calculation task with lower priority when executing the computing subtask with lower computing resource requirements in the high-priority set calculation task. Therefore, the present embodiment can solve the problems of low resource utilization and low real-time performance of the current computing resource allocation method.
[0141] like Figure 2 As shown, based on the above method embodiment, a corresponding device embodiment is provided;
[0142] One embodiment of the present invention provides another embodiment of the present invention further provides a device for dynamically allocating resources for a set calculation, comprising:
[0143] A task acquisition module is used to obtain the setting calculation tasks of several regional distribution networks and the available computing resources of the cloud server used to perform the setting calculations; wherein the setting calculation tasks include: several computing subtasks;
[0144] A task evaluation module is used to evaluate the urgency of the setting computing task, determine the task priority of each setting computing task according to the urgency, and determine the computing resource requirements corresponding to each computing subtask;
[0145] A space construction module, configured to construct an initial state space according to the set computing task, the computing subtask, the task priority, and the computing resource requirement;
[0146] The resource allocation module is used to generate a target resource allocation strategy based on the initial state space and the available computing resources, with the goal of minimizing completion time and maximizing resource utilization; wherein the target resource allocation strategy includes: the execution order of each computing subtask and the allocated target computing resources.
[0147] Furthermore, the task acquisition module acquires several regional distribution network setting calculation tasks, including:
[0148] Obtaining fault information of several regional distribution networks within a period of time, and load data of each of the distribution networks within the period of time;
[0149] Using a sliding window, calculating a load fluctuation sequence of the load data within the time period;
[0150] According to the load fluctuation sequence and the fault information, a setting calculation task for each of the regional distribution networks is generated.
[0151] Furthermore, the task evaluation module evaluates the urgency of the setting calculation task and determines the task priority of each setting calculation task according to the urgency, including:
[0152] Get pre-built task priority evaluation indicators;
[0153] generating a fuzzy judgment matrix for characterizing the impact degree of a regional distribution network fault according to the task priority evaluation index, the load fluctuation sequence, and the fault information;
[0154] Using the fuzzy analytic hierarchy process, the fuzzy judgment matrix of each of the regional distribution networks is compared to determine the urgency of the setting calculation of each of the regional distribution networks;
[0155] The task priority of the set computing task is determined according to the urgency.
[0156] It can be understood that the above-mentioned device embodiment corresponds to the method embodiment of the present invention, which can implement any of the above-mentioned method embodiments of the present invention to provide a method for dynamic resource allocation of a fixed calculation.
[0157] It should be noted that the device embodiments described above are merely illustrative, and some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment. Furthermore, in the drawings of the device embodiments provided by the present invention, the connection relationship between modules indicates that they have a communication connection, which may be implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement the present invention without inventive effort.
[0158] Based on the above-mentioned embodiment of a method for dynamic allocation of resources for a tuning calculation, another embodiment of the present invention provides a terminal device, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements a method for dynamic allocation of resources for a tuning calculation according to any embodiment of the present invention.
[0159] For example, in this embodiment, the computer program may be divided into one or more modules, which are stored in the memory and executed by the processor to implement the present invention. The one or more module elements may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program in the terminal device.
[0160] The terminal device may be a computing device such as a desktop computer, a notebook computer, a PDA, a cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.
[0161] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the terminal device, connecting various parts of the entire terminal device using various interfaces and lines.
[0162] Based on the above-mentioned method embodiments, another embodiment of the present invention provides a computer-readable storage medium, including a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute a resource dynamic allocation method for a fixed calculation as described in any one of the above-mentioned method embodiments of the present invention.
[0163] Wherein, the module / unit integrated in the device / terminal equipment, if implemented in the form of a software functional unit and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by the processor, it can implement the steps of the above-mentioned various method embodiments. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device that can carry the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.
[0164] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A method for dynamic resource allocation of a setting calculation, characterized in that: include: Obtaining setting calculation tasks for several regional distribution networks and available computing resources of a cloud server for performing the setting calculations; wherein the setting calculation tasks include: several computing subtasks; Evaluate the urgency of the set computing task, determine the task priority of each set computing task according to the urgency, and determine the computing resource requirements corresponding to each computing subtask; constructing an initial state space according to the set computing task, the task priority, and the computing resource requirement; Based on the initial state space and the available computing resources, a target resource allocation strategy is generated with the goal of minimizing completion time and maximizing resource utilization; wherein the target resource allocation strategy includes: the execution order of each computing subtask and the allocated target computing resources.
2. A method for dynamic resource allocation of a setting calculation according to claim 1, characterized in that: The task of obtaining the setting calculation of several regional distribution networks includes: Obtaining fault information of several regional distribution networks within a period of time, and load data of each of the distribution networks within the period of time; Using a sliding window, calculating a load fluctuation sequence of the load data within the time period; According to the load fluctuation sequence and the fault information, a setting calculation task for each of the regional distribution networks is generated.
3. A method for dynamic resource allocation of a setting calculation as claimed in claim 2, characterized in that: The step of evaluating the urgency of the setting calculation tasks and determining the task priority of each setting calculation task according to the urgency includes: Get pre-built task priority evaluation indicators; generating a fuzzy judgment matrix for characterizing the impact degree of a regional distribution network fault according to the task priority evaluation index, the load fluctuation sequence, and the fault information; Using the fuzzy analytic hierarchy process, the fuzzy judgment matrix of each of the regional distribution networks is compared to determine the urgency of the setting calculation of each of the regional distribution networks; The task priority of the set computing task is determined according to the urgency.
4. A method for dynamic resource allocation for setting calculations according to claim 3, characterized in that: Generating a target resource allocation strategy based on the initial state space and the available computing resources with the goal of minimizing completion time and maximizing resource utilization includes: Repeating the strategy optimization operation according to the initial state space and the available computing resources until a target scheduling strategy and a target resource allocation strategy are generated; wherein the target scheduling strategy is used to define the execution order of the plurality of the set computing tasks; The strategy optimization operation includes: Acquire a state space to be evaluated; wherein, initially, the state space to be evaluated is the initial state space; generating an action space for adjusting the execution order of the tuning computing tasks according to the task priorities and computing resource requirements of the tuning computing tasks in the state space to be evaluated, and determining the scheduling strategy to be evaluated according to the action space; With the goal of maximizing resource utilization, dynamically allocating the available computing resources according to the scheduling strategy to be evaluated, and generating a resource allocation strategy to be evaluated; Calculating the completion time required to execute all the set computing tasks under the resource allocation strategy to be evaluated and the scheduling strategy to be evaluated, and the resource utilization rate of the available computing resources; Calculate the reward value of this strategy optimization operation based on the completion time and the resource utilization rate; Determining whether the reward value meets a preset threshold; If not, a deep deterministic policy gradient algorithm is used to optimize the task priorities of the various tuning computing tasks in the state space to be evaluated based on the completion time and the resource utilization rate, generate an optimized state space, and use the optimized state space as the state space to be evaluated required for the next round of policy optimization operations; If so, the scheduling strategy to be evaluated is used as the target scheduling strategy, and the resource allocation strategy to be evaluated is used.
5. A method for dynamic resource allocation of a setting calculation as claimed in claim 4, characterized in that: The computing resource requirements include: the resource requirements corresponding to each computing subtask and the resource occupancy time; The method of dynamically allocating the available computing resources according to the scheduling strategy to be evaluated with the goal of maximizing resource utilization to generate the resource allocation strategy to be evaluated includes: Obtaining dependencies between computational subtasks in each set computational task, and determining dependent tasks of each computational subtask; According to the plurality of computing subtasks in the plurality of the set computing tasks and the scheduling strategy to be evaluated, the computing subtasks are sorted to construct a subtask sequence; Repeating the dynamic resource allocation operation according to the subtask sequence until the resource allocation strategy to be evaluated is generated; The dynamic resource allocation operation includes: Acquire resources to be allocated; wherein, initially, the resources to be allocated are available computing resources; Retrieving a plurality of executable subtasks according to the resources to be allocated and the order of the subtask sequence; wherein the sum of the resource requirements of the plurality of executable subtasks is not greater than the resources to be allocated, and the executable subtasks include: a computing subtask with an unfinished status and no dependent tasks, and a computing subtask with an unfinished status and a dependent task with a completed status; Modify the status of the executable subtask to completed, and place it in a preset execution list as an executed subtask, and record the corresponding resource occupation time; initially, the execution list is empty; Determine whether all computational subtasks in the subtask sequence are completed; If not, calculate the remaining resources after the to-be-allocated resources are allocated, and determine the allocated resources released by the fastest completed executed subtask from the execution list, and use the sum of the allocated resources and the remaining resources as the to-be-allocated resources for the next round of dynamic resource allocation operation; If so, the resource allocation strategy to be evaluated is generated according to the execution list.
6. A dynamic resource allocation device for setting calculations, characterized in that: include: A task acquisition module is used to obtain the setting calculation tasks of several regional distribution networks and the available computing resources of the cloud server used to perform the setting calculations; wherein the setting calculation tasks include: several computing subtasks; A task evaluation module is used to evaluate the urgency of the setting computing task, determine the task priority of each setting computing task according to the urgency, and determine the computing resource requirements corresponding to each computing subtask; A space construction module, configured to construct an initial state space according to the set computing task, the task priority, and the computing resource requirement; The resource allocation module is used to generate a target resource allocation strategy based on the initial state space and the available computing resources, with the goal of minimizing completion time and maximizing resource utilization; wherein the target resource allocation strategy includes: the execution order of each computing subtask and the allocated target computing resources.
7. The resource dynamic allocation device for setting calculation according to claim 6, characterized in that: The task acquisition module acquires the setting calculation tasks of several regional distribution networks, including: Obtaining fault information of several regional distribution networks within a period of time, and load data of each of the distribution networks within the period of time; Using a sliding window, calculating a load fluctuation sequence of the load data within the time period; According to the load fluctuation sequence and the fault information, a setting calculation task for each of the regional distribution networks is generated.
8. A method for dynamic allocation of resources for setting calculations according to claim 7, characterized in that: The task evaluation module evaluates the urgency of the setting calculation task and determines the task priority of each setting calculation task according to the urgency, including: Get pre-built task priority evaluation indicators; generating a fuzzy judgment matrix for characterizing the impact degree of a regional distribution network fault according to the task priority evaluation index, the load fluctuation sequence, and the fault information; Using the fuzzy analytic hierarchy process, the fuzzy judgment matrix of each of the regional distribution networks is compared to determine the urgency of the setting calculation of each of the regional distribution networks; The task priority of the set computing task is determined according to the urgency.
9. A terminal device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, the method implements a resource dynamic allocation method for a set calculation as described in any one of claims 1 to 5.
10. A computer-readable storage medium, characterized in that include: A stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute a method for dynamically allocating resources for a set calculation as described in any one of claims 1 to 5.