Line loss analysis method, system and device combining generative adversarial network and graph neural network
By combining the generation adversarial network and graph neural network, diversified grid node and edge feature data are generated, and feature learning is used for grid topology, the accuracy problem of traditional grid line loss calculation methods under the conditions of enhanced new energy access and load fluctuation is solved, and the grid operation efficiency and economy are achieved.
Patent Information
- Application Number
- CN202411741291.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-25
AI Technical Summary
The calculation method of line loss in traditional power grids is based on a static power flow model, and fails to fully consider the random changes in node loads and the complex grid topological relationship, which makes it difficult to accurately evaluate the actual loss under the conditions of enhanced new energy access and load volatility, which reduces the grid operation efficiency and economy.
Combining the Generative Adversarial Network (WGAN) and Graph Neural Network (GNN), diversified node and edge feature data are generated through WGAN, and combining the feature learning ability of GNN on the grid topology to achieve accurate prediction and analysis of line losses.
It improves the accuracy of line loss calculation, provides reliable data support, optimizes grid scheduling and loss management, and ensures the economic and stability of the system in complex operating environments.
Smart Images

Figure CN119691388A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of electric power grid technology, and in particular to a line loss analysis method, system and device combining a generative adversarial network and a graph neural network. Background Art
[0002] As the penetration rate of new energy increases, the grid structure becomes increasingly complex, and the accurate prediction and analysis of line losses become increasingly important. In traditional power grids, the calculation of line losses is often based on a fixed power flow model, which fails to fully consider the random changes in node loads and the complex grid topology. However, with the access of new energy and the increase in load volatility, this static calculation method is difficult to accurately assess the actual losses, resulting in reduced grid operation efficiency and economy. Under distributed energy and uncertain load conditions, the grid needs to have stronger adaptability and higher prediction accuracy.
[0003] In recent years, generative adversarial networks (WGAN) and graph neural networks (GNN) have shown significant advantages in data generation and graph structure data processing. WGAN can effectively generate data similar to the real distribution, providing solutions for scarce or diverse data scenarios; GNN can use the topological structure of the power grid and the relationship between nodes to extract deep features of nodes and edges, so as to predict line losses more accurately. By combining WGAN and GNN, not only can the power grid be provided with diversified and realistic node and edge features, but also the power grid topology information can be used to make more accurate predictions and analyses of line losses. Summary of the invention
[0004] The purpose of the present invention is to provide a line loss analysis method, system and device combining generative adversarial networks and graph neural networks, aiming to generate diversified node and edge feature data through WGAN, combined with the feature learning ability of GNN in power grid topology, to achieve accurate prediction and analysis of line loss. This method can improve the accuracy of power grid dispatching and loss management, adapt to the needs of modern power grids with new energy access and increased load fluctuations, and provide key data support for the safe and economical operation of the power grid.
[0005] On the one hand, the present application provides a line loss analysis method combining a generative adversarial network and a graph neural network, which comprises the following steps:
[0006] S1, collecting and processing grid node and edge feature data, and constructing a grid topology structure, which includes a node-branch association matrix and an adjacency matrix;
[0007] S2. Build and train the WGAN network model, and generate diversified node, edge features and line loss labels through the trained WGAN network model, which specifically includes the following sub-steps:
[0008] S21. Build the generator network of the WGAN network model, build a multi-layer perceptron structure, and generate node features in the power grid through the multi-layer perceptron structure. Edge Features and line loss labels
[0009] S22, constructing a discriminator network of the WGAN network model, wherein the discriminator extracts data features through several convolutional layers to discriminate the data;
[0010] S23, train the WGAN network model, and generate diversified nodes, edge features and line loss labels through the trained WGAN network model; the loss function of the generator during training is:
[0011]
[0012] in, is the loss function of the generator, Loss G is the Wasserstein distance loss, is the physical loss, λ is the weight hyperparameter for adjusting the Wasserstein distance loss and the physical loss;
[0013] The calculation formula for physical loss is:
[0014]
[0015] Among them, N b is the total number of branches, N n is the total number of nodes; is a constraint parameter used to ensure that the absolute value of each element in the matrix is 0 or 1;
[0016] S3: Based on the grid topology and the generated data samples, a GNN network model is constructed and line loss prediction training is performed, which specifically includes the following sub-steps:
[0017] S31. Construct the network structure of the GNN network model based on the node feature P i and edge feature X ij As input, a residual connected graph convolution layer is constructed, and the update formula of the graph convolution operation is:
[0018]
[0019] in, represents the graph convolution adjacency matrix after adding self-loops and normalization; H (l) represents the node embedding feature matrix of the lth layer; W (l) is the weight matrix; σ is the activation function;
[0020] Graph Convolution Adjacency Matrix The calculation is performed by the following steps:
[0021] S311. Convert the data generated by the WGAN network model into the adjacency matrix A. The conversion formula is:
[0022]
[0023] Among them, among them, The node-branch correlation matrix generated by the WGAN network model generator; for The transposed matrix of
[0024] S312, in the first residual graph convolution layer, the adjacency matrix obtained in step S311 and the adjacency matrix in the power grid topology structure are self-looped to construct a new adjacency matrix A′:
[0025] A′=A+I
[0026] Where I is the identity matrix;
[0027] S313, perform symmetric normalization on the new adjacency matrix A′ to obtain the adjacency matrix for graph convolution
[0028]
[0029] Where D is the degree matrix, and the diagonal elements of the degree matrix are D ii =∑ j A′ ij ;
[0030] S32, through the output of the final residual graph convolution layer, map the node and edge features to the line loss prediction space to generate the line loss prediction value of each edge The mean square error loss function is used to calculate the error between the predicted line loss value and the actual line loss label to optimize the prediction accuracy of the GNN network model;
[0031] S4. The data generated by the WGAN network model is used as the input of the GNN network model, and the line loss value is output for power grid line loss analysis.
[0032] Preferably, the calculation formula of the Wasserstein distance loss function in step S23 is:
[0033]
[0034] in, represents the i-th generated sample, and m is the number of batch samples.
[0035] Preferably, in step S21, the formulas of each hidden layer of the multi-layer perceptron structure are:
[0036] h (l+1) =ReLU(BN(W (l) h (l) +b (l) ))
[0037] Among them, W(l) is the weight matrix of the lth layer, h(l) is the input feature of the lth layer, b(l) is the bias term, BN means batch normalization, and the output of each hidden layer is controlled within the threshold range through the Sigmoid activation function.
[0038] Preferably, in step S22, the convolutional layer output formula of the discriminator is:
[0039] h (l+1) =LeakyReLU(Conv(h (l) , L (l) ))
[0040] Among them, Conv(·) represents the convolution operation, L (l) is the convolution kernel of the lth layer. The final output of the discriminator is flattened and mapped to a one-dimensional score value D(x) through a fully connected layer, which is used to indicate the confidence that the input data is true data.
[0041] Preferably, in step S32, the mean square error loss function calculation formula is:
[0042]
[0043] Among them, N is the total number of edges, m is the number of batch samples, represents the predicted line loss value of the kth sample, is the corresponding real line loss label.
[0044] Preferably, during the WGAN network model training process in step S23, the loss function of the discriminator is:
[0045]
[0046] Among them, x (i) represents the i-th true sample.
[0047] Preferably, step S1 specifically includes the following sub-steps:
[0048] S11. Collect node features in the power grid and edge features of each line. Node features include the injected power P of each node. i and node type T i , the edge characteristic of each line is the line reactance X ij Or admittance value Y ij =1 / X ij ;
[0049] S12. Extract the line loss label L of each line from the real power grid data ij , where L ij The calculation formula is:
[0050] L ij =|P ij | 2 ·R ij
[0051] Among them, P ij is the power transfer from line i to line j, R ij is the resistance of the line;
[0052] S13, based on the node connection relationship of the power grid, generate an adjacency matrix A, where each element A ij =1 indicates that there is a direct connection between node i and node j, otherwise A ij =0, the adjacency matrix is used for message passing in the GNN network model.
[0053] In a second aspect, the present application provides a line loss analysis system combining a generative adversarial network and a graph neural network, comprising:
[0054] A data acquisition and processing module is used to collect node features and edge features in the power grid and generate an adjacency matrix of the power grid;
[0055] WGAN generation module, which is used to generate node features, edge features and line loss labels using a generative adversarial network. The generator generates diversified data by inputting a random noise vector, and optimizes the generator and discriminator through the Wasserstein distance loss of WWGAN.
[0056] The GNN line loss prediction module is used to build a graph neural network containing a residual graph convolution layer. It takes node features and edge features as input and generates the line loss prediction value of each edge through residual connection and graph convolution operations.
[0057] The line loss analysis module is used to input the diversified data generated by WGAN into GNN for line loss analysis and output the predicted line loss value of each line.
[0058] On the third aspect, the present application provides a line loss analysis device that combines a generative adversarial network and a graph neural network, which can store and run the above-mentioned line loss analysis system.
[0059] Compared with the prior art, the present invention has the following beneficial effects:
[0060] (1) The line loss analysis method proposed in this paper combines the advantages of generative adversarial networks (WGAN) and graph neural networks (GNN). WGAN expands the applicability in scenarios with scarce or diverse data by generating diverse and realistic node and edge feature data; GNN uses the topology of the power grid for feature learning and achieves accurate prediction of line loss.
[0061] (2) The method of the present invention not only improves the accuracy of line loss calculation, but also provides reliable data support under conditions where the grid load fluctuates significantly, optimizes grid scheduling and loss management, and ensures the economy and stability of the system in a complex operating environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] Figure 1 A schematic flow chart of a line loss analysis method combining a generative adversarial network and a graph neural network provided in an embodiment of the present invention;
[0063] Figure 2 A schematic diagram of a module of a line loss analysis system combining a generative adversarial network and a graph neural network provided by an embodiment of the present invention;
[0064] Figure 3 A WGAN network schematic diagram of a line loss analysis method combining a generative adversarial network and a graph neural network provided in an embodiment of the present invention;
[0065] Figure 4 A schematic diagram of the iteration of the WGAN loss function in a line loss analysis method combining a generative adversarial network and a graph neural network provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0066] Hereinafter, embodiments of the present invention will be described with reference to the drawings.
[0067] The technical solution of the present invention corresponds to a line loss analysis method, system and device combining a generative adversarial network and a graph neural network. The method includes: collecting and processing grid node feature and edge feature data, constructing line loss labels as the basis for WGAN generation targets and supervised learning of GNN; designing a generative adversarial network (WGAN), wherein the generator network generates node features, edge features and line loss labels through random noise input, the discriminator extracts features through a convolutional layer and outputs a data authenticity score, and the WWGAN loss function is used to optimize the generator and the discriminator; constructing a GNN containing a residual graph convolutional layer, using the grid topology structure for message transmission and generating a line loss prediction value for each edge, and minimizing the prediction error through the mean square error (MSE) loss; finally, the diversified data generated by WGAN is input into the GNN, and the output line loss prediction value is used for grid scheduling and loss management, thereby improving the applicability and prediction accuracy of the model in diversified data scenarios. This solution improves the prediction accuracy and analysis effect of grid line loss through the diversified data generated by WGAN and the feature learning ability of GNN in grid topology.
[0068] Please refer to more drawings of the embodiments of the present invention, in which the method, device and medium provided by the present invention are further explained in more detailed embodiments of the present invention.
[0069] like Figure 1 As shown, in one aspect of the embodiments of the present application, a line loss analysis method combining a generative adversarial network and a graph neural network is provided, specifically comprising:
[0070] S1. Collect and process the grid node and edge feature data to construct a grid topology structure, which includes a node-branch association matrix and an adjacency matrix. This step specifically includes the following sub-steps:
[0071] S11. Collect node features in the power grid and edge features of each line. Node features include the injected power P of each node. i and node type T i , the edge characteristic of each line is the line reactance X ij Or admittance value Y ij =1 / X ij .
[0072] S12. Extract the line loss label L of each line from the real power grid data ij , where L ij The calculation formula is:
[0073] L ij =|P ij | 2 ·R ij
[0074] Among them, P ijis the power transfer from line i to line j, R ij is the resistance of the line.
[0075] S13, based on the node connection relationship of the power grid, generate an adjacency matrix A, where each element A ij =1 indicates that there is a direct connection between node i and node j, otherwise A ij =0, the adjacency matrix is used for message passing in the GNN network model.
[0076] S2. Build and train the WGAN network model, and generate diversified node, edge features and line loss labels through the trained WGAN network model, which specifically includes the following sub-steps:
[0077] S21. Build the generator network of the WGAN network model, build a multi-layer perceptron structure, and generate node features in the power grid through the multi-layer perceptron structure. Edge Features and line loss labels In step S21, the formulas of each hidden layer of the multi-layer perceptron structure are:
[0078] h (l+1) =ReLU(BN(W (l) h (l) +b (l) ))
[0079] Among them, W (l) is the weight matrix of the lth layer, h (l) is the input feature of the lth layer, b (l) is a bias term, BN stands for batch normalization, and the output of each hidden layer is controlled within the threshold range through the Sigmoid activation function.
[0080] S22. Construct the discriminator network of the WGAN network model. The discriminator extracts data features through several convolutional layers to discriminate the data. The output formula of the convolutional layer of the discriminator is:
[0081] h (l+1) =LeakyReLU(Conv(h (l) , L (l) ))
[0082] Among them, Conv(·) represents the convolution operation, L (l) is the convolution kernel of the lth layer. The final output of the discriminator is flattened and mapped to a one-dimensional score value D(x) through a fully connected layer, which is used to indicate the confidence that the input data is true data.
[0083] S23, train the WGAN network model, and generate diversified nodes, edge features and line loss labels through the trained WGAN network model; the loss function of the generator during training is:
[0084]
[0085] in, is the loss function of the generator, Loss G is the Wasserstein distance loss, is the physical loss, and λ is the weight hyperparameter for adjusting the Wasserstein distance loss and the physical loss.
[0086] The calculation formula for physical loss is:
[0087]
[0088] Among them, N b is the total number of branches, N n is the total number of nodes; is a constraint parameter used to ensure that the absolute value of each element in the matrix is either 0 or 1.
[0089] The calculation formula of Wasserstein distance loss function is:
[0090]
[0091] in, represents the i-th generated sample, and m is the number of batch samples.
[0092] The loss function of the discriminator is:
[0093]
[0094] Among them, x(i) represents the i-th true sample.
[0095] S3: Based on the grid topology and the generated data samples, a GNN network model is constructed and line loss prediction training is performed, which specifically includes the following sub-steps:
[0096] S31. Construct the network structure of the GNN network model based on the node feature P i and edge feature X ij As input, a residual connected graph convolution layer is constructed, and the update formula of the graph convolution operation is:
[0097]
[0098] in, represents the graph convolution adjacency matrix after adding self-loops and normalization; H (l) represents the node embedding feature matrix of the first layer; W (l) is the weight matrix; σ is the activation function.
[0099] Graph Convolution Adjacency Matrix The calculation is performed by the following steps:
[0100] S311. Convert the data generated by the WGAN network model into the adjacency matrix A. The conversion formula is:
[0101]
[0102] in, The node-branch correlation matrix generated by the WGAN network model generator.
[0103] S312, in the first residual graph convolution layer, the adjacency matrix obtained in step S311 and the adjacency matrix in the power grid topology structure are self-looped to construct a new adjacency matrix A′:
[0104] A′=A+I
[0105] Where I is the identity matrix.
[0106] S313, perform symmetric normalization on the new adjacency matrix A′ to obtain the adjacency matrix for graph convolution
[0107]
[0108] Where D is the degree matrix, and the diagonal elements of the degree matrix are D ii =∑ j A′ ij .
[0109] S32, through the output of the final residual graph convolution layer, map the node and edge features to the line loss prediction space to generate the line loss prediction value of each edge The mean square error loss function is used to calculate the error between the predicted line loss value and the actual line loss label to optimize the prediction accuracy of the GNN network model. The mean square error loss function calculation formula is:
[0110]
[0111] Among them, N is the total number of edges, m is the number of batch samples, represents the predicted line loss value of the kth sample, is the corresponding real line loss label.
[0112] S4. The data generated by the WGAN network model is used as the input of the GNN network model, and the line loss value is output for power grid line loss analysis.
[0113] In a second aspect, the present application provides a line loss analysis system combining a generative adversarial network and a graph neural network, as shown in 2, which includes:
[0114] The data acquisition and processing module 201 is used to collect node features and edge features in the power grid and generate an adjacency matrix of the power grid.
[0115] The WGAN generation module 202 is used to generate node features, edge features and line loss labels by using a generative adversarial network, wherein the generator generates diversified data by inputting a random noise vector and generates a line loss label by using the Wasserstei of WWGAN. n Distance loss optimizes the generator and discriminator.
[0116] The GNN line loss prediction module 203 is used to construct a graph neural network including a residual graph convolution layer, taking node features and edge features as input, and generating a line loss prediction value for each edge through residual connection and graph convolution operations.
[0117] The line loss analysis module 204 is used to input the diversified data generated by WGAN into GNN for line loss analysis and output the line loss prediction value of each line.
[0118] On the third aspect, the present application provides a line loss analysis device that combines a generative adversarial network and a graph neural network, which can store and run the above-mentioned line loss analysis system.
[0119] The method provided by the present application is described in detail in a more detailed embodiment of the present application. Figure 1 As shown, the method comprises the following steps:
[0120] S1. Collect and process node and edge feature data to build the power grid topology structure: This is to build the WGAN generation target and the GNN input feature basis to ensure the accuracy and comprehensiveness of line loss analysis. The specific process is as follows:
[0121] S11. Collect node characteristics in the power grid, such as the injected power P of each node i and node type T i , and the edge characteristics of each line, such as line reactance X ij Or admittance value Y ij =1 / X ij , these data provide real generation targets for WGAN and provide important basic features for GNN input.
[0122] S12. Extract the line loss label L of each line from the real power grid data ij , where L ij The calculation formula is:
[0123] L ij =|P ij | 2 ·R ij
[0124] Among them, P ijis the power transfer from line i to line j, R ij is the resistance of the line. The line loss label will be used as the generation target of WGAN, and also provide a supervised learning target for GNN to help the model better fit the actual data in subsequent training.
[0125] S13, based on the node connection relationship of the power grid, generate an adjacency matrix A, where each element A ij =1 indicates that there is a direct connection between node i and node j, otherwise A ij = 0. This adjacency matrix is used in the message passing process of GNN, which enables GNN to make full use of the topological characteristics of the power grid and achieve effective feature learning.
[0126] S2, such as Figure 3 As shown in the figure, WGAN is constructed and trained: WGAN generates diversified node, edge features and line loss labels to provide diversified data input for the GNN model to enhance the generalization ability of the model. The specific process is:
[0127] S21. Design the generator network of WGAN with random noise vector As input, the node features in the power grid are generated through the multi-layer perceptron (MLP) structure Edge Features Line loss label Among them, the hidden layer formulas of the MLP structure are:
[0128] h (l+1) =ReLU(BN(W (l) h (l) +b (l) ))
[0129] Among them, W (l) is the weight matrix of the lth layer, h (l) is the input feature of the lth layer, b (l) is a bias term, BN stands for batch normalization, and the final output is controlled within a reasonable range through the Sigmoid activation function.
[0130] S22. Design a discriminator network, take real data or data generated by the generator as input, and extract data features through several convolutional layers. The convolution kernel size of each convolutional layer is 3×3, and the Leaky ReLU activation function is used to improve the ability to distinguish between generated data and real data. The output formula of the convolutional layer of the discriminator is:
[0131] h (l+1) =LeakyReLU(Conv(h (l) , W (l) ))
[0132] Among them, Conv(·) represents the convolution operation, W (l) is the convolution kernel of the lth layer. The final output of the discriminator is flattened and mapped to a one-dimensional score value D(x) through a fully connected layer, which is used to indicate the confidence that the input data is true data.
[0133] S23, such as Figure 4 As shown in the figure, the WGAN network model is trained, and the trained WGAN network model generates diversified nodes, edge features and line loss labels; the loss function of the generator during training is:
[0134]
[0135] in, is the loss function of the generator, Loss G is the Wasserstein distance loss, is the physical loss, λ is the weight hyperparameter for adjusting the Wasserstein distance loss and the physical loss;
[0136] The calculation formula for physical loss is:
[0137]
[0138] Among them, N b is the total number of branches, N n is the total number of nodes; is a constraint parameter used to ensure that the absolute value of each element in the matrix is either 0 or 1.
[0139] The calculation formula of Wasserstein distance loss function is:
[0140]
[0141] in, represents the i-th generated sample, and m is the number of batch samples.
[0142] The loss function of the discriminator is:
[0143]
[0144] Among them, x(i) represents the i-th true sample. Figure 4 It can be seen that the iterative effect of the generator and the discriminator is excellent. By optimizing this loss function, the generated data is closer to the real data distribution, providing more diverse and realistic data samples for subsequent GNN model training.
[0145] S3. Build GNN and conduct line loss prediction training: Based on the grid topology and generated data samples, build a GNN model to generate line loss prediction values for each line to improve the accuracy of grid scheduling and loss management. The specific process is:
[0146] S31. Design the network structure of GNN based on node features P i and edge feature X ij As input, a residual connected graph convolution layer is constructed to enable the model to better capture the topological characteristics of the power grid. In the lth residual graph convolution layer, the update formula of the graph convolution operation is:
[0147]
[0148] in, represents the graph convolution adjacency matrix after adding self-loops and normalization; H (l) represents the node embedding feature matrix of the lth layer; W (l) is the weight matrix; σ is the activation function.
[0149] Among them, the graph convolution adjacency matrix The calculation is performed by the following steps:
[0150] S311. Convert the data generated by the WGAN network model into the adjacency matrix A. The conversion formula is:
[0151]
[0152] in, The node-branch correlation matrix generated by the WGAN network model generator.
[0153] S312, in the first residual graph convolution layer, the adjacency matrix obtained in step S311 and the adjacency matrix in the power grid topology structure are self-looped to construct a new adjacency matrix A′:
[0154] A′=A+I
[0155] Where I is the identity matrix.
[0156] S313, perform symmetric normalization on the new adjacency matrix A′ to obtain the adjacency matrix for graph convolution
[0157]
[0158] Where D is the degree matrix, and the diagonal elements of the degree matrix are D ii =∑ j A′ ij .
[0159] This residual connection helps alleviate the gradient vanishing problem in deep networks and enhances the model's feature learning ability.
[0160] S32, through the output of the final residual graph convolution layer, map the node and edge features to the line loss prediction space to generate the line loss prediction value of each edge To optimize the prediction accuracy of the model, GNN uses the mean square error (MSE) loss function to calculate the error between the predicted line loss value and the actual line loss label. The calculation formula is:
[0161]
[0162] Among them, N is the total number of edges, m is the number of batch samples, represents the predicted line loss value of the kth sample, is the corresponding real line loss label. By minimizing this loss function, the accuracy of line loss prediction is improved.
[0163] S4. Use the joint model to analyze power line loss: Use the data generated by WGAN as the input of the GNN model to make the line loss prediction model more applicable and robust in scenarios with scarce or diversified data. The specific process is:
[0164] S41. Use WGAN to generate diverse node, edge features and line loss label data to provide rich input for GNN and expand the applicable scenarios of line loss analysis to adapt to situations where load fluctuations in the power grid are significant or data is scarce.
[0165] S42. Input the diversified data generated by WGAN into the GNN model to perform line loss prediction analysis and output the line loss prediction value for each line. By comparing the predicted value with the actual line loss value, it can be seen that the predicted value is very close to the actual line loss value, which can ensure the accuracy of the prediction.
[0166] S43. In actual power grid dispatching and loss management, the line loss prediction results based on GNN output provide key data support for the economic and safety management of the power grid. This joint model can adapt to the prediction needs under different load conditions and diversified data scenarios, ensuring that the power grid still has efficient and accurate dispatching and management capabilities under complex conditions.
[0167] like Figure 2 As shown, another aspect of the present application embodiment further provides a corresponding system, including:
[0168] The data acquisition and processing module 201 is used to collect node features (such as injected power, node type) and edge features (such as line reactance or admittance value) in the power grid, extract line loss labels from real data, and generate an adjacency matrix of the power grid to construct the WGAN generation target and the input feature basis of the GNN.
[0169] The WGAN generation module 202 is used to generate node features, edge features and line loss labels by using a generative adversarial network, wherein the generator generates diversified data by inputting a random noise vector and generates a line loss label by using the Wasserstei of the WGAN. n The distance loss optimizes the generator and discriminator. The discriminator extracts features through the convolution layer and outputs the data authenticity score to ensure that the generated data is close to the real distribution.
[0170] The GNN line loss prediction module 203 is used to construct a graph neural network including a residual graph convolution layer, taking node features and edge features as input, and generating a line loss prediction value for each edge through residual connection and graph convolution operations.
[0171] The line loss analysis module 204 is used to input the diversified data generated by WGAN into GNN for line loss analysis, output the line loss prediction value of each line, provide support for power grid scheduling and loss management, and improve the applicability and prediction accuracy of the device in diversified data scenarios.
[0172] In another aspect of the embodiment of the present application, a line loss analysis device is provided, which is provided with the above system and controls the device where the storage medium is located to execute the above method when the program is running. The specific implementation process will not be repeated here.
[0173] The line loss analysis device can be a computing device such as a desktop computer, a notebook, a PDA, a server, and a cloud server. The line loss analysis device can include, but is not limited to, a processor and a memory. Those skilled in the art can understand that it can include more or fewer components than shown in the figure, or combine certain components, or different components. For example, the line loss analysis device can also include input and output devices, network access devices, buses, etc.
[0174] In this embodiment, the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
[0175] The memory may be an internal storage unit of a computer device, such as a hard disk or memory of the computer device. The memory may also be an external storage device of the computer device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device. Furthermore, the memory may include both an internal storage unit of the computer device and an external storage device. The memory is used to store computer programs and other programs and data required by the computer device. The memory may also be used to temporarily store data that has been output or is to be output.
[0176] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0177] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0178] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (Processor) to perform some steps of the above-mentioned method of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.
[0179] The embodiments described above are only descriptions of the preferred implementation modes of the present invention, and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should all fall within the protection scope determined by the claims of the present invention.
Claims
1. A line loss analysis method combining generative adversarial networks and graph neural networks, characterized in that: It includes the following steps: S1, collecting and processing grid node and edge feature data, and constructing a grid topology structure, which includes a node-branch association matrix and an adjacency matrix; S2: Build and train the WGAN network model, and generate diversified node, edge features and line loss labels through the trained WGAN network model, which specifically includes the following sub-steps: S21. Build the generator network of the WGAN network model, build a multi-layer perceptron structure, and generate node features in the power grid through the multi-layer perceptron structure. Edge Features and line loss labels S22, constructing a discriminator network of the WGAN network model, wherein the discriminator extracts data features through several convolutional layers to discriminate the data; S23, training the WGAN network model, and generating diversified node, edge features and line loss labels through the trained WGAN network model; The loss function of the generator during training is: in, is the loss function of the generator, Loss G is the Wasserstein distance loss, is the physical loss, λ is the weight hyperparameter for adjusting the Wasserstein distance loss and the physical loss; The calculation formula for physical loss is: Among them, N b is the total number of branches, N n is the total number of nodes; is a constraint parameter used to ensure that the absolute value of each element in the matrix is 0 or 1; S3: Based on the grid topology and the generated data samples, a GNN network model is constructed and line loss prediction training is performed, which specifically includes the following sub-steps: S31. Construct the network structure of the GNN network model based on the node feature P i and edge feature X ij As input, a residual connected graph convolution layer is constructed, and the update formula of the graph convolution operation is: in, represents the graph convolution adjacency matrix after adding self-loops and normalization; H (l) represents the node embedding feature matrix of the lth layer; W (l) is the weight matrix; σ is the activation function; Graph Convolution Adjacency Matrix The calculation is performed by the following steps: S311. Convert the data generated by the WGAN network model into the adjacency matrix A. The conversion formula is: in, The node-branch correlation matrix generated by the WGAN network model generator; for The transposed matrix of S312, in the first residual graph convolution layer, the adjacency matrix obtained in step S311 and the adjacency matrix in the power grid topology structure are subjected to self-loop processing to construct a new adjacency matrix A': A'=A+I Where I is the identity matrix; S313, perform symmetric normalization on the new adjacency matrix A' to obtain the adjacency matrix for graph convolution Where D is the degree matrix, and the diagonal elements of the degree matrix are D ii =∑ j A' ij ; S32, through the output of the final residual graph convolution layer, map the node and edge features to the line loss prediction space to generate the line loss prediction value of each edge The mean square error loss function is used to calculate the error between the predicted line loss value and the actual line loss label to optimize the prediction accuracy of the GNN network model; S4. The data generated by the WGAN network model is used as the input of the GNN network model, and the line loss value is output for power grid line loss analysis.
2. The line loss analysis method combining a generative adversarial network and a graph neural network according to claim 1, characterized in that: The calculation formula of Wasserstein distance loss in step S23 is: in, represents the i-th generated sample, and m is the number of batch samples.
3. The line loss analysis method combining generative adversarial network and graph neural network according to claim 2, characterized in that: In step S21, the formulas of each hidden layer of the multi-layer perceptron structure are: h (l+1) =ReLU(BN(W (l) h (l) +b (l) )) Among them, W (l) is the weight matrix of the lth layer, h (l) is the input feature of the lth layer, b (l) is a bias term, BN stands for batch normalization, and the output of each hidden layer is controlled within the threshold range through the Sigmoid activation function.
4. The line loss analysis method combining generative adversarial network and graph neural network according to claim 2, characterized in that: In step S22, the convolutional layer output formula of the discriminator is: h (l+1) =LeakyReLU(Conv(h (l) ,L (l) )) Among them, Conv(·) represents the convolution operation, L (l) is the convolution kernel of the lth layer. The final output of the discriminator is flattened and mapped to a one-dimensional score value D(x) through a fully connected layer, which is used to indicate the confidence that the input data is true data.
5. The line loss analysis method combining generative adversarial network and graph neural network according to claim 2, characterized in that: In step S32, the mean square error loss function calculation formula is: Among them, N is the total number of edges, m is the number of batch samples, represents the predicted line loss value of the kth sample, is the corresponding real line loss label.
6. The line loss analysis method combining generative adversarial network and graph neural network according to claim 2, characterized in that: During the WGAN network model training process in step S23, the loss function of the discriminator is: Among them, x (i) represents the i-th true sample.
7. The line loss analysis method combining generative adversarial network and graph neural network according to claim 1, characterized in that: Step S4 specifically includes the following sub-steps: S41. Generate diversified node, edge feature and line loss label data using the WGAN network model as input to the GNN model; S42. Input the diversified data generated by the WGAN network model into the GNN network model to perform line loss prediction analysis and output the line loss prediction value for each line.
8. The line loss analysis method combining generative adversarial network and graph neural network according to claim 1, characterized in that: Step S1 specifically includes the following sub-steps: S11. Collect node characteristics in the power grid and edge characteristics of each line. Node characteristics include the injected power P of each node. i and node type T i , the edge characteristic of each line is the line reactance X ij Or admittance value Y ij =1 / X ij ; S12. Extract the line loss label L of each line from the real power grid data ij , L ij The calculation formula is: L ij =|P ij | 2 ·R ij Among them, P ij is the power transfer from line i to line j, R ij is the resistance of the line; S13, based on the node connection relationship of the power grid, generate an adjacency matrix A, where each element A ij =1 indicates that there is a direct connection between node i and node j, otherwise A ij =0, the adjacency matrix is used for message passing in the GNN network model.
9. A line loss analysis system for the line loss analysis method combining generative adversarial network and graph neural network as claimed in claim 1, characterized in that: It includes: A data acquisition and processing module is used to collect node features and edge features in the power grid and generate an adjacency matrix of the power grid; WGAN generation module, which is used to generate node features, edge features and line loss labels using a generative adversarial network. The generator generates diversified data by inputting a random noise vector, and optimizes the generator and discriminator through the Wasserstein distance loss of WWGAN. The GNN line loss prediction module is used to build a graph neural network containing a residual graph convolution layer. It takes node features and edge features as input and generates the line loss prediction value of each edge through residual connection and graph convolution operations. The line loss analysis module is used to input the diversified data generated by WGAN into GNN for line loss analysis and output the predicted line loss value of each line.
10. A line loss analysis device combining a generative adversarial network and a graph neural network, characterized in that: Capable of storing and running the line loss analysis system described in claim 9.
Citation Information
Cited By
Electric energy meter metering drift correction method and system based on transformer area line loss, and medium
CN122109976A