Intelligent power grid dynamic graph data generation method based on deep adversarial training

Through the smart grid dynamic graph data generation method based on deep adversarial training, the problem of high calculation cost and poor timing feature fidelity of smart grid dynamic graph data generation in the prior art is solved by using the central graph sampling and multi-head self-attention mechanism. , realizes efficient and reliable dynamic data graph generation.

CN119090994AActive Publication Date: 2024-12-06STATE GRID SHANGHAI MUNICIPAL ELECTRIC POWER CO +1

Patent Information

Application Number
CN202411010831.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-26
Publication Date
2024-12-06
Estimated Expiration
2044-07-26

AI Technical Summary

Technical Problem

When generating smart grid dynamic graph data, the existing technology has problems of high computing cost, low efficiency and poor timing feature fidelity. In particular, the random walk method takes a long time and cannot effectively utilize link weights and node features. The traditional method ignores it. The slight changes in the graph structure at continuous time points.

Method used

Using the smart grid dynamic graph data generation method based on deep adversarial training, including sampling module, generation adversarial network and reconstruction module, the timing graph self-attention network is constructed through central graph sampling, multi-head self-attention mechanism and gate mechanism to generate efficient , reliable dynamic data graph.

Benefits of technology

Improve the efficiency and reliability of dynamic graph data generation, can effectively capture key nodes and their structural features in the graph, adapt to large-scale data processing, and alleviate the problem of gradient disappearance. The generated data graph is closer to the actual situation in the time dimension and has good interpretability and scalability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119090994A_ABST
    Figure CN119090994A_ABST
Patent Text Reader

Abstract

The invention relates to a smart power grid dynamic graph data generation method based on deep adversarial training, and the method comprises the following steps: obtaining smart power grid time sequence graph data, inputting the data into a smart power grid dynamic graph data generation model based on deep adversarial training, and generating a smart power grid dynamic data graph; the intelligent power grid dynamic graph data generation model based on deep adversarial training comprises a sampling module, a generative adversarial network and a reconstruction module, and the sampling module is used for generating a center graph by using a center graph sampling method; the generative adversarial network comprises a generator and a discriminator, the generator comprises a decoder and an encoder, and the encoder is used for encoding the center diagram through a time sequence diagram self-attention network constructed based on a multi-head self-attention mechanism to obtain hidden variables of the center diagram; and the reconstruction module is used for generating classification distribution of each time sequence edge according to the central graph score matrix so as to generate an intelligent power grid dynamic data graph. Compared with the prior art, the method can efficiently and reliably generate the dynamic data graph of the smart power grid.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of smart grids, and in particular to a method for generating dynamic graph data of a smart grid based on deep adversarial training. Background Art

[0002] Smart grid is an important development direction of modern power system. Its core is to realize the intelligence and automation of power system through advanced communication technology and data processing technology. With the development of smart grid, the generation and processing of massive data has become one of the key issues. Dynamic graph data reflects the dynamic changes of power system status and is crucial for the monitoring, analysis and decision-making of smart grid. However, the grid data contains a lot of sensitive information, and it is necessary to use a generative model to generate time series data that reflects the dynamic changes of the grid.

[0003] Existing graph generators, such as GraphRNN, Graphite, NetGAN, VGAE, etc., are mainly designed for static graphs and ignore the temporal characteristics of graphs. The traditional method is to aggregate timestamps to obtain a sequence of graph snapshots, and generate corresponding graphs on each graph snapshot to simulate a temporal graph. This method requires repeated running of the graph generation algorithm, which has high time and computational costs. In addition, this method ignores the slight changes in the graph structure at consecutive time points and cannot accurately capture the temporal information.

[0004] In order to solve the problem of dynamic graph generation, Zhou et al. proposed TagGen, which adds timestamps of interaction edges to nodes, connects nodes that satisfy characteristic temporal neighborhood constraints, and converts dynamic graphs into equivalent static graphs, thereby modeling dynamic graphs. Although the model achieves the best dynamic graph simulation quality, there are two problems: first, the model uses a random walk sampling method, which is time-consuming, occupies a lot of computing resources, and cannot effectively utilize information such as link weights and node features; second, the time complexity of the model is as high as O(T 2 ), where T is the number of timestamps, which limits the efficiency and scalability of the model. Zeno et al. proposed a method DYMOND based on a three-node motif, which takes into account the dynamic changes of the overall graph structure and the type of nodes in the motif. In the modeling process, DYMOND made two key assumptions: first, the arrival rate of the motif obeys an exponential distribution; second, the structural setting of the motif remains unchanged over the time range of the entire dynamic graph. However, these two assumptions are not necessarily true in practical applications. The structure and arrival rate of the motif may evolve over time, and the arrival rate is affected by time. This modeling method results in poor fidelity of the structure and timing characteristics of the model-generated graph. Therefore, it is necessary to design a dynamic graph data generation method that can efficiently and reliably generate power grid dynamic graph data. Summary of the invention

[0005] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and provide a method for generating smart grid dynamic graph data based on deep adversarial training, so as to efficiently and reliably generate grid dynamic graph data.

[0006] The purpose of the present invention can be achieved by the following technical solutions:

[0007] The present invention provides a method for generating smart grid dynamic graph data based on deep adversarial training, comprising the following steps:

[0008] Obtain smart grid time series graph data, input into a smart grid dynamic graph data generation model based on deep adversarial training, and generate a smart grid dynamic data graph;

[0009] The smart grid dynamic graph data generation model based on deep adversarial training includes a sampling module, a generative adversarial network and a reconstruction module connected in sequence; wherein the sampling module is used to sample the smart grid timing graph data using a central graph sampling method to generate a central graph;

[0010] The generative adversarial network includes a generator and a discriminator. The generator includes a decoder and an encoder. The encoder is used to encode the central graph through a time-series graph self-attention network constructed based on a multi-head self-attention mechanism to obtain the latent variables of the central graph; the decoder is used to decode the latent variables of the central graph to obtain the central graph score matrix; the discriminator is used to distinguish between real data and generated data;

[0011] The reconstruction module is used to generate the classification distribution probability of each time series edge according to the central graph score matrix, and then generate a smart grid dynamic data graph.

[0012] Furthermore, the generation process of the central graph is specifically as follows:

[0013] S101, determining an initial node of smart grid timing diagram data;

[0014] S102, taking the initial node as the center, recursively sampling its neighboring nodes, with a sampling depth of k;

[0015] S103, obtain a central graph with a radius of k, wherein the central graph includes any time series node u t And with u t All neighbor nodes whose shortest path length is less than or equal to k.

[0016] Furthermore, in step S101, the sampling probability of any time series node in the smart grid time series graph data is calculated according to the node degree, and then the initial node is determined.

[0017] Furthermore, any time series node u tThe calculation formula of the sampling probability is as follows:

[0018]

[0019] Among them, P(u t ) represents the time series node u t The sampling probability, deg(u t ) represents the node degree, V represents the set of all nodes, v t Represents a timing node.

[0020] Furthermore, the encoder includes multiple parallel time-series graph self-attention networks, each of which calculates the aggregated features of the central graph through a multi-head self-attention mechanism, and then outputs them as hidden variables of the central graph through a gating mechanism.

[0021] Furthermore, the generation process of the central graph latent variables is as follows:

[0022] S201, mapping the feature vector of each time series node of the central graph to the hidden layer space R d′×n , obtain the mapping feature vector, where d′ is the target dimension and n is the number of attention heads;

[0023] S202. Calculate the attention coefficient between each time series node and its neighboring nodes and normalize it:

[0024]

[0025] in, is the timing node u t and timing node v t The attention coefficient, is the normalized attention coefficient, and and timing nodes u respectively. t and timing node v t The mapping feature vector of , a is the attention weight of each attention head in the multi-head self-attention mechanism, [·‖·] represents vector concatenation, and LeakyReLU is a nonlinear activation function;

[0026] S203, weightedly aggregating the mapping feature vectors of the neighboring nodes of each time series node based on the normalized attention coefficient, and obtaining the aggregated features of each time series node as the output of each attention head;

[0027]

[0028] Among them, σ is a nonlinear activation function;

[0029] S204. Concatenate the outputs of all attention heads to obtain the current features of each node:

[0030]

[0031] Among them, Concat means vector concatenation, Head i represents the output of the i-th head in the temporal graph self-attention network, W o represents the output projection matrix;

[0032] S205. Use the gating mechanism to combine the current features and original features of each node to obtain the hidden variables of the central graph

[0033]

[0034] Among them, W g is the weight matrix, and ⊙ represents element multiplication.

[0035] Furthermore, the decoder decodes the latent variables of the central graph through a gated recurrent unit to obtain a score matrix of the central graph. The expression of the score matrix is ​​as follows:

[0036]

[0037] Among them, s is the score matrix, W o is the weight matrix, is the central graph hidden variable output by the encoder, h 0 is the initial hidden state of the gated recurrent unit, b o is the bias term.

[0038] Furthermore, the discriminator distinguishes between real data and generated data through a multi-layer perceptron.

[0039] Furthermore, the generative adversarial network is optimized by minimizing a loss function, wherein the loss function includes a generator loss function and a discriminator loss function, and the expression of the generator loss function is specifically as follows:

[0040]

[0041] Among them, V s Represents the initial node set of the central graph, n s represents the number of central graphs, represents the adjacency matrix of the central graph, represents the probability of generating a graph edge, G represents the generator, D represents the discriminator, and G(z) represents the data generated by the generator;

[0042] The expression of the discriminator loss function is as follows:

[0043]

[0044] Among them, x represents the real data.

[0045] Furthermore, the specific process of the reconstruction module generating the smart grid dynamic data graph is as follows:

[0046] S301. Generate the classification distribution probability of each time series edge according to the central graph score matrix:

[0047]

[0048] Among them, p(u,v,t) is the time sequence edge (u t ,v t )’s classification distribution probability, S u,v,t is the final score matrix, which is obtained by summarizing all the central graph score matrices and then averaging the probability of each edge generation, and t is the timestamp;

[0049] S302. Using the probability of classification distribution, a time series edge reflecting the dynamic changes of the smart grid is generated at each timestamp. When the number of generated time series edges is consistent with the number of edges in the original smart grid time series graph data, the generation process of the smart grid dynamic data graph is completed.

[0050] Compared with the prior art, the present invention has the following beneficial effects:

[0051] 1. The present invention designs a smart grid dynamic graph data generation model based on deep adversarial training, which can generate a smart grid dynamic data graph according to the smart grid time series graph data. The smart grid dynamic graph data generation model based on deep adversarial training includes a sampling module, a generative adversarial network and a reconstruction module connected in sequence, wherein the sampling module is used to sample the smart grid time series graph data using a central graph sampling method to generate a plurality of central graphs. The central graph sampling method can dynamically adjust the sampling strategy according to the data distribution, effectively capture the structural characteristics of the key nodes and their neighbor nodes in the graph, and is conducive to improving the reliability of the generated smart grid dynamic data graph; the encoder is used to encode the central graph through a time series graph self-attention network constructed based on a multi-head self-attention mechanism to obtain the hidden variables of the central graph, and the decoder is used to decode the hidden variables of the central graph to obtain the central graph score matrix. The multi-head self-attention mechanism can realize parallel computing on the one hand, improve the speed of model training and generating smart grid dynamic data graphs, can well adapt to large-scale smart grid data processing scenarios, and efficiently process large-scale graph data. On the other hand, it can dynamically allocate different attention weights according to the importance of neighbor nodes, focusing on nodes that play a key role in the graph data, thereby effectively aggregating the information of neighbor nodes.

[0052] 2. The present invention adds a gating mechanism after each time-series graph attention network, which can further enhance the learning ability of the encoder. The gating mechanism integrates the current features and original features of each node, and can selectively retain or discard information, thereby alleviating the gradient vanishing problem and accelerating model convergence. The introduction of the gating mechanism enables the model to maintain a high learning effect when processing long-span graph data, avoids the loss of important historical information during long-term transmission, and improves the model's ability to process complex time-series graph data. By combining the multi-head self-attention mechanism and the gating mechanism, the model can process large-scale complex time-series graph data more flexibly and effectively, improve the training efficiency of the model, and improve the reliability of the generated smart grid dynamic data graph.

[0053] 3. In the smart grid dynamic graph data generation model based on deep adversarial training designed by the present invention, the reconstruction module summarizes all the central graph score matrices, and then takes the average of the probability generated by each edge to obtain the final score matrix, and generates the classification distribution of each time series edge. On the one hand, it can realize the fusion of multi-source information, and on the other hand, it can reduce the impact of extreme values ​​or noise on the results and improve the reliability of the score matrix; using the probability of classification distribution to generate time series edges reflecting the dynamic changes of the smart grid at each timestamp, the generated data graph can be closer to the actual situation in the time dimension; the above process does not depend on a specific grid structure or data format, and can be flexibly applied to different types of smart grid dynamic data graph generation scenarios, and has strong interpretability and scalability. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 Schematic diagram of the structure of the smart grid dynamic graph data generation model based on deep adversarial training. DETAILED DESCRIPTION

[0055] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.

[0056] Example 1

[0057] This embodiment provides a method for generating smart grid dynamic graph data based on deep adversarial training, comprising the following steps:

[0058] Obtain smart grid time-series graph data, input the smart grid dynamic graph data generation model based on deep adversarial training, and generate a smart grid dynamic data graph.

[0059] Smart grid dynamic graph data generation model based on deep adversarial training Figure 1As shown, it includes a sampling module, a generative adversarial network and a reconstruction module connected in sequence. Among them, the sampling module is used to sample the smart grid time series graph data using the central graph sampling method to generate several central graphs for model training. The generative adversarial network includes a generator and a discriminator, and the generator and the discriminator are alternately optimized by minimizing the loss function. The discriminator is used to distinguish between real data and generated data. The generator includes a decoder and an encoder. The encoder is used to encode the central graph through the time series graph self-attention network constructed based on the multi-head self-attention mechanism to obtain the hidden variables of the central graph; the decoder is used to decode the hidden variables of the central graph to obtain the central graph score matrix. The reconstruction module is used to generate the classification distribution probability of each time series edge according to the central graph score matrix, and then generate the smart grid dynamic data graph.

[0060] Specifically, in the sampling module, the process of generating the central graph is as follows:

[0061] S101. Determine the initial node of smart grid time series graph data according to the node degree.

[0062] For the selection of the initial node, this embodiment calculates the sampling probability of each time series node in the smart grid time series graph data according to the node degree, and selects the node with higher degree as the initial node. t , the calculation formula of sampling probability is as follows:

[0063]

[0064] Among them, P(u t ) represents the time series node u t The sampling probability, deg(u t ) represents the node degree, V represents the set of all nodes, v t Represents a timing node.

[0065] S102: Taking the initial node as the center, recursively sample its neighboring nodes. The specific steps are as follows:

[0066] First, sample from the direct neighbor nodes of the initial node, then continue sampling from the neighbor nodes of the direct neighbor nodes, and so on, until the sampling depth reaches k.

[0067] S103, obtain the central graph G with radius k ego (u t )=(V ego (u t ),E ego (u t )), the central graph contains any time series node u t And with u t All neighbor nodes whose shortest path length is less than or equal to k.

[0068] The central graph sampling method can effectively capture the structural characteristics of key nodes and their neighboring nodes in the graph, thereby improving the learning ability and generation effect of the model.

[0069] Traditional encoders usually use memory networks such as RNN, LSTM, or GCN, but both networks have limitations. Memory networks are good at processing sequence data and capture information in the sequence through a cyclically connected structure, but the cyclic structure needs to process data in sequence, which makes the model unable to be calculated in parallel, the training efficiency is limited, and it cannot be applied to large-scale data sets. GCN can effectively capture the spatial relationship between nodes by performing convolution operations on graph data, but GCN is essentially static and cannot handle dynamic graph problems, and it is difficult for GCN to assign different weights to node neighbors. In order to solve the problems of these two networks, in this embodiment, the encoder uses a time-series graph attention network to encode the central graph. The encoder includes k stacked time-series graph self-attention networks, which can realize parallel computing. Each time-series graph self-attention network calculates the aggregated features of the central graph through a multi-head self-attention mechanism, and the aggregated features are output as hidden variables of the central graph through a gating mechanism. The specific process is as follows:

[0070] S201. For each node v in the central graph t , its feature vector Mapping to the hidden layer space R d′×n , get the mapping feature vector Where d′ is the target dimension, n is the number of attention heads,

[0071] S202, for each pair of nodes consisting of an edge (u t ,v t ), calculate the normalized attention coefficient Represents node v t For node u t The importance of feature representation is calculated as follows:

[0072]

[0073] in, For node u t and node v t The attention coefficient, and and node u respectively t and node v t , a is the attention weight of each attention head in the multi-head self-attention mechanism, [·‖·] represents vector concatenation, and LeakyReLU is a nonlinear activation function.

[0074] S203. Using normalized attention coefficient Perform weighted summation on the mapped feature vectors of neighboring nodes to obtain the aggregated features of each node as the output of each attention head;

[0075]

[0076] Among them, σ is a nonlinear activation function;

[0077] S204: Concatenate the outputs of all attention heads to obtain the current features of each node.

[0078]

[0079] Among them, Concat means vector concatenation, Head i represents the output of the i-th head in the temporal graph self-attention network, W o Represents the output projection matrix.

[0080] S205. Use the gating mechanism to combine the current features and original features of each node to obtain the central graph latent variables:

[0081]

[0082] Among them, W g is the weight matrix, and ⊙ represents element multiplication.

[0083] On the one hand, the multi-head self-attention mechanism can improve the training efficiency of the model while ensuring the quality of the graph generated by the model, so that the model can efficiently process large-scale graph data. On the other hand, it can enable the model to dynamically allocate different attention weights according to the importance of neighbor nodes. This dynamic weight allocation method enables the model to focus on the nodes that play a key role in the graph data and flexibly handle the complex relationships in the graph data, so that the information of neighbor nodes can be effectively aggregated. In order to further enhance the learning ability of the encoder, this embodiment adds a gating mechanism after each time-series graph attention network. The gating mechanism can selectively retain or discard information to control the flow of information, thereby alleviating the gradient disappearance problem and accelerating the convergence of the model. The introduction of the gating mechanism enables the model to maintain a high learning effect when processing long-span graph data, avoiding the loss of important historical information during long-term transmission, not only ensuring that the model performs well in capturing short-term features, but also being equally efficient when analyzing long-span data, and improving the model's ability to process complex data. By combining the multi-head self-attention mechanism and the gating mechanism, the model can process large-scale complex time-series graph data more flexibly and effectively.

[0084] The decoder decodes the latent variables of the central graph through a gated recurrent unit. Get the score matrix s of the central graph. The expression of the score matrix s is as follows:

[0085]

[0086] Among them, W o is the weight matrix, h 0 is the initial hidden state of the gated recurrent unit, b o is the bias term.

[0087] The discriminator learns the patterns in the input data and identifies the difference between the generated data and the real data, thereby providing effective feedback to guide the optimization of the generator. The discriminator distinguishes between real data and generated data through a multi-layer perceptron (MLP). The definition of the discriminator is as follows:

[0088]

[0089] in, represents the parameters of MLP, and σ represents the nonlinear activation function.

[0090] The goal of the generator is to deceive the discriminator so that the discriminator determines the generated data as real data. The loss function of the generator consists of two parts: one is the adversarial loss, which is used to measure the degree to which the generated data is judged as real data; the other is the reconstruction loss, which is used to improve the quality of the decoder output. In this embodiment, the cross entropy loss is used as the reconstruction loss to ensure the quality of the generated data. The expression of the generator loss function is as follows:

[0091]

[0092] Among them, V s Represents the initial node set of the central graph, n s represents the number of central graphs, represents the adjacency matrix of the central graph, represents the probability of generating a graph edge, G represents the generator, D represents the discriminator, and G(z) represents the data generated by the generator.

[0093] The goal of the discriminator is to accurately distinguish between real data and generated data. The loss function of the discriminator is used to measure the accuracy of the discriminator in distinguishing between real data and generated data. The specific expression is as follows:

[0094]

[0095] Among them, x represents the real data.

[0096] The specific process of the reconstruction module generating the smart grid dynamic data graph is as follows:

[0097] S301. Generate the classification distribution probability of each time series edge according to the central graph score matrix:

[0098]

[0099] Among them, p(u,v,t) is the time sequence edge (u t ,v t )’s classification distribution probability, S u,v,t The final score matrix is ​​obtained by summing up all the central graph score matrices and then averaging the probability of each edge generation.

[0100] S302: Sample the corresponding time series edge from the classification distribution by sampling without replacement. Specifically, from the time series node u t Sampling is done from the neighbor node set of u t The timing edge of the connection. The calculation formula is as follows:

[0101]

[0102] Among them, Cat represents classification distribution, Represents the node u t The set of adjacent edges.

[0103] The above process uses the probability of classification distribution to generate time series edges that reflect real dynamic changes at each timestamp. Finally, when the number of generated time series edges is consistent with the number of edges in the original smart grid time series graph data, the generation process of the smart grid dynamic data graph is completed. The generated smart grid dynamic graph data can be used for desensitization generation of power grid topology graphs, such as: power knowledge graph, power equipment relationship graph, transmission network graph, etc.

[0104] To verify the effectiveness of the above method, the following experiments were performed in this embodiment:

[0105] The model and evaluation scripts are implemented in Python 3.7 and PyTorch 1.8.1 and trained in CUDA-11.1 environment. The model is trained for 800 batches, with a learning rate of 0.0003, a weight decay of 1e-6, and an attention network with 4 heads. The experiments are performed on a machine equipped with Intel(R) Xeon(R) Gold 5220CPU@2.20GHz, 62GB RAM and NVIDIA Tesla V100, 32GB, using one CPU core and one GPU for each algorithm.

[0106] This example conducts experiments on 6 public dynamic graph datasets to evaluate the model performance. These datasets cover multiple fields. The statistical information of the datasets is shown in Table 1.

[0107] Table 1 Dataset statistics

[0108]

[0109] The method (DGGAN) proposed in this embodiment is compared with traditional graph generation methods and graph generation methods based on deep learning. Traditional graph generation methods include ER and AB, which are classic methods in graph theory research, generating graph structures through random processes and scale-free characteristics, respectively. Graph generation methods based on deep learning include GraphRNN, Graphite, NetGAN and TagGen, among which GraphRNN is a graph generation method based on autoregression, Graphite is a graph generation method based on variational autoencoders, NetGAN is a graph generation method based on generative adversarial networks, and TagGen is a dynamic graph generation method based on generative adversarial networks, which is one of the most advanced dynamic graph generation methods. It is worth noting that NetGAN, Graphite and traditional graph generators (ER and AB) are designed for static graphs and cannot directly process dynamic graphs. In order to achieve dynamic graph generation, this embodiment uses these methods to generate static graphs at each timestamp, and then combines these static graphs to finally obtain a complete dynamic graph.

[0110] The experiment uses multiple classic evaluation indicators to comprehensively evaluate the similarity between the real image and the generated image from multiple dimensions. The specific evaluation indicators are as follows:

[0111] Deg.: Maximum Mean Discrepancy (MMD) of degree distribution.

[0112] PLE: Power law exponent.

[0113] GINI: Gini coefficient.

[0114] Cluster: average clustering coefficient.

[0115] Claw Count: The number of claw-shaped structures in the image.

[0116] Wedge Count: The number of wedges in the graph.

[0117] Triangle Count: The number of triangles in the graph.

[0118] N-Component: Number of connected components.

[0119] Since these evaluation indicators are designed for static graphs, we refer to the processing method of TagGen and divide the dynamic graph into a series of snapshots. The evaluation indicators are calculated on each snapshot and the average and median are compared. Specifically, given a real graph And the synthetic graph G′, which aggregates the edges of the first t timestamps into the graph snapshot S t Then in the real graph snapshot S t and the composite snapshot S′ t The evaluation index f is calculated separately, and finally the average and median of the evaluation results of all graph snapshots are calculated. The specific calculation formula is as follows:

[0120]

[0121] The final experimental results are as follows. The average of the evaluation indicators is shown in Table 2, and the median of the evaluation indicators is shown in Table 3. In both tables, the smaller the value, the better the quality.

[0122] Table 2 Average evaluation indexes of different models on multiple dynamic graph datasets

[0123]

[0124]

[0125]

[0126]

[0127] Table 3 Average evaluation indexes of different models on multiple dynamic graph datasets

[0128]

[0129]

[0130]

[0131] From Table 2 and Table 3, we can draw the following conclusions:

[0132] (1) The model (DGGAN) proposed in this example is significantly better than the baseline model in terms of the quality of the generated graph. Although the average N-Component value of DGGAN on the EMAIL dataset is higher than that of NetGAN, DGGAN is better than the baseline model in other evaluation indicators of the six datasets, which verifies the effectiveness of the model. In particular, DGGAN achieves 10% on the DBLP and SO datasets in terms of the Deg. evaluation indicator. -5 The order of magnitude is 10 on the College, MATH, and USER datasets. -4In comparison, the current state-of-the-art dynamic graph generation model TagGen has a Deg. evaluation index of 10 on multiple datasets. -2 The order of magnitude proves that DGGAN has a significant advantage in simulating the degree distribution of graphs. In addition, DGGAN also performs well in other key indicators such as clustering coefficient, Gini coefficient, and number of specific subgraphs, which shows that the model can effectively maintain the structural characteristics of the network, such as community structure and node connection density. According to the data in the last four columns, it can be seen that the dynamic graphs generated by the static graph generation method are of lower quality, which reflects the necessity of designing generation methods specifically for dynamic graphs.

[0133] (2) DGGAN has excellent generalization ability. DGGAN can generate high-quality graphs when processing graph datasets of different types and sizes, which proves that DGGAN has excellent generalization ability and robustness on networks of different types and sizes, and can be well applied to power networks.

[0134] (3) DGGAN has good scalability. For large-scale dynamic graphs (such as the USER dataset, which contains approximately 200,000 time-series nodes and 1.44 million time-series edges), deep learning-based models such as Graphite and GraphRNN require a GPU with more than 32G memory for training. The GPU used in this experiment cannot meet the memory requirements and cannot be trained. However, DGGAN can be trained on a GPU with 32G memory and has excellent scalability. DGGAN can make a good balance between training time and space consumption and training efficiency, and can simulate large-scale dynamic graphs with affordable time and memory consumption.

[0135] If the above method is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0136] Example 2

[0137] This embodiment provides an electronic device, including a memory and a processor, wherein the processor is used to execute a program stored in the memory, wherein the program includes a number of instructions and can execute all or part of the steps of the method described in Example 1. The memory includes a computer-readable storage medium, which can be a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

[0138] The above description of the embodiments is to facilitate the understanding and use of the invention by those skilled in the art. It is obvious that those skilled in the art can easily make various modifications to these embodiments and apply the general principles described herein to other embodiments without creative work. Therefore, the present invention is not limited to the above embodiments, and improvements and modifications made by those skilled in the art based on the disclosure of the present invention without departing from the scope of the present invention should be within the scope of protection of the present invention.

Claims

1. A method for generating dynamic graph data of smart grid based on deep adversarial training, characterized in that: The following steps are involved: Obtain smart grid time series graph data, input into a smart grid dynamic graph data generation model based on deep adversarial training, and generate a smart grid dynamic data graph; The smart grid dynamic graph data generation model based on deep adversarial training includes a sampling module, a generative adversarial network and a reconstruction module connected in sequence; wherein the sampling module is used to sample the smart grid timing graph data using a central graph sampling method to generate a central graph; The generative adversarial network includes a generator and a discriminator. The generator includes a decoder and an encoder. The encoder is used to encode the central graph through a time-series graph self-attention network constructed based on a multi-head self-attention mechanism to obtain the latent variables of the central graph; the decoder is used to decode the latent variables of the central graph to obtain the central graph score matrix; the discriminator is used to distinguish between real data and generated data; The reconstruction module is used to generate the classification distribution probability of each time series edge according to the central graph score matrix, and then generate a smart grid dynamic data graph.

2. According to claim 1, a method for generating smart grid dynamic graph data based on deep adversarial training is characterized in that: The generation process of the central graph is as follows: S101, determining an initial node of smart grid timing diagram data; S102, taking the initial node as the center, recursively sampling its neighboring nodes, with a sampling depth of k; S103, obtain a central graph with a radius of k, wherein the central graph includes any time series node u t And with u t All neighbor nodes whose shortest path length is less than or equal to k.

3. The method for generating smart grid dynamic graph data based on deep adversarial training according to claim 2, characterized in that: In step S101, the sampling probability of any time series node in the smart grid time series graph data is calculated according to the node degree, and then the initial node is determined.

4. The method for generating smart grid dynamic graph data based on deep adversarial training according to claim 3 is characterized in that: Any sequential node u t The calculation formula of the sampling probability is as follows: Among them, P(u t ) represents the time series node u t The sampling probability, deg(u t ) represents the node degree, V represents the set of all nodes, v t Represents a timing node.

5. The method for generating smart grid dynamic graph data based on deep adversarial training according to claim 1, characterized in that: The encoder includes multiple parallel time-series graph self-attention networks, each of which calculates the aggregated features of the central graph through a multi-head self-attention mechanism, and then outputs them as hidden variables of the central graph through a gating mechanism.

6. The method for generating smart grid dynamic graph data based on deep adversarial training according to claim 5, characterized in that: The generation process of the central graph latent variables is as follows: S201, mapping the feature vector of each time series node of the central graph to the hidden layer space R d′×n , obtain the mapping feature vector, where d′ is the target dimension and n is the number of attention heads; S202. Calculate the attention coefficient between each time series node and its neighboring nodes and normalize it: in, is the timing node u t and timing node v t The attention coefficient, is the normalized attention coefficient, and and timing nodes u respectively. t and timing node v t The mapping feature vector of , a is the attention weight of each attention head in the multi-head self-attention mechanism, [·‖·] represents vector concatenation, and LeakyReLU is a nonlinear activation function; S203, weightedly aggregating the mapping feature vectors of the neighboring nodes of each time series node based on the normalized attention coefficient, and obtaining the aggregated features of each time series node as the output of each attention head; Among them, σ is a nonlinear activation function; S204. Concatenate the outputs of all attention heads to obtain the current features of each node: Among them, Concat means vector concatenation, Head i represents the output of the i-th head in the temporal graph self-attention network, W o represents the output projection matrix; S205. Use the gating mechanism to combine the current features and original features of each node to obtain the hidden variable y of the central graph. ut : Among them, W g is the weight matrix, and ⊙ represents element multiplication.

7. The method for generating smart grid dynamic graph data based on deep adversarial training according to claim 1, characterized in that: The decoder decodes the hidden variables of the central graph through a gated recurrent unit to obtain a score matrix of the central graph. The expression of the score matrix is ​​as follows: s=W o (GRU(y ut ,h0))+b o Among them, s is the score matrix, W o is the weight matrix, is the central graph hidden variable output by the encoder, h0 is the initial hidden state of the gated recurrent unit, b o is the bias term.

8. The method for generating smart grid dynamic graph data based on deep adversarial training according to claim 1, characterized in that: The discriminator distinguishes between real data and generated data through a multi-layer perceptron.

9. The method for generating smart grid dynamic graph data based on deep adversarial training according to claim 1, characterized in that: The generative adversarial network is optimized by minimizing the loss function, which includes a generator loss function and a discriminator loss function. The expression of the generator loss function is as follows: Among them, V s Represents the initial node set of the central graph, n s represents the number of central graphs, represents the adjacency matrix of the central graph, represents the probability of generating a graph edge, G represents the generator, D represents the discriminator, and G(z) represents the data generated by the generator; The expression of the discriminator loss function is as follows: Among them, x represents the real data.

10. The method for generating smart grid dynamic graph data based on deep adversarial training according to claim 1, characterized in that: The specific process of generating the smart grid dynamic data graph by the reconstruction module is as follows: S301. Generate the classification distribution probability of each time series edge according to the central graph score matrix: Among them, p(u,v,t) is the time sequence edge (u t ,v t )’s classification distribution probability, S u,v,t is the final score matrix, which is obtained by summarizing all the central graph score matrices and then averaging the probability of each edge generation, and t is the timestamp; S302. Using the probability of classification distribution, a time series edge reflecting the dynamic changes of the smart grid is generated at each timestamp. When the number of generated time series edges is consistent with the number of edges in the original smart grid time series graph data, the generation process of the smart grid dynamic data graph is completed.

Citation Information

Patent Citations

  • Smart grid in-depth learning training sample generation method based on generated antagonistic network

    CN109359815A

  • Airsoldier agent confrontation behavior modeling method based on OptiGAN and space-time attention

    CN115293022A

  • Dynamic graph link generation method

    CN116306780A

  • Remote sensing data reconstruction method combining generative adversarial network and graph neural network

    CN117493786A

  • Neural network training method and system based on distributed continuous time dynamic graph

    CN117875391A

Cited By

  • Flow data generation method using hybrid generative adversarial network

    CN120013665A

  • Stream data generation method using hybrid generative adversarial network

    CN120013665B

  • Power industry dynamic image generation method based on semantic analysis

    CN121126079A