Power grid voltage stability margin online prediction method based on graph structure
By constructing an attribute graph model and a spatiotemporal graph convolutional network in a graph database, and combining an event-driven mechanism and local subgraph computation, the real-time and adaptability issues of power grid voltage stability margin analysis are solved, achieving millisecond-level online prediction of power grid voltage stability margin and improving accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHEJIANG CHUANGLIN TECH CO LTD
- Filing Date
- 2026-04-03
- Publication Date
- 2026-06-26
AI Technical Summary
Existing methods for analyzing voltage stability margin in power grids are insufficient to meet the real-time requirements of online monitoring. Traditional numerical simulations are time-consuming, machine learning methods suffer from decreased prediction accuracy during topology changes, graph databases have low real-time performance in power grid topology management, and the ST-GCN model cannot detect dynamic changes.
A graph database is used to store the physical devices and connections of the power grid. An attribute graph model is constructed, and an event-driven mechanism is used to realize incremental updates of topology changes. Graph query templates are dynamically generated to obtain node feature matrices and adjacency matrices. A spatiotemporal graph convolutional network prediction model is constructed. High-order spatiotemporal features are extracted by stacking spatiotemporal convolutional blocks. Voltage stability indicators and margins are output in layers. Local subgraph calculations and parameter reloading are performed when there are local topology changes.
It achieves millisecond-level online prediction of grid voltage stability margin, meets the real-time requirements of online security analysis of power systems, improves the accuracy and adaptability of prediction, and provides intuitive decision support.
Smart Images

Figure CN121980970B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the technical field of power system data processing based on graph databases, and specifically relates to an online prediction method for grid voltage stability margin based on graph structure. Background Technology
[0002] Voltage stability is a crucial indicator for the safe and stable operation of a power system. Voltage stability margin (VSM) reflects the safe distance of the power grid from voltage collapse under its current operating conditions, and is a key basis for dispatching and operating personnel to assess the system's safety level and formulate preventative control strategies.
[0003] Traditional voltage stability margin analysis methods primarily rely on numerical simulation calculations. The Continuation Power Flow (CPF) method determines the voltage collapse point and stability margin by gradually increasing the load and solving the power flow equations, tracing the system's PV curve. However, this method has inherent drawbacks, including long computation times and difficulty in meeting the real-time requirements of online monitoring. For large-scale interconnected power grids, a single continuous power flow calculation typically takes several minutes or even tens of minutes, while the grid's operating state changes rapidly. Decisions based on offline calculation results often lag behind the actual system evolution, failing to provide effective support for real-time safety early warning.
[0004] In recent years, with the development of artificial intelligence technology, models such as Artificial Neural Networks (ANN) and Support Vector Machines (SVM) have been used to establish the mapping relationship between power grid operating characteristics and voltage stability margin. These methods utilize historical operating data for offline training, and in online applications, only forward inference is needed to quickly obtain prediction results, significantly improving computational speed. However, existing machine learning methods typically treat power grid data as independent feature vectors in Euclidean space, ignoring the crucial prior knowledge of the topological connections between power grid components. When the power grid undergoes topological changes due to faults, maintenance, or other reasons, the dimension or semantics of the model's input features change, leading to a significant decrease in prediction accuracy, or even complete failure, and weak generalization ability. Furthermore, these models are often "black box" structures, lacking interpretability in their predictions and failing to provide intuitive decision support for dispatchers.
[0005] Spatio-Temporal Graph Convolutional Networks (ST-GCNs) combine graph neural networks with temporal modeling techniques, enabling the simultaneous processing of graph-structured data and time-series data. However, existing ST-GCN implementations suffer from a disconnect with underlying data storage systems. Traditional architectures often employ relational databases (such as Oracle and MySQL) to store power grid topology and measurement data. When faced with millisecond-level topology updates and massive amounts of real-time data, the high latency of multi-table join queries and the complexity of data transformation make it difficult to support a low-latency end-to-end process from data acquisition to model inference. Furthermore, ST-GCN models typically hold fixed, predefined adjacency matrices, failing to perceive dynamic changes in the power grid topology. When the actual topology differs from the training topology, model input and structure mismatch occurs, compromising prediction reliability.
[0006] Graph databases, as a database system that natively stores and manages graph-structured data, employ a node-edge attribute graph model, enabling efficient execution of relational queries and path traversal, and are suitable for flexible management of power grid topologies. However, in existing technologies, graph databases are mainly used as "storage and query" engines, and complex graph computations (such as spectral analysis and feature extraction) still need to be performed externally, resulting in large computational loads and low real-time performance. Summary of the Invention
[0007] This invention provides an online prediction method for grid voltage stability margin based on graph structure to solve the aforementioned technical problems, specifically adopting the following technical solution:
[0008] A graph-based online prediction method for grid voltage stability margin includes the following steps:
[0009] The power grid physical devices, connection relationships and real-time measurement data are stored in the form of attribute graphs in the graph database. The power grid attribute graph model is constructed and an event-driven mechanism is established to realize incremental updates of topology changes.
[0010] Based on the parameterized graph query template, the graph database query statement is dynamically generated to obtain the node feature matrix and adjacency matrix at the prediction time and convert them into sparse tensor format.
[0011] A spatiotemporal graph convolutional network prediction model is constructed, which includes an encoder and a decoder, wherein the encoder includes multiple stacked spatiotemporal convolutional blocks;
[0012] The spatiotemporal graph convolutional network prediction model is driven by incremental updates of topology changes driven by the event-driven mechanism. The node feature matrix and the dynamic adjacency matrix are input into the spatiotemporal graph convolutional network prediction model. High-order spatiotemporal features are extracted through stacked spatiotemporal convolutional blocks. The decoder outputs node-level voltage stability index and system-level voltage stability margin in a hierarchical manner.
[0013] The prediction results and the embedding vectors of intermediate layer nodes in the model are written back to the graph database as attributes.
[0014] Furthermore, the nodes in the power grid attribute graph model represent buses, generators, and loads, and their attributes include static parameters and dynamic time-series measurements.
[0015] In the power grid attribute graph model, the edges represent transmission lines and transformers, and their attributes include impedance, admittance, and switching status.
[0016] The adjacency matrix is determined and weighted by the connection relationships of the edges.
[0017] Furthermore, the event-driven mechanism is as follows: when the power grid experiences switch changes or equipment switching, the graph database completes incremental updates under transaction protection and simultaneously triggers the data update process of the prediction model.
[0018] Furthermore, the parameterized graph query template dynamically generates query statements based on the prediction task range, time window T, and physical quantity type, and obtains the node feature matrix and the dynamic adjacency matrix through the index-free adjacency feature of the graph database.
[0019] Furthermore, the spatiotemporal convolutional block includes a spatial graph convolutional layer, a temporal convolutional layer, and a gating fusion mechanism;
[0020] The spatial graph convolution employs Chebyshev polynomial approximation or adaptive graph convolution, and the formula can be expressed as:
[0021] ,
[0022] in, It is the normalized graph Laplace matrix, Z (l) The meaning is the output of the l-th spatial convolution, k is the order of the Chebyshev polynomial, and T k It is a Chebyshev polynomial, θ k X is a learnable parameter, σ is the activation function, and X is the activation parameter. (l-1) It is the output of the previous layer;
[0023] The temporal convolutional layer uses one-dimensional convolution or gated recurrent units to capture temporal dependencies along the time dimension;
[0024] The gated fusion mechanism dynamically adjusts the spatial feature Z by calculating the fusion gate.s With time feature Z t The fusion ratio g is used to output the final feature H:
[0025] ,
[0026] ,
[0027] Where [;] indicates splicing, This is element-wise multiplication.
[0028] Furthermore, the spatial graph convolutional layer employs an adaptive adjacency matrix that integrates physical topology and adaptive learning, specifically as follows:
[0029] Using the physical topology adjacency matrix A from the graph database phy As an initial value, a learnable adaptive adjacency matrix A is introduced. adapt ;
[0030] During model training, A adapt The parameters are updated and optimized together with the other parameters of the spatiotemporal graph convolutional network prediction model, and the optimization formula is:
[0031] ,
[0032] Where α and β are learnable weight coefficients, · denotes matrix multiplication, Z is the output feature matrix of the spatial convolutional layer, and X is the input node feature matrix. Let σ be the learnable weight parameter matrix, and σ be the activation function.
[0033] Furthermore, the decoder's layered output includes:
[0034] The node layer is used to map and output the node-level voltage stability index through the fully connected layer.
[0035] The system layer is used to aggregate global features through an attention mechanism to output the system-level voltage stability margin.
[0036] The system layer introduces a multi-head attention mechanism.
[0037] Furthermore, the online prediction method for grid voltage stability margin based on graph structure also includes: when a local topology change occurs, the affected electrical influence domain is calculated through an incremental graph analysis algorithm as the minimum local subgraph, and the spatiotemporal graph convolutional network prediction model only performs model inference and parameter reloading on the minimum local subgraph; when the prediction task is only for the minimum local subgraph, the scheduling system only loads the model parameter slices of the nodes related to the minimum local subgraph for inference.
[0038] Furthermore, the calculation of the electrical influence domain adopts a method that combines fast estimation based on power flow sensitivity or impedance matrix with graph traversal. It expands outward from the change point until the electrical distance exceeds the threshold ε, forming the smallest local subgraph that needs to be recalculated this time.
[0039] Furthermore, the online prediction method for grid voltage stability margin based on graph structure also includes:
[0040] Online fine-tuning training is performed based on historical features in the graph database. When a new topology pattern is identified, the K most similar historical snapshots to the current new topology are retrieved from the graph database based on graph structure similarity metric. The node embedding vectors and voltage stability margin data corresponding to the K similar scenarios are used to fine-tune the last few layers of the spatiotemporal graph convolutional network model or the lightweight adapter network online.
[0041] Meta-learning during offline training: During the offline training phase, a meta-learning strategy is used to pre-train the model parameters to provide initial parameter points for online fine-tuning.
[0042] The advantage of this invention lies in the online prediction method for power grid voltage stability margin based on graph structures. This method combines the index-free adjacency characteristics of graph databases with the parallel computing capabilities of ST-GCN, supplemented by optimization mechanisms such as local updates and pipelined inference computation, reducing end-to-end prediction latency to the millisecond level, thus meeting stringent online security analysis requirements. It directly performs spatiotemporal convolution of ST-GCN on the dynamic structure provided by the graph database, achieving deep collaboration between feature extraction and underlying data management, thereby improving the accuracy and consistency of feature representation.
[0043] The advantage of this invention lies in the online prediction method for grid voltage stability margin based on graph structure. By adopting a hierarchical prediction architecture and attention mechanism, it can not only output the overall system margin, but also locate weak buses and analyze their impact, providing dispatchers with intuitive and reliable decision-making basis. Attached Figure Description
[0044] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0045] Figure 1 This is a schematic diagram of the online prediction method for grid voltage stability margin based on graph structure proposed in this application;
[0046] Figure 2This is a schematic diagram of the spatiotemporal graph convolutional network model structure constructed by the graph-based online prediction method for power grid voltage stability margin in this application;
[0047] Figure 3 This is a schematic diagram of the power grid attribute graph model constructed by the online prediction method for power grid voltage stability margin based on graph structure proposed in this application. Detailed Implementation
[0048] Embodiments of the present invention are described in detail below. Examples of these embodiments are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.
[0049] The accompanying drawings are merely illustrative of the invention and are not necessarily drawn to scale. Some of the block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0050] The flowchart shown in the attached diagram is merely an illustrative example and does not necessarily include all steps. For example, some steps may be broken down, while others may be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.
[0051] In a specific embodiment of the present invention, the innovability and practicality of the invention are demonstrated by describing an exemplary embodiment in detail. This embodiment, in conjunction with the system architecture and flowcharts in the accompanying drawings, clearly illustrates the various key modules of the invention and their interactions. The embodiments of the present invention aim to provide those skilled in the art with a technical solution that is easy to understand and implement, while demonstrating the advantages and effects of the present invention in practical applications.
[0052] like Figures 1 to 3 The figure shows an online prediction method for grid voltage stability margin based on graph structure according to this application, which includes the following steps:
[0053] S1: Store power grid physical devices, connection relationships and real-time measurement data in the form of attribute graphs in the graph database, construct the power grid attribute graph model, and establish an event-driven mechanism to realize incremental updates of topology changes;
[0054] S2: Based on the parameterized graph query template, dynamically generate graph database query statements, obtain the node feature matrix and adjacency matrix at the prediction time, and convert them into sparse tensor format;
[0055] S3: Construct a spatiotemporal graph convolutional network prediction model. The spatiotemporal graph convolutional network prediction model includes an encoder and a decoder. The encoder includes multiple stacked spatiotemporal convolutional blocks.
[0056] S4: The spatiotemporal graph convolutional network prediction model is driven by incremental updates of topology changes driven by an event-driven mechanism. The node feature matrix and dynamic adjacency matrix are input into the spatiotemporal graph convolutional network prediction model. High-order spatiotemporal features are extracted through stacked spatiotemporal convolutional blocks. The decoder outputs node-level voltage stability index and system-level voltage stability margin in a hierarchical manner.
[0057] S5: Write back the prediction results and the embedding vectors of intermediate layer nodes of the model as attributes to the graph database.
[0058] The above-described method steps of this invention, through the deep fusion of a graph database and a spatiotemporal graph convolutional network, achieve millisecond-level online prediction of power grid voltage stability margin, meeting the real-time requirements of online safety analysis of power systems. Specifically: the attribute graph model of the graph database uniformly stores topology and measurement data; the event-driven mechanism ensures real-time perception of topology changes, eliminating data transport overhead; parameterized query templates enable dynamic generation and format conversion of input data, improving data preparation efficiency and enhancing the voltage stability margin prediction model's adaptability to dynamic topology changes in the power grid, avoiding model failure or accuracy degradation due to topology changes; the encoder and decoder architecture of the spatiotemporal convolutional block (ST-GCN) enables efficient and deep fusion of spatiotemporal features to more accurately capture the spatiotemporal dynamic characteristics of the power system, and outputs hierarchical node-level voltage stability indicators and system-level voltage stability margins that consider both overall system and local details. Finally, the results are written back to the attributes of the corresponding nodes in the graph database, forming a feature closed loop, supporting knowledge accumulation and subsequent model evolution. Compared to the minute-level latency of traditional numerical simulation and the topology adaptability problem of traditional machine learning, this invention achieves end-to-end millisecond-level response, significantly improving the real-time performance, accuracy, and adaptability of online voltage stability monitoring.
[0059] In step S1 above, the power grid physical equipment, connection relationships, and real-time measurement data are stored in the graph database in the form of attribute graphs to construct a power grid attribute graph model. An event-driven mechanism is established to achieve incremental updates of the topology changes. The purpose is to construct the data infrastructure required for this invention. Specifically, in the graph database, power grid physical equipment is abstracted as nodes, including key components such as buses, generators, and loads. Electrical connections between devices are abstracted as edges, including transmission elements such as transmission lines and transformers. Node attributes include static parameters (such as rated voltage and capacity) and dynamic time-series measurements (such as voltage amplitude, phase angle, active power, and reactive power), while edge attributes include electrical parameters (such as impedance and admittance) and switch states. This attribute graph model uniformly stores the power grid's topology, physical parameters, and real-time operating data, achieving centralized data management and efficient relational queries. For example, the graph structure is: G = (V, E), where V is the set of nodes and E is the set of edges. (Adjacency matrix) (N is the number of nodes) is determined by the connection relationships of the edges and can be weighted (e.g., using the reciprocal of conductivity). For the prediction time t, the input to the spatiotemporal graph convolutional network prediction model is the node feature matrix. (D is the feature dimension, containing measurement data at time t and the preceding T-1 times) and the adjacency matrix A t .
[0060] In other words, the node types of the power grid attribute graph model constructed in this scheme cover the main physical entities of the power grid, namely, buses are electrical connections and voltage convergence points, generators are power generation sources, and loads are power consumption ends. Its node attribute design considers both static characteristics and dynamic operation; static parameters describe the inherent capabilities of the equipment (such as rated capacity and voltage level), while dynamic time-series measurements reflect real-time operating status (such as the time series of voltage and power). The edge types of the power grid attribute graph model constructed in this scheme cover the main transmission equipment, namely, transmission lines realize long-distance power transmission, and transformers realize voltage level transformation. Its edge attributes include electrical parameters (impedance, admittance) used to calculate electrical distance and influence weights; in the switching state, closed represents connectivity, and open represents isolation.
[0061] Furthermore, the adjacency matrix is determined by the connection relationships and weights of the edges. The weights can be based on electrical parameters such as admittance, reflecting the strength differences between different connections. This refined attribute design makes the power grid model both complete and flexible, supporting efficient graph traversal and query operations.
[0062] This approach enables a complete and timely display of the power grid's physical characteristics and operating status, supports multi-dimensional topology analysis, and provides a data foundation for the rapid and accurate extraction of spatiotemporal features through the storage of dynamic time-series measurements. Explicit modeling of topology changes, such as switch states, allows these changes to be reflected in real time, improving the model's adaptability to dynamic power grids.
[0063] As a further solution, the event-driven mechanism works as follows: when a power grid experiences a switch change or equipment switching, the graph database completes incremental updates under transaction protection, simultaneously triggering the data update process of the prediction model. This event-driven mechanism ensures that when topology changes such as switch changes or equipment switching occur in the power grid, the graph database can complete millisecond-level incremental updates under transaction protection, without rebuilding the entire model, providing a dynamic and consistent data foundation for subsequent real-time predictions. In other words, when a power grid experiences a switch change (such as line tripping or switch closing) or equipment switching, these topology change events are captured in real time. Then, the graph database completes incremental updates under transaction protection, modifying only the affected nodes and edges, rather than rebuilding the entire graph model. This ensures the consistency between the updated graph structure and the original graph structure while implementing the topology change. Simultaneously, this topology change event also triggers the data update process of the prediction model, initiating a new round of topology information queries, inference and output of voltage stability margin, and writing back the output prediction results to the attributes of the corresponding nodes. This event-driven mechanism reduces the perception latency of topology changes to the millisecond level, enabling the prediction model to respond immediately based on the latest topology. This avoids the time lag of traditional batch update modes, reduces computational and storage overhead, and achieves millisecond-level online prediction of grid voltage stability margin, meeting the real-time requirements of online security analysis of power systems.
[0064] In step S2 above, a graph database query statement is dynamically generated based on the parameterized graph query template to obtain the node feature matrix and adjacency matrix at the prediction time and convert them into sparse tensor format. The purpose is to realize the dynamic acquisition and format conversion of model input data, and improve the real-time performance of data acquisition and the efficiency of computation.
[0065] By using double buffering or a circular buffer mechanism, data preparation and model computation can be overlapped, thus hiding I / O latency.
[0066] As a further solution, the parametric graph query template dynamically generates query statements based on the prediction task scope, time window T, and physical quantity type. It then leverages the index-free adjacency feature of the graph database to obtain the node feature matrix and dynamic adjacency matrix. In other words, the parametric graph query template can automatically generate graph database query statements (such as Cypher or GQL) based on the specific requirements of the prediction task (e.g., prediction scope, time window T, and types of physical quantities of interest), efficiently retrieving the subgraph structure of nodes and their neighbors using the index-free adjacency feature of the graph database. The query results include a node feature matrix (containing measurement data from T historical time points) and a dynamic adjacency matrix (reflecting the current topological connectivity). The collaborative computing interface module of the system applying this method directly maps these results into a sparse tensor format, serving as input to the spatiotemporal graph convolutional network model. This allows for the pipelined processing of data and model computation; while the model is inferring data at time t, a background thread has already started prefetching and format conversion of the data required at time t+1 (from the graph database) in parallel. This process is entirely completed within the graph database. For certain preprocessing or feature-derived calculations, user-defined functions (UDFs) or stored procedures supported by the graph database can be used to perform these calculations locally at the data storage layer. For example, the deviation of node voltage amplitude from its rated value can be calculated as an additional feature, or the electrical distance can be calculated in real-time based on the current topology as the initial weight of edges. This reduces the amount of data transferred to the computation engine, avoids the overhead of data export and import, and achieves a seamless connection from storage to computation.
[0067] Specifically, the scope of the prediction task determines the geographical or electrical boundaries of the query (e.g., the entire network, a local area), the time window T determines the backtracking length of historical data (e.g., the last 10 sampling times), and the type of physical quantity determines the electrical quantities of interest (e.g., voltage amplitude V, phase angle θ, active power P, reactive power Q). Based on these parameters, the template dynamically generates specific graph database query statements, automatically adapting to the needs of different prediction scenarios. Utilizing the index-free adjacency feature of graph databases (i.e., directly accessing adjacent nodes via pointers without global index scanning), the subgraph structure of the target node and its highly correlated neighbors is efficiently obtained, directly serving subsequent local subgraph calculations. The query results include node feature matrices and dynamic adjacency matrices, providing a complete data foundation for model input. Thus, by dynamically generating query statements through parameterized templates, the system's flexibility and configurability are improved, adapting to diverse prediction tasks. The index-free adjacency feature accelerates subgraph retrieval, significantly reduces data preparation latency, directly outputs the sparse tensor format required by the model, eliminates intermediate conversion steps, and improves end-to-end efficiency.
[0068] In step S3 above, a spatiotemporal graph convolutional network (ST-GCN) prediction model is constructed. This model includes an encoder and a decoder. The encoder comprises multiple stacked spatiotemporal convolutional blocks, serving to build the core prediction model architecture. The ST-GCN model employs an encoder-decoder structure: the encoder consists of multiple stacked spatiotemporal convolutional blocks used to extract the spatial correlation features and temporal dynamic features of the power grid; the decoder is responsible for mapping the extracted high-order spatiotemporal features to the prediction target. This hierarchical architecture enables the model to simultaneously capture the graph structure characteristics and temporal evolution patterns of the power grid, providing a data foundation for subsequent hierarchical outputs.
[0069] In step S4 above, the spatiotemporal graph convolutional network prediction model is driven by incremental updates of topology changes driven by an event-driven mechanism. The node feature matrix and dynamic adjacency matrix are input into the spatiotemporal graph convolutional network prediction model. High-order spatiotemporal features are extracted through stacked spatiotemporal convolutional blocks. The decoder outputs node-level voltage stability index and system-level voltage stability margin in a hierarchical manner.
[0070] As a specific scheme, the decoder's layered output includes a node layer and a system layer. The node layer is used to map and output node-level voltage stability metrics through a fully connected layer, while the system layer is used to aggregate global features through an attention mechanism to output system-level voltage stability margins. The node layer output maps the final features H of each node to each node through a fully connected layer, outputting node-level voltage stability metrics. Among them, y node This is a vector representing the node-level voltage stability index. N is the number of nodes, i.e., the total number of all buses (or key equipment) in the power grid. R is a real matrix of dimension N×1, i.e., a column vector.
[0071] The above system-level output introduces a multi-head attention mechanism: ,
[0072] Each of them The query (Q), key (K), and value (V) matrix is composed of the final features h of the nodes. i It is obtained through different linear transformations. This mechanism allows the model to focus on key nodes from different subspaces (such as voltage stability domain, power angle stability domain, load distribution pattern, etc.), making the basis for system-level margin prediction more comprehensive and robust, while enhancing the interpretability of the model.
[0073] In the above scheme, the node layer maps spatiotemporal features to local voltage stability indices for each bus through a fully connected layer, achieving precise location of key nodes and providing a direct basis for preventive control. The system layer aggregates global features through an attention mechanism: first, it calculates the attention weights of each node (based on the similarity between features and learnable parameters), and then sums them to obtain a global feature vector; finally, it outputs the system-level voltage stability margin y through a fully connected layer. system The attention mechanism enables the model to identify key nodes that have a greater impact on system stability, enhancing the relevance and accuracy of global predictions. This hierarchical design ensures that the output includes both the overall situation (system-level voltage stability margin) and local details (node-level voltage stability indicators), achieving collaborative prediction of the overall system and local nodes. This improves the interpretability and practicality of the results, providing dispatchers with hierarchical decision support information.
[0074] As a further specific implementation, the spatiotemporal convolutional block includes a spatial graph convolutional layer, a temporal convolutional layer, and a gating fusion mechanism;
[0075] Spatial graph convolutional layers employ Chebyshev polynomial approximation or adaptive graph convolution:
[0076] The Chebyshev polynomial approximation algorithm can be expressed as:
[0077] ,
[0078] in, It is the normalized graph Laplace matrix, Z (l) The meaning is the output of the l-th spatial convolution, k is the order of the Chebyshev polynomial, and T k It is a Chebyshev polynomial, θ k X is a learnable parameter, σ is the activation function, and X is the activation parameter. (l-1) It is the output of the previous layer;
[0079] Adaptive graph convolution, on the other hand, learns and optimizes the adjacency matrix to capture data-driven implicit associations.
[0080] Temporal convolutional layers employ one-dimensional convolutions or gated recurrent units to capture temporal dependencies along the temporal dimension. One-dimensional convolutions slide along the time axis to extract local temporal patterns, while gated recurrent units capture long-term temporal dependencies through gating mechanisms. Multiple spatiotemporal convolutional blocks are stacked to extract deeper and more complex spatiotemporal features H. For example, using one-dimensional convolutions: , H(l) is the final output of the first spatiotemporal convolutional block. Conv1D is a one-dimensional convolution operation that operates along the time dimension on Z. (l) Perform convolutions to capture dependencies in the time series. (l) This is the output of the l-th spatial convolution layer.
[0081] The gating fusion mechanism dynamically adjusts the spatial feature Z by computationally fusion gating. s With time feature Z t The fusion ratio g is used to output the final feature H:
[0082] ,
[0083] ,
[0084] Where [;] indicates splicing, This is an element-wise multiplication. The gated fusion mechanism dynamically adjusts the fusion ratio of spatial and temporal features, calculates the spatial convolution output and temporal convolution output separately, and dynamically weights and fuses them through the gated vector g. This enables the model to adaptively focus on spatiotemporal features at different scales, improving its ability to model complex power grid dynamics.
[0085] Specifically, when an event-driven mechanism is triggered (timed events or topology changes), the spatiotemporal graph convolutional network prediction model receives the node feature matrix and dynamic adjacency matrix at the current moment as input. The encoder's spatiotemporal convolutional blocks aggregate neighbor node information through spatial graph convolution (capturing spatial correlations) and extract historical temporal patterns through temporal convolution (capturing temporal dependencies). After stacking multiple spatiotemporal convolutional blocks, a high-order spatiotemporal feature representation is obtained. The decoder outputs hierarchically based on these features: the node layer outputs the local voltage stability index of each bus, and the system layer aggregates global features through an attention mechanism to output the voltage stability margin of the entire power grid. This hierarchical design allows the prediction results to include both the overall situation and local details, improving interpretability. This scheme achieves unified modeling of the spatial correlations and temporal dependencies of the power grid through the joint design of spatial graph convolution and temporal convolution. Chebyshev multinomial or adaptive graph convolution provides flexible graph feature extraction capabilities. At the same time, the gating fusion mechanism enables the model to dynamically adjust the weights of spatiotemporal features, improving prediction accuracy.
[0086] As a further implementation scheme, the aforementioned spatial graph convolutional layer employs an adaptive adjacency matrix that integrates physical topology and adaptive learning, specifically as follows:
[0087] Using the physical topology adjacency matrix A from the graph database phy As an initial value, a learnable adaptive adjacency matrix A is introduced. adapt ;
[0088] During model training, A adapt The parameters are updated and optimized along with other parameters of the spatiotemporal graph convolutional network prediction model. The optimization formula is:
[0089] ,
[0090] Where α and β are learnable weight coefficients, · represents matrix multiplication, Z is the output feature matrix of the spatial convolutional layer, and X is the input node feature matrix. Let A be a learnable weight parameter matrix, and σ be the activation function. phy This is a physical topology adjacency matrix, representing the actual physical connections of the power grid. A adapt For the adaptive adjacency matrix, the graph structure parameters that the model can learn.
[0091] Specifically, this scheme further optimizes the adjacency matrix design of the spatial graph convolutional layer. The physical topology adjacency matrix Aphy comes from a graph database, reflecting the actual electrical connections of the power grid and providing a physically interpretable initial structure. The adaptive adjacency matrix Aadapt is a learnable parameter matrix that is optimized along with other model parameters during training. It can capture potential, non-physically connected but electrically strongly correlated dependencies between nodes (such as singular nodes), enhancing the model's ability to represent complex electrical coupling relationships. By fusing physical topology and adaptive learning, the model achieves both physical rationality and data adaptability. That is, the optimization process of the adaptive matrix is constrained by the physical topology, avoiding the learning results from completely deviating from the actual power grid, while simultaneously uncovering more effective feature associations from the data.
[0092] As a further aspect of this application, the online prediction method for grid voltage stability margin based on graph structures further includes: when a local topology change occurs, calculating the affected electrical influence domain using an incremental graph analysis algorithm, which serves as the minimum local subgraph. The spatiotemporal graph convolutional network prediction model only performs model inference and parameter reloading on the minimum local subgraph. When the prediction task is only for the minimum local subgraph, the scheduling system only loads model parameter slices of nodes related to the minimum local subgraph for inference. That is, when a local topology change event occurs (such as a single line tripping), in addition to updating edge attributes, an incremental graph analysis algorithm is immediately run to accurately calculate the electrical influence domain affected by this topology change.
[0093] Specifically, the calculation of the electrical influence domain employs a combination of fast estimation based on power flow sensitivity or impedance matrix and graph traversal. Starting from the change point, the calculation expands outwards until the electrical distance exceeds a threshold ε, forming the minimum local subgraph requiring recalculation. Based on the fast estimation of power flow sensitivity or impedance matrix, the electrical impact of the topology change on surrounding nodes is assessed. Then, combined with a graph traversal algorithm (such as breadth-first search with depth constraints), the calculation expands outwards from the change point until the electrical distance exceeds the preset threshold ε. At this point, boundary nodes are determined, accurately identifying the minimum local subgraph requiring recalculation. The spatiotemporal graph convolutional network prediction model only infers from this minimum local subgraph, rather than recalculating the entire graph. The scheduling system only loads model parameter slices related to the nodes of this local subgraph, not the complete model. This local calculation and parameter reloading method reduces the computational load from the entire network scale to the local scale, significantly reducing memory consumption and computational latency, ensuring millisecond-level response. This method balances electrophysical laws (sensitivity / impedance) and graph structure characteristics (traversal), accurately identifying affected local areas, avoiding excessive expansion of the calculation range, and ensuring that significantly affected nodes are not overlooked. In its implementation, this scheme requires the ST-GCN model to support parameter partitioning during design and training, and to organize parameters by node number or community division during model storage. During inference, the model dynamically loads the corresponding parameter blocks into memory or GPU memory based on the list of node IDs of the smallest local subgraph. This scheme significantly reduces the memory footprint and computational load of a single inference task, making it particularly suitable for edge computing scenarios or rapid local assessments of ultra-large-scale power grids.
[0094] For ultra-large-scale power grids, the entire graph is divided into several subgraphs, each assigned to a GPU computing unit or a model instance for parallel inference. In the global attention aggregation layer of the decoder, a distributed aggregation algorithm is designed to perform a secondary aggregation of the local aggregation results from each subgraph, resulting in the global VSM. Using this method, the system can stably control the end-to-end prediction latency (from event occurrence / request issuance to result availability) within milliseconds for ultra-large-scale power grids, meeting the stringent requirements of online dynamic security analysis.
[0095] The above scheme, by accurately identifying the electrical influence domain, limits the computational scope to the smallest local subgraph, avoiding the overhead of recalculating the entire graph. By only performing inference and parameter slicing on local subgraphs, it significantly reduces the memory footprint and computational load of a single inference task, making it particularly suitable for edge computing scenarios or rapid local evaluation of ultra-large-scale power grids. This enables the system to adapt to the real-time computing needs of large-scale power grids, improving scalability and real-time performance.
[0096] As a specific implementation of this solution, the online prediction method for grid voltage stability margin based on graph structure also includes:
[0097] Online fine-tuning training: Based on historical features in the graph database, when a new topological pattern is identified, the K most similar historical snapshots to the current new topology are retrieved from the graph database based on graph structure similarity metrics. Using the node embedding vectors and voltage stability margin data corresponding to these K similar scenarios, the last few layers of the spatiotemporal graph convolutional network model or the lightweight adapter network are fine-tuned online. The last few layers of the spatiotemporal graph convolutional network model refer to the decoder part near the output end of the model. The lightweight adapter network refers to a small trainable module inserted between the layers of the pre-trained model to quickly adapt to new tasks or new data distributions without changing the main parameters of the original model.
[0098] Meta-learning during offline training: During the offline training phase, a meta-learning strategy is used to pre-train the model parameters to provide initial parameter points for online fine-tuning.
[0099] Specifically, the node embedding vector E written back from the graph database t and the corresponding topology snapshot t This constitutes a continuously growing database of power grid operating status features. When the system identifies a completely new topology pattern that has not appeared in the training set, it can trigger an online learning process, i.e., an online fine-tuning process: First, based on graph structure similarity metrics (such as graph edit distance), it retrieves a snapshot of the current topology from the graph database. new The method first selects the K most similar historical snapshots. Then, using the node embedding vectors and voltage stability margin data corresponding to these K similar scenarios, it performs small-batch, rapid online fine-tuning of the last few layers of the model (or a lightweight adapter network). During the offline training phase, a meta-learning strategy (such as MAML or Reptile) is used to pre-train the model parameters, enabling the model to quickly adapt to new tasks (new topologies) and providing a better parameter starting point for online fine-tuning. In this way, similarity retrieval from the historical feature library achieves rapid adaptation to new topologies, small-batch online fine-tuning reduces the data requirements for adapting to new scenarios, and the meta-learning strategy pre-training provides a good parameter starting point for the model to quickly adapt to new topologies, shortening the fine-tuning convergence time. This method enables the system to have continuous learning and evolution capabilities, adapting to the long-term evolution of the power grid (such as the construction of new substations and the integration of new energy sources), significantly improving the robustness and accuracy of long-term deployment.
[0100] In step S5 above, the prediction results and the embedding vectors of intermediate layer nodes in the model are written back to the graph database as attributes, thus forming a closed loop of "data update - topology awareness - dynamic query - model inference - result write-back - knowledge accumulation". Specifically, the output system-level voltage stability margin y systemStoring the system-level attributes as system-level properties in the "System" node of the graph database, and outputting the node-level voltage stability index y for each node. node [i] and its corresponding embedding vector E t [i] is written back to the corresponding node in the graph database as a new dynamic attribute. In this way, the graph database not only stores the original data and topology but also accumulates the "knowledge features" calculated by the model, which can be used for historical pattern retrieval, retrospective analysis, and provide a feature library for possible online model fine-tuning. Thus, the predicted system-level voltage stability margin and node-level voltage stability indicators are written back to the corresponding node in the graph database as new dynamic attributes. Simultaneously, the node embedding vectors output by the intermediate layers of the model are also saved as attributes. This written-back data constitutes a continuously growing feature library of power grid operation status.
[0101] The system based on the above-mentioned graph-based online prediction method for grid voltage stability margin is configured as follows:
[0102] Graph Data Storage and Management Module: Used to store and manage power grid topology, parameters, and real-time / historical measurement data in the form of attribute graphs, providing an efficient graph traversal and query interface.
[0103] Spatiotemporal Graph Convolutional Network Prediction Module: Used to load and execute the trained ST-GCN model to achieve spatiotemporal feature extraction and hierarchical prediction of VSM (System-level Voltage Stability Margin).
[0104] Collaborative Computing Interface Module: Used to realize data format conversion, dynamic query and feature write-back between graph database and ST-GCN model, it is the technical link for deep integration of the two.
[0105] Real-time prediction, scheduling and assurance module: used to manage data flow, event response, computing task scheduling, and implement optimization strategies such as local computing and pipelines to ensure real-time performance.
[0106] Human-computer interaction and early warning module: used to visualize prediction results and key weak points, and to issue graded early warnings when VSM is below the threshold.
[0107] The operation flow of the system applying the graph-based online prediction method for grid voltage stability margin is as follows:
[0108] 1. Real-time measurement data streams (such as SCADA / PMU data) and topology event streams are continuously input into the system.
[0109] 2. The graph data storage and management module receives data and updates the node attributes and graph structure (such as edge switch status) in the graph database in a transactional manner.
[0110] 3. When the prediction period is reached or a topology change event is detected, the real-time prediction scheduling and assurance module triggers a prediction task.
[0111] 4. The instruction coordination calculation interface module of the real-time predictive scheduling and guarantee module queries the graph database to generate a snapshot of the current power grid, including the dynamic adjacency matrix A, based on the current timestamp t. t and node feature matrix X t .
[0112] 5. The collaborative computing interface module will integrate A t and X t Convert it to the tensor format required for the ST-GCN model and feed it into the spatiotemporal graph convolutional network prediction module.
[0113] 6. Using the ST-GCN model (A) t , X t To perform reasoning, in addition to obtaining the final predicted value y system and y node The node feature representations (i.e., embedding vectors) output by the intermediate layers of the model. (F is the embedding dimension) is also captured in forward inference, outputting the system-level voltage stability margin (VSM). t And stability indicators at each node level.
[0114] 7. The collaborative computing interface module integrates VSM. t Write the node metrics back to the corresponding nodes in the graph database, and also write back the embedded nodes of the intermediate layer of the model as new attributes to update the graph data.
[0115] 8. The human-computer interaction and early warning module retrieves the latest prediction results from the graph database, performs visualization rendering, and displays them in VSM. t An alert is triggered when the value falls below a threshold.
[0116] The entire operation process described above forms a closed loop of "data update - topology awareness - dynamic query - model reasoning - result write-back - visualization", with end-to-end latency guaranteed to be in the millisecond range through optimization mechanisms.
[0117] Based on the above scheme, this application combines the index-free adjacency characteristics of graph databases with the parallel computing capabilities of ST-GCN, supplemented by optimization mechanisms such as local updates and pipelined inference computation, reducing end-to-end prediction latency to the millisecond level, meeting the most stringent online security analysis requirements. Deeply fused spatiotemporal features utilize the ST-GCN of this application to directly perform spatiotemporal convolution on the dynamic structure provided by the graph database, achieving deep collaboration between feature extraction and underlying data management, and improving the accuracy and consistency of feature representation.
[0118] This application employs a hierarchical prediction architecture and attention mechanism, which can not only output the overall system margin, but also locate weak buses and analyze their impact, providing dispatchers with intuitive and reliable decision-making basis.
[0119] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the above embodiments do not limit the present invention in any way, and all technical solutions obtained by equivalent substitution or equivalent transformation fall within the protection scope of the present invention.
Claims
1. A method for online prediction of grid voltage stability margin based on graph structure, characterized in that, Includes the following steps: The power grid physical devices, connection relationships and real-time measurement data are stored in the form of attribute graphs in the graph database. The power grid attribute graph model is constructed and an event-driven mechanism is established to realize incremental updates of topology changes. Based on the parameterized graph query template, the graph database query statement is dynamically generated to obtain the node feature matrix and adjacency matrix at the prediction time and convert them into sparse tensor format. A spatiotemporal graph convolutional network prediction model is constructed, which includes an encoder and a decoder, wherein the encoder includes multiple stacked spatiotemporal convolutional blocks; The spatiotemporal graph convolutional network prediction model is driven by incremental updates of topology changes driven by the event-driven mechanism. The node feature matrix and the adjacency matrix are input into the spatiotemporal graph convolutional network prediction model. High-order spatiotemporal features are extracted through stacked spatiotemporal convolutional blocks. The decoder outputs node-level voltage stability index and system-level voltage stability margin in a hierarchical manner. The prediction results and the embedding vectors of intermediate layer nodes in the model are written back to the graph database as attributes. The event-driven mechanism is as follows: when the power grid experiences switch changes or equipment switching, the graph database completes incremental updates under transaction protection and simultaneously triggers the data update process of the prediction model. The decoder's layered output includes: The node layer is used to map and output the node-level voltage stability index through the fully connected layer. The system layer is used to aggregate global features through an attention mechanism to output the system-level voltage stability margin. The system layer introduces a multi-head attention mechanism.
2. The online prediction method for grid voltage stability margin based on graph structure according to claim 1, characterized in that, The nodes in the power grid attribute graph model represent buses, generators, and loads, and their attributes include static parameters and dynamic time-series measurements. In the power grid attribute graph model, the edges represent transmission lines and transformers, and their attributes include impedance, admittance, and switching status. The adjacency matrix is determined and weighted by the connection relationships of the edges.
3. The online prediction method for grid voltage stability margin based on graph structure according to claim 1, characterized in that, The parameterized graph query template dynamically generates query statements based on the prediction task range, time window T, and physical quantity type, and obtains the node feature matrix and the adjacency matrix of the nodes through the index-free adjacency feature of the graph database.
4. The online prediction method for grid voltage stability margin based on graph structure according to claim 1, characterized in that, The spatiotemporal convolutional block includes a spatial graph convolutional layer, a temporal convolutional layer, and a gated fusion mechanism; The spatial graph convolution employs Chebyshev polynomial approximation or adaptive graph convolution, and the formula can be expressed as: , in, It is the normalized graph Laplace matrix, Z (l) The meaning is the output of the l-th spatial convolution, k is the order of the Chebyshev polynomial, and T k It is a Chebyshev polynomial, θ k X is a learnable parameter, σ is the activation function, and X is the activation parameter. (l-1) It is the output of the previous layer; The temporal convolutional layer uses one-dimensional convolution or gated recurrent units to capture temporal dependencies along the time dimension; The gated fusion mechanism dynamically adjusts the spatial feature Z by calculating the fusion gate. s With time feature Z t The fusion ratio g is used to output the final feature H: , , Where [;] indicates splicing, This is element-wise multiplication.
5. The online prediction method for grid voltage stability margin based on graph structure according to claim 4, characterized in that, The spatial graph convolutional layer employs an adaptive adjacency matrix that integrates physical topology and adaptive learning, specifically: Using the physical topology adjacency matrix A from the graph database phy As an initial value, a learnable adaptive adjacency matrix A is introduced. adapt ; During model training, A adapt The parameters are updated and optimized together with the other parameters of the spatiotemporal graph convolutional network prediction model, and the optimization formula is: , Where α and β are learnable weight coefficients, · denotes matrix multiplication, Z is the output feature matrix of the spatial convolutional layer, and X is the input node feature matrix. Let σ be the learnable weight parameter matrix, and σ be the activation function.
6. The online prediction method for grid voltage stability margin based on graph structure according to claim 1, characterized in that, The online prediction method for grid voltage stability margin based on graph structure further includes: when a local topology change occurs, the affected electrical influence domain is calculated by an incremental graph analysis algorithm as the minimum local subgraph, and the spatiotemporal graph convolutional network prediction model only performs model inference and parameter reloading on the minimum local subgraph; when the prediction task is only for the minimum local subgraph, the scheduling system only loads the model parameter slices of the nodes related to the minimum local subgraph for inference.
7. The online prediction method for grid voltage stability margin based on graph structure according to claim 6, characterized in that, The calculation of the electrical influence domain adopts a method that combines fast estimation based on power flow sensitivity or impedance matrix with graph traversal. It expands outward from the change point until the electrical distance exceeds the threshold ε, forming the smallest local subgraph that needs to be recalculated.
8. The online prediction method for grid voltage stability margin based on graph structure according to claim 1, characterized in that, The graph-based online prediction method for grid voltage stability margin also includes: Online fine-tuning training is performed based on historical features in the graph database. When a new topology pattern is identified, the K most similar historical snapshots to the current new topology are retrieved from the graph database based on graph structure similarity measurement. The node embedding vectors and voltage stability margin data corresponding to the K most similar historical snapshots are used to fine-tune the last few layers of the spatiotemporal graph convolutional network model or the lightweight adapter network online. Meta-learning during offline training: During the offline training phase, a meta-learning strategy is used to pre-train the model parameters to provide initial parameter points for online fine-tuning.
Citation Information
Patent Citations
Electric power system operation state identification and prediction method, device and equipment based on multiple tasks and self-attention
CN120163056A
Smart power grid state estimation method and system based on space-time diagram convolutional network, and medium
CN120372189A