Power system transient stability evaluation method and system based on graph neural network and space-time transformation

CN123012947APending Publication Date: 2026-10-30NARI TECH CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202610905722.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-23
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0005]发明目的:本发明的目的是提供一种基于图神经网络与时空变换的电力系统暂态稳定评估方法及系统,能够深度融合多源信息、精细刻画故障动态过程,并有效挖掘电力系统中非欧几里得空间,以缓解现有模型评估精度不足与泛化能力弱的问题

Benefits of technology

[0046]有益效果:与现有技术相比,本发明具有如下显著优点:1、本发明融合节点潮流、多阶段拓扑、故障时间与位置及暂态时序轨迹等多源数据,利用图Transformer、图同构网络和双分支时空变换器分别提取全局空间、局部结构和时空动态特征,精细刻画故障前中后动态过程并挖掘非欧几里得空间结构,缓解了现有模型评估精度不足与泛化能力弱的问题;2、通过图Transformer的多头注意力机制与图同构网络的注入式邻域聚合,分别捕捉长程关联与局部结构特征,增强了对电力系统拓扑空间依赖的表征能力;3、双分支时空变换器在频域经傅里叶变换增强周期性交互,在时域利用自注意力捕捉长时序依赖,两者融合后充分提取暂态过程的时序演化规律;4、将故障起止时间和故障节点信息编码后与全局、局部、时空特征拼接,构建全局综合特征向量,提升了模型对异构信息的融合能力与不同故障场景下的泛化性能。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123012947A_ABST
    Figure CN123012947A_ABST
Patent Text Reader

Abstract

The application discloses a power system transient stability evaluation method and system based on a graph neural network and a space-time transformation, first, transient response samples are obtained by using simulation software, node power flow, multi-stage adjacency matrix, fault information and transient time sequence trajectory data are extracted, and preprocessing is completed; secondly, a graph Transformer network is constructed to capture global spatial features, a graph isomorphic network is used to extract local structural features, and a double-branch space-time transformer (including a frequency domain branch and a time domain branch) is used to mine space-time dynamic features of a transient process; then, the above features are spliced with fault time and position features, input into a multi-layer perception machine classifier, and a transient stability probability is output; and the evaluation result is obtained by comparing the transient stability probability with a threshold value; by fusing multiple source data, the application finely depicts dynamic processes before, during and after a fault and non-Euclidean space structures, and effectively improves the precision and generalization ability of transient stability evaluation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of artificial intelligence technology and power system safety and stability analysis technology, and particularly relates to a power system transient stability assessment method and system based on graph neural network and spatiotemporal transformation. Background Technology

[0002] With the accelerated construction of new power systems, the high proportion of renewable energy connected to the grid, and the large-scale integration of power electronic equipment, the dynamic characteristics of the power grid are becoming increasingly complex, and its operation is becoming more flexible and variable. Transient stability assessment, as a crucial link in ensuring the safe operation of the power grid, needs to quickly and accurately determine whether the system can maintain synchronous operation after a fault occurs, providing core support for emergency control decisions. The continuous expansion of the current power system and the deepening spatiotemporal coupling of its operating state place higher demands on the accuracy and speed of transient stability assessment, urgently requiring the development of efficient assessment methods capable of adapting to complex dynamic characteristics.

[0003] In existing technologies, traditional transient stability assessment mainly relies on time-domain simulation methods, which simulate the dynamic response of the system after a fault by solving a system of high-dimensional differential-algebraic equations through numerical integration. In recent years, data-driven methods, especially deep learning techniques, have been widely introduced into this field. For example, patent CN120724668A discloses a power system transient stability assessment method based on spatiotemporal graph convolutional networks. It first uses a hybrid feature selection method combining random forest and big mouse algorithm, and then uses a spatiotemporal graph convolutional network to simultaneously capture the temporal dynamic characteristics of the power grid topology and transient processes.

[0004] However, the existing methods still have significant shortcomings. On the one hand, they lack sufficient depth in fusing multi-source information (such as steady-state operating quantities, transient response trajectories, fault location and type) during the post-fault transient process, making it difficult to fully characterize the spatiotemporal coupling characteristics of the fault dynamic process. On the other hand, existing models often employ relatively independent modules or simplified graph convolution operations when extracting the spatial structure of the power grid topology and the temporal evolution of transient processes. This limits their ability to mine complex spatiotemporal correlations in long-distance dependencies and non-Euclidean spaces, leading to decreased evaluation accuracy and insufficient generalization ability under certain operating conditions. Summary of the Invention

[0005] Purpose of the invention: The purpose of this invention is to provide a method and system for evaluating the transient stability of power systems based on graph neural networks and spatiotemporal transformation. This method can deeply integrate multi-source information, accurately depict the dynamic process of faults, and effectively mine the non-Euclidean space in the power system, thereby alleviating the problems of insufficient evaluation accuracy and weak generalization ability of existing models.

[0006] Technical solution: The power system transient stability assessment method based on graph neural networks and spatiotemporal transformation described in this invention includes the following steps:

[0007] S1. Use simulation software to obtain raw samples of transient response of power system under different fault scenarios, extract node power flow characteristics, multi-stage topology adjacency matrix, fault node information, fault start and end time parameters and transient time series trajectory curve data from them, perform normalization preprocessing, convert the multi-stage topology adjacency matrix into edge index format, and generate corresponding time mask according to the transient time series trajectory curve data.

[0008] S2. Construct a graph Transformer network. Input the node power flow features and the multi-stage edge indices corresponding to the pre-fault, during-fault, and post-fault clearance stages into the graph Transformer network. Capture the long-range association between each stage node and its neighboring nodes through a multi-head attention mechanism. Use global average pooling to aggregate the node features of the three stages (pre-fault, during-fault, and post-fault clearance) into corresponding graph-level features. Then concatenate the graph-level features of the three stages to output a global spatial feature vector.

[0009] S3. Construct a graph isomorphic network. The node power flow features and multi-stage edge indices are synchronously input into the graph isomorphic network. The node features themselves and their neighborhood features are fused through an injection-based neighborhood aggregation strategy to update the node features at each stage. The updated node features at the three stages of pre-fault, during-fault, and post-fault clearance are aggregated into corresponding graph-level isomorphic features using global average pooling. The graph-level isomorphic features of the three stages are then concatenated to output a local structural feature vector.

[0010] S4. Construct a dual-branch spatiotemporal transformer network. Input the transient time-series trajectory curve data and time mask into the dual-branch spatiotemporal transformer network. In the frequency domain branch, the data is converted to the frequency domain through fast Fourier transform for feature interaction, and then frequency domain context features are extracted through inverse fast Fourier transform and the first Transformer encoder. In the time domain branch, long-term temporal dependencies are captured through spatial embedding and the second Transformer encoder using a self-attention mechanism. The output features of the frequency domain branch and the time domain branch are added element-wise, and then averaged in the time dimension to output a spatiotemporal dynamic feature vector.

[0011] S5. The fault start and end time parameters and fault node information are mapped into time feature vectors and fault location feature vectors respectively through a linear layer, and then concatenated with the global spatial feature vector, local structural feature vector, and spatiotemporal dynamic feature vector to construct a global comprehensive feature vector. This vector is then input into a classifier composed of a multilayer perceptron, and a transient stability probability value is output through the Sigmoid activation function. The transient stability probability value is compared with a preset threshold. If the transient stability probability value is greater than or equal to the threshold, it is determined to be transiently stable; otherwise, it is determined to be transiently unstable, and the stability evaluation result is output.

[0012] This invention lays the foundation for a refined characterization of the non-Euclidean spatial characteristics and dynamic processes of faults in power systems through multi-stage topology modeling and time mask generation in step S1. Step S2's graph Transformer utilizes a multi-head attention mechanism to capture long-range spatial relationships between nodes, while Step S3's graph isomorphic network extracts local topological features through injected neighborhood aggregation. The combination of these two approaches integrates global and local spatial information from different dimensions, effectively alleviating the problem of insufficient spatial dependency mining in complex power systems by a single model. Step S4's bi-branch spatiotemporal transformer extracts frequency domain context and long-term temporal dependencies through frequency and time domain branches, significantly enhancing the ability to capture dynamic evolution patterns during transient processes. Step S5 integrates fault time, location, and multi-source feature vectors to construct a comprehensive evaluation framework, further improving the evaluation's adaptability to changes in fault scenarios. Overall, this method can deeply integrate multi-source heterogeneous information and finely characterize the spatiotemporal dynamic processes at different stages before and after a fault, thereby effectively alleviating the shortcomings of existing models in terms of evaluation accuracy and generalization ability.

[0013] Preferably, in step S1:

[0014] Set the fault start time to a fixed time and construct fault scenarios that combine three-phase short-circuit faults at each bus node in the power system with different fault clearing times;

[0015] The node voltage amplitude, node voltage phase angle, node active power injection, and node reactive power injection under each fault scenario are extracted as node power flow features, and the corresponding topological adjacency matrices before, during, and after the fault are extracted.

[0016] Perform data format conversion, outlier handling, and z-score normalization on the original transient response samples to eliminate dimensional differences and noise interference;

[0017] The topological adjacency matrices of each stage are converted into edge index format to construct graph structure data suitable for graph neural network processing.

[0018] The preferred step S1, by setting a fixed fault start time and combining three-phase short-circuit faults with different clearing times, can systematically construct diverse fault scenarios, effectively enhancing the sample's coverage of actual transient processes. Extracting multi-dimensional power flow features such as node voltage, phase angle, and power injection, and combining them with the topological adjacency matrices of the pre-fault, mid-fault, and post-fault stages, can provide rich spatial and state information for the subsequent network. Further performing format conversion, outlier handling, and z-score normalization helps mitigate the adverse effects of dimensional differences and noise interference in the original data on model learning. Converting the topological adjacency matrices of each stage into a unified edge index format can construct graph structure data adapted to the input of a graph neural network, thus providing strong support for the model to efficiently mine non-Euclidean spatial dependencies in the power system.

[0019] Preferably, the graph Transformer network described in step S2 includes two stacked multi-head TransformerConv layers, with each TransformerConv layer followed by a LayerNorm layer and a ReLU activation function. The node power flow features and the edge indices corresponding to before, during, and after the fault are input into the graph Transformer network. The node features are mapped and interacted with the features of neighboring nodes through a multi-head attention mechanism. After obtaining graph-level features by global average pooling for each graph, the three sets of graph-level features are concatenated along the feature dimension to obtain the output features of the graph Transformer network.

[0020] The preferred step S2, by stacking two multi-head TransformerConv layers and combining LayerNorm and ReLU activation functions, can enhance the modeling depth and training stability of the graph Transformer network for long-range spatial dependencies between nodes. By inputting the edge indices and node flow features of each stage into the network, and using the multi-head attention mechanism to fully map and interact with the features of the node itself and its neighboring nodes, it helps to alleviate the problem of traditional graph networks' insufficient capture of long-distance node associations. By performing global average pooling on each stage and then concatenating the graph-level features, the network can effectively preserve the spatial semantic differences of different stages before, during, and after the fault is cleared, thereby providing a richer global spatial representation for subsequent evaluation.

[0021] Preferably, the graph isomorphic network described in step S3 includes two GINConv layers, each containing a multilayer perceptron. The node power flow features and the edge indices corresponding to the fault before, during, and after fault clearance are input into the graph isomorphic network. The node's own features and neighborhood features are fused through an injection-based neighborhood aggregation strategy. After ReLU activation of the output of each layer, global average pooling is used to obtain three sets of graph-level isomorphic features. The three sets of graph-level isomorphic features are then concatenated to obtain the output features of the graph isomorphic network.

[0022] The preferred step S3 enhances the nonlinear fitting ability of graph isomorphic networks to local topological structures by constructing two GINConv layers and introducing a multilayer perceptron within each layer. By inputting the edge indices and node power flow features of each stage into the network, and using an injection-based neighborhood aggregation strategy to deeply fuse the node's own features with the neighborhood features, it helps to alleviate the problem of insufficient discriminative power of traditional graph convolution methods when distinguishing different neighborhood structures. After ReLU activation and global average pooling, the outputs of each stage are concatenated to form graph-level isomorphic features, which can effectively preserve the local structural differences of different stages before, during, and after fault clearing, thereby providing a more refined local spatial representation for transient stability assessment.

[0023] Preferably, the frequency domain branching in step S4 includes: inputting the transient time-series trajectory curve data into the frequency domain branch, mapping it to a high-dimensional feature sequence through an embedding layer, performing a fast Fourier transform on the high-dimensional feature sequence to convert the time-domain feature sequence to the frequency domain, obtaining a complex-form frequency domain feature tensor; splitting the complex-form frequency domain feature tensor into a real part tensor and an imaginary part tensor, and concatenating them along the feature dimension; filtering and interacting the concatenated real and imaginary features through a linear filter; recombining the filtered features into a complex-form frequency domain feature tensor and performing an inverse fast Fourier transform to restore the signal to the time domain; taking the modulus of the result after the inverse transform, adding a frequency embedding vector, and extracting the frequency domain context features through a first Transformer encoder.

[0024] In the preferred step S4, the frequency domain branch maps the transient time-series trajectory into a high-dimensional feature sequence through the embedding layer and transforms it to the frequency domain using the Fast Fourier Transform. This helps to explicitly express periodic or implicit frequency patterns that are difficult to capture directly in the time domain. By splitting the real and imaginary parts and concatenating them, and then using a linear filter to achieve frequency domain feature filtering and interaction, the problem of insufficient utilization of frequency information in traditional time-domain modeling can be effectively alleviated. After recombining the complex features, performing the inverse transform and taking the modulus, and then combining the frequency embedding vector with the first Transformer encoder to extract contextual features, the model's ability to mine the dynamic changes of different frequency components during the transient process can be further enhanced.

[0025] Preferably, the temporal branch and dual-branch fusion in step S4 include: the temporal branch maps the transient temporal trajectory curve data through a spatial embedding layer and directly inputs it into an independent second Transformer encoder, using a self-attention mechanism to capture long-distance dependencies in the sequence; the frequency domain context features output by the frequency domain branch and the temporal dependency features output by the temporal branch are added element-wise; the added features are then processed sequentially through a linear layer and an inverse fast Fourier transform for feature integration; and average pooling is performed on the time dimension to obtain a fixed-length spatiotemporal dynamic feature vector.

[0026] In the preferred step S4, the temporal branch is directly input into an independent second Transformer encoder after being mapped through a spatial embedding layer. This effectively captures long-distance dependencies in transient temporal trajectories using a self-attention mechanism, alleviating the problem of information decay in traditional sequence models over long time scales. Element-wise addition of the frequency domain context features output by the frequency domain branch and the temporal dependency features output by the temporal branch helps to fuse dynamic information from two different perspectives. Furthermore, integrating features through a linear layer and inverse fast Fourier transform, and performing average pooling on the time dimension to obtain a fixed-length vector, allows the final spatiotemporal dynamic features to retain key dynamic patterns while possessing a unified dimensional expression.

[0027] Preferably, step S5 includes:

[0028] The fault start time and fault end time are concatenated and mapped to a time feature vector through a first linear layer. The one-hot encoded vector of the fault node is mapped to a fault location feature vector through a second linear layer. The time feature vector, fault location feature vector, global spatial feature vector, local structural feature vector, and spatiotemporal dynamic feature vector are concatenated along the feature dimension to obtain a global comprehensive feature vector. The global comprehensive feature vector is input into a classifier composed of a multilayer perceptron, and the transient stability probability value between 0 and 1 is output by the Sigmoid activation function. The transient stability probability value is compared with a preset threshold. If the transient stability probability value is greater than or equal to the preset threshold, it is determined to be transiently stable; otherwise, it is determined to be transiently unstable.

[0029] The preferred step S5 maps the fault start and end times to a time feature vector via a linear layer and maps the one-hot encoding of the fault node to a location feature vector. This explicitly introduces key prior information such as the fault occurrence time, duration, and spatial location, alleviating the model's insufficient sensitivity to changes in the fault scenario. By concatenating five types of features—time, location, global space, local structure, and spatiotemporal dynamics—in the feature dimension to form a comprehensive feature vector, it helps to integrate multi-source heterogeneous information to enrich the evaluation basis. Finally, the transient stability probability is output through a multilayer perceptron and Sigmoid activation, and compared with a preset threshold to obtain the judgment result, which can enhance the interpretability of the evaluation decision and its adaptability to different fault conditions.

[0030] Preferably, the method further includes model training and validation steps:

[0031] The original samples of the transient response are divided into training and validation sets. During the training phase, the Adam optimizer is used to iteratively optimize the model, and the learning rate and weight decay parameters are set. The binary cross-entropy loss function is used to calculate the error between the model's predicted output and the true label. In each iteration, the gradient is cleared, the backpropagation of the loss is calculated, and gradient clipping is applied to prevent gradient explosion, and the model parameters are updated. After each training cycle, the model performance is evaluated using the validation set, the validation accuracy is calculated, and when the validation accuracy exceeds the current best record, the current model parameters are saved as the best model.

[0032] The optimized model training and validation steps, by dividing the training and validation sets, provide independent data support for model performance evaluation and help mitigate the risk of overfitting. Employing the Adam optimizer and combining it with learning rate and weight decay parameters promotes smooth convergence during iterations. Using the binary cross-entropy loss function to calculate the error between the prediction and the true label, along with gradient pruning, helps alleviate the adverse effects of gradient explosion on training stability. Saving the optimal model parameters based on the validation accuracy after each training cycle effectively preserves the model state with better generalization ability, providing a more reliable parameter basis for subsequent evaluation.

[0033] Preferably, the method further includes a prediction and result analysis step:

[0034] Load the parameters of the best-trained model and evaluate its performance using an independent test set; compare the transient stable probability value output by the classifier with a preset threshold and convert it into a binary category; calculate the evaluation metric, which includes at least one of accuracy, precision, recall, and F1 score; plot the loss decrease curve and accuracy increase curve during training to analyze the model convergence, and plot the confusion matrix to show the model's prediction distribution on different categories.

[0035] The optimized prediction and result analysis steps, by loading the best model parameters and evaluating them on an independent test set, help to objectively measure the model's generalization performance in unknown scenarios. Comparing the transient stable probability value with a preset threshold to a binary category, combined with multi-dimensional indicators such as accuracy, precision, recall, and F1 score, can more comprehensively reflect the model's predictive ability across categories. Plotting loss decrease curves and accuracy increase curves facilitates intuitive analysis of the convergence trend during model training, while the confusion matrix displays the category distribution of the prediction results, helping to identify the model's discrimination tendency on stable and unstable samples, providing a reference for further optimization.

[0036] Secondly, the power system transient stability assessment system based on graph neural networks and spatiotemporal transformation described in this invention includes:

[0037] The data preprocessing and graph structure conversion module is used to obtain the original samples of transient response of the power system under different fault scenarios using simulation software, extract node power flow characteristics, multi-stage topology adjacency matrix, fault node information, fault start and end time parameters and transient time series trajectory curve data from them, perform normalization preprocessing, convert the multi-stage topology adjacency matrix into edge index format, and generate the corresponding time mask according to the transient time series trajectory curve data.

[0038] The graph Transformer network module is used to input the node power flow features and the multi-stage edge indices corresponding to the pre-fault, during-fault, and post-fault clearance stages into the graph Transformer network. The multi-head attention mechanism is used to capture the long-range association between each stage node and its neighboring nodes. The global average pooling operation is used to aggregate the node features of the three stages of pre-fault, during-fault, and post-fault clearance stages into corresponding graph-level features. The graph-level features of the three stages are then concatenated to output a global spatial feature vector.

[0039] The graph isomorphic network module is used to synchronously input the node power flow features and multi-stage edge indices into the graph isomorphic network. It integrates the node's own features and neighborhood features through an injection-type neighborhood aggregation strategy to update the node features at each stage. It uses global average pooling to aggregate the updated node features at the three stages of pre-fault, during-fault, and post-fault clearance into corresponding graph-level isomorphic features. Then, it concatenates the graph-level isomorphic features of the three stages to output a local structural feature vector.

[0040] The spatiotemporal transformer network module is used to input the transient temporal trajectory curve data and time mask into the dual-branch spatiotemporal transformer network. In the frequency domain branch, the data is transformed to the frequency domain through fast Fourier transform for feature interaction, and then frequency domain context features are extracted through inverse fast Fourier transform and the first Transformer encoder. In the time domain branch, long-term temporal dependencies are captured through spatial embedding and the second Transformer encoder using a self-attention mechanism. The output features of the frequency domain branch and the time domain branch are added element-wise, and then averaged in the time dimension to output a spatiotemporal dynamic feature vector.

[0041] The feature fusion and classification module is used to map the fault start and end time parameters and fault node information into time feature vectors and fault location feature vectors respectively through a linear layer, and concatenate them with the global spatial feature vector, local structural feature vector, and spatiotemporal dynamic feature vector to construct a global comprehensive feature vector. This vector is then input into a classifier composed of a multilayer perceptron, and a transient stability probability value is output through a Sigmoid activation function. The transient stability probability value is compared with a preset threshold. If the transient stability probability value is greater than or equal to the threshold, it is determined to be transiently stable; otherwise, it is determined to be transiently unstable, and a stability evaluation result is output.

[0042] The model training and validation module is used to divide the original transient response samples into training and validation sets. During the training phase, the Adam optimizer is used to iteratively optimize the model, setting the learning rate and weight decay parameters. The binary cross-entropy loss function is used to calculate the error between the model's predicted output and the true label. In each iteration, the gradient is cleared, the backpropagation of the loss is calculated, gradient clipping is applied, and the model parameters are updated. After each training cycle, the model performance is evaluated using the validation set, and the validation accuracy is calculated. When the validation accuracy exceeds the current best record, the current model parameters are saved as the best model.

[0043] The model prediction and result analysis module is used to load the parameters of the best trained model, evaluate the model's performance using an independent test set, compare the transient stable probability value output by the classifier with a preset threshold to convert it into a binary category, calculate evaluation metrics, which include at least one of accuracy, precision, recall, and F1 score, and plot the loss decrease curve and accuracy increase curve during the training process to analyze the model's convergence, and plot the confusion matrix to show the model's prediction distribution on different categories.

[0044] Thirdly, the present invention also provides a computer device, including a memory and a processor, wherein the memory stores a computer program that can be loaded and executed by the processor to perform the power system transient stability assessment method based on graph neural networks and spatiotemporal transformation.

[0045] Fourthly, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the aforementioned power system transient stability assessment method based on graph neural networks and spatiotemporal transformation.

[0046] Beneficial Effects: Compared with existing technologies, this invention has the following significant advantages: 1. This invention integrates multi-source data such as node power flow, multi-stage topology, fault time and location, and transient time-series trajectories. It utilizes graph Transformer, graph isomorphic network, and bi-branch spatiotemporal transformer to extract global spatial, local structural, and spatiotemporal dynamic features respectively, accurately depicting the dynamic process before, during, and after a fault and mining non-Euclidean spatial structures, thus alleviating the problems of insufficient evaluation accuracy and weak generalization ability of existing models; 2. Through the multi-head attention mechanism of graph Transformer and the injection-type neighborhood aggregation of graph isomorphic network, long-range correlation and local structural features are captured respectively, enhancing the ability to represent the topological spatial dependence of power systems; 3. The bi-branch spatiotemporal transformer enhances periodic interactions in the frequency domain through Fourier transform and captures long-term temporal dependencies in the time domain using self-attention. After the two are fused, the temporal evolution law of the transient process is fully extracted; 4. After encoding the fault start and end time and fault node information, it is concatenated with global, local, and spatiotemporal features to construct a global comprehensive feature vector, improving the model's ability to fuse heterogeneous information and its generalization performance under different fault scenarios. Attached Figure Description

[0047] Figure 1 This is a schematic diagram of the overall architecture of the method of the present invention;

[0048] Figure 2 This is a schematic diagram of the method flow of the present invention. Detailed Implementation

[0049] The technical solution of the present invention will be further described below with reference to the accompanying drawings.

[0050] Traditional transient stability assessment methods mainly rely on time-domain numerical simulations based on differential-algebraic equations. While these methods offer good model adaptability and result reliability, and can describe the dynamic behavior of the system in detail, they suffer from high computational complexity and long processing times, making it difficult to meet the stringent timeliness requirements of online real-time assessment for large power grids. As the scale and complexity of power grids continue to expand, the limitations of traditional methods become increasingly apparent.

[0051] This invention provides a power system transient stability assessment method based on graph neural networks and spatiotemporal transformation. The method selects node power flow characteristics reflecting the system's steady-state operating point, multi-stage adjacency matrices reflecting the topological evolution before and after a fault (before, during, and after fault clearance), and transient time-series data reflecting the system's dynamic response as model inputs. This maximizes the acquisition of multi-dimensional information covering spatial topology, physical state, and temporal dynamics. Graph Transformer networks and Graph Isomorphic Networks (GINs) are used to jointly represent the spatial topological connectivity of the power system. Multi-head attention mechanisms are used to capture long-range feature associations between nodes, and neighborhood aggregation strategies are used to capture isomorphic structural features of local topologies. A spatiotemporal transformer architecture incorporating Fast Fourier Transform (FFT) is used to model transient data from both time and frequency domain perspectives, capturing global dependencies and high-frequency dynamic features in the time series, enhancing the model's understanding of complex nonlinear dynamic behavior of the power grid and its feature extraction capabilities. Multi-source feature fusion technology is combined to integrate global information, achieving efficient and accurate assessment of power system transient stability. Figure 1 As shown, it includes the following 7 steps:

[0052] S101: Generation and Preprocessing of Power Grid Transient Sample Data

[0053] Raw samples were generated by simulating the transient response of a power system under different fault scenarios using simulation software. Specifically, the fault start time was set to be the same (t = 0.1s), covering a combination of three-phase short-circuit faults at each bus node and five fault end times (0.2s, 0.3s, 0.4s, 0.5s, 0.6s). Node power flow information (node ​​voltage phase angles u and θ, node active and reactive power injection p and q), adjacency matrices (A0, A1, A2) before, during, and after fault clearance, fault nodes and fault start and end times, and transient time-series trajectory curves were extracted as inputs to the model. Stability evaluation labels were used as the model output. Preprocessing operations were performed on the raw data, including data format conversion, outlier handling, and z-score normalization, to ensure consistent input dimensions and eliminate noise interference and dimensional differences. The processed multi-source features are used as input. By converting the adjacency matrix into edge index format, the multi-dimensional features covering spatial topology, temporal dynamics, and fault attributes can be effectively read by the subsequent graph neural network and spatiotemporal transformer, laying the foundation for the model to comprehensively capture information related to the transient stability of the power system.

[0054] Figure 2The overall model architecture diagram of the power system transient stability assessment method based on graph neural network and spatiotemporal transformation provided in the embodiments of the present invention mainly includes a graph builder, a graph Transformer network, a graph isomorphic network (GIN), a spatiotemporal transformer, and a feature fusion and classification module, which are used to capture the global dynamic features, local isomorphic features, and oscillations and long-term dependencies in the transient time series of the power system, respectively, and finally output the system stability assessment results and assist in scheduling decisions.

[0055] S102: Construction of Graph Transformer Network

[0056] The power flow information of the power system nodes and A0, A1, and A2 are used as inputs to the model. The graph Transformer model consists of two stacked multi-head TransformerConv layers, each followed by LayerNorm and ReLU activation functions. The first TransformerConv layer uses node features... and edge_index as input, where The number of nodes in the power system. TransformerConv maps input features to multiple subspaces using a multi-head attention mechanism. The output dimension is... Where d is the number of features of the first-layer nodes, and heads is the number of attention heads. TransformerConv calculates the Query / Key / Value for each edge: , , .in , , Let be the learned weight matrix. For each node i, we have .in Let H1 be the set of neighbors of node i. Concatenating the outputs of all attention heads yields the output feature H1. After performing the above process for each of the three edge indices (A0, A1, A2), the node features of each graph are averaged using global_mean_pool (samples are distinguished by batch vectors), resulting in three features of [batch_size, H2]. Concatenating these features yields the final output feature. .

[0057] S103: Construction of Graph Isomorphic Networks

[0058] The power flow information of the power system nodes and A0, A1, and A2 are used as inputs to the model. The GIN part consists of two GINConv layers, each containing a multilayer perceptron (MLP). The GIN layer updates node features through an injection-based neighborhood aggregation strategy, as shown in the following formula: .in This represents the feature vector of node v at the k-th layer. Let v be the set of neighbors of node v. The parameters are either learnable or fixed scalars. For the three input edge indices (A0, A1, A2), features are extracted independently through two layers of the GINConv network. After each convolutional layer, the ReLU function is used for activation. Finally, global mean pooling is used to aggregate the node features corresponding to each set of adjacency matrices into a graph-level feature vector. The three sets of graph-level features are then concatenated along the feature dimension to obtain the final GIN branch output features. It can effectively capture the isomorphic characteristics of power systems under different topologies before, during, and after a fault.

[0059] S104: Construction of Space-Time Transformer Network

[0060] Transient time domain data The corresponding time mask is input to the space-time transformer network. This network is designed with parallel frequency domain and time domain branches:

[0061] Frequency Domain Branch: First, the input is mapped to a high-dimensional space through an embedding layer. Then, a Fast Fourier Transform (FFT) is performed on the feature sequence to transform the signal from the time domain to the frequency domain. In the frequency domain, the complex tensor is split into real and imaginary parts and concatenated. A linear filter is used for frequency domain feature filtering and interaction. Subsequently, it is recombinated into a complex form and subjected to an Inverse Fast Fourier Transform (IFFT). The modulus of the inverse transform result is taken and frequency embedding is added. Finally, a Transformer encoder extracts the frequency domain context features.

[0062] Temporal branch: After mapping the original input through a spatial embedding layer, it is directly input into another independent Transformer encoder, which uses a self-attention mechanism to capture long-distance dependencies in the sequence.

[0063] Branch fusion: The output features of the frequency domain branch and the time domain branch are added element-wise, and then integrated through a linear layer and IFFT transformation. Finally, average pooling is performed on the time dimension to obtain a fixed-length spatiotemporal feature vector. This allows for the simultaneous capture of high-frequency oscillation characteristics and long-term dynamic changes during the transient process of the power system.

[0064] S105: Alignment and Fusion of Multi-Source Features

[0065] ① Time characteristics: The time of fault onset and fault end time Stacking, mapped to feature vectors through linear layers. .

[0066] ② Fault location features: The one-hot encoded vector of the fault node is mapped to a feature vector through a linear layer. The features from steps 2, 3, 4, and 5 are then combined to obtain the fused features. The fused feature vector is input into the classifier. The classifier consists of a multilayer perceptron and ultimately outputs a probability value between 0 and 1, used to determine the transient stability (stable or unstable) of the power system sample.

[0067] S106: Model Training and Validation

[0068] The dataset is divided into a training set and a validation set. During the training phase, the model is iteratively optimized using the training set data.

[0069] Parameter settings: The Adam optimizer is used, with an initial learning rate of 0.001 and a weight decay of 1e-4 to prevent overfitting.

[0070] Loss calculation: The error between the model's predicted output and the true label is calculated using the binary cross-entropy loss function (BCELoss).

[0071] Backpropagation and update: In each iteration, the gradients are cleared, the backpropagation of the loss is calculated, gradient clipping is applied to prevent gradient explosion, and finally the model parameters are updated.

[0072] Model Validation and Optimization: After each training epoch, the model performance is evaluated using the validation set, and the validation accuracy is calculated. When the validation accuracy exceeds the current best record, the current model parameters are saved as the optimal model for subsequent testing.

[0073] S107: Model Performance Evaluation

[0074] Load the pre-trained optimal model parameters and evaluate the model's performance using an independent test set.

[0075] Metrics calculation: Input the test set into the model, and convert the output probabilities into binary categories (stable / unstable) with a threshold of 0.5. Calculate accuracy, precision, recall, and F1 score.

[0076] Visual analysis: Plot the loss decrease curve and accuracy increase curve during the training process to analyze the model's convergence; calculate and plot the confusion matrix to visually display the model's prediction distribution across different categories.

[0077] Based on a similar inventive concept, this invention also provides a power system transient stability assessment system based on graph neural networks and spatiotemporal transformation, corresponding to the aforementioned power system transient stability assessment method based on graph neural networks and spatiotemporal transformation, comprising:

[0078] The data preprocessing and graph structure conversion module is used to obtain the original samples of transient response of the power system under different fault scenarios using simulation software, extract node power flow characteristics, multi-stage topology adjacency matrix, fault node information, fault start and end time parameters and transient time series trajectory curve data from them, perform normalization preprocessing, convert the multi-stage topology adjacency matrix into edge index format, and generate the corresponding time mask according to the transient time series trajectory curve data.

[0079] The graph Transformer network module is used to input the node power flow features and the multi-stage edge indices corresponding to the pre-fault, during-fault, and post-fault clearance stages into the graph Transformer network. The multi-head attention mechanism is used to capture the long-range association between each stage node and its neighboring nodes. The global average pooling operation is used to aggregate the node features of the three stages of pre-fault, during-fault, and post-fault clearance stages into corresponding graph-level features. The graph-level features of the three stages are then concatenated to output a global spatial feature vector.

[0080] The graph isomorphic network module is used to synchronously input the node power flow features and multi-stage edge indices into the graph isomorphic network. It integrates the node's own features and neighborhood features through an injection-type neighborhood aggregation strategy to update the node features at each stage. It uses global average pooling to aggregate the updated node features at the three stages of pre-fault, during-fault, and post-fault clearance into corresponding graph-level isomorphic features. Then, it concatenates the graph-level isomorphic features of the three stages to output a local structural feature vector.

[0081] The spatiotemporal transformer network module is used to input the transient temporal trajectory curve data and time mask into the dual-branch spatiotemporal transformer network. In the frequency domain branch, the data is transformed to the frequency domain through fast Fourier transform for feature interaction, and then frequency domain context features are extracted through inverse fast Fourier transform and the first Transformer encoder. In the time domain branch, long-term temporal dependencies are captured through spatial embedding and the second Transformer encoder using a self-attention mechanism. The output features of the frequency domain branch and the time domain branch are added element-wise, and then averaged in the time dimension to output a spatiotemporal dynamic feature vector.

[0082] The feature fusion and classification module is used to map the fault start and end time parameters and fault node information into time feature vectors and fault location feature vectors respectively through a linear layer, and concatenate them with the global spatial feature vector, local structural feature vector, and spatiotemporal dynamic feature vector to construct a global comprehensive feature vector. This vector is then input into a classifier composed of a multilayer perceptron, and a transient stability probability value is output through a Sigmoid activation function. The transient stability probability value is compared with a preset threshold. If the transient stability probability value is greater than or equal to the threshold, it is determined to be transiently stable; otherwise, it is determined to be transiently unstable, and a stability evaluation result is output.

[0083] The model training and validation module is used to divide the original transient response samples into training and validation sets. During the training phase, the Adam optimizer is used to iteratively optimize the model, setting the learning rate and weight decay parameters. The binary cross-entropy loss function is used to calculate the error between the model's predicted output and the true label. In each iteration, the gradient is cleared, the backpropagation of the loss is calculated, gradient clipping is applied, and the model parameters are updated. After each training cycle, the model performance is evaluated using the validation set, and the validation accuracy is calculated. When the validation accuracy exceeds the current best record, the current model parameters are saved as the best model.

[0084] The model prediction and result analysis module is used to load the parameters of the best trained model, evaluate the model's performance using an independent test set, compare the transient stable probability value output by the classifier with a preset threshold to convert it into a binary category, calculate evaluation metrics, which include at least one of accuracy, precision, recall, and F1 score, and plot the loss decrease curve and accuracy increase curve during the training process to analyze the model's convergence, and plot the confusion matrix to show the model's prediction distribution on different categories.

[0085] The present invention also discloses an electronic device.

[0086] Specifically, the electronic device can be a desktop computer, laptop computer, handheld computer, or cloud server, etc. This computer device may include, but is not limited to, a processor and memory. The processor and memory can be connected via a bus or other means. The processor can be a Central Processing Unit (CPU). The processor can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, graphics processing units (GPUs), embedded neural network processing units (NPUs) or other dedicated deep learning coprocessors, discrete gate or transistor logic devices, discrete hardware components, or combinations of the above types of chips.

[0087] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules. The processor executes various functional applications and data processing by running non-transitory software programs, instructions, and modules stored in memory. Memory may include a program storage area and a data storage area. The program storage area may store the control unit and the application program required for at least one function; the data storage area may store data created by the processor, etc. Furthermore, memory may include high-speed random access memory and non-transitory memory. In some embodiments, memory may optionally include memory remotely located relative to the processor, which can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0088] The present invention also discloses a computer-readable storage medium.

[0089] Specifically, the computer-readable storage medium is used to store a computer program, which, when executed by a processor, implements the methods described in the above method implementation.

[0090] Those skilled in the art will understand that all or part of the processes in the methods described above can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments described above. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk drive (HDD), or solid-state drive (SSD), etc.; the storage medium can also include combinations of the above types of memory.

Claims

1. A method for evaluating the transient stability of a power system based on graph neural networks and spatiotemporal transformation, characterized in that, Includes the following steps: S1. Use simulation software to obtain raw samples of transient response of power system under different fault scenarios, extract node power flow characteristics, multi-stage topology adjacency matrix, fault node information, fault start and end time parameters and transient time series trajectory curve data from them, perform normalization preprocessing, convert the multi-stage topology adjacency matrix into edge index format, and generate corresponding time mask according to the transient time series trajectory curve data. S2. Construct a graph Transformer network. Input the node power flow features and the multi-stage edge indices corresponding to the pre-fault, during-fault, and post-fault clearance stages into the graph Transformer network. Capture the long-range association between each stage node and its neighboring nodes through a multi-head attention mechanism. Use global average pooling to aggregate the node features of the three stages (pre-fault, during-fault, and post-fault clearance) into corresponding graph-level features. Then concatenate the graph-level features of the three stages to output a global spatial feature vector. S3. Construct a graph isomorphic network. The node power flow features and multi-stage edge indices are synchronously input into the graph isomorphic network. The node features themselves and their neighborhood features are fused through an injection-based neighborhood aggregation strategy to update the node features at each stage. The updated node features at the three stages of pre-fault, during-fault, and post-fault clearance are aggregated into corresponding graph-level isomorphic features using global average pooling. The graph-level isomorphic features of the three stages are then concatenated to output a local structural feature vector. S4. Construct a dual-branch spatiotemporal transformer network, inputting the transient time-series trajectory curve data and time mask into the dual-branch spatiotemporal transformer network; in the frequency domain branch, the data is converted to the frequency domain through fast Fourier transform for feature interaction, and then frequency domain context features are extracted through inverse fast Fourier transform and the first Transformer encoder; in the time domain branch, long-term temporal dependencies are captured through spatial embedding and the second Transformer encoder using a self-attention mechanism. The output features of the frequency domain branch and the time domain branch are added element-wise, and then average pooled in the time dimension to output a spatiotemporal dynamic feature vector. S5. The fault start and end time parameters and fault node information are mapped into time feature vectors and fault location feature vectors respectively through a linear layer, and then concatenated with the global spatial feature vector, local structural feature vector, and spatiotemporal dynamic feature vector to construct a global comprehensive feature vector. This vector is then input into a classifier composed of a multilayer perceptron, and a transient stability probability value is output through the Sigmoid activation function. The transient stability probability value is compared with a preset threshold. If the transient stability probability value is greater than or equal to the threshold, it is determined to be transiently stable; otherwise, it is determined to be transiently unstable, and the stability evaluation result is output.

2. The method according to claim 1, characterized in that, In step S1: Set the fault start time to a fixed time and construct fault scenarios that combine three-phase short-circuit faults at each bus node in the power system with different fault clearing times; The node voltage amplitude, node voltage phase angle, node active power injection, and node reactive power injection under each fault scenario are extracted as node power flow features, and the corresponding topological adjacency matrices before, during, and after the fault are extracted. Perform data format conversion, outlier handling, and z-score normalization on the original transient response samples to eliminate dimensional differences and noise interference; The topological adjacency matrices of each stage are converted into edge index format to construct graph structure data suitable for graph neural network processing.

3. The method according to claim 1, characterized in that, The graph Transformer network described in step S2 It includes two stacked multi-head TransformerConv layers, with each TransformerConv layer followed by a LayerNorm layer and a ReLU activation function. The node power flow features and the corresponding edge indices before, during, and after the fault are input into the graph Transformer network. The node features are mapped and interacted with the features of neighboring nodes through a multi-head attention mechanism. After obtaining graph-level features by global average pooling for each graph, the three sets of graph-level features are concatenated along the feature dimension to obtain the output features of the graph Transformer network.

4. The method according to claim 1, characterized in that, The graph isomorphic network described in step S3 includes two GINConv layers, each containing a multilayer perceptron. The node power flow features and the corresponding edge indices before, during, and after the fault are input into the graph isomorphic network. The node's own features and neighborhood features are fused through an injection-based neighborhood aggregation strategy. After ReLU activation, global average pooling is used to obtain three sets of graph-level isomorphic features. The three sets of graph-level isomorphic features are then concatenated to obtain the output features of the graph isomorphic network.

5. The method according to claim 1, characterized in that, The frequency domain branching in step S4 includes: inputting the transient time-series trajectory curve data into the frequency domain branch, mapping it into a high-dimensional feature sequence through an embedding layer, performing a fast Fourier transform on the high-dimensional feature sequence to convert the time-domain feature sequence to the frequency domain, obtaining a complex-form frequency domain feature tensor; splitting the complex-form frequency domain feature tensor into a real part tensor and an imaginary part tensor, and concatenating them along the feature dimension; filtering and interacting the concatenated real and imaginary features through a linear filter; recombinating the filtered features into a complex-form frequency domain feature tensor and performing an inverse fast Fourier transform to restore the signal to the time domain; taking the modulus of the result after the inverse transform, adding a frequency embedding vector, and extracting the frequency domain context features through a first Transformer encoder.

6. The method according to claim 1, characterized in that, The temporal branch and dual-branch fusion in step S4 include: the temporal branch maps the transient time-series trajectory curve data through a spatial embedding layer and directly inputs it into an independent second Transformer encoder, using a self-attention mechanism to capture long-distance dependencies in the sequence; the frequency domain context features output by the frequency domain branch and the temporal dependency features output by the temporal branch are added element-wise; the added features are then processed sequentially through a linear layer and an inverse fast Fourier transform for feature integration; and average pooling is performed on the time dimension to obtain a fixed-length spatiotemporal dynamic feature vector.

7. The method according to claim 1, characterized in that, Step S5 includes: The fault start time and fault end time are concatenated and mapped to a time feature vector through a first linear layer. The one-hot encoded vector of the fault node is mapped to a fault location feature vector through a second linear layer. The time feature vector, fault location feature vector, global spatial feature vector, local structural feature vector, and spatiotemporal dynamic feature vector are concatenated along the feature dimension to obtain a global comprehensive feature vector. The global comprehensive feature vector is input into a classifier composed of a multilayer perceptron, and the transient stability probability value between 0 and 1 is output by the Sigmoid activation function. The transient stability probability value is compared with a preset threshold. If the transient stability probability value is greater than or equal to the preset threshold, it is determined to be transiently stable; otherwise, it is determined to be transiently unstable.

8. The method according to claim 1, characterized in that, It also includes model training and validation steps: The original samples of the transient response are divided into a training set and a validation set; during the training phase, the Adam optimizer is used to iteratively optimize the model, and the learning rate and weight decay parameters are set. The binary cross-entropy loss function is used to calculate the error between the model's predicted output and the true label. In each iteration, the gradient is cleared, the backpropagation of the loss is calculated, and gradient clipping is applied to prevent gradient explosion, and the model parameters are updated. After each training cycle, the model performance is evaluated using the validation set, the validation accuracy is calculated, and when the validation accuracy exceeds the current best record, the current model parameters are saved as the best model.

9. The method according to claim 8, characterized in that, It also includes prediction and results analysis steps: Load the parameters of the best-trained model and evaluate its performance using an independent test set; compare the transient stable probability value output by the classifier with a preset threshold and convert it into a binary category; calculate the evaluation metric, which includes at least one of accuracy, precision, recall, and F1 score; plot the loss decrease curve and accuracy increase curve during training to analyze the model convergence, and plot the confusion matrix to show the model's prediction distribution on different categories.

10. A power system transient stability assessment system based on graph neural networks and spatiotemporal transformation, characterized in that, include: The data preprocessing and graph structure conversion module is used to obtain the original samples of transient response of the power system under different fault scenarios using simulation software, extract node power flow characteristics, multi-stage topology adjacency matrix, fault node information, fault start and end time parameters and transient time series trajectory curve data from them, perform normalization preprocessing, convert the multi-stage topology adjacency matrix into edge index format, and generate the corresponding time mask according to the transient time series trajectory curve data. The graph Transformer network module is used to input the node power flow features and the multi-stage edge indices corresponding to the pre-fault, during-fault, and post-fault clearance stages into the graph Transformer network. The multi-head attention mechanism is used to capture the long-range association between each stage node and its neighboring nodes. The global average pooling operation is used to aggregate the node features of the three stages of pre-fault, during-fault, and post-fault clearance stages into corresponding graph-level features. The graph-level features of the three stages are then concatenated to output a global spatial feature vector. The graph isomorphic network module is used to synchronously input the node power flow features and multi-stage edge indices into the graph isomorphic network. It integrates the node's own features and neighborhood features through an injection-type neighborhood aggregation strategy to update the node features at each stage. It uses global average pooling to aggregate the updated node features at the three stages of pre-fault, during-fault, and post-fault clearance into corresponding graph-level isomorphic features. Then, it concatenates the graph-level isomorphic features of the three stages to output a local structural feature vector. The spatiotemporal transformer network module is used to input the transient temporal trajectory curve data and time mask into the dual-branch spatiotemporal transformer network. In the frequency domain branch, the data is transformed to the frequency domain through fast Fourier transform for feature interaction, and then frequency domain context features are extracted through inverse fast Fourier transform and the first Transformer encoder. In the time domain branch, long-term temporal dependencies are captured through spatial embedding and the second Transformer encoder using a self-attention mechanism. The output features of the frequency domain branch and the time domain branch are added element-wise, and then averaged in the time dimension to output a spatiotemporal dynamic feature vector. The feature fusion and classification module is used to map the fault start and end time parameters and fault node information into time feature vectors and fault location feature vectors respectively through a linear layer, and concatenate them with the global spatial feature vector, local structural feature vector, and spatiotemporal dynamic feature vector to construct a global comprehensive feature vector. This vector is then input into a classifier composed of a multilayer perceptron, and a transient stability probability value is output through a Sigmoid activation function. The transient stability probability value is compared with a preset threshold. If the transient stability probability value is greater than or equal to the threshold, it is determined to be transiently stable; otherwise, it is determined to be transiently unstable, and a stability evaluation result is output. The model training and validation module is used to divide the original transient response samples into training and validation sets. During the training phase, the Adam optimizer is used to iteratively optimize the model, setting the learning rate and weight decay parameters. The binary cross-entropy loss function is used to calculate the error between the model's predicted output and the true label. In each iteration, the gradient is cleared, the backpropagation of the loss is calculated, gradient clipping is applied, and the model parameters are updated. After each training cycle, the model performance is evaluated using the validation set, and the validation accuracy is calculated. When the validation accuracy exceeds the current best record, the current model parameters are saved as the best model. The model prediction and result analysis module is used to load the parameters of the best trained model, evaluate the model's performance using an independent test set, compare the transient stable probability value output by the classifier with a preset threshold to convert it into a binary category, calculate evaluation metrics, which include at least one of accuracy, precision, recall and F1 score, and plot the loss decrease curve and accuracy increase curve during the training process to analyze the model's convergence, and plot the confusion matrix to show the model's prediction distribution on different categories.

Citation Information

Patent Citations

  • Power system transient stability assessment method based on space-time diagram convolutional network

    CN120724668A