Power system adaptive load flow calculation method and device based on edge graph attention network

The adaptive power flow calculation method of edge graph attention network solves the problems of non-convergence and insufficient generalization ability in power system power flow calculation, achieves high-precision and fast power flow prediction, and enhances the security and energy of the power system. efficiency.

CN118783448APending Publication Date: 2024-10-15NORTHEAST DIANLI UNIVERSITY +1
View PDF 0 Cites 10 Cited by

Patent Information

Application Number
CN202410777613.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-17
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

When faced with a high proportion of new energy and load volatility, existing power system power flow calculation methods suffer from non-convergence, insufficient generalization capabilities, limited prediction accuracy and reliability, and the inability to effectively handle nonlinear complexity and non-Euclidean complexity. Problems with graph-structured data.

Method used

An adaptive power flow calculation method based on edge graph attention network is adopted. By constructing an edge graph attention power flow calculation model, the multi-head attention mechanism and multi-graph parallel training are used, and the mean square error and mean absolute error are used as indicators to measure model performance. , adjust model hyperparameters and apply regularization technology to achieve online real-time power flow calculation under changes in power grid topology.

Benefits of technology

It achieves high-precision and fast power flow calculations, avoids calculation non-convergence problems, enhances the safety and reliability of the power system, can adapt to emergencies and outliers, improves prediction accuracy and energy efficiency, and optimizes power system operations. model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118783448A_ABST
    Figure CN118783448A_ABST
Patent Text Reader

Abstract

The invention discloses a power system self-adaptive load flow calculation method and device based on an edge graph attention network, and the method comprises the steps: constructing an edge graph attention load flow calculation model architecture, and carrying out the modeling of load flow calculation into an edge graph attention topological graph according to a non-Euclidean graph structure of a power system; a multi-head attention mechanism is adopted to carry out different weighting on nodes or edges, and different features of the graph are expressed; multi-graph parallel training is adopted; adopting a mean square error and a mean absolute error as indexes for measuring the performance of the model; if the model precision reaches an expected value, obtaining an edge graph attention network-based power system adaptive load flow calculation model; if the precision of the model does not reach the expected value, hyper-parameters of the model are adjusted; a regularization technology is applied to the loss function; the known state quantity of the electric power system at a certain time point in a specific scene is input into the model, the model can obtain a complete power flow result of the electric power system under the current working condition through online real-time mapping, and the latest power flow result guarantee serves as the basis of operation analysis of the electric power system. The device comprises a processor and a memory.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of power systems, and in particular to a method and device for calculating power system adaptive power flow based on an edge graph attention network. Background Art

[0002] The current power system is undergoing a rapid development stage of transformation to a new power system. The high penetration rate of renewable energy such as photovoltaic power stations and wind farms has brought fluctuations and intermittency to the new power system. [1] The rapid development of high penetration rate of renewable energy and high proportion of power electronic equipment has become an important technical feature of the new power system. [2] , the safe and stable operation of the power system faces new forms and challenges. On the one hand, the complexity of traditional simulation modeling continues to increase, the time step continues to decrease, the computational burden grows exponentially, and the AC power flow requires multiple iterations and there are non-convergence situations. On the other hand, with the dual substantial growth in the number of operating modes and disturbance modes, it is no longer sustainable to rely on operating personnel to analyze massive operating simulation results and select countermeasures. The introduction of data-driven analytical modeling technology into the field of power system analysis has become an inevitable trend [3] .

[0003] Traditional power flow calculation represented by the Newton-Raphson method (abbreviated as Newton-Raphson NR) is usually based on physical models and uses numerical calculation ideas to iteratively solve nonlinear equations. However, this method has the following shortcomings [4-6] :The local convergence characteristics of the Newton method make it sensitive to initial values. Unreasonable initial values ​​will lead to slow convergence of power flow calculation or even non-convergence. When the power flow does not converge, it is impossible to clearly determine whether it is caused by the defects of the Newton method or the absence of power flow solutions in the system under this operating mode. The singularity or pathological condition of the Jacobian matrix will seriously affect the stability and convergence of the algorithm. Singular or nearly singular Jacobian matrices may cause the algorithm to be unable to find a solution, resulting in non-convergence of the power flow calculation results. It has high requirements for data accuracy. The data-driven power flow calculation method uses the real-time operating data measured by the power system to establish a model, and through offline learning, fits the nonlinear relationship between the system operating conditions and the output data, transfers the computational burden to offline training, and uses the trained model online to realize real-time computational analysis. Using massive training samples, it automatically aggregates information from high-dimensional raw inputs to generate an effective mechanism for more targeted new features, overcoming the difficulty of manually constructing features in complex systems. It not only avoids the problem of non-convergence of power flow, but also can adapt to complex power systems in a large number of scenarios.

[0004] The core of deep learning (DL) is neural network, which realizes the mapping relationship between input data and output data. By stacking multiple layers of neural network, multi-level abstract representation of data is realized, which has the ability to process large-scale data. Representative DL technologies, such as deep belief network (DBN) [7-8] 、deep neural networks (DNN [9-10] , convolutional neural network (CNN), and reinforcement learning (RL) are more suitable for input information arranged in a distance grid, i.e. structured data. Power flow calculation is one of the most basic offline / online applications of power systems. It calculates the node voltage and branch power of the entire network under a specific topological relationship based on a given power flow initial value. Reference

[10] proposed a method for automatic adjustment of power flow calculation convergence in large power grids by establishing a deep neural network to mine the power flow calculation characteristics in N-1 safety verification.

[0005] However, the application of existing DL technology still has the following limitations and shortcomings:

[0006] 1) Inability to effectively handle nonlinear complexity: Actual data on new power systems with multiple renewable energy generating units and load fluctuations often have nonlinear and complex characteristics, which traditional linear models cannot effectively capture;

[0007] 2) Insufficient generalization ability: When faced with new or unseen data, traditional models often have poor generalization ability, which is particularly disadvantageous in a rapidly changing environment;

[0008] 3) Limited prediction accuracy and reliability: The prediction accuracy and reliability of traditional methods are often insufficient under special conditions (e.g., extreme climate, emergencies, etc.). When demand changes rapidly, traditional models may not be able to update prediction results in time, affecting decision-making efficiency.

[0009] 4) Only using structured data as input: considering the busbars of the power system as graph nodes and the transmission lines as graph edges, existing DL techniques cannot fully and effectively aggregate the spatial features of non-Euclidean graph structured data;

[0010] 5) The effect is not ideal in the field of discrete relationship modeling: the model is not applicable in application scenarios dominated by network topology with connection relationships;

[0011] 6) DL models are often “black box” models, which affects the reliability of model applications.

[0012] References

[0013] [1] Liao W, Bak-Jensen B, Pillai JR, et al. A review of graph neural networks and their applications in power systems [J]. Journal of Modern PowerSystems and Clean Energy, 2021, 10(2): 345-360.

[0014] [2] Zhou Xiaoxin, Chen Shuyong, Lu Zongxiang, Huang Yanhao, Ma Shicong, Zhao Qiang. Technical characteristics of my country's new generation power system during energy transformation[J]. Proceedings of the CSEE, 2018, 38(07): 1893-1904+2205. DOI: 10.13334 / j.0258-8013.pcsee.180067.

[0015] [3] Guan Lin, Huang Jiyu, Cai Xihan, Zhu Siting. Application and prospect of graph deep learning technology in power system analysis and decision-making[J]. High Voltage Engineering, 2022, 48(09): 3405-3422. DOI: 10.13336 / j.1003-6520.hve.20221052.

[0016] [4] Li Xue, Liu Ye, Jiang Tao, Chen Houhe, Li Guoqing. Research on parallel calculation method of power system load margin[J]. Proceedings of the CSEE, 2019, 39(17): 5105-5117+5291. DOI: 10.13334 / j.0258-8013.pcsee.181172.

[0017] [5] Jiang Tao, Zhang Yong, Li Xue, Li Guoqing, Chen Houhe. Holonomic embedded computation of AC and DC power flows in power systems[J]. Transactions of the Chinese Society of Electrotechnical Engineering, 2021, 36(21): 4429-4443+4481. DOI: 10.19595 / j.cnki.1000-6753.tces.201306.

[0018] [6] Zhang Guofang, Luo Yadi, Li Jing, Dai Xu, Dai Yuhan. Parallel solution method for power flow correction equation of large power grid[J]. Power System Protection and Control, 2017, 45(19): 117-122.

[0019] [7]Liang H, Liu Y, Sheng G, et al. Fault-cause identification methodbased on adaptive deep belief network and time–frequency characteristics of traveling wave[J]. IET Generation, Transmission&Distribution, 2019, 13(5):724-732.

[0020] [8] Su Tong, Liu Youbo, Shen Xiaodong, Liu Tingjian, Qiu Gao, Liu Junyong. Deep learning driven evolutionary algorithm for preventive control of transient stability of power systems[J]. Proceedings of the CSEE, 2020, 40(12): 3813-3824. DOI: 10.13334 / j.0258-8013.pcsee.191114.

[0021] [9] James JQ, Hou Y, Li VO K. Online false data injection attack detection with wavelet transform and deep neural networks [J]. IEEETransactions on Industrial Informatics, 2018, 14(7): 3271-3280.

[0022]

[10] Yang Yan, Yang Zhifang, Yu Juan, Xiang Mingxu, Yu Hongxin, Wang Hongbin. N-1 safety verification method with uncertainty based on deep learning[J]. Proceedings of the CSEE, 2021, 41(08): 2716-2725. DOI: 10.13334 / j.0258-8013.pcsee.191601. Summary of the invention

[0023] The present invention provides a method and device for calculating power flow in an electric power system based on an edge graph attention network. The present invention can realize online real-time power flow calculation in multiple scenarios of power grid topology changes, with high prediction accuracy and fast calculation time, avoiding the problem of non-convergence of power flow calculation in traditional methods; at the same time, it helps operation and maintenance personnel to identify and respond to potential risks in a timely manner, and enhance the overall safety of the power system. See the following description for details:

[0024] In the first aspect, a method for calculating an adaptive power flow in an electric power system based on an edge graph attention network is provided, the method comprising:

[0025] 1) Construct an edge graph attention power flow calculation model architecture, and model the power flow calculation as an edge graph attention topology graph according to the non-Euclidean graph structure of the power system;

[0026] 2) Use a multi-head attention mechanism to express different features of the graph by weighting nodes or edges differently; use multi-graph parallel training;

[0027] 3) The mean square error and mean absolute error are used as indicators to measure the performance of the model; if the model accuracy reaches the expected value, the adaptive power flow calculation model of the power system based on the edge graph attention network is obtained; if the model accuracy does not reach the expected value, the hyperparameters of the model are adjusted; regularization technology is applied in the loss function;

[0028] 4) The known state quantities of the power system at a certain point in time under a specific scenario are input into the model. The model can obtain the complete power flow results of the power system under the current working conditions through online real-time mapping. The latest power flow results are used as the basis for power system operation analysis.

[0029] The architecture of the edge graph attention flow calculation model is as follows: the input of any single layer is a node feature vector set X and an edge feature vector set Y;

[0030] The output of the edge graph attention layer is a new feature set after the node information and edge information are aggregated:

[0031] X={x′1,x′2,…x′ N},x′ i ∈R F′

[0032] Y={y′1,y′2,…y′ L},y′ i ∈R Q′

[0033] Where x and x′, y and y′ have different feature dimensions, and F′ is the dimension of the feature.

[0034] Among them, the multi-head attention mechanism is:

[0035] Attention coefficient e in graph attention mechanism ij Indicates the relative importance between nodes, that is, when calculating information transmission and aggregation between nodes, it is used to control the weight of each node in the calculation:

[0036] e ij =α[Wx i ||Wx j ||We ij +b]

[0037] Where: W is a learnable parameter matrix, α is a learnable scaling factor, || represents the concatenation operation of the vector, b is the bias term, and x j is the original node feature, e ij is the eigenvector of the edge between nodes;

[0038] The softmax function is introduced for normalization, and the calculation formula of the nonlinear activation function LeakyReLu(·) is added as follows:

[0039]

[0040] Where: k∈N i represents the neighboring nodes of the central node i. ij is the eigenvector of the edge between nodes, e ik It is the feature vector of the edges between the central node and all neighboring nodes.

[0041] The input of the known state quantity of the power system at a certain time point in a specific scenario into the model is:

[0042] Select the eLu function, use the information of the power grid transmission line and the contribution of the neighboring nodes to the central node to aggregate the power grid bus information to generate new node information;

[0043] y′ (i,j) =σ((x′ i ||x′ j ||y (i,j) )w2)

[0044] Where: y (i,j) is the original edge feature, w2 is the learnable parameter of the current layer, and is concatenated with the node embedding features on both sides of each edge;

[0045] K independent attention mechanisms are used to calculate the attention coefficient, and the local representation vectors learned by each attention head are merged or averaged:

[0046]

[0047] In the second aspect, a device for adaptive power flow calculation of an edge graph attention network power system is provided, the device comprising: a processor and a memory, the memory storing program instructions, the processor calling the program instructions stored in the memory to enable the device to execute any one of the methods described in the first aspect.

[0048] In a third aspect, a computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes any one of the methods described in the first aspect.

[0049] The beneficial effects of the technical solution provided by the present invention are:

[0050] 1. The present invention can adapt to the volatility of high-proportion renewable energy and the randomness of load demand, and can calculate the power flow results of all scenes to be verified at one time, with high prediction accuracy and fast calculation time, avoiding the problem of non-convergence of power flow calculation by traditional methods;

[0051] 2. The present invention has good adaptability to emergencies and abnormal values ​​in the power grid. This technology can help operation and maintenance personnel to identify and respond to potential risks in a timely manner and enhance the overall safety of the power system. In addition, the model can show the importance of different nodes and edges in the prediction, helping engineers better understand the behavior of the power flow model.

[0052] 3. The present invention can more accurately predict electricity demand and supply through efficient power flow calculation, optimize the operation mode of the power system and reduce energy waste; this not only improves energy efficiency, but also helps to reduce the overall operating cost of the power system; power market participants can use the accurate and real-time power flow information provided by the present invention to make more scientific investment and trading decisions, for example, it can predict the power supply and demand situation in a specific period of time, and help formulate more favorable power purchase or sales strategies. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 The overall flow chart of the prediction of the network model for edge graph attention flow calculation;

[0054] Figure 2 Update diagrams for power system characteristics;

[0055] Figure 3 Schematic diagram of the loss curve for training the collected sample set;

[0056] in, Figure 3 (a) represents the node model, Figure 3 (b) represents the edge model, and the loss function value shows a decreasing trend with the increase of training generations.

[0057] Figure 4 Schematic diagram of the calculation of multi-head attention coefficients and feature aggregation;

[0058] Figure 5 Expand the schematic diagram for the first-order neighborhood;

[0059] Figure 6 The schematic diagram for parallel computing of graph data;

[0060] Figure 7 Designing an architecture diagram for the edge graph attention layer;

[0061] Figure 8This is a topology diagram of the IEEE39 node network. DETAILED DESCRIPTION

[0062] In order to make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention are described in further detail below.

[0063] The edge graph attention deep neural network is an advanced deep learning architecture that can effectively utilize edge information and fully consider the spatial correlation between data for power flow calculation in power systems under variable topology conditions. This method has many advantages over traditional power flow calculation methods:

[0064] 1) It can effectively handle nonlinear complexity and quickly fit the power system flow of multiple accident scenarios, realize online real-time power system flow calculation, and avoid the problem of non-convergence of power flow. By constructing the attention coefficient matrix between nodes, the "black box" characteristic problem of deep learning is greatly alleviated.

[0065] 2) Strong generalization ability: Through its unique attention mechanism, it can capture the complex dependencies between nodes, has good adaptability to changes in grid topology in multiple accident scenarios such as line disconnection, can adapt to the volatility and randomness of a high proportion of renewable energy, and has strong generalization ability.

[0066] 3) High prediction accuracy and robustness: It can realize the rapid fitting of the nonlinear relationship between renewable energy output, load data, branch flow, and node voltage in multiple scenarios, and has the ability of topological generalization. It has strong robustness to changes in injected power, grid topology, and line characteristics.

[0067] 4) It can efficiently process unstructured data, namely graph-structured data: It is suitable for processing unstructured data, implements a node-level parameter sharing mechanism on the graph, and uses topological relationships to constrain the scope and mode of information aggregation between nodes. This not only enables the model's feature aggregation to better reflect graph relationships, but also enables the model to have theoretical application expansion capabilities for the addition and removal of nodes and edges through parameter sharing.

[0068] 5) Efficient modeling under discrete relationships: It can take into account the correlation of node information in sample data in feature extraction, dynamically adjust the weight of nodes according to specific tasks and data, and perform better in local feature extraction. When the graph topology changes, it can adaptively adjust the attention parameters to adapt to the new graph topology, showing good information aggregation and graph feature learning effects.

[0069] 6) Explanability of opening the black box: By performing weighted calculations on the nodes and edges in the graph, it is possible to learn the graph structure and implicitly integrate the importance of the nodes in the graph. Its interpretability analysis focuses on explaining the importance of the graph nodes or edges. Using heat maps or color coding to display the attention weights between nodes, the degree of interactivity between adjacent nodes can be directly observed.

[0070] In summary, edge graph attention based deep neural network provides a powerful method to improve the accuracy, efficiency and reliability of variable topology power flow calculation in power systems.

[0071] In order to realize the adaptive power flow calculation of the new power system, the embodiment of the present invention proposes a new adaptive power flow calculation method of the power system based on the edge graph attention network based on the graph deep learning analysis method.

[0072] The embodiments of the present invention fully and effectively utilize the historical power flow data and the topological structure information of the power system. The edge graph attention network introduces an attention mechanism when aggregating nodes, takes into account the relevance of node information in sample data in feature extraction, dynamically adjusts the weight of nodes according to specific tasks and data, and can have better performance in local feature extraction. Compared with the traditional graph convolutional network, the edge graph attention network can dynamically adjust the importance of each node to its neighbors according to the changes in the local structure of the graph. This mechanism enables the edge graph attention network to adaptively adjust the attention parameters to adapt to the new graph topology when the graph topology changes, which shows good information aggregation ability and graph feature learning effect. In addition, in the two information processing processes of attention calculation and neighborhood representation aggregation, the edge information is introduced in the representation aggregation stage to improve the model's ability to utilize the edge information, and the power flow physics model is embedded in the edge graph attention network by considering the rich edge information. This fully captures the local and global information in the graph structure and improves the performance of the model. The proposed method is divided into the following steps: first, the edge graph attention power flow calculation model architecture is constructed to achieve complete power flow mapping covering all information of the power system; second, an improved learnable attention coefficient mechanism is proposed to achieve the fusion of node features and edge features to maximize the mining of global information; then, the first-order neighborhood extension, feature vector selection and topology structure change processing methods are designed to improve the neural network training performance; finally, numerical simulations are used to verify the high precision and fast mapping capabilities of the proposed edge graph attention power flow calculation model, as well as its strong adaptability and generalization capabilities to topology change scenarios, such as Figure 1 shown.

[0073] Example 1

[0074] In order to describe the spatial connection relationship of the power system, the graph model is widely used to describe the topology of the power system. The graph data carried by the graph model is a non-Euclidean structure, which is used to realize high-precision and high-efficiency power flow calculation of new power systems under complex conditions. The embodiment of the present invention proposes an edge graph attention graph deep neural network. The overall prediction process of the edge graph attention power flow calculation network model is as follows Figure 1 As shown. The algorithm implementation includes the following steps:

[0075] 101: Collected and sorted in MATPOWER software, the voltage amplitude, phase angle and branch power flow before and after the fault are calculated by the Newton-Ray method;

[0076] Among them, for the power flow calculation, a large number of system operation states are randomly generated, and finally the required power flow calculation data is obtained from the node power flow list and node admittance matrix list in the simulation software. The historical data reflects the output size at each moment in the past, and the calculated power flow data samples are diverse. It is assumed that the wind speed and light intensity obey the Weibull distribution and Beta distribution respectively, and the load obeys the normal distribution, the mean is the given value of the standard test system, and the standard deviation is 10% of the mean.

[0077] 102: The edge graph attention power flow calculation model architecture was constructed. According to the non-Euclidean graph structure of the power system, the power flow calculation problem was modeled as an edge graph attention topology graph G(N,E,A);

[0078] Where N represents the node information, including: the node injected active power P i , node injected reactive power Q i , node voltage amplitude V i 、Node voltage phase angle θ i ; E represents side information, including: branch active power P ij , branch reactive power Q ij , branch conductance G ij 、Branch Susceptance B ij ; and A is the adjacency matrix, which is used to represent the network topology. Thus, a complete mapping of power system flow calculation is formed, such as Figure 2 As shown in Figure 1. Node N initially aggregates information from its neighbors to calculate representations. After the update, N' uses the learned representations to update its own features. The edge information E to E' is initially propagated with weights, and then the learned weights are used to update the information transfer in the model. The model is trained using the sample set collected in step 101. The training process is as follows: Figure 3 As shown. Among them, Figure 3 (a) represents the node model, Figure 3 (b) represents the edge model, and the loss function value shows a decreasing trend with the increase of training generations.

[0079] 103: To ensure the performance of the edge graph attention flow calculation model, the model in step 102 is improved, including: firstly, the first-order neighborhood is expanded to help the graph neural network better capture the relationship between nodes and increase the relationship modeling capability between nodes;

[0080] Among them, the embodiment of the present invention does not add or delete corresponding rows and columns on the original adjacency matrix, the size of the adjacency matrix is ​​fixed, and only the corresponding values ​​in the adjacency matrix need to be updated to reflect the new topological structure. Then, a multi-head attention mechanism can be used to focus on graph data from multiple angles. By weighting nodes or edges differently, the different features of the graph can be better expressed, and the contribution of each element can be more easily explained while improving the expressive power of the model. Finally, multi-graph parallel training is used to solve the problem that the training time and difficulty are longer and more difficult than traditional deep learning models due to the large number of parameters that need to be trained.

[0081] 104: After the model is improved in step 103, the constructed model is trained until the model training is completed. In order to evaluate the prediction performance, the embodiment of the present invention uses mean square error and mean absolute error as indicators to measure the model performance;

[0082] 105: If the model accuracy reaches the expected value, the adaptive power flow calculation model of the power system based on the edge graph attention network can be obtained; if the model accuracy does not reach the expected value, adjust the hyperparameters of the model;

[0083] Among them, adjust the model's hyperparameters, such as learning rate, number and size of hidden layers, batch size, etc., try different model architectures, such as deeper networks, different types of layers or activation functions. Apply regularization techniques such as Dropout or L2 regularization in the loss function to prevent overfitting.

[0084] 106: Using the model, the known state quantities of the power system at a certain point in time under a specific scenario are input into the model. The model can obtain the complete power flow results of the power system under the current working conditions through online real-time mapping. The latest power flow results are used as the basis for power system operation analysis, which can assist power system operators to quickly generate dispatch strategies, which are particularly suitable for demand response and power allocation during peak and valley electricity price periods, and help to accurately predict load changes in various regions or equipment.

[0085] Among them, this high-precision prediction capability allows the power grid to allocate resources more efficiently, optimize power flow, and ensure stable power supply during peak demand periods. By analyzing the topology and operation data of the power grid, weak links that may cause failures can be identified. Identifying these potential problems in advance allows the operation and maintenance team to intervene in advance and perform necessary maintenance or adjustments, thereby significantly reducing the failure rate of the system. When a power system fails, the topology identification of the power flow result can quickly analyze the type, location and possible cause of the fault, making the response measures faster and more accurate. This not only reduces the time for fault recovery, but also minimizes the load loss caused by the fault. This adaptive adjustment capability enables the power grid to respond more flexibly to various operational challenges and maintain system performance and reliability.

[0086] In summary, the present invention implements the above steps 101-106 to construct an edge graph attention power flow calculation model, realize high-precision and high-efficiency calculation of power flows in multiple scenarios of power systems with high penetration of new energy, and can quickly respond to changes in the system, such as load fluctuations, changes in power generation, and system failures. Real-time online power flow high-precision and fast calculation can assist power system operators in quickly generating dispatching strategies, which is particularly suitable for demand response and power dispatch during peak and valley electricity price periods, helping to reduce operating costs and increase the economy of the system. In addition, through fast and accurate power flow forecasting, dispatchers can better manage and allocate resources in the power grid, such as: reasonably allocating the output of generator sets, optimizing inter-regional power transmission, and more effectively utilizing renewable energy and energy storage systems.

[0087] Example 2

[0088] The scheme in Example 1 is further introduced below in combination with specific calculation formulas and principle analysis, as described below for details:

[0089] 201: Historical power flow data is an important part that affects power flow prediction. The power flow sample set includes: voltage amplitude, voltage phase angle, active power, reactive power, etc. They have different dimensions and large numerical differences, which is not conducive to the training of graph deep neural network for power system power flow analysis. Directly inputting the original data into the neural network is prone to data drowning. Therefore, in order to effectively improve the learning efficiency of graph deep neural network and prevent overfitting, the input and output feature vectors of power flow analysis need to be normalized to avoid numerical problems and reduce the adverse effects of abnormal samples.

[0090] Data cleaning is performed before input into the model. Defective and missing values ​​in the data are replaced by the average power flow value of the previous period. Then the load data values ​​are mapped to [0,1] using the z-score normalization transformation, which improves the convergence speed of the model. The standardized values ​​can be expressed as:

[0091]

[0092] Where: x μ is the mean of the sample data; x σ is the variance of the sample data; x is the sample data.

[0093] The specific approach is: first calculate the mean and standard deviation of the graph data. When processing graph structure data, the z-score standardization method uses the sample mean and standard deviation to perform normalization so that the mean of the data is 0 and the standard deviation is 1.

[0094] 202: This step constructs the edge graph attention flow calculation model architecture, where the input of any single layer is a node feature vector set X and an edge feature vector set Y;

[0095] For graph data, the input of the model can be expressed as:

[0096] X={x1,x2,…x N},x i ∈R F (2)

[0097] Y={y1,y2,…y L},y i ∈R Q (3)

[0098] Where: N is the number of system nodes, L is the number of system edges, x i is the feature vector of node i, y i is the feature vector of edge i, F is the feature number of the node, and Q is the feature number of the edge.

[0099] The output of the edge graph attention layer is a new feature set after the node information and edge information are aggregated:

[0100] X={x′1,x′2,…x′ N},x′ i ∈R F′ (4)

[0101] Y={y′1,y′2,…y′ L},y′ i ∈R Q′ (5)

[0102] Where x and x′, y and y′ have different feature dimensions, and F′ is the dimension of the feature.

[0103] Attention coefficient e in graph attention mechanism ij Indicates the relative importance between nodes, that is, when calculating information transmission and aggregation between nodes, it is used to control the weight of each node in the calculation:

[0104] e ij =α[Wx i ||Wx j ||We ij +b] (6)

[0105] Where: W is a learnable parameter matrix, α is a learnable scaling factor, ∥ represents the concatenation operation of the vector, b is the bias term, and x j is the original node feature, e ij is the eigenvector of the edges between nodes.

[0106] In order to ensure that the attention coefficients are fairly distributed among multiple nodes and that the weights are not too large or too small, a softmax function is introduced for normalization, such as Figure 4 As shown, the calculation formula of adding the nonlinear activation function LeakyReLu(·) is:

[0107]

[0108] Where: k∈N i represents the neighboring nodes of the central node i. ij is the eigenvector of the edge between nodes, e ik It is the feature vector of the edges between the central node and all neighboring nodes.

[0109] Next, update the information as follows to get the output features of each node and edge:

[0110]

[0111] Where: x′ i is the new feature after the node information is updated output by the EGAT layer; σ(·) is the activation function, and w1 is the learnable parameter of the current layer. In the embodiment of the present invention, it is selected as the eLu function. The node (grid bus) information is aggregated using the information of the edge (grid transmission line) and the contribution of the neighboring nodes to the central node to generate new node information.

[0112] y′ (i,j) =σ((x′ i ||x′ j ||y (i,j) )w2) (9)

[0113] Where: y (i,j) is the original edge feature, and w2 is the learnable parameter of the current layer. By concatenating the node embedding features on both sides of each edge, the new edge embedding feature embeds the information of the nodes on both sides while retaining the original information, thus expanding the spatial dimension of the information.

[0114] The attention coefficient is calculated using K (K ≥ 2) independent attention mechanisms, which requires merging or averaging the local representation vectors learned by each attention head.

[0115]

[0116] The merging operation is to concatenate the local representation vectors learned by each attention head to form a complete representation vector.

[0117] The averaging operation is to concatenate the output representation vectors of each attention head according to the dimension to obtain a large representation vector sequence. Then, this large representation vector sequence is averaged according to a certain dimension (usually the number of heads) to obtain an average vector.

[0118] 203: This step expands the first-order neighborhood to help the graph neural network better capture the relationship between nodes and increase the ability to model the relationship between nodes.

[0119] For example, in the first-order neighborhood, the one with the largest reactance value is l 27 , and l 12 +l 16 Less than l 27 , so it satisfies the first-order neighborhood expansion condition, such as Figure 5 shown.

[0120] Data parallelism is a method of dividing data into multiple parts and processing them in parallel on different devices. In the edge graph attention mechanism, this means dividing a large graph dataset into multiple subgraphs, each of which is processed on a different device. Data parallelism requires data communication and synchronization. Parameter sharing between different subgraphs is necessary, and these parameters can be updated during training.

[0121] In a single training process, multiple samples are organized into block diagonal relationships as shown in the figure. There is no connection between each subgraph, which will help the model converge to the local optimal solution faster, such as Figure 6 shown.

[0122] Considering that when a graph structure node loses connection, the eigenvalue of the corresponding edge is set to 0, the embodiment of the present invention designs a column vector M∈R that reflects the change of graph topology. L×1 .

[0123]

[0124] When no branch is disconnected, all elements of the vector are 1; when a branch is disconnected, the element value corresponding to the disconnected branch is set to 0. After each layer of graph convolution operation is completed, each column of the edge feature vector is multiplied by the vector to ensure that the feature value corresponding to the disconnected branch is always 0. In this way, the impact of the change in the topological structure can be fully reflected without affecting the learning of the adjacent edge features.

[0125] Example 3

[0126] The feasibility of the solutions in Embodiments 1 and 2 is verified by combining specific examples, as described below:

[0127] The parameters of the data-driven model are trained and adjusted based on a given data set. They are a reflection of the patterns and rules learned during the training process, which can help the model make accurate predictions on new data. If the model parameters are not set appropriately or the quality of the training data is poor, the model may become very ineffective in predicting new data. Therefore, in order to build an effective data-driven model, it is necessary to carefully select and process the training data, and adjust and optimize the model parameters. The model parameters of the embodiment of the present invention are as follows: Figure 7 shown.

[0128] As shown in Table 1, the present invention sets the known system state quantity under the power system working condition as input and sets the unknown system state quantity as output:

[0129] In model training, the adaptive moment estimation (ADAM) optimization algorithm is used. The training parameters of the model in the present invention are shown in Table 2. The loss function is used to measure the difference between the model prediction result and the true value. It must meet two basic requirements: it can evaluate the accuracy of the model and the parameters to be calculated are differentiable:

[0130]

[0131] Among them, Y i is the model prediction value, is the true value, L reg is a regularization term. The present invention uses the mean square error loss function (Mean Squared Error). The mean square error and mean absolute error are selected as indicators to measure model performance. The specific model performance evaluation index calculation is shown in formula (14), (15):

[0132]

[0133] Where n is the number of samples; MSE is the mean of the squares of the differences between the predicted values ​​and the true values, and MAE is the mean of the absolute values ​​of the differences between the predicted values ​​and the true values. The two are calculated differently, and MSE has a greater penalty for samples with larger errors. MSE is usually more commonly used because it has better mathematical properties in gradient descent.

[0134] As shown in Table 3, the error index results of the evaluation model used in the example of the present invention show that the output results of the model are highly accurate and have a fast response time, meeting the requirements of power flow reliability in power system operation analysis.

[0135] The computing cloud platform is configured as follows: machine model: GN8.LARGE56 (6-core CPU, 56G memory), instance type is cloud server CVM-GPU computing type GN8, the learning rate set for the node prediction model is 0.00001, the maximum number of iterations is 16000, the learning rate set for the edge prediction model is 0.0002, the maximum number of iterations is 5000, and the batch size (batch_size) = 32. The proposed edge graph attention flow calculation model is implemented in the Pytorch-Geometric framework. According to the settings and inputs of the model, the IEEE 39 node system is trained. The system is as follows Figure 8 shown.

[0136] Table 1 Input and output feature selection list

[0137]

[0138] Table 2 List of hyperparameter configuration

[0139]

[0140] Table 3 Model performance comparison

[0141]

[0142]

[0143] Example 4

[0144] A power system adaptive power flow calculation device based on edge graph attention network, the device comprising: a processor and a memory, the memory storing program instructions, the processor calling the program instructions stored in the memory to enable the device to execute the following method steps in embodiment 1:

[0145] 1) Construct an edge graph attention power flow calculation model architecture, and model the power flow calculation as an edge graph attention topology graph according to the non-Euclidean graph structure of the power system;

[0146] 2) Use a multi-head attention mechanism to express different features of the graph by weighting nodes or edges differently; use multi-graph parallel training;

[0147] 3) The mean square error and mean absolute error are used as indicators to measure the performance of the model; if the model accuracy reaches the expected value, the adaptive power flow calculation model of the power system based on the edge graph attention network is obtained; if the model accuracy does not reach the expected value, the hyperparameters of the model are adjusted; regularization technology is applied in the loss function;

[0148] 4) The known state quantities of the power system at a certain point in time under a specific scenario are input into the model. The model can obtain the complete power flow results of the power system under the current working conditions through online real-time mapping. The latest power flow results are used as the basis for power system operation analysis.

[0149] The architecture of the edge graph attention flow calculation model is as follows: the input of any single layer is a node feature vector set X and an edge feature vector set Y;

[0150] The output of the edge graph attention layer is a new feature set after the node information and edge information are aggregated:

[0151] X={x′1,x′2,…x′ N},x′ i ∈R F′

[0152] Y={y′1,y′2,…y′ L},y′ i ∈R Q′

[0153] Where x and x′, y and y′ have different feature dimensions, and F′ is the dimension of the feature.

[0154] Among them, the multi-head attention mechanism is:

[0155] Attention coefficient e in graph attention mechanism ij Indicates the relative importance between nodes, that is, when calculating information transmission and aggregation between nodes, it is used to control the weight of each node in the calculation:

[0156] e ij =α[Wx i ||Wx j ||We ij +b]

[0157] Where: W is a learnable parameter matrix, α is a learnable scaling factor, ∥ represents the concatenation operation of the vector, b is the bias term, and x j is the original node feature, e ij is the eigenvector of the edge between nodes;

[0158] The softmax function is introduced for normalization, and the calculation formula of the nonlinear activation function LeakyReLu(·) is added as follows:

[0159]

[0160] Where: k∈N i represents the neighboring nodes of the central node i. ij is the eigenvector of the edge between nodes, e ik It is the feature vector of the edges between the central node and all neighboring nodes.

[0161] Among them, the known state quantity of the power system at a certain point in time under a specific scenario is input into the model as:

[0162] Select the eLu function, use the information of the power grid transmission line and the contribution of the neighboring nodes to the central node to aggregate the power grid bus information to generate new node information;

[0163] y′ (i,j) =σ((x′ i ||x′ j ||y (i,j) )w2)

[0164] Where: y (i,j) is the original edge feature, w2 is the learnable parameter of the current layer, and is concatenated with the node embedding features on both sides of each edge;

[0165] K independent attention mechanisms are used to calculate the attention coefficient, and the local representation vectors learned by each attention head are merged or averaged:

[0166]

[0167] It should be pointed out here that the device description in the above embodiment corresponds to the method description in the embodiment, and the embodiment of the present invention will not be described in detail here.

[0168] The execution subjects of the above-mentioned processor and memory can be devices with computing functions such as computers, single-chip microcomputers, and microcontrollers. In specific implementation, the embodiments of the present invention do not limit the execution subjects and are selected according to the needs of actual applications.

[0169] The data signal is transmitted between the memory and the processor via a bus, which is not described in detail in the embodiment of the present invention.

[0170] Based on the same inventive concept, an embodiment of the present invention further provides a computer-readable storage medium, the storage medium includes a stored program, and when the program is running, the device where the storage medium is located is controlled to execute the method steps in the above embodiment.

[0171] The computer-readable storage medium includes but is not limited to a flash memory, a hard disk, a solid-state drive, and the like.

[0172] It should be pointed out here that the description of the readable storage medium in the above embodiment corresponds to the description of the method in the embodiment, and the embodiment of the present invention will not be described in detail here.

[0173] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions according to the embodiments of the present invention are generated.

[0174] The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. Computer instructions may be stored in a computer-readable storage medium or transmitted via a computer-readable storage medium. The computer-readable storage medium may be any available medium that can be accessed by the computer or a data storage device such as a server or a data center that includes one or more available media. The available medium may be a magnetic medium or a semiconductor medium, etc.

[0175] Unless otherwise specified, the models of the components in the embodiments of the present invention are not limited, and any device that can perform the above functions may be used.

[0176] Those skilled in the art will appreciate that the accompanying drawing is only a schematic diagram of a preferred embodiment, and the serial numbers of the embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0177] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for adaptive power flow calculation of power system based on edge graph attention network, characterized in that: The method comprises: 1) Construct an edge graph attention power flow calculation model architecture, and model the power flow calculation as an edge graph attention topology graph according to the non-Euclidean graph structure of the power system; 2) Use a multi-head attention mechanism to express different features of the graph by weighting nodes or edges differently; use multi-graph parallel training; 3) The mean square error and mean absolute error are used as indicators to measure the performance of the model; if the model accuracy reaches the expected value, the adaptive power flow calculation model of the power system based on the edge graph attention network is obtained; if the model accuracy does not reach the expected value, the hyperparameters of the model are adjusted; regularization technology is applied in the loss function; 4) The known state quantities of the power system at a certain point in time under a specific scenario are input into the model. The model can obtain the complete power flow results of the power system under the current working conditions through online real-time mapping. The latest power flow results are used as the basis for power system operation analysis.

2. According to claim 1, a method for calculating power flow in an adaptive power system based on an edge graph attention network is characterized in that: The architecture of the edge graph attention flow calculation model is as follows: the input of any single layer is a node feature vector set X and an edge feature vector set Y; The output of the edge graph attention layer is a new feature set after the node information and edge information are aggregated: X={x′1,x′2,…x′ N },x′ i ∈R F′ And={y′1,y′2,…y′ L },and' i ∈R Q′ Where x and x′, y and y′ have different feature dimensions, and F′ is the dimension of the feature.

3. According to claim 1, a method for calculating power system adaptive power flow based on edge graph attention network is characterized in that: The multi-head attention mechanism is: Attention coefficient e in graph attention mechanism ij Indicates the relative importance between nodes, that is, when calculating information transmission and aggregation between nodes, it is used to control the weight of each node in the calculation: e ij =α[Wx i ||Wx j ||We ij +b] Where: W is a learnable parameter matrix, α is a learnable scaling factor, ∥ represents the concatenation operation of the vector, b is the bias term, and x j is the original node feature, e ij is the eigenvector of the edge between nodes; The softmax function is introduced for normalization, and the calculation formula of the nonlinear activation function LeakyReLu(·) is added as follows: Where: k∈N i represents the neighboring nodes of the central node i. ij is the eigenvector of the edge between nodes, e ik It is the feature vector of the edges between the central node and all neighboring nodes.

4. According to claim 1, a method for calculating power system adaptive power flow based on edge graph attention network is characterized in that: The input of the known state quantity of the power system at a certain time point in a specific scenario into the model is: Select the eLu function, use the information of the power grid transmission line and the contribution of the neighboring nodes to the central node to aggregate the power grid bus information to generate new node information; and' (i,j) =σ((x′ i ||x′ j ||and (i,j) )w2) Where: y (i,j) is the original edge feature, w2 is the learnable parameter of the current layer, and is concatenated with the node embedding features on both sides of each edge; K independent attention mechanisms are used to calculate the attention coefficient, and the local representation vectors learned by each attention head are merged or averaged:

5. A power system adaptive power flow calculation device based on edge graph attention network, characterized in that: The device comprises: a processor and a memory, wherein program instructions are stored in the memory, and the processor calls the program instructions stored in the memory to enable the device to execute the method according to any one of claims 1 to 4.

6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is enabled to perform the method according to any one of claims 1 to 4.

Citation Information

Cited By

  • Power system safety self device action scheme generation method, device, equipment and storage medium

    CN119448216A

  • Power system security device action scheme generation method, device, equipment and storage medium

    CN119448216B

  • Power system load prediction method based on modal decomposition and independent attention mechanism

    CN119561009A

  • Power distribution network voltage flow state estimation method and system based on GAT

    CN119765350A

  • Comprehensive energy system rapid energy flow analysis method based on physical mechanism guidance and multi-head map attention mechanism

    CN119830130A