Power grid supply and demand situation awareness method and system based on graph neural network
By using graph structuring and time dynamic pattern capture mechanisms based on graph neural networks, the problem of insufficient adaptability in the existing technology for power grid supply and demand situation perception is solved, and accurate and real-time perception and assessment of power grid supply and demand situation are achieved.
Patent Information
- Application Number
- CN202511896586.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-16
- Publication Date
- 2026-03-06
AI Technical Summary
Existing power grid supply and demand situational awareness technologies cannot adaptively adjust the convolution kernels or cyclic units with fixed parameters when dealing with complex time-varying characteristics. This results in the inability to accurately capture dynamic patterns in non-steady-state scenarios such as sudden load changes or rapid ramp-up of renewable energy output, affecting the accuracy and foresight of supply and demand situational assessment.
A graph neural network-based approach is adopted to transform power grid topology and operation data into situation map data through graph structuring and feature engineering. Spatial feature extraction is performed using graph attention networks, and a state-dependent temporal dynamic pattern capture mechanism is introduced to dynamically generate convolution kernels to adaptively adjust feature extraction parameters, thereby achieving accurate perception of power grid supply and demand status.
It enables accurate, real-time, and physically interpretable perception of the power grid supply and demand situation, improves the accuracy and foresight of supply and demand situation assessment, and can flexibly capture instantaneous evolution patterns under different operating conditions.
Smart Images

Figure CN121614836A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the intersection of power system operation analysis and artificial intelligence technology, and more specifically, to a power grid supply and demand situation perception system and method based on graph neural networks. Background Technology
[0002] With the high proportion of renewable energy integration and the increasing complexity of load characteristics, the operation of modern power grids exhibits strong randomness, rapid fluctuations, and complex spatiotemporal correlations. Real-time perception and accurate assessment of power grid supply and demand are the core foundation for ensuring the safe and stable operation of the power system and realizing intelligent dispatch. Existing power grid supply and demand perception technologies are mainly divided into two categories: simulation calculation based on physical models and data analysis based on traditional machine learning, but both have significant limitations. Although physical model simulation is theoretically rigorous, it often has extremely high computational complexity in order to ensure accuracy, making it difficult to meet the timeliness requirements of real-time online analysis of large-scale power grids. Moreover, it is highly sensitive to the accuracy of model parameters and cannot effectively handle the random uncertainty of renewable energy output. Although traditional machine learning methods improve computational speed, they often ignore the inherent topology of the power grid, treating node data as isolated feature vectors, and failing to capture the deep spatial correlations and cascading risks formed by the propagation of power flow through physical connections.
[0003] While graph neural networks offer a novel approach to processing non-Euclidean grid data, existing technologies still have limitations when dealing with complex time-varying characteristics. Specifically, current spatiotemporal graph neural networks typically use convolutional kernels or recurrent units with fixed parameters to process node feature sequences when modeling the time dimension. This static feature extraction method ignores the dynamic dependence of the grid's operating state and cannot adaptively adjust the convolutional kernel parameters or attention weights according to the current real-time state. When the grid is in non-steady-state scenarios such as drastic load fluctuations due to sudden events or rapid ramp-up of renewable energy output, fixed-pattern models struggle to capture these instantaneously different dynamic patterns, resulting in inaccurate extraction of key features and consequently affecting the accuracy and foresight of the final supply and demand situation assessment.
[0004] Therefore, an optimized power grid supply and demand situational awareness scheme based on graph neural networks is desired. Summary of the Invention
[0005] To address the aforementioned technical problems, this application is proposed. Embodiments of this application provide a power grid supply and demand situational awareness system and method based on graph neural networks.
[0006] According to one aspect of this application, a power grid supply and demand situation perception method based on graph neural networks is provided, comprising:
[0007] Acquire power grid network topology data and power grid operation data;
[0008] Graph structuring and feature engineering are performed on power grid network topology data and power grid operation data to obtain power grid status diagram structure data;
[0009] Spatial feature extraction and correlation learning are performed on the power grid status map structure data to obtain the updated node feature vector time series;
[0010] The updated node feature vector time series is subjected to time dynamic pattern capture to obtain the final comprehensive feature vector of the power grid status.
[0011] The power grid supply and demand situation is quantitatively assessed and classified based on the final comprehensive feature vector of the power grid situation to obtain the power grid supply and demand situation category.
[0012] According to another aspect of this application, a power grid supply and demand situation awareness system based on graph neural networks is provided, comprising:
[0013] The data acquisition module is used to acquire power grid network topology data and power grid operation data;
[0014] The graph structuring and feature engineering module is used to perform graph structuring and feature engineering on power grid network topology data and power grid operation data to obtain power grid status graph structure data.
[0015] The spatial feature extraction and correlation learning module is used to extract spatial features and learn correlations from the power grid status map structure data to obtain the updated node feature vector time series.
[0016] The time dynamic pattern capture module is used to capture the time dynamic pattern of the updated node feature vector time series to obtain the final comprehensive feature vector of the power grid status.
[0017] The supply and demand situation quantitative assessment and classification output module is used to perform supply and demand situation quantitative assessment and classification output on the final comprehensive feature vector of the power grid situation to obtain the power grid supply and demand situation category.
[0018] Compared with existing technologies, this method first transforms power grid topology and multi-source operational data into power grid situation map data containing prior knowledge of physical connections through graph structuring and feature engineering. Then, it uses a graph attention network to extract spatial features from the graph data, capturing the spatial dependence of power flow distribution by learning the relationships between nodes. Building on this, a state-dependent temporal dynamic pattern capture mechanism is introduced. This mechanism generates kernel attention weights based on updated node features and then dynamically assembles convolutional kernels to implement state-adaptive convolution. This dynamic mechanism enables the model to adaptively adjust feature extraction parameters according to the real-time state of the power grid, effectively capturing the non-steady-state changes in load fluctuations and renewable energy output. Finally, by fusing spatiotemporal features for quantitative evaluation and classification, it achieves accurate, real-time, and physically interpretable perception of the power grid supply and demand situation, solving the problem that traditional methods struggle to balance topology structure and dynamic adaptability. Attached Figure Description
[0019] The above and other objects, features, and advantages of this application will become more apparent from the more detailed description of the embodiments of this application in conjunction with the accompanying drawings. The drawings are provided to further illustrate the embodiments of this application and form part of the specification. They are used together with the embodiments of this application to explain this application and do not constitute a limitation thereof. In the drawings, the same reference numerals generally represent the same components or steps.
[0020] Figure 1 This is a flowchart of a power grid supply and demand situation perception method based on a graph neural network according to an embodiment of this application;
[0021] Figure 2 This is a data flow diagram illustrating a power grid supply and demand situation awareness method based on a graph neural network according to an embodiment of this application.
[0022] Figure 3 This is a flowchart illustrating a graph structuring and feature engineering method for obtaining power grid situation graph structure data based on graph neural networks, according to an embodiment of this application.
[0023] Figure 4 This is a flowchart illustrating a graph neural network-based power grid supply and demand situation perception method according to an embodiment of this application, which captures the time-series sequence of updated node feature vectors to obtain the final comprehensive feature vector of the power grid situation.
[0024] Figure 5 This is a flowchart illustrating a graph neural network-based power grid supply and demand situation awareness method according to an embodiment of this application, which involves dynamically assembling kernels and performing state-adaptive convolution on the updated node feature vector time-series sequence to obtain a state-adaptive output feature sequence.
[0025] Figure 6 This is a block diagram of a power grid supply and demand situation awareness system based on a graph neural network according to an embodiment of this application. Detailed Implementation
[0026] Hereinafter, exemplary embodiments according to this application will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this application, and not all embodiments of this application. It should be understood that this application is not limited to the exemplary embodiments described herein.
[0027] As indicated in this application and claims, unless the context clearly indicates otherwise, the words "a," "an," "an," and / or "the" are not specifically singular and may include plural forms. Generally speaking, the terms "comprising" and "including" only indicate the inclusion of explicitly identified steps and elements, which do not constitute an exclusive list, and the method or apparatus may also include other steps or elements.
[0028] While this application makes various references to certain modules of the systems according to embodiments of this application, any number of different modules can be used and run on user terminals and / or servers. The modules described are merely illustrative, and different aspects of the systems and methods may use different modules.
[0029] Flowcharts are used in this application to illustrate the operations performed by the system according to embodiments of this application. It should be understood that the preceding or following operations are not necessarily performed in exact order. Instead, various steps can be processed in reverse order or simultaneously as needed. Furthermore, other operations can be added to these processes, or one or more steps can be removed from them.
[0030] Existing power grid situational awareness methods based on graph neural networks often rely on convolutional kernels or recurrent units with fixed parameters when processing time-dimensional features, making it difficult to flexibly adjust feature extraction modes according to the real-time operating status of the power grid. This static mechanism leads to the model's inability to accurately capture instantaneous dynamic patterns when facing non-steady-state scenarios such as load surges or the ramp-up of renewable energy output, thus limiting the accuracy and foresight of supply and demand situation assessment. Therefore, this application proposes a power grid supply and demand situational awareness method based on graph neural networks. Specifically, this approach first performs graph-structured mapping on power grid network topology data and operational data, including node electrical measurements, branch power flow, and equipment parameters, to construct a situational graph structure that comprehensively reflects the physical connections and operating status of the power grid. Subsequently, a trained graph attention network is used to extract spatial features from the graph data, and the updated node feature vector time-series sequence is obtained by learning the correlation between nodes. Notably, for capturing dynamic patterns of time-series features, this application does not use traditional fixed convolutions, but instead generates kernel parameters based on state dependencies on the updated node feature vectors to obtain kernel attention weight vectors, which are then weighted and assembled into dynamic convolutional kernels. By using these dynamically generated convolutional kernels to perform state-adaptive convolution on the node feature sequences, the model can flexibly adjust the convolution parameters according to the current real-time state of the power grid, thereby effectively capturing the instantaneous evolution patterns under different operating conditions. Finally, the extracted state-adaptive output feature sequences are fused with the original sequences, and a classifier is used to quantitatively assess the supply and demand situation and output the category, thus achieving high-precision and highly adaptive power grid supply and demand situation perception.
[0031] Figure 1 This is a flowchart of a power grid supply and demand situation perception method based on a graph neural network according to an embodiment of this application. Figure 2 This is a data flow diagram illustrating a power grid supply and demand situational awareness method based on a graph neural network according to an embodiment of this application. Figure 1 and Figure 2 As shown, a power grid supply and demand situation perception method based on graph neural networks according to an embodiment of this application includes the following steps: S100, acquiring power grid network topology data and power grid operation data; S200, performing graph structuring and feature engineering on the power grid network topology data and power grid operation data to obtain power grid situation graph structure data; S300, performing spatial feature extraction and correlation learning on the power grid situation graph structure data to obtain an updated node feature vector time series sequence; S400, performing time dynamic pattern capture on the updated node feature vector time series sequence to obtain the final comprehensive feature vector of the power grid situation; S500, performing supply and demand situation quantitative evaluation and classification output on the final comprehensive feature vector of the power grid situation to obtain the power grid supply and demand situation category.
[0032] Specifically, in step S100, power grid network topology data and power grid operation data are acquired. It is understood that, because the power grid constitutes a complex physical network, its supply and demand situational awareness highly depends on the physical connections between devices and real-time electrical physical quantities. Simply analyzing isolated data points lacks the necessary spatial context information. Therefore, in the technical solution of this application, power grid network topology data and power grid operation data are acquired to provide a complete digital mapping foundation for subsequent graph structure construction. This ensures that the input data simultaneously includes the static physical framework and dynamic operating status information of the power grid, laying a reliable data foundation for accurate spatial feature extraction and status assessment.
[0033] More specifically, in a concrete example of this application, data reading and aggregation are implemented by establishing a data interface with an energy management system or a data acquisition and monitoring system. First, power grid topology data is read from a static parameter database or public information model to analyze the physical connections between buses, transformers, and transmission lines, thereby determining the grid connectivity matrix. Simultaneously, time-aligned grid operation data is retrieved from a real-time database. This grid operation data specifically covers nodal electrical measurements characterizing bus voltage states, such as voltage amplitude and phase angle of each bus. Branch power flow data representing power transmission states is also acquired, including active and reactive power flows through transmission lines and transformers. Furthermore, equipment operating parameters that determine supply and demand boundary conditions need to be extracted, including real-time active and reactive power output and technical output limits of generator units, as well as active and reactive power demands of load nodes. In this way, the data mapping preparation from the physical power grid to the digital space is completed.
[0034] Specifically, in step S200, graph structuring and feature engineering are performed on the power grid network topology data and power grid operation data to obtain power grid status diagram structure data. It is understood that, because the original power grid data is usually stored in a dispersed and heterogeneous form, it lacks a unified data structure that can be directly recognized and processed by graph neural networks, and single discrete measurement values are difficult to directly reflect the complex physical coupling relationships and supply and demand constraints between power grid nodes. Therefore, in the technical solution of this application, graph structuring and feature engineering are further performed on the power grid network topology data and power grid operation data to obtain power grid status diagram structure data. This mathematically maps the physical connection relationships of the power grid to nodes and edges in a graph structure, and aggregates and transforms the dispersed electrical measurement data and equipment parameters into high-dimensional feature vectors attached to the corresponding graph elements. In this way, standardized graph data that combines prior knowledge of physical topology with high-density operational status information can be constructed, laying a structured data foundation for subsequent models to accurately capture the spatial correlation characteristics and supply and demand status evolution patterns of the power grid.
[0035] Figure 3This is a flowchart illustrating the graph structuring and feature engineering of power grid network topology data and power grid operation data to obtain power grid situation graph structure data, according to an embodiment of this application of a power grid supply and demand situation perception method based on graph neural networks. For example... Figure 3 As shown, step S200 includes: S210, obtaining the voltage amplitude and voltage phase angle of each node from the power grid operation data; S220, in response to the node being a power generation node, extracting real-time active power output, reactive power output, upper limit of technical output, lower limit of technical output, and recent output ramp-up rate from the power grid operation data, and vectorizing the real-time active power output, reactive power output, upper limit of technical output, lower limit of technical output, recent output ramp-up rate, voltage amplitude, and voltage phase angle to obtain a node feature vector; S230, in response to the node being a load node, extracting real-time active load, reactive load, and short-term load forecast values from the power grid operation data, and vectorizing the real-time active load, reactive load, and short-term load forecast values, voltage amplitude, and voltage phase angle to obtain a node feature vector.
[0036] In step S210, the voltage amplitude and voltage phase angle of each node are obtained from the power grid operation data. It is understood that voltage amplitude and voltage phase angle are the most fundamental and core state variables characterizing the operating state of the power system, directly reflecting the current power balance level and stability margin of the system. The degree of deviation in voltage amplitude reflects the reactive power balance, while the voltage phase angle difference determines the direction and magnitude of active power transmission. Therefore, in the technical solution of this application, the voltage amplitude and voltage phase angle of each node are further obtained from the power grid operation data, serving as the basic common features for constructing the node feature vector. This ensures that the feature representation of each node contains key physical quantities that reflect the power flow distribution and local voltage support capacity of the entire network, providing core input for the subsequent model learning of the electrical coupling relationships between nodes.
[0037] More specifically, in a concrete example of this application, all nodes identified after parsing the power grid network topology data are first traversed and indexed. For each indexed node, its unique identifier is used for precise matching in the preprocessed power grid operation dataset. After a successful match, the measured voltage amplitude V and measured voltage phase angle θ of that node at the current time segment are directly extracted. For nodes with missing or poor measurement data, state estimation techniques based on least squares or interpolation methods based on near-time data are used to complete V and θ; and measurement anomalies are detected using a combination of the three-σ principle and isolated forest, with outliers being removed or reconstructed according to rules to ensure the robustness and physical consistency of the input data. Subsequently, the extracted voltage amplitude V and voltage phase angle θ are normalized to eliminate dimensional differences and transformed into a numerical format suitable for neural network input, which is then stored as the basic dimension in the node's feature vector.
[0038] In step S220, in response to the node being a power generation node, real-time active power output, reactive power output, upper technical output limit, lower technical output limit, and recent output ramp-up rate are extracted from the grid operation data. These data, along with voltage amplitude and voltage phase angle, are then vectorized to obtain the node feature vector. It is understandable that, as the source of energy supply to the grid, the operating state of a power generation node depends not only on its current instantaneous output level but also on the physical regulation capabilities and safety constraints of its equipment. A simple output value cannot reflect the system's reserve capacity and regulatory flexibility, factors crucial for assessing supply-demand balance and responding to load fluctuations. Therefore, in the technical solution of this application, in response to the node being a power generation node, real-time active power output, reactive power output, upper limit of technical output, lower limit of technical output, and recent output ramp-up rate are extracted from the power grid operation data. These real-time active power output, reactive power output, upper limit of technical output, lower limit of technical output, recent output ramp-up rate, voltage amplitude, and voltage phase angle are then vectorized to obtain a node feature vector. This constructs a full-dimensional generator set feature description that includes the current state, regulation boundaries, and dynamic response characteristics. In this way, the graph neural network model can not only perceive the current supply level but also deeply understand the remaining regulation margin and ramp-up capability of each power source, thereby accurately identifying potential risks of power shortages or regulation obstruction.
[0039] More specifically, in a concrete example of this application, the type of each node in the graph structure is first determined based on the node attribute fields in the power grid network topology data. When the current node is identified as a power generation node connected to a generator set, detailed parameters of that node are retrieved from the associated operational database. Specifically, the real-time active power output representing the current actual power generation level is extracted. With no effort At the same time, obtain the upper limit of the technical output that defines the feasible domain for safe operation of the unit. With the lower limit of technical output Furthermore, by calculating the rate of change of active power output of the unit within the recently set time window, the recent output ramp-up rate, which characterizes its dynamic response flexibility and adjustment speed, is obtained. Finally, the five physical quantities reflecting the characteristics of the power source side, along with the voltage amplitude V and voltage phase angle θ, which are common state quantities of the entire network, are concatenated and standardized in a preset order to form a high-dimensional numerical vector. This vector is then assigned to the generating node as its initial feature representation in the graph structure for use by the subsequent spatial feature extraction layer.
[0040] In step S230, in response to the node being a load node, real-time active load, reactive load, and short-term load forecast values are extracted from the power grid operation data. These values, along with voltage amplitude and voltage phase angle, are then vectorized to obtain a node feature vector. It is understood that since load nodes represent the demand side of the power grid, their real-time power consumption not only determines the current system balance but also their future trends are decisive factors affecting short-term supply and demand security. Focusing solely on the current load is insufficient for forward-looking situation warnings. Therefore, in this application's technical solution, in response to the node being a load node, real-time active load, reactive load, and short-term load forecast values are extracted from the power grid operation data. These values, along with voltage amplitude and voltage phase angle, are then vectorized to obtain a node feature vector, thereby integrating the real-time demand status and future trend information into the graph data features. This endows the model with the ability to perceive load fluctuation trends, enabling it to assess the current supply and demand situation while also considering future short-term demand evolution, thus improving the predictability of situational awareness.
[0041] More specifically, in a concrete example of this application, all nodes marked as load classes in the graph structure are first identified by traversing and checking node type identifiers. For each confirmed load node, its current real-time active load is extracted from the real-time measurement database. With reactive load These two parameters directly reflect the current energy consumption intensity of the node. Simultaneously, short-term load forecasts for the node within a predetermined future time step are obtained from the load forecasting system. These forecasts contain information about the periodicity and trend of load changes. Subsequently, the extracted real-time active load, real-time reactive load, short-term load forecasts, and voltage amplitude V and voltage phase angle θ—the basic electrical attributes of the power grid nodes—are combined according to a unified feature encoding rule. By concatenating and normalizing these heterogeneous data, a multi-dimensional feature vector comprehensively reflecting current demand intensity and future growth trends is constructed and bound to the corresponding load node, serving as the input features for subsequent graph neural network supply-demand balance analysis and risk prediction.
[0042] Specifically, in step S300, spatial feature extraction and correlation learning are performed on the power grid status diagram structure data to obtain an updated node feature vector time series. It is understood that, due to the strong spatial correlation of power grid operating states, the power flow distribution and stability level of a node are strictly constrained by topological connections and the states of neighboring nodes. Simply treating node data in isolation cannot capture the chain reaction mechanism of fault propagation and power flow transfer. Therefore, in the technical solution of this application, spatial feature extraction and correlation learning are further performed on the power grid status diagram structure data to obtain an updated node feature vector time series. Specifically, the power grid status diagram structure data is input into a trained graph attention network to obtain the updated node feature vector time series. This utilizes the attention mechanism to adaptively aggregate the feature information of neighboring nodes and learn the spatial dependencies of each node in the power grid topology. This enables the model to deeply understand the spatial logic of the power grid topology and automatically focus on key nodes that have a greater impact on supply and demand balance, generating a high-order feature representation that integrates global topological information.
[0043] More specifically, in a concrete example of this application, a graph attention network-based processing logic is used to perform layer-by-layer feature transformation on the input graph structure data. First, for any node i and its neighbor node j in the power grid graph structure, the model calculates the attention coefficient between them. This coefficient quantitatively characterizes the importance of the state information of neighbor node j to the central node i. Then, to eliminate the influence of dimensionality and achieve a probabilistic representation of the weights, the attention coefficient is normalized. At this point, the normalized attention weights between node i and its neighbor node j are... Calculated using the following formula:
[0044] in, The attention weights are normalized. This indicates that the summation operation is performed on all neighboring nodes k of node i, ensuring that the sum of their weights is 1. (That is, the exponential parameter in the numerator of the formula) represents the original attention coefficient between node i and node j. for The function. After obtaining accurate weight assignments, the model performs weighted aggregation of the features of all neighboring nodes based on these weights, thereby updating the feature representation of the central node. The specific calculation formula for node feature update is as follows:
[0045] In this formula, This represents the updated feature vector of node i after fusing neighbor information. This is a nonlinear activation function used to introduce nonlinear transformation capabilities into the model, enabling it to learn more complex power grid operation modes. This involves a weighted summation of the features of all neighboring nodes j of node i, where the weights are the attention weights calculated in the previous step. In this way, the above spatial aggregation process is repeated for each time step in the time series, and finally an updated time series of node feature vectors is output, which includes both the dynamic changes of the nodes themselves and the influence of spatial topology.
[0046] Specifically, in step S400, the updated node feature vector time series is subjected to time dynamic pattern capture to obtain the final comprehensive feature vector of the power grid situation. It is understandable that existing time feature extraction methods typically employ static and weight-shared convolutional kernels. This means that regardless of whether the power grid is currently in a stable, safe equilibrium state, or in a critical state of power shortage or even near overload, the model uses the same set of fixed pattern detectors to extract features that reflect the time evolution pattern. However, the inherent saliency of time series features is highly coupled with the real-time operating state of the power grid. For example, when the system is in a safe equilibrium state, its inherent robustness makes small power fluctuations often appear as meaningless noise, and the model should focus more on smooth long-period trends. However, when the system enters a state of power shortage and the safety margin decreases, some previously negligible weak patterns (such as abnormal high-frequency oscillations in generator output or rapid nonlinear increases in load) transform from ordinary noise into strong signals indicating escalating risks.
[0047] Therefore, in the technical solution of this application, the updated node feature vector time series is further subjected to time dynamic pattern capture to obtain the final comprehensive feature vector of the power grid situation. By introducing an adaptive temporal convolution mechanism based on dynamic kernel generation, the static convolution kernel is abandoned. Instead, a dedicated convolution kernel that best fits the current state is dynamically generated based on the node feature vector input at each time step, which already contains the spatial state information of the power grid at that moment. This dynamic kernel is then used to perform temporal feature extraction. This establishes a state-adaptive feature extraction mechanism, enabling the model to flexibly adjust its sensitivity to fluctuations of different frequencies and amplitudes according to the real-time operating conditions of the power grid. This significantly enhances the model's ability to capture key state transition points, accurately identifying major trends during stable periods and keenly capturing weak fault precursors during critical periods, thereby improving the robustness and foresight of supply and demand situation perception.
[0048] Figure 4 This is a flowchart illustrating a graph neural network-based power grid supply and demand situation awareness method according to an embodiment of this application, which captures the time-series sequence of updated node feature vectors to obtain the final comprehensive feature vector of the power grid situation. Figure 4As shown, step S400 includes: S410, generating kernel parameters based on state dependence for each updated node feature vector in the updated node feature vector time series to obtain a kernel attention weight vector; S420, based on the kernel attention weight vector, performing dynamic convolution kernel assembly and state adaptive convolution on the updated node feature vector time series to obtain a state adaptive output feature sequence; S430, performing feature fusion on the state adaptive output feature sequence and the updated node feature vector time series to obtain the final comprehensive feature vector of the power grid situation.
[0049] In step S410, state-dependent kernel parameter generation is performed on each updated node feature vector in the updated node feature vector time series to obtain a kernel attention weight vector. It is understandable that, due to the significant differences in the time series fluctuation patterns exhibited by the power grid under different operating states (such as stable operation, load surges, or equipment failures), a fixed convolutional kernel cannot simultaneously and accurately extract diverse dynamic characteristics. Furthermore, existing technologies lack a mechanism to map the instantaneous state of the power grid into specific adjustment commands, causing the model to be unable to adaptively change its focus over time. Therefore, in the technical solution of this application, state-dependent kernel parameter generation is further performed on each updated node feature vector in the updated node feature vector time series to obtain a kernel attention weight vector. This implements the first step of the optimized mechanism, namely, state-dependent kernel parameter generation, establishing a mechanism that can map the instantaneous state of the power grid into specific adjustment commands, providing precise control signals for the subsequent dynamic adjustment of the convolutional kernel. For example, when the power grid is under stress, the generated weight vector will naturally assign higher weights to the basic convolutional kernels that are good at detecting spikes or rapid rise patterns. This provides a quantitative guidance signal that is closely related to the current power grid state for the on-demand customization of subsequent dynamic convolutional kernels, thereby ensuring that the model always responds to various complex operating conditions in the most suitable way.
[0050] More specifically, in a particular example of this application, the updated node feature vector at a single time step t is first received. After spatial information extraction, this vector incorporates the states of neighboring nodes, representing a condensed representation of the current power grid state. It is then input into a parameter generation network (a small feedforward neural network) to generate a kernel attention weight vector of dimension M. This process can be represented as:
[0051] in, The updated node feature vector, obtained at time step t after spatial information extraction, is a condensed representation of the power grid state at the current moment. This is the kernel attention weight vector, representing the attention weights generated at time step t. Its dimension is the same as the number of basic convolutional kernels, and it is used to guide the synthesis of dynamic kernels. Generate learnable weight matrices and bias terms for the network parameters. Normalization using the softmax function ensures the output... Each element in the matrix is non-negative and sums to 1, thus forming an effective probability distribution to guide the weighted assembly of subsequent dynamic convolutional kernels.
[0052] In step S420, based on the kernel attention weight vector, the updated node feature vector time series sequence is dynamically assembled with convolution kernels and subjected to state-adaptive convolution to obtain a state-adaptive output feature sequence. It is understood that a single fixed convolution kernel cannot accurately capture the complex mixed features from power grid operation data, which include both long-term stable trends and instantaneous high-frequency oscillations, and lacks an execution mechanism that can flexibly invoke different feature extraction capabilities based on the aforementioned generated attention weights. Therefore, in the technical solution of this application, the updated node feature vector time series sequence is further dynamically assembled with convolution kernels and subjected to state-adaptive convolution based on the kernel attention weight vector to obtain a state-adaptive output feature sequence. Specifically, this includes weighted summation of the basic convolution kernels based on the kernel attention weight vector to obtain a dynamic convolution kernel, and then performing a convolution operation on the updated node feature vector time series sequence based on this dynamic convolution kernel. In this way, it is equivalent to building a feature extractor tailored to the current power grid state in real time, so that the model can call the most suitable combination of convolution parameters to process the input data at each time step. This ensures a smooth fit to the normal operation trend while improving the sensitivity to capture abnormal fluctuations and weak fault precursors, and achieves high-precision feature perception with state adaptation.
[0053] Figure 5 This is a flowchart illustrating a graph neural network-based power grid supply and demand situational awareness method, based on an embodiment of this application, which involves dynamically assembling convolutional kernels and performing state-adaptive convolution on the updated node feature vector time-series sequence to obtain a state-adaptive output feature sequence. (See flowchart for details.) Figure 5 As shown, step S420 includes: S421, performing a weighted summation of the basic convolutional kernels based on the kernel attention weight vector to obtain a dynamic convolutional kernel; S422, performing a state-adaptive convolution on the updated node feature vector temporal sequence based on the dynamic convolutional kernel to obtain a state-adaptive output feature sequence.
[0054] In step S421, the basic convolutional kernel is weighted and summed based on the kernel attention weight vector to obtain the dynamic convolutional kernel. It is understandable that, in actual operation, the load characteristics and renewable energy output of the power grid exhibit mixed features across multiple time scales, including both long-term stable trends (such as daily load curves) and instantaneous high-frequency fluctuations (such as wind power ramp-up or short-circuit fault moments). A single static convolutional kernel often specializes in only one mode and cannot simultaneously accommodate multiple complex temporal characteristics. Therefore, in the technical solution of this application, the basic convolutional kernel is further weighted and summed based on the kernel attention weight vector to obtain the dynamic convolutional kernel, thereby utilizing the state-dependent weights generated in the previous steps. For a set consisting of M learnable basic convolutional kernels We perform weighted summation to assemble a dynamic convolutional kernel specific to the current time t in real time. This enables on-demand customization of feature extraction tools. At each time step, the model can automatically allocate the power of different basic convolutional kernels based on the current specific state of the power grid (such as stable or critical), synthesizing the most suitable convolutional kernel for the current scenario. This improves the ability to capture the time-varying characteristics of complex power grids without increasing computational depth.
[0055] More specifically, in a concrete example of this application, M basic convolutional kernels with different receptive fields or frequency response characteristics are pre-trained, each kernel representing a specific basic time pattern detector (e.g., some are good at capturing low-frequency trends, and some are good at capturing high-frequency abrupt changes). At time step t, the weight vector generated in the preceding steps, reflecting the current power grid state, is used... These M basic kernels are linearly combined. The dynamic convolution kernel assembly calculation is as follows:
[0056] in, The base convolutional kernel is the k-th of M learnable base convolutional kernels, representing a specific base temporal pattern detector. Weight vector The k-th component in the equation represents the importance of the k-th basic convolutional kernel at the current time step. The kernel is a dynamic convolution kernel, a customized kernel synthesized dynamically at time step t by weighted summation of the basic convolution kernel. This approach enables the on-the-fly construction of a feature extractor best suited to the current power grid state, preparing for subsequent state-adaptive convolution operations.
[0057] In step S422, based on a dynamic convolution kernel, a state-adaptive convolution is performed on the updated node feature vector time series sequence to obtain a state-adaptive output feature sequence. It is understandable that traditional feature extraction paradigms often use fixed filters to process all time segments, making it difficult for models to flexibly switch analysis priorities based on changes in real-time telemetry data, unlike experienced power grid dispatching experts. This makes it challenging to accurately focus on the most diagnostically valuable patterns within massive time series data. Therefore, in the technical solution of this application, a state-adaptive convolution is further performed on the updated node feature vector time series sequence based on a dynamic convolution kernel to obtain a state-adaptive output feature sequence. This utilizes the newly generated dynamic convolution kernel specific to the current time step to perform a dilated causal convolution operation on the input feature sequence within the current time step and its historical receptive field. This enables a highly targeted time series feature extraction that is completely tailored to the current power grid state. Its direct effect is the production of new features containing key dynamic information, whose signal-to-noise ratio is much higher than that of static convolution methods, effectively capturing long-term trends during stable periods or weak fault precursors during critical periods.
[0058] More specifically, in a concrete example of this application, a sliding window computation is performed on time series data using dynamically assembled convolutional kernels. This computation follows the principle of dilated causal convolution, utilizing only information from the current and past time steps, and introducing a dilation mechanism to expand the receptive field. The state-adaptive convolution operation is computed as follows:
[0059] in, To provide state-adaptive output features, the output features are calculated at time step t using a dynamic convolution kernel. K is the size of the convolution kernel, which determines the time span covered by the convolution operation. The dilation factor is used to adjust the receptive field of the convolution, enabling it to capture dependencies across different time spans. The weight parameters of the dynamic convolution kernel at position j. This represents the node feature vector corresponding to a historical moment. Through this operation, dynamically generated instructions are translated into specific mathematical transformations, achieving deep coupling between the feature extraction process and the real-time state of the power grid. In a specific scenario, assuming the current moment... The power grid is currently experiencing a period of high winds, and the output of a wind farm at a critical node is undergoing a rapid ramp-up (e.g., increasing from 20% of rated output to 80% in a short period). At this time, the dynamic convolutional kernel generated in the previous steps... It will be automatically adjusted to a form sensitive to high-frequency change rates (i.e., assigning higher weights to the basic kernel, which is good at detecting fast rising edges). This is done during state-adaptive convolution computation. At that time, the dilated causal convolution operation can accurately start from... The model extracts the characteristic signal of excessively rapid power output change rate from the sequence, while ignoring the underlying low-frequency load fluctuation noise. This allows the model to immediately identify potential risks of insufficient peak shaving or precursors of line overload, producing characteristic signals. It will contain strong warning information. Conversely, if the current moment During the nighttime off-peak load period, the power grid operates smoothly with minimal voltage and frequency fluctuations. The dynamic convolution kernel generated at this time... It tends to smooth out filter characteristics (i.e., assign higher weights to the base kernel, which excels at capturing long-term trends). During convolution operations, it automatically filters out high-frequency white noise generated by sensor measurement errors, focusing on extracting the slow decreasing trend of the load. The output features calculated in this way... It can accurately reflect the steady-state margin of the system, avoid false alarms caused by small random fluctuations, and ensure the accuracy and anti-interference capability of situational awareness.
[0060] In step S430, the state-adaptive output feature sequence and the updated node feature vector time-series sequence are fused to obtain the final comprehensive feature vector of the power grid situation. It is understandable that, due to the potential attenuation or loss of key information during the hierarchical transmission process of deep learning models, and the fact that features extracted solely by dynamic convolution may approach zero during stable power grid operation due to a lack of significant changes, the original information describing the basic operating conditions of the power grid (such as base voltage level and power flow reference value) is lost, making it difficult for the model to maintain a judgment of the overall steady state. Therefore, in the technical solution of this application, the state-adaptive output feature sequence and the updated node feature vector time-series sequence are further fused to obtain the final comprehensive feature vector of the power grid situation. This effectively fuses the newly extracted dynamic features with the original state information and finally aggregates them into a single vector. This ensures that even if the dynamic convolution module fails to extract additional significant features at certain stable moments, the original information describing the basic state of the power grid is preserved. It can also be transmitted losslessly to deep networks, avoiding the loss of crucial information. Ultimately, it produces a highly condensed and information-rich final feature vector. It includes both critical, transient dynamic events (such as fault precursors) captured through state adaptation mechanisms and retains the overall, fundamental state information of the power grid, thereby greatly enhancing the model's adaptive perception of time series features and providing the highest quality input for subsequent accurate supply and demand situation classification.
[0061] More specifically, in a particular example of this application, a residual connection operation is first performed to adaptively output features the state obtained in the previous step, which contains a specific dynamic pattern. Updated node feature vectors compared to the original input At the corresponding time step Element-wise addition is performed. This operation enhances dynamic features while preserving the original spatial topology. The sum is then processed using a nonlinear activation function (preferably ReLU) to increase the nonlinear expressive power of the features. The calculation formula for this fusion process is as follows:
[0062] in, In time step The elements in the output feature sequence after residual connection and activation function processing are then processed. The entire network consists of multiple stacked layers of this structure, resulting in the final layer's time-series output. After (assuming the time window length is) Finally, a global average pooling operation is performed to aggregate the time-series information into a single final comprehensive feature vector. The calculation formula is as follows:
[0063] in, This is the final output of the entire time-series processing module, a single vector representing global spatiotemporal dynamic information, with dimensions consistent with the single-moment feature dimension. Through this full-time average aggregation, the model can extract a fixed-length feature representation from a variable-length time-series input. This feature vector integrates the average level of the power grid's operating state and the cumulative effect of dynamic changes throughout the observation window, providing a highly condensed decision basis for subsequent classifiers to assess supply and demand. Through this mechanism, for example, when the power grid is in a state of power shortage or criticality, dynamic convolution extracts… Contains strong risk volatility signals, which, after fusion, These subtle, rapidly changing patterns that foreshadow risks will be highlighted, enabling precise detection of precursors to critical state transitions; while when the power grid is in a safe and balanced state, It may contain only minor noise; in this case, residual connectivity ensures that the model primarily focuses on the noise generated by the noise. The transmission of long-period smooth trends automatically reduces attention to meaningless noise fluctuations, thereby improving the robustness and anti-interference ability of the model.
[0064] Specifically, in step S500, the final comprehensive feature vector of the power grid situation is subjected to quantitative evaluation and classification of supply and demand to obtain the power grid supply and demand situation category. It is understandable that although the final comprehensive feature vector extracted in the preceding steps contains rich information about the spatiotemporal operation of the power grid, it is essentially a high-dimensional abstract numerical representation, lacking intuitive physical semantics for dispatching personnel and unable to be directly used to guide specific dispatching decisions. Therefore, in the technical solution of this application, the final comprehensive feature vector of the power grid situation is further subjected to quantitative evaluation and classification of supply and demand to obtain the power grid supply and demand situation category. This involves inputting the final comprehensive feature vector of the power grid situation into a Softmax classifier to obtain the power grid supply and demand situation category, thereby mapping the abstract high-dimensional feature space to a specific physical situation semantic space. In this way, clear decision conclusions such as "safe balance," "power shortage warning," or "overload risk" and their confidence probabilities can be directly output, providing power grid dispatchers with intuitive, reliable, and quantitative auxiliary decision support.
[0065] More specifically, in a concrete example of this application, a fully connected layer is first constructed as a mapping unit to synthesize the final power grid situation feature vector obtained after global average pooling. Input it. This fully connected layer uses a learnable weight matrix. and bias terms The feature vector is linearly transformed and its dimensions compressed to map its dimensions to a logistic value vector consistent with the number of predefined situation categories. This logistic value vector is then input into a Softmax activation function for probability normalization, and the predicted probability distribution of the current power grid situation belonging to each category is calculated. The formula for calculating this predicted probability is:
[0066] in, Indicates that given input data (i.e., after a series of processing) Under the conditions of ), the power grid status belongs to category . The predicted probability, The final situation category variable has a range of values. , and These are the weight matrix and bias term corresponding to the classification layer, respectively. Finally, based on the output probability distribution, the category with the highest probability value is selected as the final judgment result and output. Simultaneously, this maximum probability value is also output as the confidence level of this situation assessment. If the confidence level is lower than a preset threshold, the operator is prompted to conduct manual review, thus forming a closed-loop decision support process. For example, in the actual operation scenario during peak summer electricity consumption, if the model calculates... It is 0.85, while A value of only 0.10 indicates that the current power grid is in a "power shortage warning" state. This means that although no actual power outage or equipment tripping has occurred at the moment, potential supply-demand imbalance risks have been identified based on the spatiotemporal correlation information in the comprehensive feature vector (such as power flow approaching its limit at certain key sections and load showing a continuous upward trend). At this time, not only is the category label output, but the high-contribution area that led to this judgment (such as a receiving-end power grid area) is also highlighted, prompting the dispatcher to initiate demand-side response or prepare backup power in advance, thereby proactively intervening before the risk evolves into an actual fault.
[0067] In summary, a power grid supply and demand situation perception method based on graph neural networks according to embodiments of this application is explained. First, through graph structuring and feature engineering, the power grid topology and multi-source operational data are transformed into power grid situation map data containing prior knowledge of physical connections. Then, a graph attention network is used to extract spatial features from the graph data, capturing the spatial dependence of power flow distribution by learning the relationships between nodes. Based on this, a state-dependent temporal dynamic pattern capture mechanism is introduced, which generates kernel attention weights based on updated node features and then dynamically assembles convolutional kernels to implement state-adaptive convolution. This dynamic mechanism can adaptively adjust feature extraction parameters according to the real-time state of the power grid, improving the feature capture capability for non-steady-state scenarios. Finally, by fusing spatiotemporal features for quantitative evaluation and classification, accurate, real-time, and physically interpretable perception of the power grid supply and demand situation is achieved, solving the problem that traditional methods struggle to balance topology structure and dynamic adaptability.
[0068] Figure 6 This is a block diagram of a power grid supply and demand situational awareness system based on a graph neural network, according to an embodiment of this application. Figure 6 As shown, a power grid supply and demand situation awareness system 100 based on a graph neural network according to an embodiment of this application includes: a data acquisition module 110 for acquiring power grid network topology data and power grid operation data; a graph structuring and feature engineering module 120 for performing graph structuring and feature engineering on the power grid network topology data and power grid operation data to obtain power grid situation diagram structure data; a spatial feature extraction and correlation learning module 130 for performing spatial feature extraction and correlation learning on the power grid situation diagram structure data to obtain an updated node feature vector time series sequence; a time dynamic pattern capture module 140 for performing time dynamic pattern capture on the updated node feature vector time series sequence to obtain a final comprehensive feature vector of the power grid situation; and a supply and demand situation quantitative assessment and classification output module 150 for performing supply and demand situation quantitative assessment and classification output on the final comprehensive feature vector of the power grid situation to obtain a power grid supply and demand situation category.
[0069] As described above, a power grid supply and demand situation awareness system 100 based on graph neural networks according to embodiments of this application can be implemented in various types of computing devices or control units. For example, it can be deployed in server clusters in power grid dispatch control centers, edge intelligent gateways in substations, energy management system workstations in power systems, or high-performance computing platforms deployed in regional control centers. In one possible implementation, the power grid supply and demand situation awareness system 100 based on graph neural networks according to embodiments of this application can be integrated into the computing device as a software module and / or hardware module. For example, the power grid supply and demand situation awareness system based on graph neural networks can be a high-level application component in the operating environment of the computing device or dispatch automation system. This software module is configured to perform graph structured processing of power grid network topology and operating data, spatial feature extraction and association learning based on graph attention networks, temporal dynamic pattern capture based on dynamic convolutional kernels, and quantitative assessment and classification of supply and demand situation based on comprehensive features. Alternatively, it can be a dedicated power grid intelligent analysis algorithm library developed for the computing device. Of course, the power grid supply and demand situation awareness system 100 based on graph neural networks can also be one of the many hardware modules of the computing device or control unit, or it can be embedded in a field-programmable gate array to accelerate large-scale graph data processing and deep learning inference in parallel, or it can be a power grid situation awareness system-on-a-chip for a specific application.
[0070] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or improvement of the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A power grid supply and demand situation awareness method based on a graph neural network, characterized in that, The method comprises the following steps: obtaining power grid network topology data and power grid operation data; performing graph structuring and feature engineering on the power grid network topology data and the power grid operation data to obtain power grid situation graph structure data; performing spatial feature extraction and correlation relationship learning on the power grid situation graph structure data to obtain an updated node feature vector time sequence; performing time dynamic mode capturing on the updated node feature vector time sequence to obtain a power grid situation final comprehensive feature vector; performing supply and demand situation quantitative evaluation and classification output on the power grid situation final comprehensive feature vector to obtain a power grid supply and demand situation category.
2. The power grid supply and demand situation awareness method based on a graph neural network according to claim 1, characterized in that, The power grid operation data comprises node electrical quantity measurement, branch power flow data and equipment operation parameters.
3. The power grid supply and demand situation awareness method based on a graph neural network according to claim 1, characterized in that, The graph structuring and feature engineering on the power grid network topology data and the power grid operation data to obtain the power grid situation graph structure data comprises the following steps: obtaining the voltage amplitude and the voltage phase angle of each node from the power grid operation data; in response to the node being a power generation type node, extracting the real-time active power, the real-time reactive power, the upper limit of the technical power, the lower limit of the technical power, and the recent power ramp rate from the power grid operation data, and vectorizing the real-time active power, the real-time reactive power, the upper limit of the technical power, the lower limit of the technical power, the recent power ramp rate, the voltage amplitude and the voltage phase angle to obtain a node feature vector; in response to the node being a load type node, extracting the real-time active load, the real-time reactive load and the short-term load forecast value from the power grid operation data, and vectorizing the real-time active load, the real-time reactive load and the short-term load forecast value, the voltage amplitude and the voltage phase angle to obtain a node feature vector.
4. The power grid supply and demand situation awareness method based on a graph neural network according to claim 1, characterized in that, The spatial feature extraction and correlation relationship learning on the power grid situation graph structure data to obtain the updated node feature vector time sequence comprises the following step: inputting the power grid situation graph structure data into a trained graph attention network to obtain the updated node feature vector time sequence.
5. The power grid supply and demand situation awareness method based on a graph neural network according to claim 1, characterized in that, The time dynamic mode capturing on the updated node feature vector time sequence to obtain the power grid situation final comprehensive feature vector comprises the following steps: performing state-dependent kernel parameter generation on each updated node feature vector in the updated node feature vector time sequence to obtain a kernel attention weight vector; based on the kernel attention weight vector, performing dynamic convolution kernel assembly and state adaptive convolution on the updated node feature vector time sequence to obtain a state adaptive output feature sequence; performing feature fusion on the state adaptive output feature sequence and the updated node feature vector time sequence to obtain the power grid situation final comprehensive feature vector.
6. The power grid supply and demand situation awareness method based on a graph neural network according to claim 5, characterized in that, Based on the kernel attention weight vector, the dynamic convolution kernel assembly and the state adaptive convolution are performed on the updated node feature vector time sequence to obtain the state adaptive output feature sequence, which comprises the following steps: based on the kernel attention weight vector, weighted sum is performed on the basic convolution kernel to obtain a dynamic convolution kernel; based on the dynamic convolution kernel, state adaptive convolution is performed on the updated node feature vector time sequence to obtain the state adaptive output feature sequence.
7. The power grid supply and demand situation awareness method based on a graph neural network according to claim 1, characterized in that, The power grid supply and demand situation final comprehensive feature vector is input into a Softmax classifier to obtain the power grid supply and demand situation category.
8. A power grid supply and demand situation awareness system based on a graph neural network, characterized in that, Comprise: a data acquisition module configured to acquire power grid network topology data and power grid operation data; a graph structuring and feature engineering module configured to perform graph structuring and feature engineering on the power grid network topology data and the power grid operation data to obtain power grid situation graph structure data; a spatial feature extraction and association relationship learning module configured to perform spatial feature extraction and association relationship learning on the power grid situation graph structure data to obtain an updated node feature vector time series; a time dynamic pattern capturing module configured to perform time dynamic pattern capturing on the updated node feature vector time series to obtain a power grid situation final comprehensive feature vector; a supply and demand situation quantitative assessment and classification output module configured to perform supply and demand situation quantitative assessment and classification output on the power grid situation final comprehensive feature vector to obtain a power grid supply and demand situation category.
9. The power grid supply and demand situation awareness system based on a graph neural network according to claim 8, characterized in that, The time dynamic pattern capturing module comprises: a kernel parameter generation unit configured to perform state-dependent kernel parameter generation on each updated node feature vector in the updated node feature vector time series to obtain a kernel attention weight vector; a state-adaptive output feature sequence acquisition unit configured to perform dynamic convolution kernel assembly and state-adaptive convolution on the updated node feature vector time series based on the kernel attention weight vector to obtain a state-adaptive output feature sequence; the state-adaptive output feature sequence and the updated node feature vector time series are fused to obtain the power grid situation final comprehensive feature vector.
10. The power grid supply and demand situation awareness system based on a graph neural network according to claim 8, characterized in that, The state-adaptive output feature sequence acquisition unit comprises: a weighted summation subunit configured to perform weighted summation on a basic convolution kernel based on the kernel attention weight vector to obtain a dynamic convolution kernel; a state-adaptive convolution subunit configured to perform state-adaptive convolution on the updated node feature vector time series based on the dynamic convolution kernel to obtain the state-adaptive output feature sequence.