A method for evaluating power grid transient power angle stability based on spatiotemporal dynamic graph model
By constructing a grid transient power angle stability assessment method based on a spatiotemporal dynamic graph model, combined with a time-series multi-head attention mechanism and a graph isomorphism network, the problem of insufficient dynamic reflection of grid topology changes in existing technologies is solved, and the information transmission characteristics of different regions in the grid transient process are effectively captured, thereby improving the accuracy and robustness of the grid transient power angle stability assessment.
Patent Information
- Application Number
- CN202411524580.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2044-10-30
AI Technical Summary
Existing power system transient stability assessment methods based on graph deep learning have the problem of fixed input form of graph node features when extracting grid topology information, and cannot dynamically reflect changes in grid topology, resulting in insufficient utilization of grid time series feature information, especially the low sensitivity of information transfer feature extraction between high-dimensional sub-regions.
A grid transient power angle stability assessment method based on a spatiotemporal dynamic graph model is adopted. Combining the temporal multi-head attention mechanism and graph isomorphism network, a dynamic graph neural network model is constructed. Through the dynamic graph isomorphism network and the temporal graph collapse pooling layer, it dynamically adapts to changes in the grid topology and captures the information transfer characteristics between different regions during the grid transient process.
It significantly improves the accuracy and robustness of the transient power angle stability assessment of the power grid, can dynamically adapt to changes in the power grid topology, and improves the timeliness and robustness of the transient stability assessment, especially in complex power grid environments.
Smart Images

Figure CN119129157B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of smart grids and relates to an artificial intelligence technology for power grid transient stability assessment, and in particular to a power grid transient power angle stability assessment method based on a spatiotemporal dynamic graph model. Background Art
[0002] With the rapid development of power systems and the continuous integration of large-scale renewable energy and AC / DC hybrid networks, the demand for safe and stable grid operations has increased significantly. Power system transients, particularly the period from fault occurrence to fault removal, are often brief and variable in duration. For complex, tightly coupled, high-dimensional grids facing sudden system failures and operational risks, rapid and accurate transient stability assessment (TSA) is crucial.
[0003] In recent years, with the rapid progress of artificial intelligence technology and the popularization of vector measurement units (PMUs) in wide-area measurement systems, the research field of data-driven TSA has developed rapidly. By directly establishing an end-to-end mapping relationship between the system characteristic quantities and transient stability states of the power system, it is possible to effectively make up for the shortcomings of TSA based on mechanism models in terms of accuracy and effectiveness in the face of increasingly complex power grid environments. At present, machine learning algorithms have been widely used in the field of transient stability assessment. For example, the literature [Dai Yuanhang, Chen Lei, Zhang Weiling, Min Yong, Li Wenfeng. Transient stability assessment of power systems based on multi-support vector machine synthesis [J]. Proceedings of the CSEE, 2016, 36(05): 1173-1180. DOI: 10.13334 / j.0258-8013.pcsee.2016.05.001.] studied the transient stability assessment effect of support vector machines (SVMs). The literature [Sun Hongbin, Wang Kang, Zhang Boming, Zhao Feng. Cai Transient stability rule extraction using linear decision tree [J]. Proceedings of the CSEE, 2011, 31(34): 61-67+8. DOI: 10.13334 / j.0258-8013.pcsee.2011.34.004.] The extracting of transient stability rules is realized by utilizing the interpretability of decision tree (DT) model. However, the machine learning input for TSA mostly relies on expert experience. The use of feature extraction or feature selection methods often affects the final stability judgment effect. There are also certain deficiencies in the information extraction of high-dimensional data.
[0004] At the same time, deep learning algorithms have become the mainstream research method for data-driven TSA because they can use the original measurement data of the power system as direct input in TSA and autonomously extract high-dimensional features of the power grid. For example, in the literature [Gao Kunlun, Yang Shuai, Liu Siyan, Li Xiangwei. Power system transient stability assessment based on one-dimensional convolutional neural network [J]. Automation of Electric Power Systems, 2019, 43(12): 18-26.], the grid node voltage amplitude, phase angle, branch active and reactive power and other sample data are spliced, and the sample time series features are extracted using a one-dimensional convolution neural network (1D-CNN). In the literature [Shi Z, Yao W, Zeng L, et al. Convolutional neural network-based power system transient stability assessment and instability mode prediction [J]. Applied Energy, 2020, 263: 114586.], the observation data of the disturbed system is output in a form similar to a two-dimensional image, and transient stability features are extracted using CNN. Reference [Sun Lixia, Bai Jingtao, Zhou Zhaoyu, Zhao Chenyun. Power system transient stability assessment based on bidirectional long short-term memory network [J]. Automation of Power Systems, 2020, 44(13): 64-72.] The TSA model is constructed based on the long short-term memory network (LSTM), which further enhances the feature extraction capability of the time-varying characteristics of power parameters.
[0005] Early deep learning-based grid transient power angle stability assessment mainly used convolutional neural network or recurrent neural network structure to extract time series feature information in the grid transient process for stability judgment. Although it can effectively extract time dimension features, for power systems with obvious non-Euclidean topology, these models are difficult to represent the spatial feature relationship between different components or physical parameters. In this context, some scholars began to study grid transient stability assessment based on graph deep learning to enhance the prediction ability of grid transient stability. Reference [Wang Zhengcheng, Zhou Yanzhen, Guo Qinglai, Sun Hongbin. Message passing graph neural network transient stability assessment considering power system topology changes [J]. Proceedings of the CSEE, 2021, 41(07): 2341-2350. DOI: 10.13334 / j.0258-8013.pcsee.202139.] A TSA model was constructed based on the message passing graph neural network (MPNN) framework, and it can effectively capture the impact of grid topology changes on prediction results. Reference [Zhong Zhi, Guan Lin, Su Yinsheng, Yao Haicheng, Huang Jiyu, Guo Mengxuan. Transient stability assessment of power system based on graph attention deep network [J]. Power System Technology, 2021, 45(06): 2122-2130. DOI: 10.13335 / j.1000-3673.pst.2020.0897.] The graph attention network (GAT) is used to enhance the TSA model's ability to extract local features of the power grid. Reference [Zhang Liang, An Jun, Zhou Yibo. Power system transient stability assessment based on temporal convolution and graph attention network [J / OL]. Automation of Power Systems: 1-12 [2023-02-16]. http: / / kns.cnki.net / kcms / detail / 32.1180.tp.20221116.1730.010.html] uses temporal convolutional neural network (TCN) and GAT to simultaneously extract the spatiotemporal characteristics of the power grid.
[0006] Existing graph-based deep learning-based power system transient stability assessment methods have been extensively studied for extracting grid topology information, but their sensitivity to extracting features related to information transfer between high-dimensional sub-regions of the power system is low. However, in actual power system operation, currents exhibit regional transmission trends. For example, currents in power generation areas, divided by key sections of the power grid, generally propagate toward load areas. Furthermore, grid characteristics in specific regions are often closely linked to the transient stability of the overall system. Therefore, fully exploiting the characteristics of high-dimensional sub-graphs of the power grid and inter-regional information transfer is crucial for improving the performance of power grid transient stability assessments.
[0007] Existing technologies mostly use static graphical models for transient power angle stability assessment. The main problems include: 1) the input form of graph node features is fixed, resulting in insufficient utilization of grid timing characteristic information; 2) the graph input is generated based on the grid steady state or the topology structure at a certain moment, which fails to dynamically reflect grid topology changes. Summary of the Invention
[0008] To address the above issues, the present invention relates to a method for evaluating the transient power angle stability of a power grid based on a spatiotemporal dynamic graph model, and in particular, to an evaluation method based on a spatiotemporal dynamic graph model. The model proposed in the present invention combines a temporal multi-head attention mechanism (MHA) with a graph isomorphism network (GIN) to construct a dynamic graph neural network model (AndyGIN), which can significantly improve the accuracy and robustness of the transient power angle stability evaluation of the power grid, and enhance the accuracy and robustness of the transient power angle stability evaluation after different faults in actual large-scale power grids.
[0009] In order to achieve the above object, the technical solution adopted by the present invention is:
[0010] A method for evaluating the transient power angle stability of a power grid based on a spatiotemporal dynamic graph model comprises the following steps:
[0011] Step 1: The multivariate time series of the power grid is trimmed and integrated into the input tensor X, where the mth multivariate time series x m =[x m1 ,x m2 ,...,x md ], m=1,2,...,M, M is the number of multivariate time series, d is the length of a single time series data, x md is the dth data in the mth multivariate time series; along the time dimension, X is divided into S time series slices of equal length X1, X2,…, X S , each time slice corresponds to a time slot, and the time slice X corresponding to time slot t t The length is d / S, t = 1, 2, ..., S;
[0012] Step 2: Construct the initial dynamic graph G = {G1, G2, ..., G S}, where G t =(V t ,A t ), then V={V1,V2,...,V S} represents a node set, A={A1,A2,...,A S} represents the adjacency matrix set; for each time slot t, two learnable embedding vectors α and β of length M are generated, and the elements in the vector are completely learnable parameters. The first generation is obtained by random initialization, and the vector α is calculated. T The product of and β is the adjacency matrix A corresponding to time slot t t The initial value of
[0013] Step 3: For time slot t, slice the corresponding time series X t And the adjacency matrix A corresponding to the time slot t Input into the dynamic graph isomorphic network, the feature tensor composed of all nodes output by the l-th layer dynamic graph isomorphic network
[0014] Step 4: For time slot t, the feature tensor obtained by the l-th layer dynamic graph isomorphism network is Input the time series graph to collapse the pooling layer, and adjust the pooling ratio hyperparameter r pooled Perform graph collapse processing on the current dynamic graph structure to obtain the corresponding pooled feature tensor and the adjacency matrix
[0015] Step 5, feature extraction iteration: When If the number of nodes in the corresponding dynamic graph is greater than 1, repeat steps 3 to 4; otherwise, go to step 6;
[0016] Step 6: The feature vector obtained for each time slot The data are concatenated into a vector and input into the fully connected layer for binary classification to obtain the transient power angle stability assessment result.
[0017] In one embodiment, in step 1, the dth data x in the mth multivariate time series md It includes the bus voltage U, bus angle θ, bus active load P and reactive load Q corresponding to the bus nodes of the main grid structure of the power grid. The types of power grid faults include: failure of safety and control devices to operate, N-1, N-2, N-3, DC bipolar blocking, single-phase failure to operate due to three-phase short circuit and transient instability of power angle caused by DC restart; the transient process of the power system caused by the fault will lead to changes in the grid topology connection mode, but will not affect the total number of bus nodes in the power grid. It will only cause the characteristic representation of the bus node itself to change over time.
[0018] In one embodiment, step 2 uses a self-learning graph generation module to construct an initial adjacency matrix set, where the matrix dimension is determined by d, and the adjustable hyperparameters are topk and the total number of time slots n. Then, the graph conversion module is used to construct the association between adjacent time slot graphs to obtain the initial adjacency matrix set.
[0019] In one embodiment, in step 2, the self-learning graph generation module encodes the adjacency matrix using embedding based on a multi-layer perceptron (MLP), and assigns two parameters to each graph node, respectively representing all starting nodes and target nodes of the node.
[0020] In one embodiment, in step 2, the two learnable embedding vectors α and β are respectively expressed as α=[α t,1 ,α t,2 ,...,α t,M ] and β[β t,1 ,β t,2 ,...,β t,M ], adjacency matrix A t The initial value of The implementation process is as follows:
[0021]
[0022] Among them, argtopk() is used to return A obtained by multiplying α and β. t The indices idx and idy corresponding to the first k largest matrix elements in A; x and y represent the matrix A. t The row and column numbers in the dynamic graph G for each time slot t , when t=1, the dynamic graph node set is described as V1=(v 1,1 ,v 1,2 ,...,v 1,N ); When t>1, the dynamic graph node set is represented by V t =(v t,1 ,v t,2 ,...,v t,N ,v t-1,1 ,v t-1,2 ,...,v t-1,N ), and at the same time add a connection edge from each node in time slot t-1 to the corresponding node in time slot t, that is, e (t-1,n),(t,n) ,n=1,2,...,N, where N represents the number of nodes.
[0023] In one embodiment, in step 3, the calculation formula of the node features output by the first layer dynamic graph isomorphic network is:
[0024]
[0025] Where: Represents the feature vector output by the dynamic graph isomorphism network of the first layer of the dynamic graph of node v in the dynamic graph of time slot t; MLP l,trepresents the fully connected network to which the isomorphic network of the lth layer of the dynamic graph belongs in the dynamic graph corresponding to time slot t; u∈N(v,t) represents the neighbor nodes of node v in the dynamic graph of time slot t; ε is a learnable parameter used to adjust the importance of the node's own features;
[0026] The node features output by the dynamic graph isomorphic network at layer l Arranged in matrix form As the input of the lth time-series graph collapse pooling layer, the formula for constructing the feature vector from the node features is as follows:
[0027]
[0028] N l Indicates the number of nodes corresponding to this layer.
[0029] In one embodiment, the calculation process of the time graph collapse pooling layer in step 4 is as follows:
[0030]
[0031] Where: Represents the tensor composed of the node features output by the collapse pooling layer of the l-th layer of the temporal graph, Represents the graph adjacency matrix after pooling of the collapsed pooling layer of the l-th layer of the temporal graph. Both are input to the l+1-th layer of the dynamic graph isomorphism network, thereby continuously repeating steps 3 and 4; N l+1 The number of nodes after pooling in the corresponding time series graph collapse pooling layer is determined by the number of nodes in the lth layer and the pooling ratio hyperparameter, that is, N l+1 =r pooled ×N l , W t l and represents the learnable parameter matrix;
[0032] In one embodiment, the step 4 uses a two-dimensional convolutional neural network based on a given pooling ratio hyperparameter r pooled The corresponding nodes are clustered into clusters as fused super nodes, where the node dimensions are regarded as different feature extraction channels in a two-dimensional convolutional neural network.
[0033] In one embodiment, the step 6 first converts the final feature vector Input fully connected layer:
[0034]
[0035] Among them, FC represents the fully connected layer, To represent the prediction results of stability, the fully connected layer maps the high-dimensional features into a two-dimensional output space, corresponding to stable and unstable states;
[0036] Then apply the Softmax function to get the probability of stability and instability:
[0037] P(stable),P(unstable)=Softmax(Y)
[0038] The Softmax function converts the output of the fully connected layer into a probability distribution, ensuring that the sum of the two probabilities is 1;
[0039] Finally, make the final judgment based on probability:
[0040] If P(stable)>P(unstable), the system is considered stable; otherwise, the system is considered unstable.
[0041] In one embodiment, in step 6, Focal Loss is used as the loss function during training:
[0042]
[0043] Among them, y is the true label, is the prediction result, α is the weight factor, and γ is the modulation factor.
[0044] Compared to existing technologies, this invention can dynamically adapt to changes in grid topology, improving the timeliness and robustness of transient stability assessments. Through a dynamic graph model, this invention can effectively capture the information transfer characteristics between different regions during grid transients, significantly improving the performance of transient power angle stability assessments, particularly in complex grid environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 It is the overall flow chart of the present invention.
[0046] Figure 2 1 is a schematic diagram of the main grid topology structure of the power system in an embodiment of the present invention.
[0047] Figure 3 It is a flowchart of the implementation of the figure conversion module in an embodiment of the present invention.
[0048] Figure 4 Schematic diagram of hierarchical pooling based on TGP in an embodiment of the present invention.
[0049] Figure 5 It is a schematic diagram of the dynamic graph set structure in an embodiment of the present invention. DETAILED DESCRIPTION
[0050] The embodiments of the present invention are described in detail below with reference to the accompanying drawings and examples.
[0051] According to the above, since the existing technology based on data-driven transient power angle stability judgment technology has insufficient ability to extract information between power grid regions, the present invention is based on graph deep learning technology, and through establishing a message passing graph neural network framework based on subgraphs of different scales of the power grid, it realizes the interconnection and interaction of power grid-related parameters in different regions and feature aggregation, and uses GAT as a single-layer feature extraction model. By using the attention mechanism to adaptively adjust the aggregation parameters in the feature update process, an end-to-end transient stability prediction model is established, which provides a new feasible means for graph neural networks to solve the problem of transient power angle stability assessment, and provides a preliminary attempt to integrate vertical domain knowledge into graph deep learning applications in the power grid field.
[0052] Specifically, refer to Figure 1 The present invention provides a method for evaluating the transient power angle stability of a power grid based on a spatiotemporal dynamic graph model, comprising the following steps:
[0053] Step 1: Data preprocessing.
[0054] The multivariate time series of the power grid is trimmed and integrated into An input tensor of the form m is the mth multivariate time series, x m =[x m1 ,x m2 ,...,x md ], m=1,2,...,M, M is the number of multivariate time series, d is the length of a single time series data, x md is the dth data in the mth multivariate time series. Divide X into S time series slices of equal length along the time dimension X1, X2, ..., X S ,, each time slice corresponds to a time slot, and the time slice X corresponding to time slot t t The length is
[0055] The data set used in the embodiment of the present invention is generated based on the AC / DC hybrid network with a high proportion of new energy built by the China Electric Power Research Institute. Figure 2As shown, different fault scenarios that lead to power angle instability are set as experimental objects. This example has a total of 197 nodes (of which 85 are 500kV main grid nodes), and the installed capacity ratio of new energy and conventional units is set at a ratio of 1:2.31, of which the output of new energy is 1.8 million kilowatts, the output of direct drive, doubly fed wind turbines and photovoltaics at the sending end is 600,000 kilowatts each, and the output of conventional units is 7.8 million kilowatts. Fault types include: power angle transient instability faults caused by safety and control device refusal to operate, N-1, N-2, N-3, DC bipolar lockout, three-phase short circuit single-phase refusal to operate, and DC restart. In a single sample, the fault occurred 0.05s after the start of the simulation, the fault lasted 0.1s, and the sampling time interval was 0.01s. The sample set contains a total of 23,996 simulation samples, of which 2,957 are unstable samples. The experimental part of the present invention randomly divides the sample set into training set, verification set and test set according to the ratio of 8:1:1.
[0056] Multivariate time series data used in this invention Contains M time series x m =[x m1 ,x m2 ,...,x md ], and the length of a single sequence is d. In the present invention, four electrical quantities, including bus voltage U, bus angle θ, bus active load P and reactive load Q, corresponding to the 85 bus nodes (nodes with bus voltage above 500kV) of the main grid structure of the power grid in the CEPRI-TAS-173 example are selected to construct the corresponding single sample multivariate time series input. The number of multivariate time series M is 340 (i.e. 4×85), and a single time series includes 20 sampling points, i.e. d=20. Divide X into S time slots along the time dimension. In the actual implementation process, S=3 is selected, then the length of each time slot is 7, and the time slots with insufficient length are supplemented by 0 to meet the requirements. Then divide X into X1, X2 and X3.
[0057] Step 2: Initial dynamic graph construction.
[0058] According to the segmentation of X, the initial dynamic graph G = {G1, G2, ..., G S}, where G t =(V t ,A t ), then V={V1,V2,...,V S} represents a node set, A={A1,A2,...,A S} represents the set of adjacency matrices. Furthermore, this step constructs an initial set of adjacency matrices using a self-learning graph generation module. This module encodes the adjacency matrix using embeddings based on a multi-layer perceptron (MLP). Each graph node is assigned two parameters, representing the start and target nodes for that node. The dimensionality of the adjacency matrix is determined by d, with adjustable hyperparameters being topk and the total number of time slots, n. The graph transformation module then constructs associations between graphs in adjacent time slots, resulting in an initial set of adjacency matrices.
[0059] For each time slot t, two vectors α and β with a sequence length of M are generated, and the elements in the vectors are completely learnable parameters. The first generation is obtained by random initialization. On this basis, the vector α is calculated T The product of and β is the adjacency matrix A corresponding to time slot t t The initial value of the original adjacency matrix The specific implementation process is as follows:
[0060]
[0061] Where α=[α t,1 ,α t,2 ,...,α t,M ],β=[β t,1 ,β t,2 ,...,β t,M ] represents the random initialization of the learnable embedding vectors α and β; argtopk() is used to return the index idx, idy corresponding to the first k largest matrix elements in the adjacency matrix obtained by multiplying the vectors α and β. x, y represent the matrix A t For each time slot in the dynamic graph G t In the first time slot t=1, the dynamic graph information is only represented by the current time slot graph structure, and its input is and The dynamic graph node set is described as V1=(v 1,1 ,v 1,2 ,...,v 1,N ). For the subsequent time slot t, the dynamic graph node set will become V t =(v t,1 ,v t,2 ,...,v t,N ,v t-1,1 ,v t-1,2 ,...,v t-1,N ). At the same time, add a connection edge from each node in time slot t-1 to the corresponding node in time slot t, that is, e (t-1,n),(t,n) ,n=1,2,...,N, where N represents the number of nodes.
[0062] This self-learning graph generation method has the following advantages: First, it makes the establishment of the initial graph input no longer limited to the number of bus nodes in the power grid itself, increasing the flexibility and applicability of the model. Second, it avoids the problem of difficulty in modeling the initial features of the graph nodes due to different measurement parameters of different bus nodes. Finally, the graph generation module can continuously perform iterative optimization during model training to reflect the stage-by-stage differences in the actual power system topology during transient processes. The graph conversion module constructs the association between adjacent time slot graphs to obtain a complete initial adjacency matrix set A. The working principle of this module draws on the basic idea of recurrent neural networks, that is, the grid characteristic information contained in the current time slot is composed of the graph structure characteristic information of the corresponding time slot and the grid characteristic information contained in the previous time slot. On this basis, the graph conversion module realizes the connection between the graph structure corresponding to a specific time slot and the node characteristic information in the graph structure of its previous time slot.
[0063] In specific implementations, the present invention assumes that while transient power system processes caused by faults may alter the grid topology, this does not affect the total number of bus nodes in the grid. Instead, it only causes the characteristics of the bus nodes themselves to change over time. Based on this assumption, the same number of nodes are added to the dynamic graph structure corresponding to each time slot, representing the bus node information from the previous time slot.
[0064] The advantage of this graph transformation method is that it can effectively capture the dynamic characteristics of power grid transients and link grid states at different times, providing richer and more coherent information for subsequent feature extraction. At the same time, it also maintains consistency in model processing, enabling the model to uniformly handle grid states at different times.
[0065] Step 3: Dynamic Graph Isomorphism Network (DyGIN) feature extraction.
[0066] The main purpose of this step is to use the Dynamic Graph Isomorphism Network (DyGIN) to capture the topological changes of the power grid during transient processes.
[0067] First, slice the time series X obtained in step 2 t And the adjacency matrix A corresponding to the time slot t Input to the DyGIN layer, the feature tensor composed of all nodes output by the dynamic graph isomorphism network in the first layer
[0068] The core of the DyGIN layer is to update node features through a message passing mechanism, while taking into account the information transmission between different time slots. The node feature update of the DyGIN of the present invention first calculates the node features output by the dynamic graph isomorphic network of the first layer:
[0069]
[0070] Where: In the dynamic graph representing time slot t, the feature vector output by node v in the DyGIN network at layer l; MLP l,t represents the fully connected network to which the l-th layer of the DyGIN network belongs in the dynamic graph corresponding to time slot t; u∈N(v,t) represents the neighbor nodes of node v in the dynamic graph of time slot t. ε is a learnable parameter used to adjust the importance of the node's own features.
[0071] Update the node features of the lth DyGIN layer Arranged in matrix form As the input of the subsequent lth TGP layer, the formula for constructing the feature vector from the node features is as follows:
[0072]
[0073] Where: N l Indicates the number of nodes corresponding to this layer.
[0074] DyGIN's design features make it particularly well-suited for transient stability analysis of power systems. By introducing the time dimension t, DyGIN can capture temporal changes in the grid topology, which is crucial for analyzing system behavior before and after faults. Using a summation operation as an aggregation function better preserves graph structural information than averaging or maximizing, facilitating differentiation between different network topologies. The learnable parameter ε allows the model to adaptively adjust the importance of both node characteristics and neighborhood characteristics, enhancing its flexibility. Another key feature of the DyGIN layer is its sensitivity to graph isomorphism. In power systems, this means that even if the busbar numbering changes, DyGIN can consistently represent the network as long as the overall topology remains unchanged. This property is particularly important for large-scale power systems, as it ensures the model's generalization. Through DyGIN processing, node feature representations are obtained that integrate both temporal and spatial information. These features not only capture the network state at a single moment in time but also the dynamic characteristics of the system's evolution over time. This is crucial for accurately assessing the transient power stability of power systems, as transient stability is inherently a dynamic process that requires consideration of both the instantaneous state and its temporal evolution. Step 4: Timing Graph Collapse Pooling (TGP).
[0075] For time slot t, the lth DyGIN layer gets Enter the TGP layer and adjust the pooling ratio hyperparameter r pooled Perform graph collapse processing on the current dynamic graph structure to obtain the corresponding pooled feature tensor and the adjacency matrix
[0076] The TGP layer is a novel pooling method proposed in this paper. It not only considers the topological structure of the graph, but also incorporates timing information. It is particularly suitable for processing dynamic systems such as power systems with complex spatiotemporal characteristics.
[0077] The core idea of the TGP layer is to cluster the nodes in the graph into “super nodes” while preserving the temporal information.
[0078] The specific implementation is as follows:
[0079] 1. Node feature pooling:
[0080]
[0081] in, N represents the tensor composed of the node features output by the lth layer TGP, which is also the input of the l+1th layer DyGIN network; l+1 The number of nodes after pooling in the corresponding time series graph collapse pooling layer is determined by the number of nodes in the lth layer and the pooling ratio hyperparameter, that is, N l+1 =r pooled ×N l ;W t l and represents the learnable parameter matrix.
[0082] 2. Adjacency matrix update:
[0083]
[0084] in, It represents the graph adjacency matrix after the l-th layer TGP pooling, which is also the input of the l+1-th layer DyGIN network.
[0085] In the actual implementation of TGP, a two-dimensional convolutional neural network is used based on a given pooling ratio hyperparameter r pooled The corresponding nodes are clustered together as fused supernodes, where the node dimensions are treated as different feature extraction channels in a two-dimensional convolutional neural network. This approach allows the model to adaptively learn how to optimally aggregate nodes to preserve the most important structural information. Through TGP processing, we obtain a dimensionality-reduced feature representation and a corresponding new adjacency matrix. These features contain rich spatiotemporal information while significantly reducing the data dimensionality, providing high-quality, low-dimensional input for subsequent transient power angle stability assessment.
[0086] Step 5, feature extraction iteration.
[0087] when When the number of nodes in the corresponding dynamic graph is greater than 1, repeat steps 3 to 4; otherwise, go to step 6.
[0088] At each iteration, the tensor shape of the DyGIN layer's output remains consistent with its input. This design ensures that when multiple DyGIN layers are stacked, each layer maintains a consistent data structure, facilitating subsequent processing. Simultaneously, the TGP layer gradually reduces the number of nodes until only a single node remains, representing the global characteristics of the entire system.
[0089] Step 6: Transient power angle stability assessment.
[0090] After completing all iterations, a highly abstract representation of the system characteristics is obtained. The goal of this step is to perform the final transient power angle stability assessment based on these characteristics. The specific implementation is as follows:
[0091] 1. The final feature vector X l Input fully connected layer:
[0092]
[0093] Among them, FC represents the fully connected layer, Indicates the prediction result of stability, X l The feature vector obtained for each time slot is The concatenated vectors, The function of the fully connected layer is to map high-dimensional features into a two-dimensional output space, corresponding to stable and unstable states.
[0094] 2. Apply the Softmax function to get the probability of stability and instability:
[0095] P(stable),P(unstable)=Softmax(Y)
[0096] The Softmax function converts the output of the fully connected layer into a probability distribution, ensuring that the sum of the two probabilities is 1.
[0097] 3. Make a final judgment based on probability:
[0098] If P(stable)>P(unstable), the system is considered stable; otherwise, the system is considered unstable.
[0099] This assessment process, from raw power system data to the final stability assessment results, is end-to-end, requiring no manual feature engineering. This approach automatically discovers and leverages implicit patterns in the data, capturing complex relationships that are difficult to discern manually. The model not only provides a stable / unstable judgment but also provides corresponding probabilities, providing engineers with more information for risk assessment. For example, if the model predicts a 51% probability of system instability, this indicates that the system is in a critical state and may require more cautious operation. By analyzing the weights of the fully connected layers, the contribution of different features to the final decision can be determined, improving the model's interpretability. Due to the use of highly abstract features, the final assessment process is computationally lightweight and suitable for real-time applications. This makes this method suitable for online monitoring and real-time control of power systems.
[0100] The present invention also requires the construction of a loss function for parameter learning. In order to further improve the performance of the model, especially considering the problem of sample imbalance in power system transient stability assessment (usually there are many more stable samples than unstable samples), the embodiment of the present invention uses Focal Loss as the loss function during the training process:
[0101]
[0102] Among them, y is the true label, is the model prediction value, α is the weighting factor (taken as 0.25 in this paper), and γ is the modulation factor (taken as 4 in this paper). By adjusting α, we can give higher weight to minority class samples (usually unstable samples), alleviating the impact of sample imbalance. Adjusting the parameter γ makes the model pay more attention to samples that are difficult to classify during training, improving the model's ability to recognize edge cases.
[0103] Overall, the proposed method not only handles large-scale, complex power grids but also adapts to diverse fault scenarios, providing strong support for the safe and stable operation of power systems. Its efficiency, accuracy, and interpretability make it a powerful complement to traditional methods and is expected to play a significant role in future smart grids.
[0104] Example Effect Description
[0105] In order to verify the effectiveness of the dynamic graphical model AndyGIN proposed in this paper in transient power angle stability assessment, the CEPRI-TAS-173 case and stable and unstable samples generated under the corresponding multi-fault scenario are used for experiments. The data sample composition of the training set, validation set, and test set is the same as that used by the MS-GAT model, which facilitates subsequent experimental analysis and comparison of the impact of the dynamic graphical network on the transient power angle stability assessment performance compared with the simple graphical model.
[0106] In actual use, the bus voltage U, bus angle θ, bus active load P and reactive load Q corresponding to 85 bus nodes (bus voltage above 500kV) in the main grid structure of the CEPRI-TAS-173 example are selected to construct the corresponding single sample multivariate time series input The number of multivariate time series d is 340, and the length of the single time series l is 20 sampling points.
[0107] The experimental results of all control models and the k-GAT model used in the present invention on the test set are shown in Table 1.
[0108] Table 1 Test results of different multivariate time series classification models on the CEPRI-TAS-173 example
[0109] Experimental model <![CDATA[A cc / %]]> <![CDATA[P rec / %]]> <![CDATA[R ec / %]]> <![CDATA[F1 value]]> OS-CNN 97.82 98.41 97.64 0.9802 ShapeNet 98.10 98.76 97.69 0.9822 TapNet 94.24 95.64 94.03 0.9483 1NN-ED 82.75 86.47 82.16 0.8426 1NN-DTW-I 86.59 88.33 86.24 0.8727 1NN-DTW-D 87.52 88.94 87.46 0.8819 MLSTM-FCN 85.15 87.32 84.98 0.8613 TodyNet 98.37 98.84 98.06 0.9845 MS-GAT 97.63 98.38 97.35 0.9786 AndyGIN 98.63 99.02 98.47 0.9874
[0110] The selected multivariate time series classification models are as follows: 1) OS-CNN: This model extracts time series information based on a one-dimensional convolutional neural network and combines the Goldbach conjecture to design multi-layer convolution blocks, theoretically achieving a free receptive field for sequences of arbitrary length. It is currently one of the most effective models for time series classification tasks; 2) ShapeNet. This model studies shapelet sequences for multivariate time series classification tasks and can embed shapelet candidate sequences of different lengths into a unified space for classification. 3) TapNet. This model uses LSTM and multiple groups of one-dimensional convolutions to extract low-dimensional sequential and multivariate information from time series, and uses an attention mechanism to extract high-dimensional feature information from time series. 4) 1NN-ED. This model is one of the main baseline models for multivariate time series classification tasks. Its essence is a nearest neighbor classifier using Euclidean distance. 5) 1NN-DTW-I and 1NN-DTW-D. Similar to 1NN-ED, this is a time series classification model that uses a nearest neighbor classifier. However, it calculates the similarity between unknown and known samples based on the Dynamic Time Warping (DTW) algorithm. 1NN-DTW-I uses an index to accelerate the nearest neighbor search, while 1NN-DTW-D directly performs the similarity search between unknown and nearest neighbor known samples. 6) MLSTM-FCN. This model uses LSTM and stacked convolutional layers to extract feature information of multivariate time series variables. Compression and excitation modules between convolutional layers adaptively adjust the contribution and weight of different channel features to the final classification result. 7) TodyNet. This is a multivariate time series classification model that uses a stacked TCN and GIN, and implements hierarchical pooling of graph topology information using a TGP graph collapse pooling layer.
[0111] The accuracy rate A cc It is the primary indicator for evaluating the transient power angle stability of the model, and the recall rate R ecThe higher the model is, the lower the possibility of "misjudgment stability" is, and the prediction accuracy P rec The higher the value, the lower the probability that the model will predict a stable sample as unstable. The F1 value reflects the evaluation effect of the model on the imbalanced data set. cc and recall R ec The requirements are high, that is, the model is expected to ensure the prediction accuracy while also avoiding misjudging unstable samples as stable samples to avoid power accidents.
[0112] The test results show that the dynamic graph model AndyGIN proposed in this paper for grid transient power angle stability assessment has achieved the best results compared with other multivariate time series classification models and MS-GAT models, with a prediction accuracy of A cc It reached 98.63%, which is higher than the accuracy of the static graph model MS-GAT and the dynamic graph model TodyNet that uses TCN to extract timing features. cc Improvements of 1.10% and 0.26%, respectively, were achieved. 1NN-ED, 1NN-DTW-I, and 1NN-DTW-D all use nearest neighbor classifiers that calculate sample similarity in different ways. However, due to their difficulty extracting the underlying spatiotemporal features from multivariate time series, their transient stability assessment results are poor. The OS-CNN and TapNet models, which use convolutional neural network modules to extract temporal features, are able to effectively extract temporal information from individual time series to a certain extent. In particular, the receptive field of OS-CNN effectively covers time series of any length, resulting in relatively good transient stability assessment results. The ShapeNet model outperforms the previous two due to its effective utilization of temporal information, but it does not involve the extraction of grid topology information, resulting in slightly weaker predictions than the dynamic graph models AndyGIN and TodyNet. The MS-GAT model proposed in Chapter 3 of this paper, while effectively extracting grid topology features by considering the features between subgraphs of different scales, extracts temporal features using only a small number of sampling points and a fully connected network, resulting in weaker predictions than AndyGIN. In the above models, TodyNet is a dynamic graph network model with a similar structure to AndyGIN. It can simultaneously extract temporal and spatial feature information of the power grid. However, the two have different processes for extracting temporal features. TodyNet uses TCN with convolution kernels of different sizes for extraction, while AndyGIN extracts through a multi-head attention mechanism. Compared with TCN, AndyGIN has a stronger ability to extract temporal information during power grid transient processes. Therefore, the final transient stability assessment results of TodyNet are slightly weaker than those of AndyGIN.
[0113] In order to analyze the effectiveness of the various components of the dynamic graph model AndyGIN proposed in this paper and their contribution to the transient power angle stability assessment of the power grid, a module of the complete AndyGIN is removed to form a new model. The specific models and corresponding modifications are as follows: 1) AndyGIN without Graph: The topology feature extraction module in AndyGIN is removed, and the MHA time series feature extraction module is directly used to extract features from the original multivariate time series data, and the results are input into the fully connected network for classification; 2) AndyGIN without DyGraph: The feature extraction results of the MHA module are used as node features, and a unique graph structure is generated by the self-learning graph generation module. The static GIN network is used to extract power grid topology features, and the results are pooled using a three-layer TGP graph collapse hierarchical pooling and a single-layer global pooling network, and then input into the fully connected network for classification; 3) AndyGIN without TGP: A single block AndyGIN is used, and the TGP layer is removed to directly connect to the global pooling and subsequent fully connected networks for classification. The transient stability assessment results using the above three modified models and the original AndyGIN model on the test set are shown in Table 2.
[0114] Table 2 Evaluation results of AndyGIN and its modified models on the test set
[0115]
[0116] It can be seen from the results that the prediction effect of the AndyGIN model is significantly better than the other three models that have removed a certain module. Combined with the results of AndyGIN without Graph, it can be seen that the power grid topology information extracted by the graph deep learning network can effectively improve the transient power angle stability assessment effect of the model. For AndyGIN without DyGraph, this experiment shows that by using a dynamic graph model, it is possible to capture information about the changes in the topological structure of the power grid at different stages of the transient process. At the same time, by adding TGP graph collapse hierarchical pooling, the loss of topological information output by the graph model in the graph classification task can be effectively avoided. Based on the above ablation experimental results and analysis, it is shown that each module of AndyGIN proposed in the present invention has a positive gain effect on the transient power angle stability assessment of the power grid.
[0117] In summary, the present invention constructs a graph input based on the topological structure of the power system and the grid measurement data in the time window from the steady state before the fault occurs to the moment of fault removal, uses the graph neural network deep learning model to achieve end-to-end mapping, and outputs the prediction result of the transient power angle stability of the power grid; based on the k-dimensional graph neural network (k-GNN), the basic framework of the message passing graph neural network is constructed to achieve feature aggregation and update for subgraphs of different scales of the power grid; based on the graph attention network (GAT), the aggregation function weights of neighboring nodes in the bus node feature update process are adaptively adjusted through the multi-head attention mechanism, which serves as a single-layer feature extraction network in the transient stability assessment model; based on the focal loss function, the imbalance problem of the number of positive and negative samples and the training difficulty in transient stability simulation is solved; as a data-driven transient stability assessment model, the present invention can effectively explore the potential message passing properties between high-dimensional subgraph regions in the power grid, improve the transient stability assessment effect in power systems of different scales and multiple fault scenarios, provide a feasible means for power grid transient stability assessment, and provide a feasible idea for integrating data-driven stability judgment models into power grid domain knowledge.
Claims
1. A method for evaluating the transient power angle stability of a power grid based on a spatiotemporal dynamic graph model, characterized in that: The steps include: Step 1: The multivariate time series of the power grid is trimmed and integrated into the input tensor X, where the mth multivariate time series x m =[x m1 ,x m2 ,...,x md ], m=1,2,...,M, M is the number of multivariate time series, d is the length of a single time series data, x md is the dth data in the mth multivariate time series; along the time dimension, X is divided into S time series slices of equal length X1, X2,…, X S , each time slice corresponds to a time slot, and the time slice X corresponding to time slot t t The length is d / S, t = 1, 2, ..., S; Step 2: Construct the initial dynamic graph G = {G1, G2, ..., G S }, where G t =(V t ,A t ), then V={V1,V2,…,V S } represents a node set, A={A1,A2,…,A S } represents the adjacency matrix set; for each time slot t, two learnable embedding vectors α and β of length M are generated, and the elements in the vector are completely learnable parameters. The first generation is obtained by random initialization, and the vector α is calculated. T The product of and β is the adjacency matrix A corresponding to time slot t t The initial value of Step 3: For time slot t, slice the corresponding time series X t And the adjacency matrix A corresponding to the time slot t Input into the dynamic graph isomorphic network, the feature tensor composed of all nodes output by the l-th layer dynamic graph isomorphic network Step 4: For time slot t, the feature tensor obtained by the l-th layer dynamic graph isomorphism network is Input the time series graph to collapse the pooling layer, and adjust the pooling ratio hyperparameter r pooled Perform graph collapse processing on the current dynamic graph structure to obtain the corresponding pooled feature tensor and the adjacency matrix Step 5, feature extraction iteration: When If the number of nodes in the corresponding dynamic graph is greater than 1, repeat steps 3 to 4; otherwise, go to step 6; Step 6: The feature vector obtained for each time slot The data are concatenated into a vector and input into the fully connected layer for binary classification to obtain the transient power angle stability assessment result.
2. The method for evaluating the transient power angle stability of a power grid based on a spatiotemporal dynamic graph model according to claim 1, characterized in that: In step 1, the dth data x in the mth multivariate time series md It includes the bus voltage U, bus angle θ, bus active load P, reactive load Q and grid fault type corresponding to the bus nodes of the main grid structure of the power grid. The grid fault types include: failure of safety and control device to operate, N-1, N-2, N-3, DC bipolar lockout, single-phase failure to operate due to three-phase short circuit and transient instability of power angle caused by DC restart; the transient process of the power system caused by the fault will cause the grid topology connection mode to change, but will not affect the total number of bus nodes in the power grid, but will only cause the characteristic representation of the bus node itself to change over time.
3. The method for evaluating the transient power angle stability of a power grid based on a spatiotemporal dynamic graph model according to claim 1, characterized in that: In step 2, the self-learning graph generation module is used to construct an initial adjacency matrix set, where the matrix dimension is determined by d, and the adjustable hyperparameters are topk and the total number of time slots n. Then, the graph conversion module is used to construct the association between adjacent time slot graphs to obtain the initial adjacency matrix set.
4. The method for evaluating the transient power angle stability of a power grid based on a spatiotemporal dynamic graph model according to claim 3 is characterized in that: In step 2, the self-learning graph generation module encodes the adjacency matrix using embedding based on a multi-layer perceptron (MLP), and assigns two parameters to each graph node, which respectively represent all the starting nodes and target nodes of the node.
5. The method for evaluating the transient power angle stability of a power grid based on a spatiotemporal dynamic graph model according to claim 1, characterized in that: In step 2, the two learnable embedding vectors α and β are expressed as α = [α t,1 ,α t,2 ,...,α t,M ] and β=[β t,1 ,β t,2 ,...,β t,M ], adjacency matrix A t The initial value of The implementation process is as follows: Among them, argtopk() is used to return A obtained by multiplying α and β. t The indices idx and idy corresponding to the first k largest matrix elements in A; x and y represent the matrix A. t The row and column numbers in the dynamic graph G for each time slot t , when t=1, the dynamic graph node set is described as V1=(v 1,1 ,v 1,2 ,...,v 1,N ); When t>1, the dynamic graph node set is represented by V t =(v t,1 ,v t,2 ,...,v t,N ,v t-1,1 ,v t-1,2 ,...,v t-1,N ), and at the same time add a connection edge from each node in time slot t-1 to the corresponding node in time slot t, that is, e (t-1,n),(t,n) ,n=1,2,...,N, where N represents the number of nodes.
6. The method for evaluating the transient power angle stability of a power grid based on a spatiotemporal dynamic graph model according to claim 1, characterized in that: In step 3, the calculation formula of the node features output by the dynamic graph isomorphic network at the first layer is: Where: Represents the feature vector output by the dynamic graph isomorphism network of the first layer of the dynamic graph of node v in the dynamic graph of time slot t; MLP l,t represents the fully connected network to which the isomorphic network of the first layer of dynamic graph belongs in the dynamic graph corresponding to time slot t; u∈N(v,t) represents the neighbor nodes of node v in the dynamic graph of time slot t; ε is a learnable parameter used to adjust the importance of the node's own features; The node features output by the dynamic graph isomorphic network at layer l Arranged in matrix form As the input of the lth time-series graph collapse pooling layer, the formula for constructing the feature vector from the node features is as follows: N l Indicates the number of nodes corresponding to this layer.
7. The method for evaluating the transient power angle stability of a power grid based on a spatiotemporal dynamic graph model according to claim 1, characterized in that: In step 4, the calculation process of the time graph collapse pooling layer is as follows: Where: Represents the tensor composed of the node features output by the collapse pooling layer of the l-th layer of the temporal graph, Represents the graph adjacency matrix after pooling of the collapsed pooling layer of the l-th layer of the temporal graph. Both are input to the l+1-th layer of the dynamic graph isomorphism network, thereby continuously repeating steps 3 and 4; N l+1 The number of nodes after pooling in the corresponding time series graph collapse pooling layer is determined by the number of nodes in the lth layer and the pooling ratio hyperparameter, that is, N l+1 =r pooled ×N l , and represents the learnable parameter matrix.
8. The method for evaluating the transient power angle stability of a power grid based on a spatiotemporal dynamic graph model according to claim 1, characterized in that: In step 4, a two-dimensional convolutional neural network is used based on a given pooling ratio hyperparameter r pooled The corresponding nodes are clustered into clusters as fused super nodes, where the node dimensions are regarded as different feature extraction channels in a two-dimensional convolutional neural network.
9. The method for evaluating power grid transient power angle stability based on a spatiotemporal dynamic graph model according to claim 1, characterized in that: In step 6, first the final feature vector Input fully connected layer: Among them, FC represents the fully connected layer, To represent the prediction results of stability, the fully connected layer maps the high-dimensional features into a two-dimensional output space, corresponding to stable and unstable states; Then apply the Softmax function to get the probability of stability and instability: P(stable),P(unstable)=Softmax(Y) The Softmax function converts the output of the fully connected layer into a probability distribution, ensuring that the sum of the two probabilities is 1; Finally, make the final judgment based on probability: If P(stable)>P(unstable), the system is considered stable; otherwise, the system is considered unstable.
10. The method for evaluating power grid transient power angle stability based on a spatiotemporal dynamic graph model according to claim 1, characterized in that: In step 6, FocalLoss is used as the loss function during training: Among them, y is the true label, is the prediction result, α is the weight factor, and γ is the modulation factor.