A large power grid security checking calculation method applicable to multiple time scales

By evaluating the complexity of the grid's security verification calculation content, selecting a parallel computing mode, and using parallel algorithms with load balancing and CPU+GPU hybrid architectures, the problems of long-term and low resource utilization of large-scale grid security verification calculations are solved, achieving efficient and stable computing efficiency.

CN119917290BActive Publication Date: 2025-06-10STATE GRID ZHEJIANG ELECTRIC POWER CO LTD NINGBO POWER SUPPLY CO +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510405414.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-02
Publication Date
2025-06-10
Estimated Expiration
2045-04-02

AI Technical Summary

Technical Problem

In the prior art, large-scale power grid safety verification and calculation takes time and low resource utilization. Especially in multi-user concurrency scenarios, traditional stand-alone or homogeneous clusters are difficult to meet the timeliness requirements.

Method used

By evaluating the complexity of the calculation content, selecting suitable parallel computing modes, and dynamically allocating computing subtasks based on the load balancing mechanism, using a parallel algorithm with a hybrid CPU + GPU architecture, combining shared memory optimization and mixed precision computing, significantly improving computing efficiency.

Benefits of technology

It improves the utilization rate of computing resources, significantly improves the safety verification efficiency of large-scale power grids, and can quickly complete the concurrent safety verification tasks of multiple users, meeting the stability and efficiency under high load conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119917290B_ABST
    Figure CN119917290B_ABST
Patent Text Reader

Abstract

The present invention discloses a large power grid security checking calculation method applicable to multiple time scales, belonging to the technical field of data processing, and comprising the following steps: S1, obtaining the calculation content of multi-user security checking tasks, evaluating the complexity of the calculation content, and selecting a parallel calculation mode based on the evaluation result; S2, extracting calculation subtasks of multi-user security checking tasks based on the parallel calculation device pool and job scheduling strategy set in the parallel calculation mode, and dynamically allocating the calculation subtasks to corresponding calculation nodes by using a load balancing mechanism; S3, processing the calculation subtasks of multiple calculation nodes by using a parallel algorithm with a CPU+GPU hybrid architecture, and merging the calculation subtask results of multiple users to generate a final security checking report. The solution not only improves the utilization rate of computing resources in the resource pool, but also significantly improves the security checking efficiency of large-scale power grids.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and specifically, to a large power grid security checking calculation method applicable to multiple time scales. Background Art

[0002] With the rapid development of the UHV power grid, the expansion of the power grid scale has led to the complication of electrical connections, and the security and stability analysis needs to cover multiple time scales such as medium and long term, monthly, day-ahead, intra-day, and real-time. In the prior art, there are problems such as long calculation time and low resource utilization rate in large-scale power grid security checking. Especially in the multi-user concurrent scenario, traditional single machines or homogeneous clusters are difficult to meet the timeliness requirements. Therefore, there is an urgent need for an efficient and scalable parallel calculation method to improve the processing efficiency of multi-threaded tasks.

[0003] The above information disclosed in the background art section is only used to enhance the understanding of the background of the present application, and thus it may include information that does not constitute the prior art known to those of ordinary skill in the art. Summary of the Invention

[0004] The object of the present invention is to solve the problem of low processing efficiency of multi-threaded tasks. The present application proposes a large power grid security checking calculation method applicable to multiple time scales. By evaluating the calculation complexity of the calculation content, the parallel calculation mode is initially determined. Then, the multi-user security checking tasks are decomposed into multiple calculation subtasks, and the calculation subtasks are dynamically allocated based on the load balancing mechanism to achieve optimal resource allocation and improve the utilization rate of calculation resources. The parallel algorithm using the CPU+GPU hybrid architecture significantly improves the calculation efficiency through shared memory optimization and mixed-precision calculation. Finally, the calculation subtask results of the security checking of multiple users are sorted and merged to obtain the final security checking calculation result. The solution not only improves the utilization rate of the calculation resources in the resource pool but also significantly improves the large-scale power grid security checking efficiency.

[0005] In a first aspect, a technical solution provided in an embodiment of the present invention is: a large power grid security checking calculation method applicable to multiple time scales, including the following steps:

[0006] S1. Obtain the calculation content of the multi-user security checking task, evaluate the complexity of the calculation content, and select a parallel calculation mode based on the evaluation result;

[0007] S2. Extract the calculation subtasks of the multi-user security checking task based on the parallel calculation device pool and job scheduling strategy set in the parallel calculation mode, and dynamically allocate the calculation subtasks to the corresponding calculation nodes by using the load balancing mechanism;

[0008] S3. Use a parallel algorithm with a CPU+GPU hybrid architecture to process the computing subtasks of multiple computing nodes, and merge the computing subtask results of multiple users to generate a final security check report.

[0009] Preferably, the computing content includes the power grid model scope and time scale;

[0010] The computing scale is divided into levels I, II, and III from small to large according to the power grid model scope;

[0011] The time scale includes medium- and long-term, monthly, day-ahead, intra-day, and real-time.

[0012] Preferably, evaluating the complexity of the computing content and selecting a parallel computing mode based on the evaluation results includes the following steps;

[0013] Extract the number of nodes, branches, and sections of the power grid topology structure based on the power grid model scope and the number of time periods;

[0014] Determine the complexity evaluation value according to the number of nodes, branches, sections, and their corresponding node calculation coefficients and branch-section coupling coefficients; select a matching parallel computing mode from the parallel computing mode library according to the complexity evaluation value.

[0015] Preferably, the parallel computing mode includes at least one of the following:

[0016] Single-machine CPU multi-core parallel mode, using the OpenMP shared memory programming model, matching level I intra-day computing tasks;

[0017] Single-machine heterogeneous parallel mode, using the OpenMP+CUDA programming model, matching level II static security analysis tasks;

[0018] Cluster multi-core parallel mode, using the OpenMP+MPI message communication model, matching level III medium- and long-term computing tasks;

[0019] Cluster heterogeneous parallel mode, using the OpenMP+CUDA+MPI hybrid programming model, matching level III large-scale real-time computing tasks.

[0020] Preferably, S2. Extract the computing subtasks of the multi-user security check task based on the parallel computing device pool and job scheduling strategy set in the parallel computing mode, and use a load balancing mechanism to dynamically allocate the computing subtasks to the corresponding computing nodes; including the following steps:

[0021] According to the hardware attributes of the computing nodes in the parallel computing device pool and the network analysis application type, select a matching splitting strategy from the preset task splitting rule library to obtain the initial computing subtasks;

[0022] Based on the task dependencies in the job scheduling strategy, perform a topological sort on the computing subtasks to generate an acyclic task dependency graph;

[0023] Determine the idle rate, load rate, and queue length of the computing nodes to determine the granularity adjustment factor, and adjust the initial computing subtasks according to the granularity adjustment factor to match the computing subtask granularity corresponding to the computing nodes to obtain the target computing subtasks;

[0024] Determine the load weights of the computing nodes participating in the calculation in sequence through the CPU utilization rate, GPU video memory occupancy rate, and task queue length; allocate the target computing subtasks to the computing node corresponding to the smallest load weight.

[0025] Preferably, determine the idle rate, load rate, and queue length of the computing nodes to determine the granularity adjustment factor , and the formula is as follows:

[0026] ;

[0027] Wherein, is the load rate of the current node, is the load rate threshold, is the idle rate of the current node, is the idle rate threshold, is the normalized value of the task queue length of the current node, is the queue length threshold, , and are weight coefficients respectively, wherein, .

[0028] Preferably, use a parallel algorithm with a CPU+GPU hybrid architecture to process the computing subtasks of multiple computing nodes, including the following steps:

[0029] According to the calculation type and hardware adaptability of the computing subtasks, dynamically allocate the tasks to the CPU or GPU computing units;

[0030] Adopt OpenMP multithreading management on the CPU side to execute the cooperative operation with multiple GPUs;

[0031] Adopt a batch power flow parallel solution method on the GPU side to achieve multi-section synchronous calculation;

[0032] Obtain the calculation process data of each computing subtask, perform structured processing on the calculation process data, and store it in a hierarchical manner in a memory database or a distributed database.

[0033] Preferably, the above-mentioned adopting OpenMP multithreading management on the CPU side to execute the cooperative operation with multiple GPUs includes the following steps:

[0034] Create multiple threads using OpenMP, with each thread responsible for managing the task scheduling of a GPU device; automatically adapt the computational subtasks according to the load balancing mechanism of the GPU device;

[0035] Each thread starts a GPU kernel function through the CUDA API, passing the parameters of the computational subtasks. Each thread monitors the GPU computing progress in real time, records the number of completed cross-sections, the remaining computing amount, and the estimated completion time.

[0036] Preferably, the multi-section synchronous calculation is implemented by using a batch power flow parallel solution method on the GPU side, including the following steps:

[0037] Regularly store the multi-period power grid admittance matrix as a three-dimensional tensor according to the cross-section numbering rule. The admittance matrix of each cross-section is stored in a sparse format, and the non-zero elements are arranged in row-major order; the grid parameters are organized as a two-dimensional tensor according to the cross-section numbering;

[0038] Align and store the three-dimensional tensor or / and two-dimensional tensor according to the number of bytes to adapt to the access granularity of the GPU;

[0039] Use multiple CUDA thread blocks to implement asynchronous execution of multi-section calculations. One CUDA thread block is allocated for each cross-section. The number of threads within the thread block adapts to the Warp scheduling granularity of the NVIDIA GPU. Each thread block loads the non-zero elements of the admittance matrix of the current cross-section into the shared memory, and each thread block independently executes the Newton-Raphson iteration to calculate the node voltage amplitude and phase angle and write the iteration results into the result buffer in the global video memory;

[0040] Determine the residual norm of each thread block for calculating the current cross-section. If the convergence condition is met, mark the calculation of this cross-section as completed.

[0041] Preferably, the steps for merging the calculation subtask results of multiple users to generate a final security check report include:

[0042] Merge the calculation subtask results of different periods of the same user in chronological order to obtain a user-level security verification report; or

[0043] Conduct aggregation analysis on the calculation subtask result data of all users according to the user ID and period number to generate a network-level security verification report.

[0044] The beneficial effects of the present invention:

[0045] (1) Aiming at the problems of long calculation time and low resource utilization rate in large-scale power grid security checking calculations, this application evaluates the complexity of the calculation content, selects a suitable parallel computing mode (such as multi-core parallel on a single CPU, heterogeneous parallel on a single machine, multi-core parallel in a cluster, heterogeneous parallel in a cluster), and dynamically allocates calculation subtasks based on a load balancing mechanism, so that computing resources are fully utilized, avoiding the problem of resource waste in traditional single machines or homogeneous clusters. A parallel algorithm with a CPU+GPU hybrid architecture, combined with shared memory optimization and mixed-precision calculation, significantly improves the calculation efficiency. Especially in the multi-user concurrent scenario, it can quickly complete the large-scale power grid security checking task.

[0046] (2) Power grid security checking needs to cover multiple time scales such as medium- and long-term, monthly, day-ahead, intra-day, and real-time. Traditional methods are difficult to meet the calculation requirements of different time scales. This application divides the calculation tasks according to the power grid model scope and time scale, and selects different parallel computing modes according to the complexity evaluation value. For tasks of different time scales, different parallel computing strategies are adopted (for example, the multi-core parallel mode on a single CPU is suitable for intra-day calculation tasks, and the heterogeneous parallel mode in a cluster is suitable for large-scale real-time calculation tasks), which can flexibly meet the calculation requirements of different time scales, ensuring that both medium- and long-term planning and real-time security analysis can be efficiently completed. Through task decomposition and dynamic allocation, the system can automatically select the optimal computing mode according to the characteristics of the tasks and the availability of computing resources, improving the adaptability and flexibility of the system.

[0047] (3) With the expansion of the power grid scale and the increase in the number of users, traditional single machines or homogeneous clusters are difficult to meet the calculation requirements in the multi-user concurrent scenario. This application adopts the heterogeneous parallel mode in a cluster, combined with a hybrid programming model of OpenMP, CUDA, and MPI, supports multi-user concurrent computing, and dynamically adjusts the granularity of calculation subtasks through a load balancing mechanism to ensure the load balance of each computing node. At the same time, using the parallel computing power of the GPU, multi-section synchronous calculation is realized, further improving the concurrent processing ability of the system. Through dynamic load balancing and the parallel computing of the GPU, the system can efficiently process a large number of concurrent tasks, avoiding the calculation bottleneck problem in traditional methods and ensuring the stability and efficiency of the system under high load.

[0048] The above invention content is only an overview of the technical solution of the present invention. In order to be able to more clearly understand the technical means of the present invention, it can be implemented according to the content of the specification. And in order to make the above and other purposes, features, and advantages of the present invention more obvious and understandable, the following specifically gives the specific implementation manners of the present invention. Brief Description of the Drawings

[0049] Other features, objects, and advantages of the present invention will become more apparent from the following detailed description of non-limiting embodiments read in conjunction with the accompanying drawings. The drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Also, throughout the drawings, the same reference numerals are used to denote the same components.

[0050] Figure 1 This is a flowchart of a method for large power grid security checking calculation applicable to multiple time scales of the present invention. Specific embodiments

[0051] To make the objectives, technical solutions, and advantages of the present invention clearer and more understandable, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only the best embodiments of the present invention, which are only used to explain the present invention and do not limit the protection scope of the present invention. All other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.

[0052] Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts depict the operations (or steps) as sequential processes, many of the operations (or steps) can be implemented in parallel, concurrently, or simultaneously. In addition, the order of the operations can be rearranged. The process can be terminated when its operations are completed, but there can also be additional steps not included in the drawings; the process can correspond to a method, function, procedure, subroutine, subprogram, etc.

[0053] Embodiment: As Figure 1 shown, a method for large power grid security checking calculation applicable to multiple time scales includes the following steps:

[0054] S1. Obtain the calculation content of the multi-user security checking task, evaluate the complexity of the calculation content, and select a parallel calculation mode based on the evaluation result.

[0055] As a preferred embodiment, the calculation content includes the power grid model scope and time scale; the calculation scale is divided into levels I, II, and III from small to large according to the power grid model scope; the time scale includes medium- and long-term, monthly, day-ahead, intra-day, and real-time.

[0056] As a preferred embodiment, the evaluating the complexity of the calculation content and selecting a parallel calculation mode based on the evaluation result includes the following steps;

[0057] Extract the number of nodes, branches, and sections of the power grid topology structure based on the power grid model scope and the number of time periods;

[0058] Determine the complexity evaluation value based on the number of nodes, branches, sections, and their corresponding node calculation coefficients and branch-section coupling coefficients; select a matching parallel computing mode from the parallel computing mode library according to the complexity evaluation value.

[0059] It can be understood that based on the power grid model range and the number of time periods, the number of nodes in the power grid topology structure is extracted. N 1. Number of branches N 2 and the number of sections N 3. Number of nodes N 1. Number of branches N 2 directly reflects the complexity of the power grid topology. The provincial model has a smaller coverage area and lower orders of magnitude of nodes and branches; the national grid level needs to handle tens of thousands of nodes and branches due to cross-regional interconnection. The number of sections represents the time-scale granularity. For real-time calculations, second-level sections need to be processed (such as N 3 = 86400 / day), while only a small number of representative sections are required for medium- and long-term calculations. In a specific example, the power grid model range can be set as follows: provincial model: N 1 ≤ 5000, N 2 ≤ 8000; network-level model: 5000 < N 1 ≤ 20000, 8000 < N 2 ≤ 30000; national grid-level model: N 1 > 20000, N 2 > 30000; the number of time periods is divided according to the time scale: medium- and long-term: N 3 ≤ 10 (such as annual / quarterly plans); monthly: 10 < N 3 ≤ 100; day-ahead / real-time: N 3 > 100.

[0060] Furthermore, the complexity evaluation value can be expressed as: ; where k 1 is the node calculation coefficient (empirical value k 1 = 0.5), k 2 is the branch-section coupling coefficient (empirical value k 2 = 0.1), which is used to quantify the calculation complexity correlation relationship between branches (such as transmission lines, transformers) and time period sections (time points) in power grid security verification. In practice, the correlation degree calculation formula needs to be used for calculation, specifically: , m is the weight coefficient.

[0061] As a preferred embodiment, the parallel computing mode includes at least one of the following:

[0062] Single-machine CPU multi-core parallel mode, adopting the OpenMP shared memory programming model, matching level-I intraday calculation tasks;

[0063] The single-machine heterogeneous parallel mode adopts the OpenMP+CUDA programming model and matches the level-II static security analysis task;

[0064] The cluster multi-core parallel mode adopts the OpenMP+MPI message communication model and matches the level-III medium- and long-term calculation task;

[0065] The cluster heterogeneous parallel mode adopts the OpenMP+CUDA+MPI hybrid programming model and matches the level-III large-scale real-time calculation task.

[0066] It can be understood that for the single-machine CPU multi-core parallel mode: if C ≤10 6 , the shared memory programming model OpenMP is adopted, which is applicable to provincial intraday calculations; for the single-machine heterogeneous parallel mode: if 10 6 < C ≤10 8 , the OpenMP+CUDA programming model is adopted, which is applicable to network-level static security analysis; for the cluster multi-core parallel mode: if 10 8 < C ≤10 10 , the OpenMP+MPI message communication model is adopted, which is applicable to state grid-level medium- and long-term checking; for the cluster heterogeneous parallel mode: if C >10 10 , the OpenMP+CUDA+MPI hybrid programming model is adopted, which is applicable to state grid-level real-time high-throughput tasks.

[0067] In this embodiment, first, the calculation content of the multi-user security checking task is obtained, including the power grid model scope and time scale. The power grid model scope is divided into level-I (provincial), level-II (network-level), and level-III (state grid-level) according to the scale, and the time scale includes medium- and long-term, monthly, day-ahead, intraday, and real-time. Based on the power grid model scope and the number of time periods, the number of nodes, branches, and sections of the power grid topology structure is extracted. According to the number of nodes, branches, sections, and their corresponding node calculation coefficients and branch-section coupling coefficients, the complexity evaluation value is calculated. Through complexity evaluation, the system can automatically select the optimal parallel calculation mode according to the calculation requirements of the task, avoiding the problems of resource waste and low calculation efficiency caused by mismatched calculation modes in traditional methods. For example, for small-scale intraday calculation tasks, the single-machine CPU multi-core parallel mode can make full use of the computing power of the multi-core CPU and significantly improve the calculation efficiency; while for large-scale real-time calculation tasks, the cluster heterogeneous parallel mode can combine the computing advantages of the CPU and GPU to ensure that the calculation task is completed in a short time.

[0068] S2. Extract the computational subtasks of the multi-user security checking task based on the parallel computing device pool and job scheduling strategy set in the parallel computing mode, and dynamically allocate the computational subtasks to the corresponding computing nodes using a load balancing mechanism.

[0069] As a preferred embodiment, S2 includes the following steps:

[0070] According to the hardware attributes of the computing nodes in the parallel computing device pool and the types of network analysis applications, select a matching splitting strategy from the preset task splitting rule library to obtain the initial computational subtasks; where the hardware attributes include: the number of CPU cores, the GPU video memory capacity, and the network bandwidth between nodes; the types of network analysis applications include: static security analysis, power flow calculation, and sensitivity analysis; the splitting strategies include: splitting by power grid area: dividing the whole network model into multiple electrically weakly coupled sub-regions, and each sub-region is a computational subtask; splitting by time-section cross-section: decomposing the multi-time-section task into independent subtasks according to time slices, and each cross-section is calculated separately; splitting by calculation type: splitting the mixed task (such as power flow + security check) into heterogeneous subtasks and allocating them to the CPU or GPU nodes respectively.

[0071] In this embodiment, according to the hardware attributes of the computing nodes in the parallel computing device pool (such as the number of CPU cores, the memory size, the GPU model and the video memory capacity, etc.) and the types of network analysis applications, select a matching splitting strategy from the preset task splitting rule library to obtain the initial computational subtasks, which can make full use of the hardware advantages of the computing nodes. For example, for nodes with powerful GPU computing capabilities, split out intensive tasks such as matrix operations suitable for GPU processing; for nodes with many CPU cores but weak GPU performance, allocate more logical operation tasks that rely on CPU serial processing. When processing security checking tasks containing a large number of matrix multiplication operations, the computing efficiency is greatly improved.

[0072] Furthermore, based on the task dependencies in the job scheduling strategy, perform a topological sort on the computational subtasks to generate an acyclic task dependency graph; the task dependencies include data dependencies and timing dependencies, where data dependencies indicate that subtask B needs to wait for the output data of subtask A; timing dependencies indicate that medium- and long-term tasks need to be started after the day-ahead tasks are completed.

[0073] In this embodiment, based on the task dependencies in the job scheduling strategy, topological sorting is performed on the computing subtasks to generate an acyclic task dependency graph, ensuring the correctness and sequentiality of task execution during the computing process, and avoiding errors or deadlock situations caused by improper task execution order. In complex power grid security checking scenarios, for example, a power flow calculation task may depend on the initialization task of the power grid topology. Through topological sorting, it can ensure that the topology construction is completed first and then the power flow calculation is carried out, thus guaranteeing the smooth progress of the entire computing process, effectively reducing the computing error rate, and improving the reliability of the computing results.

[0074] Furthermore, determine the idle rate, load rate, and task queue length of the computing node to determine the granularity adjustment factor, and adjust the initial computing subtasks according to the granularity adjustment factor to match the computing subtask granularity corresponding to the computing node to obtain the target computing subtasks.

[0075] As a preferred embodiment, determine the idle rate, load rate, and queue length of the computing node to determine the granularity adjustment factor , and the formula is as follows:

[0076] ;

[0077] where, is the load rate of the current node, is the load rate threshold, is the idle rate of the current node, is the idle rate threshold, is the normalized value of the task queue length of the current node, is the queue length threshold, , and are weight coefficients respectively, where, .

[0078] In this embodiment, when the computing node has a high idle rate, a low load rate, and a short task queue length, the task granularity is appropriately increased to make full use of the node resources; on the contrary, when the node is heavily loaded, the task granularity is reduced to avoid overloading the node. By dynamically adjusting the task granularity, the utilization rate of the overall computing resources is significantly improved.

[0079] Determine the load weights of the computing nodes participating in the calculation in sequence through the CPU utilization rate, GPU video memory occupancy rate, and task queue length; allocate the target computing subtasks to the computing node corresponding to the smallest load weight.

[0080] As a preferred embodiment, the load weight calculation formula can be expressed as:

[0081] ;

[0082] Among them, is the utilization rate of the CPU, is the video memory occupancy rate of the GPU, is the normalized value of the task queue length of the current node, and b1, b2, and b3 are the set weight coefficients respectively.

[0083] In this embodiment, through the dynamic load balancing mechanism, the computing tasks can be evenly distributed among the computing nodes, avoiding the situation where some nodes are overloaded while others are idle. In the scenario of multiple users submitting security check tasks concurrently, the system can dynamically allocate tasks according to the real-time load status of each node. For example, at a certain moment, there are 10 computing nodes in the system. Through the load balancing mechanism, the load difference among the nodes always remains within the compliance range (e.g., 10%), significantly improving the concurrent processing ability and overall performance of the system, and ensuring the stability and efficiency of the system under high load.

[0084] S3. Use a parallel algorithm with a CPU+GPU hybrid architecture to process the computing subtasks of multiple computing nodes, and merge the results of the computing subtasks of multiple users to generate a final security check report.

[0085] As a preferred embodiment, using a parallel algorithm with a CPU+GPU hybrid architecture to process the computing subtasks of multiple computing nodes includes the following steps:

[0086] Dynamically allocate tasks to the CPU or GPU computing units according to the computing type and hardware adaptability of the computing subtasks.

[0087] It can be understood that in large power grid security check calculations, there are a large number of computationally intensive tasks such as matrix operations and numerical iterations. The GPU has natural advantages in processing such tasks and can use its numerous computing cores to achieve parallel acceleration. For example, in the matrix inversion operation in power flow calculation, the GPU can process several times faster than the CPU. For control tasks such as task scheduling and logical judgment, the CPU is more proficient. Through precise allocation, the computing subtasks can be reasonably diverted to the most suitable computing unit.

[0088] Furthermore, use OpenMP multi-thread management on the CPU side to execute and cooperate with multiple GPUs.

[0089] As a preferred embodiment, the use of OpenMP multi-thread management on the CPU side to execute and cooperate with multiple GPUs includes the following steps:

[0090] Use OpenMP to create multiple threads, and each thread is responsible for managing the task scheduling of a GPU device; automatically adapt the computing subtasks according to the load balancing mechanism of the GPU device;

[0091] Each thread starts a GPU kernel function through the CUDA API, passing the parameters of the computing subtask. Each thread monitors the GPU computing progress in real time, records the number of completed cross-sections, the remaining computing amount, and the estimated completion time.

[0092] It can be understood that the multi-threads created by OpenMP can efficiently manage the task scheduling of different GPU devices. Each thread automatically adapts the computing subtask according to the load balancing mechanism of the GPU device, avoiding the situation where a certain GPU is overloaded while other GPUs are idle. Through the above coordination operations, the overall computing power of the system is further improved.

[0093] Furthermore, a batch power flow parallel solution method is adopted on the GPU side to achieve multi-section synchronous calculation.

[0094] As a preferred embodiment, the batch power flow parallel solution method adopted on the GPU side to achieve multi-section synchronous calculation includes the following steps:

[0095] The multi-period power grid admittance matrix is stored as a three-dimensional tensor according to the cross-section numbering rule, and the admittance matrix of each cross-section is stored in a sparse format, and the non-zero elements are arranged in row-major order; the grid parameters are organized as a two-dimensional tensor according to the cross-section numbering;

[0096] The three-dimensional tensor or / and two-dimensional tensor are stored by byte alignment to adapt to the access granularity of the GPU;

[0097] Use multiple CUDA thread blocks to achieve asynchronous execution of multi-section calculations. One CUDA thread block is allocated for each cross-section. The number of threads in the thread block adapts to the Warp scheduling granularity of the NVIDIA GPU. Each thread block loads the non-zero elements of the admittance matrix of the current cross-section into the shared memory, and each thread block independently executes the Newton-Raphson iteration to calculate the node voltage amplitude and phase angle and writes the iteration result into the result buffer in the global video memory;

[0098] Determine the residual norm of each thread block for calculating the current cross-section. If the convergence condition is met, mark the calculation of this cross-section as completed.

[0099] It can be understood that a large power grid contains multiple cross-sections, and the traditional serial calculation method is extremely inefficient. On the GPU side, the multi-period power grid admittance matrix and grid parameters are stored in a specific format to adapt to its access granularity, significantly reducing the data reading time. Using multiple CUDA thread blocks to asynchronously process different cross-sections, and each thread block independently executes the Newton-Raphson iteration to calculate the node voltage amplitude and phase angle, which provides strong support for the real-time, safe and efficient analysis of the power grid.

[0100] Furthermore, obtain the calculation process data of each computing subtask, perform structured processing on the calculation process data, and store it in a hierarchical manner in a memory database or a distributed database.

[0101] In this embodiment, the calculation process of each calculation subtask is recorded according to the following fields: task ID, calculation node number, start and end timestamps; number of convergence iterations, maximum error value, critical branch load rate; exception flag bits (such as over-limit warning, data overflow); the obtained process logs are stored in a hierarchical manner as real-time logs and persistent logs, where the real-time logs are stored in an in-memory database (such as Redis) for real-time query by the online monitoring system; the persistent logs are archived by user and time period to a distributed file system (such as HDFS), for example, the retention period is ≥ 30 days.

[0102] As a preferred embodiment, the steps of merging the calculation subtask results of multiple users to generate a final security check report are as follows:

[0103] Merge the calculation subtask results of the same user at different time periods in chronological order to obtain a user-level security verification report; or

[0104] Perform aggregation analysis on the calculation subtask result data of all users according to the user ID and time period number to generate a network-level security verification report.

[0105] In this embodiment, the in-memory database is suitable for storing hot data that needs to be accessed quickly, can meet the frequent data reading requirements during the real-time calculation process, and ensure the smoothness of the calculation process. The distributed database is used to store a large amount of historical data to ensure data security and scalability. For example, when grid operation and maintenance personnel need to view the recent security check calculation process data to analyze the grid operation trend, they can quickly obtain it from the in-memory database; for long-term historical data archiving and in-depth analysis, it can be extracted from the distributed database. The storage method designed in this application not only facilitates data management and maintenance, but also provides a rich data foundation for subsequent grid optimization, fault diagnosis, etc., improving the intelligent level of grid security management.

[0106] The above specific implementation manners are the preferred implementation manners of a method for large power grid security check calculation applicable to multiple time scales of the present invention, and do not limit the specific implementation scope of the present invention. The scope of the present invention includes but is not limited to this specific implementation manner. Any equivalent changes made according to the shape and structure of the present invention are within the protection scope of the present invention.

Claims

1. A large power grid security verification calculation method suitable for multiple time scales, characterized in that: The following steps are involved: S1. Obtain the calculation content of the multi-user security verification task, evaluate the complexity of the calculation content and select a parallel computing mode based on the evaluation result; S2. Extract the computing subtasks of the multi-user security verification task based on the parallel computing device pool and job scheduling strategy set in the parallel computing mode, and dynamically allocate the computing subtasks to the corresponding computing nodes using a load balancing mechanism; S3, using a parallel algorithm of CPU+GPU hybrid architecture to process computing subtasks of multiple computing nodes, merge computing subtask results of multiple users, and generate a final safety verification report; The calculation content includes the scope and time scale of the power grid model; The power grid model is divided into level I, level II, and level III from small to large according to the power grid model range; The time scales include medium- to long-term, monthly, day-ahead, intraday and real-time; The step of evaluating the complexity of the calculation content and selecting a parallel computing mode based on the evaluation result comprises the following steps: Extract the number of nodes, branches and sections of the power grid topology based on the power grid model range and time period; Determine a complexity evaluation value according to the number of nodes, the number of branches, the number of sections and their corresponding node calculation coefficients and branch-section coupling coefficients; select a matching parallel computing mode from a parallel computing mode library according to the complexity evaluation value; The parallel computing mode includes at least one of the following: The single-machine CPU multi-core parallel mode uses the OpenMP shared memory programming model to match the level I intraday computing tasks; Single-machine heterogeneous parallel mode, using OpenMP+CUDA programming model, matching level II static safety analysis tasks; Cluster multi-core parallel mode, using OpenMP+MPI message communication model, matching level III medium and long-term computing tasks; Cluster heterogeneous parallel mode, using OpenMP+CUDA+MPI hybrid programming model, matches level III large-scale real-time computing tasks; In S2, the computing subtasks of the multi-user security verification task are extracted based on the parallel computing device pool and job scheduling strategy set in the parallel computing mode; the steps include: According to the hardware attributes of the computing nodes in the parallel computing device pool and the type of network analysis application, a matching splitting strategy is selected from a preset task splitting rule library to obtain an initial computing subtask; Based on the task dependency in the job scheduling strategy, the computing subtasks are topologically sorted to generate an acyclic task dependency graph; The idle rate, load rate and queue length of the computing node are determined to determine the granularity adjustment factor, and the initial computing subtask is adjusted according to the granularity adjustment factor to match the computing subtask granularity corresponding to the computing node to obtain the target computing subtask.

2. A large power grid security verification calculation method applicable to multiple time scales according to claim 1, characterized in that: In S2, a load balancing mechanism is used to dynamically allocate computing subtasks to corresponding computing nodes; the following steps are included: The load weights of the computing nodes participating in the calculation are determined in turn through the CPU utilization, GPU memory occupancy and task queue length; the target computing subtask is assigned to the computing node corresponding to the smallest load weight.

3. A large power grid security verification calculation method applicable to multiple time scales according to claim 2, characterized in that: Determine the idle rate, load rate and queue length of the computing node to determine the granularity adjustment factor λ, the formula is as follows: Among them, L cur is the load rate of the current node, L thr is the load rate threshold, I cur is the idle rate of the current node, I thr is the idle rate threshold, Q cur is the normalized value of the task queue length of the current node, Q thr is the queue length threshold, α, β and γ are weight coefficients respectively, where α+β+γ=1.

4. The method for calculating the safety verification of a large power grid applicable to multiple time scales according to claim 1 is characterized in that: The parallel algorithm of CPU+GPU hybrid architecture is used to process the computing subtasks of multiple computing nodes, including the following steps: Dynamically assign tasks to CPU or GPU computing units based on the computing type and hardware adaptability of the computing subtask; OpenMP multi-thread management is used on the CPU side to perform collaborative operations with multiple GPUs; The batch power flow parallel solution method is used on the GPU side to achieve multi-section synchronous calculation; The computing process data of each computing subtask is obtained and structured and then stored in a memory database or a distributed database.

5. A large power grid security verification calculation method applicable to multiple time scales according to claim 4, characterized in that: The method of using OpenMP multi-thread management on the CPU side to perform collaborative operations with multiple GPUs includes the following steps: Use OpenMP to create multiple threads, each thread is responsible for managing the task scheduling of a GPU device; automatically adapt the computing subtasks according to the load balancing mechanism of the GPU device; Each thread starts the GPU kernel function through the CUDA API and passes the parameters of the calculation subtask. Each thread monitors the GPU calculation progress in real time and records the number of completed sections, the remaining calculation amount and the estimated completion time.

6. A large power grid security verification calculation method applicable to multiple time scales according to claim 5, characterized in that: The method of using a batch power flow parallel solution method on the GPU side to realize multi-section synchronous calculation includes the following steps: The admittance matrix of the multi-period power grid is stored as a three-dimensional tensor according to the section number. The admittance matrix of each section is stored in a sparse format, and the non-zero elements are arranged in row priority order. The power grid parameters are organized into a two-dimensional tensor according to the section number. Align the 3D tensor and / or 2D tensor according to the number of bytes to store them to fit the access granularity of the GPU. Use multiple CUDA thread blocks to implement asynchronous execution of multi-section calculations, where each section is assigned a CUDA thread block, and the number of threads in the thread block is adapted to the Warp scheduling granularity of the NVIDIA GPU. Each thread block loads the non-zero elements of the admittance matrix of the current section into the shared memory. Each thread block independently performs Newton-Raphson iterations to calculate the node voltage amplitude and phase angle and writes the iteration results to the result buffer in the global video memory. Determine the residual norm of the current section calculated by each thread block, and mark the section calculation completed if the convergence condition is met.

7. The method for calculating the safety verification of a large power grid applicable to multiple time scales according to claim 1 is characterized in that: The step of combining the calculation subtask results of multiple users to generate a final safety verification report includes the following steps: Merge the calculation subtask results of the same user in different time periods in chronological order to obtain a user-level security verification report; or The computing subtask result data of all users is aggregated and analyzed according to the user ID and time period number to generate a full-network security verification report.

Citation Information

Patent Citations

  • Cluster GPU (graphic processing unit) resource scheduling system and method

    CN102541640A

  • Multi-time scale security check system and method for uniformly scheduling computing resources

    CN110196773A