Electric power system state estimation method based on graph contrast learning

Through the method based on graph comparison learning, the graph sequence data of the power system is constructed and the hybrid encoder of dynamic edge convolution neural network and graph convolution network are combined to solve the accuracy of noise data and complex power grid structure in power system state estimation. Problem, achieving more efficient and robust state estimation effects.

CN119475263AActive Publication Date: 2025-02-18SOUTH CHINA UNIV OF TECH

Patent Information

Application Number
CN202411555649.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-04
Publication Date
2025-02-18
Estimated Expiration
2044-11-04

AI Technical Summary

Technical Problem

现有技术在电力系统状态估计中难以满足现代电网对快速准确状态获取的要求,尤其是在处理噪声数据和复杂电网结构时。

Method used

Using graph comparison learning-based power system state estimation method, we use edge feature masking technology and comparison loss and node state quantity prediction loss by constructing graph sequence data and combining dynamic edge convolution neural networks and graph convolution networks. Dual optimization strategy enhances the robustness and generalization capabilities of the model.

Benefits of technology

Effectively learn the internal structure and mode of power system data, enhance the robustness of the model to feature loss and noise, improve the accuracy and calculation performance of state estimation, and adapt to changes in complex power grid structures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119475263A_ABST
    Figure CN119475263A_ABST
Patent Text Reader

Abstract

The invention discloses an electric power system state estimation method based on graph contrast learning. The method comprises the following steps: constructing graph sequence data of electric power system state estimation; constructing an electric power system state estimation model based on graph contrast learning, and putting the graph sequence data into the electric power system state estimation model based on graph contrast learning; inputting the node feature sequence and the masked edge features into a hybrid encoder of a dynamic edge convolutional neural network combining a self-attention mechanism and a residual block and a graph convolutional neural network with a dynamic propagation strategy of a gating mechanism to comprehensively process the features of nodes and edges; comparing an updating mechanism and a sampling symmetry training strategy of model parameters of the learning framework through a graph; and calculating a node voltage phase angle by using the branch phase angle difference, and outputting a state estimation result. According to the method, the internal structure and mode of the power system data can be effectively learned by combining graph contrast learning and a deep neural network technology, and the capability of identifying and filtering abnormal data is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of power system state estimation, and in particular relates to a power system state estimation method based on graph contrast learning. Background Art

[0002] The power system is responsible for the generation, transmission and distribution of electric energy. Its efficient, economical and safe operation is crucial to the power industry. The operation of the power system depends on accurate state estimation (SE). State estimation provides real-time system operation status, such as bus voltage amplitude and phase angle, transmission line load and generator output, etc. It can verify and update system models, monitor and evaluate system status, detect and eliminate erroneous data, optimize resource allocation, and support emergency response and recovery operations, thus providing a basic guarantee for the safe and stable operation and efficient management of the power system. Modern power systems are highly dynamic and randomly changing due to the access of distributed energy and the rapid change of loads, making their operation mode and dynamic characteristics more and more complex and changeable. SE technology mainly relies on the measurement data of Supervisory Control And Data Acquisition (SCADA), such as branch flow (branch active and reactive power), node voltage (amplitude and phase angle) and node injection power, to estimate the power system status such as voltage amplitude and phase angle. However, the traditional state estimation system based on supervisory control and data acquisition (SCADA) scheme cannot meet the requirements of modern power grid for fast and accurate state acquisition in terms of accuracy, real-time and computational stability.

[0003] Phasor measurement units (PMUs) provide an accurate measurement method by synchronizing with GPS satellite time references. Thanks to this global time synchronization mechanism, each substation can receive synchronized phasor data with the same timestamp, thereby generating a consistent system operating state at a given moment, avoiding the limitation of manually setting phase angles in traditional state estimation. This real-time and accurate measurement significantly improves the observability of the power system. The real-time system state and power flow data obtained by PMUs provide a solid and reliable foundation for state estimation, ensuring that the system can be efficiently monitored and managed in complex dynamic environments. Utilizing the high accuracy and synchronization characteristics of PMUs, modern power systems can perform state estimation more accurately and adapt to rapidly changing grid needs.

[0004] SE is the process of determining the actual state of the power system by optimizing the difference between the measured data and the system state variables, and its goal is to minimize this difference while satisfying the physical constraints of the power system. Specifically, the optimization goal of the SE problem is to ensure that the estimated system state is as close to the actual state as possible while complying with the physical laws and constraints of the power system, such as the power balance equation and the branch power flow equation. In constructing models to solve SE problems, researchers usually adopt the least squares (LS) or least absolute value (LAV) criteria. The goal of the least squares (LS) method is to minimize the sum of squared errors between the measured and estimated values. Since the objective function of the LS method is convex, the corresponding optimization problem is also a convex optimization problem. The LS method is often used in conjunction with the Gauss-Newton iterative solver because of its wide applicability in practical applications. The Gauss-Newton method is based on a quadratic loss function, but is sensitive to initial values ​​and may cause the solution process to diverge in some cases. The goal of the least absolute value method (LAV) is to minimize the sum of absolute errors between the measured and estimated values. Due to the nonlinearity and non-smoothness of the absolute value function, the objective function of the LAV method is non-convex, resulting in the optimization problem being a non-convex optimization problem. The LAV method is known for its robustness in dealing with data with outliers. However, LAV-based solvers are usually computationally slow because they involve non-convex and non-smooth optimization problems, which makes them unsuitable for real-time system monitoring. Researchers have also explored other model-based methods such as gradient descent and linear programming. However, these methods usually have difficulty handling inequality constraints, and may cause oscillations or slow convergence due to improper step size selection during the iteration process, and are susceptible to local minima, resulting in the limitation of finding local rather than global optimal solutions. In recent years, researchers have focused on developing solutions based on deep learning algorithms to bypass optimization barriers in power system monitoring and control. The main idea is to approximate the mapping of measurement data to state variables through a neural network (NN), thereby providing more efficient and real-time state estimation.

[0005] Therefore, in addition to traditional model-based SE, various data-driven SE methods have been developed, such as convolutional neural networks in deep learning algorithms, long short-term memory networks, recurrent neural networks, etc., which can automatically learn complex patterns and relationships from huge historical and real-time data, and have become a powerful alternative to traditional state estimation techniques. Further, researchers have found that graph-based methods can be regarded as an ideal framework for encapsulating and analyzing the spatial dependencies and long-distance interactions of power networks. In this method, the power grid is constructed as a graph model, in which the buses of the power grid are represented as nodes, and the transmission lines are used as edges connecting the nodes. Based on graph neural networks (GNNs) and their variants, the complex interdependencies between nodes in the graph can be modeled to obtain their intrinsic structural information. GNNs have been applied to various applications in power systems.

[0006] However, when the training set contains noisy data, the performance of graph neural networks (GNNs) tends to drop significantly, because the message aggregation and transmission mechanism of GNNs will propagate the wrong information in the noisy data to other nodes, thereby increasing the probability of node prediction errors. In addition, defining negative samples is challenging, and the traditional all-to-all comparison method requires that the representation of each node be compared with the representation of all other nodes. As the number of nodes increases, the number of comparisons increases exponentially, resulting in a sharp increase in computational and memory costs. Summary of the invention

[0007] The main purpose of the present invention is to overcome the shortcomings and deficiencies of the prior art and to provide a method for power system state estimation based on graph contrast learning. By combining graph contrast learning with deep neural network technology, the present invention can effectively learn the intrinsic structure and pattern of power system data and enhance the robustness of the model to feature missing and noise.

[0008] In order to achieve the above object, the present invention adopts the following technical solutions:

[0009] The present invention provides a method for estimating a power system state based on graph contrast learning, comprising the following steps:

[0010] Collecting power system state estimation measurement data and constructing graph sequence data for power system state estimation; the graph sequence data includes node feature sequences, edge feature sequences and graph adjacency matrix;

[0011] Constructing a power system state estimation model based on graph contrastive learning, wherein the power system state estimation model based on graph contrastive learning adopts a graph enhancement method of edge feature masking technology, a hybrid encoder combining a dynamic edge convolutional neural network and a graph convolutional network, and a dual optimization strategy combining contrast loss and node state quantity prediction loss;

[0012] The graph sequence data is used in a power system state estimation model based on graph contrast learning, and edge feature masking technology is used to conditionally mask edge features;

[0013] The node feature sequence and the masked edge feature are input into a hybrid encoder of a dynamic edge convolutional neural network that combines a self-attention mechanism and a residual block and a graph convolutional neural network with a dynamic propagation strategy with a gating mechanism to comprehensively process the features of nodes and edges.

[0014] Through the model parameter update mechanism and sampling symmetry training strategy of the graph contrast learning framework, the stability and generalization ability of the model in processing graph sequence data are enhanced;

[0015] The node voltage phase angle is calculated using the branch phase angle difference and the state estimation result is output.

[0016] As a preferred technical solution, the power system state estimation measurement data is represented as a graph G = {V, E}, where V represents a node set, representing each node in the power system; E represents an edge set, representing the transmission line between nodes in the power system; each node v∈V and e∈E is associated with its corresponding mapping function and

[0017] As an optimal technical solution, in the power system state estimation model based on graph contrastive learning, a hybrid encoder of a dynamic edge convolutional neural network combining a self-attention mechanism and a residual block and a graph convolutional neural network with a dynamic propagation strategy with a gating mechanism replaces the graph neural network model in the original graph contrastive learning framework to comprehensively process the features of nodes and edges; through dynamic edge convolution, the edge features are converted into weight information and combined with the node information to enhance its representation ability; a dynamic graph convolutional network with a gating mechanism is used to process complex spatial structures, so that the model can fully capture and integrate local and global information in the graph data; finally, the model parameter update mechanism and sampling symmetry training strategy of the graph contrastive learning framework are used to enhance the stability and generalization ability of the model when processing graph structure data; the model training is carried out in combination with contrast loss and node state loss to optimize the feature distinction ability of the model.

[0018] As a preferred technical solution, the edge feature masking technology is used to conditionally mask edge features, specifically:

[0019] When using data augmentation to generate two enhanced views, the graph structure of the two views needs to remain unchanged. The edge feature masking method is used to randomly set thresholds for the two views. When the data on the four edges of each view are less than the threshold, the characteristic value of the corresponding edge is 0, and the edge feature is the branch flow of the edge.

[0020] As a preferred technical solution, the calculation method of the hybrid encoder of the dynamic edge convolutional neural network and the graph convolutional neural network is expressed as:

[0021] In the dynamic edge convolutional neural network, the branch powers pt, pf, qt, and qf are used as edge features, and the dynamic edge convolutional neural network adjusts its weights according to the real-time changes of these edge features to improve the prediction accuracy of the model for the network state;

[0022] The residual block and the self-attention mechanism are used to learn and transform edge features to replace the multi-layer perceptron MLP in the original dynamic edge convolutional neural network, and the corresponding edge weight matrix is ​​learned; the residual block realizes the effective transmission of feature information between network layers through a combination of identity mapping and linear transformation; the output of the residual block is transmitted to the self-attention layer, in which the model self-attention mechanism calculates the interaction and importance between different features, so that the dynamic edge convolutional neural network can focus on more important features and capture long-distance dependencies;

[0023] The residual block enhances features by the following steps:

[0024]

[0025] in: is the ReLU activation function, W and b are the weights and biases of the linear transformation, BN is batch normalization, and x′ is the original edge feature information;

[0026] The self-attention mechanism enhances features through the following steps:

[0027]

[0028] Where: Q = W Q Z, Q are query matrices, Z is the feature processed by the residual block, and the input X is processed by the weight matrix W Q Transformation: K = W K Z, K is the key matrix, which is the input Z through the weight matrix W K Transformation yields V = W V Z, V are value matrices, which are input Z through the weight matrix W V Transformed to get, It means calculating the similarity between the query and the key, and then normalizing it through the softmax function to get the attention weight, d k is the dimension of the key matrix, used for the scaling factor.

[0029] As a preferred technical solution, in the graph convolutional neural network, the feature update of each node is achieved by aggregating the features of its adjacent nodes. This process is used to capture the local relationship between nodes.

[0030] As a preferred technical solution, the dynamic propagation strategy dynamically adjusts the propagation depth in each propagation, determines the number of iterations of the graph convolution operation based on a randomly generated depth parameter c, and realizes multi-level processing of graph node features. The formula is as follows:

[0031]

[0032] Among them, X (c)is the node feature matrix after the dynamic propagation depth adjustment strategy. c is composed by a random number generator during each training, which controls the number of iterations of the graph convolution operation and performs c graph convolution operations, thereby realizing dynamic adjustment of the information propagation depth, allowing the network to process different levels of graph structure information in each training iteration, and enhancing the generalization and robustness of the model. ReLU() is an activation function that increases nonlinear processing capabilities and helps capture complex graph structure features. ω is a weight matrix, b is a bias term, deg(i) and deg(j) are the degrees of nodes i and j, respectively. is a normalization term that helps control the impact of nodes with different degrees on features. N(i) is the set of neighbor nodes of node i. X c is the feature matrix of node i after c layers of graph convolution, It is the feature matrix of neighbor node j after c-1 layers of graph convolution.

[0033] As a preferred technical solution, the purpose of the gating mechanism is to enhance the model's ability to process graph structure data. When node features are aggregated, calculations can be performed based on the local neighborhood information of the nodes in the graph, and the retention or suppression of information can be more flexibly controlled, thereby enhancing the model's ability to express graph data. (c) is the node feature matrix after the dynamic propagation depth adjustment strategy, and the operation of the gating mechanism is defined as follows:

[0034] The forget gate adjusts the information of the node input feature X to determine the part of the information that should be retained;

[0035] The input gate is used to control the new features obtained from the graph convolution layer that need to be introduced;

[0036] The outputs of the forget gate and the input gate are used to update the features of the node;

[0037] Before finally determining the output, the output gate adjusts the information that has been processed by the forget gate and the input gate again to obtain the output value of the node feature.

[0038] As a preferred technical solution, the purpose of the gating mechanism is to enhance the model's ability to process graph structure data. When node features are aggregated, calculations can be performed based on the local neighborhood information of the nodes in the graph, and the retention or suppression of information can be more flexibly controlled to enhance the model's ability to express graph data. Under the gating mechanism, node features are dynamically adjusted based on their neighborhood information to control the retention, introduction and output of node features. The operation of the gating mechanism is defined as follows:

[0039] Forget gate: acts on the input feature X of the node, dynamically adjusts the information in the current input feature of the node, and determines which features should be retained or suppressed;

[0040] Input gate: The input gate controls the new feature information aggregated from neighbor nodes through the graph convolution layer in order to introduce effective features suitable for the current state of the node, so that the model can selectively introduce information from neighbor nodes at different propagation depths;

[0041] Feature update: The output results of the forget gate and the input gate are used to update the feature matrix of the node. The node features are enhanced in the local neighborhood and adaptively updated according to the local structural information.

[0042] Output gate: Before the final output node features, the output gate further adjusts the node features processed by the forget gate and the input gate to ensure that the final output node features fully reflect the integration of local graph structure information and neighborhood features.

[0043] As a preferred technical solution, the updating mechanism of the model parameters and the sampling symmetry training strategy of the graph contrast learning framework are introduced, specifically:

[0044] In the model parameter update, the update methods of the two graph encoders, online encoder and target encoder, are different. The online encoder uses the gradient update parameter θ by following the contrast loss of cosine similarity and the mean square error loss of node state quantity. The contrast loss measures the similarity of the outputs of the two encoders by cosine similarity, that is, the target representation output by the online encoder And target encoder indicates The node state loss is the mean square error between the predicted value and the true value of the voltage amplitude, and the sum of the mean square errors between the predicted value and the true value of the voltage phase angle difference. The purpose is to make the output of the online encoder closer to the target encoder and minimize the error of the state estimation.

[0045] The gradient update parameter θ is expressed as follows:

[0046]

[0047] Among them, η is the learning rate, θ is the model parameter that needs to be updated, and Optimize is an optimization function used to update the model parameters according to the gradient of the loss function. The Adam optimization method is used to update the parameters; That is, the loss function of the model training, which includes contrast loss and state estimation loss. is the loss function The gradient of the parameter θ;

[0048] The training is symmetrized by using the online representation of the second view to predict the target representation of the first view, and the target parameter It will be updated according to the value of the online parameter θ. The updating method is the exponential moving average method, in which the decay rate τ is used to control the average speed and weight. The steps for updating the parameters are:

[0049]

[0050] Update the momentum according to the parameters of the online encoder.

[0051] As a preferred technical solution, the node voltage phase angle is calculated by using the branch phase angle difference and the state estimation result is output. The specific calculation is shown in the formula:

[0052]

[0053] Where A is an N×N association matrix used to describe the relationship between a node and its connected branches in power system analysis, N is the number of nodes, is the branch phase angle estimation vector, is the node voltage phase angle difference estimation vector, which estimates the voltage phase angle of each node in the system based on the calculated branch phase angle difference.

[0054] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0055] (1) In order to solve the problem of performance degradation of graph neural networks (GNNs), the present invention introduces a graph contrastive learning framework. Graph contrastive learning maximizes the representation consistency of positive sample node pairs with similar features and minimizes the representation consistency of dissimilar negative sample node pairs by utilizing the feature information of known graph data mining nodes, thereby effectively learning the feature representation of graph structured data and enhancing the robustness of the model to noisy data.

[0056] (2) In order to solve the problem of rising computational and memory costs, the present invention introduces a graph contrastive learning framework that does not require negative sample pairs. This method eliminates the dependence on negative sample pairs, avoids the computational complexity of all-to-all comparison, reduces computational and memory costs, and can also mine the intrinsic relationships between nodes, thereby improving the robustness and performance of the model.

[0057] (3) The present invention effectively enhances the model's ability to capture long-distance dependencies and global structural information by introducing a dynamic edge convolutional neural network with a self-attention mechanism and residual blocks. The self-attention mechanism helps the model focus on the features of key edges and their neighboring edges in the graph structure, while the residual block ensures the training stability and convergence speed of the deep network, thereby improving the accuracy and robustness of the dynamic edge convolutional neural network in processing edge features.

[0058] (4) Based on GCN (graph convolutional network), the present invention introduces a dynamic propagation strategy with a gating mechanism, which enables the model to flexibly adjust the depth of information propagation according to the actual operation of the power system. Compared with the fixed propagation depth of traditional GCN, this mechanism can effectively prevent over-propagation or under-propagation of information and avoid problems such as over-smoothing or over-aggregation. At the same time, the gating mechanism allows the model to filter out invalid or noisy information and retain key information, thereby improving the adaptability and generalization ability of the model in different power system scenarios.

[0059] (5) The present invention further improves the accuracy of power system state estimation by using branch phase angle differences to calculate node voltage phase angles. Compared with traditional state estimation methods, the introduction of branch phase angle differences can more accurately capture the changes in node voltages in the power grid, especially when dealing with complex power grid structures, and can provide more accurate state prediction results.

[0060] (6) The present invention improves the state estimation effect by combining the dual optimization strategy of contrast loss and node state quantity prediction loss; by combining graph contrast learning with deep neural network technology, it can effectively learn the intrinsic structure and pattern of power system data, enhance the model's robustness to feature missing and noise, help the network identify and filter out abnormal data, and provide a new and effective way for power system state estimation. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0062] Figure 1 It is a flow chart of a method for estimating a power system state based on graph contrast learning according to an embodiment of the present invention;

[0063] Figure 2 This is a model diagram of state estimation according to an embodiment of the present invention. DETAILED DESCRIPTION

[0064] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application.

[0065] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments.

[0066] Example 1

[0067] like Figure 1 As shown, this embodiment provides a method for estimating a power system state based on graph contrast learning, comprising the following steps:

[0068] S1. Collecting measurement data for power system state estimation and constructing graph sequence data for power system state estimation; the graph sequence data includes node feature sequence, edge feature sequence and graph adjacency matrix;

[0069] Specifically, the data set in this embodiment adopts the IEEE39 system data set, including the following contents:

[0070] S11, single topology sample set;

[0071] The IEEE 39 system load is generated in proportion to the time series trend of the public PMU measurement data set (sampling frequency 20ms). Based on the original topology of the IEEE 39 system, Gaussian white noise is added to simulate the measurement error through the method of ZHANG et al. The mean and variance of the injected active power noise are (0.19%, 0.04%), and the mean and variance of the injected reactive power noise are (-0.10%, 0.08%). The data set containing Gaussian white noise (sample size 1.8w) simulates the data set with the introduction of measurement error.

[0072] S12, multi-topology sample set;

[0073] Based on the original topology, the N-1 safety verification scenario of the power system is simulated, that is, one branch is disconnected (the disconnected branch is not directly connected to the transformer or generator to avoid overload of the generator or load), forming 4 new topologies, and then adding the full topology. Finally, the voltage phasor and node injection power are obtained by solving the optimal power flow on each topology as the PMU measurement data set. After removing the non-convergent sections, each topology has 1.8w sections, and the total sample size is 9w. All samples are randomly shuffled and divided into training set, validation set, and test set according to 7:2:1, and Gaussian white noise is introduced into the multi-topology sample set, and the noise distribution is the same as the single topology experiment.

[0074] S2. Construct a power system state estimation model based on graph contrast learning, such as Figure 2As shown, the model includes a graph enhancement method based on a graph contrastive learning framework, a design of an edge feature masking technology, a hybrid encoder combining a dynamic edge convolutional neural network and a graph convolutional network, and a dual optimization strategy combining contrast loss and node state quantity prediction loss.

[0075] Furthermore, a hybrid encoder that combines a dynamic edge convolutional neural network with a self-attention mechanism and residual blocks and a graph convolutional neural network with a dynamic propagation strategy with a gating mechanism replaces the graph neural network model in the original graph contrastive learning framework to comprehensively process the features of nodes and edges. Through dynamic edge convolution, edge features are converted into weight information and combined with node information to enhance its representation ability. In addition, a dynamic graph convolutional network with a gating mechanism is used to process complex spatial structures, so that the model can fully capture and integrate local and global information in graph data. Finally, through the update mechanism of model parameters and the sampling symmetry training strategy of the graph contrastive learning framework, the stability and generalization ability of the model when processing graph structure data are enhanced. Combining contrast loss and node state loss for model training not only optimizes the model's feature discrimination ability, but also improves the prediction accuracy.

[0076] S3. Input the graph sequence data into the power system state estimation model based on graph contrastive learning, and use edge feature masking technology to conditionally mask edge features.

[0077] Furthermore, the step S3 is specifically as follows:

[0078] In the power system, it is necessary to follow its physical characteristics. When two enhanced views are generated by data enhancement, the graph structure of the two views needs to remain unchanged, because if the graph structure changes, the admittance matrix in the power system will change accordingly, and the corresponding graph is not the same time. Therefore, according to this characteristic, this embodiment selects the edge feature masking method, by randomly setting a threshold for the two views. When the data on the four edges of each view are less than the threshold, the feature value of the corresponding edge is 0. The edge feature is the branch flow pt, pf, qt, qf of the edge.

[0079]

[0080] Among them, conditions1 is a conditional expression, and its value is 1 if and only if all four comparisons are true (that is, the values ​​of all four variables are less than α1 or α1), otherwise its value is 0. AND means that all conditions must be met at the same time. f refers to from, t refers to to, p is active power, and q is reactive power.

[0081] S4. The node feature sequence and masked edge features are input into a hybrid encoder of a dynamic edge convolutional neural network that combines a self-attention mechanism and a residual block and a graph convolutional neural network with a dynamic propagation strategy with a gating mechanism to comprehensively process the features of nodes and edges.

[0082] Furthermore, the step S4 includes the following contents:

[0083] S41. The dynamic edge convolutional neural network is specifically:

[0084] The core advantage of the dynamic edge convolutional neural network (ECC) is that it can dynamically generate convolution weights based on edge features. In the power system, edge features such as power flow and reactive power flow directly affect the performance and stability of the system. This embodiment uses branch power pt, pf, qt, and qf as edge features. ECC can adjust its weights according to the real-time changes of these features to improve the model's prediction accuracy of the network status.

[0085] The convolution operation of ECC is a weighted average operation, whose weight is determined by the edge weights between nodes and can be applied to any graph structure. For each node i, consider its neighboring nodes j∈N(i), where N(i) is the set of neighboring nodes of node i, which is obtained by weighted summation of the eigenvalues ​​of all neighbors.

[0086]

[0087] Where: F is a transformation function with parameter w, L(j,i) is the feature of the edge between node i and node j, X(j) is the feature of node j, and b is a bias term. During the training phase, b and w are updated at each iteration. During the testing phase, b and w do not change. In the original ECC, F is represented by a multi-layer perceptron MLP.

[0088] In this embodiment, it is proposed to use residual blocks and self-attention mechanisms to learn and transform edge features, thereby learning the corresponding edge weight matrix, including:

[0089] S411, residual block;

[0090] The residual block can maintain the information flow in the network and prevent the problem of gradient disappearance in deep networks. The residual block realizes the effective transmission of feature information between network layers through a combination of identity mapping and linear transformation.

[0091]

[0092] in: is the ReLU activation function, W and b are the weights and biases of the linear transformation, BN is batch normalization, and x′ is the original edge feature information. It helps to improve the gradient vanishing problem that the network may encounter during training.

[0093] S412, self-attention mechanism;

[0094] The output of the residual block is passed to the self-attention layer, where the model calculates the interactions and importance between different features, allowing the model to focus on more important features and capture long-distance dependencies.

[0095] Given the feature Z processed by the residual block, the self-attention mechanism enhances the feature by the following steps:

[0096]

[0097] Where: Q = W Q Z, Q are query matrices, which are obtained by transforming the input Z through the weight matrix WQ. K = W K Z, K is the key matrix, which is obtained by transforming the input Z through the weight matrix WK, V = W V Z, V are value matrices, which are obtained by transforming the input Z through the weight matrix WV. The similarity between the query and the key is calculated and then normalized by the softmax function to obtain the attention weight, d k is the dimension of the key matrix, which is used as a scaling factor to prevent the vanishing gradient problem caused by the dot product when the dimension is large. This mechanism enables the model to focus on the important parts of the edge features.

[0098] S42. The graph convolutional neural network is specifically:

[0099] In power systems, the characteristics of nodes are not only determined by their own properties (such as power injection), but also affected by connected nodes. Graph convolutional neural networks (GCNs) can construct node features that reflect the status of the entire local network by aggregating feature information from neighbors, which enhances the model's ability to predict node behavior.

[0100] In GCN, the feature update of each node is achieved by aggregating the features of its neighboring nodes. This process can capture the local relationship between nodes. The specific formula is as follows:

[0101]

[0102] Where ω is the weight matrix, b is the bias term, deg(i) and deg(j) are the degrees of nodes i and j respectively. is a normalization term that helps control the impact of nodes with different degrees on features and prevents high-degree nodes from having too much impact on the learning process. N(i) is the set of neighbor nodes of node i, and X i is the feature matrix of node i, X j is the feature matrix of neighbor node j.

[0103] S421, dynamic propagation depth adjustment strategy;

[0104] In graph convolutional networks, too many layers (i.e., too many iterations) may cause the feature differences between nodes to disappear, a phenomenon known as oversmoothing. By controlling the depth parameter c, we ensure that the network can find a balance between retaining sufficient discrimination and capturing the necessary dependencies between nodes. This strategy dynamically adjusts the propagation depth in each propagation and determines the number of iterations of the graph convolution operation based on a randomly generated depth parameter c, thereby achieving multi-level processing of graph node features.

[0105]

[0106] Among them, c is composed of a random number generator during each training, which controls the number of iterations of the graph convolution operation and performs c graph convolution operations, thereby dynamically adjusting the depth of information propagation, allowing the network to process different levels of graph structure information in each training iteration, and enhancing the generalization and robustness of the model; ReLU() is an activation function that increases nonlinear processing capabilities and helps capture complex graph structure features. ω is a weight matrix, b is a bias term, deg(i) and deg(j) are the degrees of nodes i and j, respectively. is a normalization term that helps control the impact of nodes with different degrees on features and prevents high-degree nodes from having too much impact on the learning process. N(i) is the set of neighbor nodes of node i, and X c is the feature matrix of node i after c layers of graph convolution, It is the feature matrix of neighbor node j after c-1 layers of graph convolution.

[0107] S422, gate control mechanism;

[0108] Inspired by the gating mechanism of the long short-term memory network (LSTM), this embodiment introduces a gating mechanism in GCN. This gating mechanism is different from the application of LSTM in processing sequence data, but is adjusted and optimized in the context of graph data. The gating mechanism directly acts on the node features of each layer, adjusts the features through gating operations, and then uses the processed features for calculations in the next layer. The purpose of introducing the gating mechanism in GCN is to enhance the model's ability to process graph structure data, especially when node features are aggregated, it can be calculated based on the local neighborhood information of the nodes in the graph, more flexibly control the retention or suppression of information, and enhance the model's ability to express graph data. Assuming that X is a node feature matrix that has undergone a dynamic propagation depth adjustment strategy, the operation of the gating mechanism is defined as follows:

[0109] The forget gate adjusts the information of the node input feature X to determine the part of the information that should be retained;

[0110] f=σ(XW f +b f );

[0111] Among them, W f and b f is the weight and bias of the forget gate, σ is the sigmoid activation function, through the sigmoid activation function, the value is kept between 0 and 1, so as to selectively retain the old information;

[0112] The input gate is used to control the new information (new features X obtained from the graph convolution layer) (c) ) need to be introduced;

[0113] i=σ(X c W i +b i );

[0114] Among them, W i and b i are the weights and biases of the input gate;

[0115] Status Update:

[0116] X′=f⊙X+i⊙X c

[0117] Among them, ⊙ represents element-by-element multiplication, the forget gate f controls the retained part of X, and the input gate i controls the proportion of input information;

[0118] The outputs of the forget gate and the input gate are used to update the features of the node. This means that during the propagation process, the dynamically adjusted graph convolutional neural network model hopes to gradually update the features through the control of the gate, rather than processing the input all at once like LSTM. After the forget gate and the input gate, the features are considered to be the final features of the graph convolution operation of the current layer. In order to further decide whether to output these features to the next layer, the output gate is used.

[0119] The output gate re-adjusts the information that has been processed by the forget gate and input gate before finally determining the output;

[0120] o=σ(X'W o +b o );

[0121] Among them, W o and b o are the weight and bias of the output gate;

[0122] Node feature update formula:

[0123] X new =o·X';

[0124] Among them, the output gate is updated to X new Further scaling adjusts the output value of the node feature.

[0125] The graph convolutional network model that combines gating mechanisms and residual connections can better capture patterns in complex graph structures by controlling the fineness of information flow and increasing the depth of the network without sacrificing stability.

[0126] S5. Through the model parameter update mechanism of the graph contrast learning framework (including contrast loss and state estimation loss) and the sampling symmetry training strategy, the stability and generalization ability of the model in processing graph sequence data are enhanced.

[0127] Furthermore, step S5 is specifically as follows:

[0128] In the model parameter update, the two graph encoders online encoder and target encoder are updated in different ways. The online encoder updates the parameter θ by following the gradient of cosine similarity and node state mean square error loss to make the predicted target representation Closer to the target encoder representation of each node That is the loss function of model training (including contrast loss and state estimation loss).

[0129]

[0130] in, is the predicted value of the voltage amplitude, V m,i is the true value of the voltage amplitude, is the predicted value of the voltage phase angle difference, is the true value of the voltage phase angle difference, is the contrast loss function.

[0131] The gradient update parameter θ is expressed as:

[0132]

[0133] Where η is the learning rate and θ is the model parameter that needs to be updated. Optimize is an optimization function used to update the model parameters according to the gradient of the loss function, and the Adam optimization method is used to update the parameters; That is, the loss function of the model training, which includes contrast loss and state estimation loss. is the loss function The gradient of the parameter θ.

[0134] In practice, we also symmetrize the training by using the online representation of the second view to predict the target representation for the first view. It will be updated according to the value of the online parameter θ. The updating method is the exponential moving average method, in which the decay rate τ is used to control the average speed and weight. The steps for updating the parameters are:

[0135]

[0136] The momentum is updated according to the parameters of the online encoder, which is not easy to fall into the trivial solution.

[0137] S6. Calculate the node voltage phase angle using the branch phase angle difference and output the state estimation result.

[0138] Furthermore, step S6 is specifically as follows:

[0139] By using branch phase angle difference instead of node phase angle as the state quantity, the model can better mine the electrical connection and topological relationship between the measured information, thereby improving the computational performance of the power system state estimation model based on graph contrast learning. The specific calculation is shown in the formula:

[0140]

[0141] Where A is an N×N association matrix (adjacency matrix) used to describe the relationship between a node and its connected branches in power system analysis, N is the number of nodes, is the branch phase angle difference estimation vector, is the node voltage phase angle estimation vector, which can be used to estimate the voltage phase angle of each node in the system based on the calculated branch phase angle difference.

[0142] For this example, the specific parameter settings of the power system state estimation model based on graph contrastive learning are as follows: To ensure fair comparison, the hidden dimension of all methods is set to 64. In addition, the Adam optimizer is used to select hyperparameters (such as learning rate, α1, and α2) through Bayesian parameter optimization to optimize each benchmark model to achieve the best performance. In the Case39 node system, lr is 0.0001, α1 and α2 are 541 and 533 respectively. For the traditional state estimation WLS method, we use MATLAB R2024a as the development tool.

[0143] The server runs the CentOS 7.6 operating system and is equipped with a 48-core 2.2GHz CPU, an NVIDIA A100 GPU (40GB video memory), and 376GB of memory. In terms of software, we use PyCharm as a development tool and use PyTorch for model building and training.

[0144] Example 2

[0145] In this embodiment 2, the ACTIVSg2000 system data set is used to further illustrate the technical solution of the present invention. The power system state estimation method based on graph contrast learning in this embodiment 2 includes the following steps:

[0146] S1. Collecting power system state estimation measurement data and constructing graph sequence data for power system state estimation, wherein the graph sequence data includes a node feature sequence, an edge feature sequence and a graph adjacency matrix;

[0147] S2. Construct a power system state estimation model based on graph contrastive learning, including designing a graph enhancement method based on edge feature masking technology based on graph contrastive learning framework, adopting a hybrid encoder combining dynamic edge convolutional neural network and graph convolutional network, and a dual optimization strategy combining contrast loss and node state quantity prediction loss;

[0148] S3. Input the graph sequence data into the power system state estimation model based on graph contrastive learning, and use edge feature masking technology to conditionally mask edge features.

[0149] S4. The node feature sequence and masked edge features are input into a hybrid encoder of a dynamic edge convolutional neural network that combines a self-attention mechanism and a residual block and a graph convolutional neural network with a dynamic propagation strategy with a gating mechanism to comprehensively process the features of nodes and edges.

[0150] S5. Through the model parameter update mechanism of the graph contrast learning framework (including contrast loss and state estimation loss) and the sampling symmetry training strategy, the stability and generalization ability of the model in processing graph sequence data are enhanced.

[0151] S6. Calculate the node voltage phase angle using the branch phase angle difference and output the state estimation result.

[0152] In this embodiment 2, except for the following contents, the implementation process of other steps is the same as that of embodiment 1:

[0153] Step S1 is specifically as follows:

[0154] S11, single topology sample set: The power flow is calculated according to the public time series data set of the ACTIVSg2000 system, and 28756 converged section samples are taken. Gaussian white noise is added (the noise parameters are the same as above), and the samples are divided into training set, validation set, and test set according to 7:2:1.

[0155] S12, multi-topology sample set: consistent with the calculation of multi-topology samples of IEEE 39, four new topologies are formed, and finally the voltage phasor and node injection power are obtained as PMU measurement data sets by solving the optimal power flow on each topology. 28756 converged section samples are taken for each topology, totaling 14w samples, which are divided into training set, validation set, and test set according to 7:2:1.

[0156] For this embodiment 2, the specific parameter settings of the power system state estimation model based on graph contrast learning are as follows: To ensure fair comparison, the hidden dimension of all methods is set to 64. In addition, the Adam optimizer is used to select hyperparameters (such as learning rate, α1 and α2) through Bayesian parameter optimization to optimize each benchmark model to achieve the best performance. In the ACTIVSg2000 node system, lr is 0.001, α1 and α2 are 105 and -1398 respectively. For the traditional state estimation WLS method, we use MATLAB R2024a as the development tool.

[0157] The server runs the CentOS 7.6 operating system and is equipped with a 48-core 2.2GHz CPU, an NVIDIA A100 GPU (40GB video memory), and 376GB of memory. In terms of software, we use PyCharm as a development tool and use PyTorch for model building and training.

[0158] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0159] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0160] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.

Claims

1. A power system state estimation method based on graph contrast learning, characterized in that: The steps include: Collecting power system state estimation measurement data and constructing graph sequence data for power system state estimation; the graph sequence data includes node feature sequences, edge feature sequences and graph adjacency matrix; Constructing a power system state estimation model based on graph contrastive learning, wherein the power system state estimation model based on graph contrastive learning adopts a graph enhancement method of edge feature masking technology, a hybrid encoder combining a dynamic edge convolutional neural network and a graph convolutional network, and a dual optimization strategy combining contrast loss and node state quantity prediction loss; The graph sequence data is used in a power system state estimation model based on graph contrast learning, and edge feature masking technology is used to conditionally mask edge features; The node feature sequence and the masked edge feature are input into a hybrid encoder of a dynamic edge convolutional neural network that combines a self-attention mechanism and a residual block and a graph convolutional neural network with a dynamic propagation strategy with a gating mechanism to comprehensively process the features of nodes and edges. Through the model parameter update mechanism and sampling symmetry training strategy of the graph contrast learning framework, the stability and generalization ability of the model in processing graph sequence data are enhanced; The node voltage phase angle is calculated using the branch phase angle difference and the state estimation result is output.

2. The method for estimating power system state based on graph contrast learning according to claim 1, characterized in that: The power system state estimation measurement data is represented as a graph G = {V, E}, where V represents a node set, representing each node in the power system; E represents an edge set, representing the transmission lines between nodes in the power system; each node v∈V and e∈E is associated with its corresponding mapping function and 3. The method for estimating power system state based on graph contrast learning according to claim 1, characterized in that: In the power system state estimation model based on graph contrastive learning, a hybrid encoder of a dynamic edge convolutional neural network combining a self-attention mechanism and a residual block and a graph convolutional neural network with a dynamic propagation strategy with a gating mechanism replaces the graph neural network model in the original graph contrastive learning framework to comprehensively process the features of nodes and edges; through dynamic edge convolution, the edge features are converted into weight information and combined with the node information to enhance its representation ability; a dynamic graph convolutional network with a gating mechanism is used to process complex spatial structures, so that the model can fully capture and integrate local and global information in graph data; finally, the model parameter update mechanism and sampling symmetry training strategy of the graph contrastive learning framework are used to enhance the stability and generalization ability of the model when processing graph structure data; the model training is carried out in combination with contrast loss and node state loss to optimize the feature discrimination ability of the model.

4. The method for estimating power system state based on graph contrast learning according to claim 1, characterized in that: The edge feature masking technology is used to conditionally mask edge features, specifically: When using data augmentation to generate two enhanced views, the graph structure of the two views needs to remain unchanged. The edge feature masking method is used to randomly set thresholds for the two views. When the data on the four edges of each view are less than the threshold, the characteristic value of the corresponding edge is 0, and the edge feature is the branch flow of the edge.

5. The method for estimating power system state based on graph contrast learning according to claim 1, characterized in that: The calculation method of the hybrid encoder of the dynamic edge convolutional neural network and the graph convolutional neural network is expressed as: In the dynamic edge convolutional neural network, the branch powers pt, pf, qt, and qf are used as edge features, and the dynamic edge convolutional neural network adjusts its weights according to the real-time changes of these edge features to improve the prediction accuracy of the model for the network state; The residual block and the self-attention mechanism are used to learn and transform edge features to replace the multi-layer perceptron MLP in the original dynamic edge convolutional neural network, and the corresponding edge weight matrix is ​​learned; the residual block realizes the effective transmission of feature information between network layers through a combination of identity mapping and linear transformation; the output of the residual block is transmitted to the self-attention layer, in which the model self-attention mechanism calculates the interaction and importance between different features, so that the dynamic edge convolutional neural network can focus on more important features and capture long-distance dependencies; The residual block enhances features by the following steps: in: is the ReLU activation function, W and b are the weights and biases of the linear transformation, BN is batch normalization, and x′ is the original edge feature information; The self-attention mechanism enhances features through the following steps: Where: Q = W Q Z, Q is the query matrix, Z is the feature processed by the residual block, and the input Z is processed by the weight matrix W Q Transformation: K = W K Z, K is the key matrix, which is the input Z through the weight matrix W K Transformation yields V = W V Z, V are value matrices, which are input Z through the weight matrix W V Transformed to get, It means calculating the similarity between the query and the key, and then normalizing it through the softmax function to get the attention weight, d k is the dimension of the key matrix, used for the scaling factor.

6. The method for estimating power system state based on graph contrast learning according to claim 1, characterized in that: In the graph convolutional neural network, the feature update of each node is achieved by aggregating the features of its adjacent nodes. This process is used to capture the local relationship between nodes.

7. The method for estimating power system state based on graph contrast learning according to claim 1, characterized in that: The dynamic propagation strategy dynamically adjusts the propagation depth in each propagation and determines the number of iterations of the graph convolution operation based on a randomly generated depth parameter c to achieve multi-level processing of graph node features. The formula is as follows: Among them, X (c) is the node feature matrix after the dynamic propagation depth adjustment strategy. c is composed by a random number generator during each training, which controls the number of iterations of the graph convolution operation and performs c graph convolution operations, thereby realizing dynamic adjustment of the information propagation depth, allowing the network to process different levels of graph structure information in each training iteration, and enhancing the generalization and robustness of the model. ReLU() is an activation function that increases nonlinear processing capabilities and helps capture complex graph structure features. ω is a weight matrix, b is a bias term, deg(i) and deg(j) are the degrees of nodes i and j, respectively. is a normalization term that helps control the impact of nodes with different degrees on features. N(i) is the set of neighbor nodes of node i. X c is the feature matrix of node i after c layers of graph convolution, It is the feature matrix of neighbor node j after c-1 layers of graph convolution.

8. The method for estimating power system state based on graph contrast learning according to claim 1, characterized in that: The purpose of the gating mechanism is to enhance the model's ability to process graph structured data. When node features are aggregated, they can be calculated based on the local neighborhood information of the nodes in the graph, and the retention or suppression of information can be controlled more flexibly, thereby enhancing the model's ability to express graph data. Under the gating mechanism, node features are dynamically adjusted based on their neighborhood information to control the retention, introduction, and output of node features. The operation of the gating mechanism is defined as follows: Forget gate: acts on the input feature X of the node, dynamically adjusts the information in the current input feature of the node, and determines which features should be retained or suppressed; Input gate: The input gate controls the new feature information aggregated from neighbor nodes through the graph convolution layer in order to introduce effective features suitable for the current state of the node, so that the model can selectively introduce information from neighbor nodes at different propagation depths; Feature update: The output results of the forget gate and the input gate are used to update the feature matrix of the node. The node features are enhanced in the local neighborhood and adaptively updated according to the local structural information. Output gate: Before the final output node features, the output gate further adjusts the node features processed by the forget gate and the input gate to ensure that the final output node features fully reflect the integration of local graph structure information and neighborhood features.

9. The method for estimating power system state based on graph contrast learning according to claim 1, characterized in that: The update mechanism of model parameters and sampling symmetry training strategy of the graph contrast learning framework are introduced, specifically: In the model parameter update, the update methods of the two graph encoders, online encoder and target encoder, are different. The online encoder uses the gradient update parameter θ by following the contrast loss of cosine similarity and the mean square error loss of node state quantity. The contrast loss measures the similarity of the outputs of the two encoders by cosine similarity, that is, the target representation output by the online encoder And target encoder indicates The node state loss is the mean square error between the predicted value and the true value of the voltage amplitude, and the sum of the mean square errors between the predicted value and the true value of the voltage phase angle difference. The purpose is to make the output of the online encoder closer to the target encoder and minimize the error of the state estimation. The gradient update parameter θ is expressed as follows: Among them, η is the learning rate, θ is the model parameter that needs to be updated, and Optimize is an optimization function used to update the model parameters according to the gradient of the loss function. The Adam optimization method is used to update the parameters; That is, the loss function of the model training, which includes contrast loss and state estimation loss. is the loss function The gradient of the parameter θ; The training is symmetrized by using the online representation of the second view to predict the target representation of the first view, and the target parameter It will be updated according to the value of the online parameter θ. The updating method is the exponential moving average method, in which the decay rate τ is used to control the average speed and weight. The steps for updating the parameters are: Update the momentum according to the parameters of the online encoder.

10. The method for estimating power system state based on graph contrast learning according to claim 1, characterized in that: The node voltage phase angle is calculated by using the branch phase angle difference and the state estimation result is output. The specific calculation is shown in the formula: Where A is an N×N association matrix used to describe the relationship between a node and its connected branches in power system analysis, N is the number of nodes, is the branch phase angle estimation vector, is the node voltage phase angle difference estimation vector, which estimates the voltage phase angle of each node in the system based on the calculated branch phase angle difference.

Citation Information

Patent Citations

  • Electromechanical disturbance positioning and propagation prediction method based on graph neural network

    CN114818483A

  • Power system state estimation method based on message passing graph neural network

    CN115146538A

  • Micro-grid space-time perception energy management method based on security deep reinforcement learning

    CN115731072A

  • Electric power system transient signal identification method

    CN117454269A

Cited By

  • Online low-altitude image recognition method for dynamic open environment

    CN120411833A

  • Calculation method for construction period of electric power information system

    CN120875331A

  • Multi-modal time sequence astronomical data training method and device based on graph contrast learning and storage medium

    CN120951262A

  • Multi-modal time-series astronomical data training method and device based on graph contrastive learning and storage medium

    CN120951262B

  • Power grid similar operation section sample set construction method and system

    CN121301918A