Low-voltage transformer area topology identification method based on graph attention network
By applying a graph attention network in the low-voltage platform distribution network, the importance and degree of influence between learning nodes are solved, and the problems of low-voltage platform topological recognition efficiency and insufficient accuracy in the existing technology are achieved, achieving more efficient and more accurate topological recognition effects.
Patent Information
- Application Number
- CN202411556016.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2025-02-25
AI Technical Summary
The prior art has problems such as low efficiency, high cost and error-prone in topological identification of low-voltage table areas, and cannot effectively deal with dynamic topological structures, resulting in difficulty in meeting the requirements of refined operation and control.
The Graph Attention Network (GAT) method is used to abstract the low-voltage table area distribution network into a network topology diagram. By training the GAT model, the importance and influence degree between nodes are learned, thereby achieving more accurate topological identification.
It improves the accuracy and efficiency of topological identification, can better handle dynamic topological structures, and meets the refined operation and control needs of the distribution network in the low-voltage station area.
Smart Images

Figure CN119518720A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of distribution network topology identification, and specifically is a low-voltage substation topology identification method based on a graph attention network. Background Art
[0002] As an important part of the power system, the topology of the low-voltage distribution network is directly related to the safe and stable operation and power supply quality of the power system. Traditional low-voltage distribution area topology identification mainly relies on manual work, which has problems such as low efficiency, high cost, and easy errors. How to effectively identify the topology of low-voltage distribution areas is an urgent problem to be solved. In recent years, with the rapid development of artificial intelligence technology, the application of deep learning to low-voltage distribution area topology identification has become a research hotspot. At present, topology identification technology mainly relies on static topology structure, but it has problems such as insufficient distinction of node importance and inability to handle dynamic topology structure. Its topology identification accuracy is difficult to meet the requirements of refined operation and control of low-voltage distribution networks.
[0003] Therefore, it is necessary to provide a new low-voltage distribution network topology identification method to solve the above technical problems. Summary of the invention
[0004] In view of the technical problems pointed out in the above background technology, the purpose of the present invention is to provide a low-voltage substation topology identification method based on graph attention network.
[0005] To achieve the purpose of the present invention, the technical solution provided by the present invention is as follows:
[0006] A low-voltage area topology identification method based on a graph attention network includes the following steps:
[0007] Step S1: Model training; details are as follows:
[0008] Step S1.1: abstract the low-voltage distribution network into a network topology diagram, regard switches and household meters as nodes of the network topology diagram, and regard lines as branches of the network topology diagram;
[0009] Step S1.2: Select the historical voltage measurement data of the low voltage area to construct a sample data set and obtain the input feature vector of each node;
[0010] Step S1.3: construct a switch state label vector corresponding to the topological structure;
[0011] Step S1.4: performing data preprocessing on the input feature vector of the node and the switch state label vector;
[0012] Step S1.5: Establish a GAT model structure, including an attention layer and an attention head structure. The attention layer is a layer in the GAT model, which is used to update node features and learn the relationship between nodes using the attention mechanism; the attention head structure is a component of the attention layer, which is used to independently update features and learn the relationship between nodes;
[0013] Step S1.6: Use the input feature vector and switch state label vector preprocessed in step S1.4 as input data and use Glorot to initialize the network parameter attention vector The weight matrix W of the feature vector is obtained, and the AdamSGD optimizer is used to minimize the cross entropy loss on the training node. The Early Stopping technique is used to determine when to terminate the training, and a low-voltage station topology recognition model based on the graph attention network is obtained.
[0014] Step S2: Topology identification; details are as follows:
[0015] Step 2.1: construct a topological diagram of the low-voltage distribution network to be identified;
[0016] Step 2.2: Obtain the real-time voltage measurement data collected by the low-voltage distribution, low-voltage outgoing line switches and low-voltage household meters of the low-voltage substation to be identified, and construct a node input feature vector;
[0017] Step 2.3: Preprocess the node input feature vector as model input data, marked as The dimension is F, and the trained low-voltage area topology identification model based on the graph attention network is called to obtain the corresponding model output, that is, the probability vector of the switch state estimation, and is marked as The low voltage area topology is obtained.
[0018] Among them, the step S1 also includes step S1.7: by comparing and analyzing with the GCN, DTW distance, and DNN models in terms of recognition accuracy and recognition time, the performance of the low-voltage substation topology recognition model based on the graph attention network is verified.
[0019] Among them, the step 2.1 specifically includes: abstracting the low-voltage distribution network to be identified into a network topology diagram, regarding switches and household meters as nodes of the network topology diagram, and regarding lines as branches of the network topology diagram.
[0020] Wherein, in the step 2.2, a sample data set is constructed by selecting historical voltage measurement data of the low-voltage substation to obtain an input feature vector of each node.
[0021] Wherein, the step S1.5: establishing the GAT model structure specifically includes:
[0022] Step S1.5.1: Construct a single-layer graph attention network; the input of each layer is a set of node features Where N is the number of nodes, F is the number of features in each node, and this layer produces a new set of node features. As the output of the network, F′ is the number of output features in each node;
[0023] Step S1.5.2: Based on the known eigenvector The corresponding topological structure determines the first-order neighbor node j of node i, j∈N i , where N i is a neighborhood of node i in the graph;
[0024] Step S1.5.3: As an initial step, the weight matrix W∈R F′×F , a parameterized shared linear transformation is applied to each node; then, a self-attention-shared attention machine a is performed on the node: R F′ ×R F′ →R, calculate the attention coefficient e ij , indicating the importance of node features of node j to node i. The attention coefficient formula is shown in formula (1):
[0025]
[0026] The attention mechanism is a single-layer feedforward neural network composed of a weight vector Parameterize and apply LeakyReLU function for nonlinear transformation, T represents transposition, || is the concatenation operation;
[0027] Step S1.5.4: To make the coefficients between different nodes easier to compare, all choices of j are normalized using the softmax function, calculated as follows:
[0028]
[0029] Among them, α ij represents the normalized attention coefficient, e ik represents the kth first-order neighbor node of i; after full expansion, the coefficient calculated by the attention mechanism can be expressed as:
[0030]
[0031] Step S1.5.5: The normalized attention coefficient will be used to calculate the linear combination of the features corresponding to it, and nonlinearly activated with the σ function to enhance the representation ability and robustness of the model as the final output feature of each node:
[0032]
[0033] Step S1.5.6: Construct multi-head attention for the same input feature vector K independent attention mechanisms perform the above transformation in parallel, and then combine their features to obtain the following output feature representation:
[0034]
[0035] in, Indicates average, is the kth attention mechanism (a k ) calculated the normalized attention coefficient, W k is the weight matrix of the corresponding input linear transformation, and the final output returned is It will consist of the KF′ features of each node;
[0036] Step S1.5.7: Construct a multi-head attention. The construction method is shown in equations (1)-(5). By stacking multiple attention heads, the GAT model can learn the local features in the node neighborhood and the global relationship between nodes, and obtain a richer node feature representation;
[0037] Step S1.5.8: After the feature vector input to the second layer of the GAT network is updated once, it is set as the fully connected layer pair Perform a linear transformation, and then use the softmax function to convert the linearly transformed vector into a probability distribution represents the probability that switch i is closed.
[0038] Wherein, the data preprocessing described in step S1.4 includes data denoising and data normalization.
[0039] Compared with the prior art, the present invention uses a graph attention network model to learn the importance and influence of nodes, thereby improving the interpretability of the model and more accurately predicting the substation topology. It avoids the problems of insufficient distinction of node importance and inability to handle dynamic topology in current methods, and is suitable for low-voltage substation networks with complex and changeable topologies, meeting the requirements for refined operation and control of distribution networks. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 is a flow chart of the model training phase provided by an embodiment of the present invention;
[0041] Figure 2 It is a schematic diagram of the process of constructing the GAT model in an embodiment of the present invention;
[0042] Figure 3It is a flow chart of a method for determining when to terminate training using the Early Stopping technology in an embodiment of the present invention. DETAILED DESCRIPTION
[0043] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0044] It should be noted that the low-voltage substation topology identification method based on the graph attention network provided by the present invention, in the model training stage, the method first abstracts the low-voltage substation distribution network into a network topology diagram, takes the historical voltage measurement data of the low-voltage substation as a sample data set, and constructs the input feature vector of the node. On this basis, the feature vector of the node and the switch state label of the corresponding topological structure are used as the input of the model, and the weight matrix W of the network parameter attention vector and the feature vector is trained using the graph attention network (GraphAttentionNetworks, GAT) model. By iteratively optimizing the loss function, a low-voltage substation topology identification model based on the graph attention network is obtained. In the topology identification stage, the real-time voltage measurement data collected by the low-voltage distribution, low-voltage outgoing line switch and low-voltage household meter are used to perform topological identification of the low-voltage substation based on the trained identification model.
[0045] like Figure 1-Figure 3 As shown, this embodiment provides a low-voltage area topology identification method based on a graph attention network, comprising the following steps:
[0046] Step S1: Model training; details are as follows:
[0047] Step S1.1: abstract the low-voltage distribution network into a network topology diagram, regard switches and household meters as nodes of the network topology diagram, and regard lines as branches of the network topology diagram;
[0048] Step S1.2: Select the historical voltage measurement data of the low voltage area to construct a sample data set and obtain the input feature vector of each node;
[0049] Step S1.3: construct a switch state label vector corresponding to the topological structure;
[0050] Step S1.4: performing data preprocessing on the input feature vector of the node and the switch state label vector;
[0051] Step S1.5: Establish a GAT model structure, including an attention layer and an attention head structure. The attention layer is a layer in the GAT model, which is used to update node features and learn the relationship between nodes using the attention mechanism; the attention head structure is a component of the attention layer, which is used to independently update features and learn the relationship between nodes;
[0052] Step S1.6: Use the input feature vector and switch state label vector preprocessed in step S1.4 as input data and use Glorot to initialize the network parameter attention vector The weight matrix W of the feature vector is obtained, and the AdamSGD optimizer is used to minimize the cross entropy loss on the training node. The Early Stopping technique is used to determine when to terminate the training, and a low-voltage station topology recognition model based on the graph attention network is obtained.
[0053] Step S2: Topology identification; details are as follows:
[0054] Step 2.1: construct a topological diagram of the low-voltage distribution network to be identified;
[0055] Step 2.2: Obtain the real-time voltage measurement data collected by the low-voltage distribution, low-voltage outgoing line switches and low-voltage household meters of the low-voltage substation to be identified, and construct a node input feature vector;
[0056] Step 2.3: Preprocess the node input feature vector as model input data, marked as The dimension is F, and the trained low-voltage area topology identification model based on the graph attention network is called to obtain the corresponding model output, that is, the probability vector of the switch state estimation, and is marked as The low voltage area topology is obtained.
[0057] Among them, the step S1 also includes step S1.7: by comparing and analyzing with the GCN, DTW distance, and DNN models in terms of recognition accuracy and recognition time, the performance of the low-voltage substation topology recognition model based on the graph attention network is verified.
[0058] Among them, the step 2.1 specifically includes: abstracting the low-voltage distribution network to be identified into a network topology diagram, regarding switches and household meters as nodes of the network topology diagram, and regarding lines as branches of the network topology diagram.
[0059] Wherein, in the step 2.2, a sample data set is constructed by selecting historical voltage measurement data of the low-voltage substation to obtain an input feature vector of each node.
[0060] Wherein, the step S1.5: establishing the GAT model structure specifically includes:
[0061] Step S1.5.1: Construct a single-layer graph attention network; the input of each layer is a set of node features Where N is the number of nodes, F is the number of features in each node, and this layer produces a new set of node features. As the output of the network, F′ is the number of output features in each node;
[0062] Step S1.5.2: Based on the known eigenvector The corresponding topological structure determines the first-order neighbor node j of node i, j∈N i , where N i is a neighborhood of node i in the graph;
[0063] Step S1.5.3: As an initial step, the weight matrix W∈R F′×F , a parameterized shared linear transformation is applied to each node; then, a self-attention-shared attention machine a is performed on the node: R F′ ×R F′ →R, calculate the attention coefficient e ij , indicating the importance of node features of node j to node i. The attention coefficient formula is shown in formula (1):
[0064]
[0065] The attention mechanism is a single-layer feedforward neural network composed of a weight vector Parameterize and apply LeakyReLU function for nonlinear transformation, T represents transposition, || is the concatenation operation;
[0066] Step S1.5.4: To make the coefficients between different nodes easier to compare, all choices of j are normalized using the softmax function, calculated as follows:
[0067]
[0068] Among them, α ij represents the normalized attention coefficient, e ik represents the kth first-order neighbor node of i; after full expansion, the coefficient calculated by the attention mechanism can be expressed as:
[0069]
[0070] Step S1.5.5: The normalized attention coefficient will be used to calculate the linear combination of the features corresponding to it, and nonlinearly activated with the σ function to enhance the representation ability and robustness of the model as the final output feature of each node:
[0071]
[0072] Step S1.5.6: Construct multi-head attention for the same input feature vector K independent attention mechanisms perform the above transformation in parallel, and then combine their features to obtain the following output feature representation:
[0073]
[0074] in, Indicates average, is the kth attention mechanism (a k ) calculated the normalized attention coefficient, W k is the weight matrix of the corresponding input linear transformation, and the final output returned is It will consist of the KF′ features of each node;
[0075] Step S1.5.7: Construct a multi-head attention. The construction method is shown in equations (1)-(5). By stacking multiple attention heads, the GAT model can learn the local features in the node neighborhood and the global relationship between nodes, and obtain a richer node feature representation;
[0076] Step S1.5.8: After the feature vector input to the second layer of the GAT network is updated once, it is set as the fully connected layer pair Perform a linear transformation, and then use the softmax function to convert the linearly transformed vector into a probability distribution represents the probability that switch i is closed.
[0077] Wherein, the data preprocessing described in step S1.4 includes data denoising and data normalization.
[0078] It should be noted that the method for constructing the node input feature vector and switch state label vector involved in step S1.2 and step S1.3 of the model training phase is as follows:
[0079] (1) Node input feature vector
[0080] Construct the corresponding sample vector u for the collected low-voltage area node voltage measurement data i ,u i =(u i1 ,u i2 ,…,u it ), i∈(1,N), u i1 ,u i2 ,……,u it They are the voltage measurement data corresponding to the same node at different times.
[0081] (2) Switch state label vector
[0082] The voltage measurement data of the low-voltage area at each moment corresponds to the switch state of the topological structure as the label vector N represents the number of all switches to be evaluated.
[0083] It should be noted that the data preprocessing method for the input node feature vector and label vector in step S1.4 of the model training phase is as follows:
[0084] Data preprocessing includes two parts: data denoising and data normalization, which processes the original data to improve the accuracy of model prediction.
[0085] (1) Data denoising
[0086] When the measurement devices in the distribution network collect and transmit measurement data, the device itself and the external environment may affect the data. Therefore, it is necessary to denoise the measurement data to restore the real data as much as possible and ensure the quality of the input data of the topology identification model.
[0087] This paper uses the approximately symmetrical compactly supported orthogonal wavelet (Symlet) denoising function to preliminarily process the measurement data. Symlet wavelet has good symmetry and can reduce distortion when denoising data.
[0088] (2) Data normalization
[0089] Normalizing the data so that the preprocessed data is mapped to a fixed range (such as [0,1] or [-1,1]) according to a certain mapping relationship can eliminate the impact of singular sample data on the model training effect, and can also speed up the gradient descent method, obtain the optimal solution faster, and improve the model convergence speed and training accuracy.
[0090] This paper adopts the Min-Max normalization method to map the data to the [0,1] interval according to a certain mapping relationship to achieve data normalization. The mapping function is:
[0091]
[0092] Among them, u and u norm are the node voltage amplitudes before and after normalization of the node; u min and u max are respectively the minimum and maximum values of the historical voltage amplitude measurement data at this node.
[0093] The training method of the GAT-based topology recognition model involved in step S1.6 of the model training phase is as follows:
[0094] 1) Construction of training set, validation set and test set. The input feature vector of each node after preprocessing and the switch state label vector of the corresponding topological structure are divided into training set, validation set and test set in a ratio of 6:1:1. The training set is used to train the model and determine parameters (such as weight matrix W and attention vector ), the validation set is used as the data basis for hyperparameter tuning, and the test set is used to test the accuracy of the model.
[0095] 2) Initialization of model parameters and hyperparameters. Set tolerance parameters, batch size, execution environment, etc. The model weights are initialized using the Glorot method; set the range of hyperparameter optimization, including the number of GAT layers, the number of GAT heads, the learning rate, etc. This patent defines the cross entropy function (CE) as the loss function for model training, and its formula is:
[0096]
[0097] Among them, L c is the loss function value of all nodes in the graph; y m is the true value of the mth switch node state; is the predicted value of the mth switch node state.
[0098] 3) Model training and parameter tuning. The input node feature vector and the switch state label vector of the corresponding topological structure are used as the input of the model. The model is trained using the GNNs library function, and the commonly used Adam SGD algorithm is selected as the optimizer for model parameter training. At the same time, the gradient descent method is used to update the weights, and the Early Stopping technology is used to decide whether to stop model training.
[0099] 4) Save the trained GAT model recognition results.
[0100] It should be noted that the GAT model construction method involved in step S1.5 of the model training phase is as follows: GAT uses two attention layers. The first layer is used for feature extraction and sets K attention heads. The second layer sets 1 attention head for classification to generate probability distribution. The first layer uses a single-layer feedforward neural network. First, the attention coefficient is calculated. The formula is as follows:
[0101]
[0102] Among them, e ij is the attention coefficient, which indicates the importance of the feature of node j to node i; and Represents the feature vector W of node i and node j, W∈R F′×F represents the weight matrix of the node feature vector, represents the attention vector, T represents the transpose, and both are learned by the network after GRO initialization; then, the self-attention-shared attention mechanism a is performed on the node: R F′ ×R F′ →R calculates the attention coefficient e ij , indicating the importance of node features of node j to node i; || is the concatenation operation; LeakyReLU is the activation function, indicating a nonlinear transformation of the formula; softmax indicates the transformation of e ij Normalize.
[0103] The feature vector update is calculated as follows:
[0104]
[0105] in, is the updated feature vector of single-layer GAT, and W is The weight, α ij is the attention coefficient obtained from the above formula; σ represents the nonlinear activation of the formula.
[0106] Construct multi-head attention, K independent attention mechanisms execute the above transformation in parallel, and then connect their features to obtain the following output feature representation:
[0107]
[0108] Among them, 1 / K represents the average, is the kth attention mechanism (a k ) calculated the normalized attention coefficient, W k is the weight matrix of the corresponding input linear transformation, and the final output returned is will consist of the KF' features of each node.
[0109] After a feature update, the feature vector input to the second layer of the GAT network is set as the fully connected layer pair Perform a linear transformation, and then use the softmax function to convert the linearly transformed vector into a probability distribution represents the probability that switch i is closed.
[0110] It should be noted that the method for Glorot initialization of GAT model network parameters involved in step S1.6 of the model training phase is as follows:
[0111] The Glorot initialization algorithm, also known as the Xavier initialization algorithm, is an algorithm for initializing parameters of deep neural networks. The goal of this algorithm is to keep the variance of activation values unchanged during forward and backward propagation, thereby avoiding the gradient vanishing or gradient exploding problem.
[0112] The Glorot initialization algorithm calculates the standard deviation of the initialization parameters based on the number of nodes in the input layer and the output layer. However, this definition needs some adjustments when dealing with graph networks GAT, because the connections in the graph network are based on the topological structure of the graph, rather than a simple linear layer. In the attention layer of GAT, each attention head is actually processing these feature vectors instead of directly processing the number of nodes. Here we use the normalized Glorot, and its calculation formula is as follows:
[0113]
[0114] Among them, σ represents the standard deviation of the initialization parameters, which determines the distribution range of the initialization parameters. The larger the value, the wider the range of the parameter values. in Indicates the dimension of the input node feature vector. The larger the value, the more information the input layer contains, and a larger parameter value is required to represent it. out Represents the dimension of the output node feature vector. The larger the value, the more information the output layer needs to process, and a smaller parameter value is needed to avoid overfitting.
[0115] The specific steps of the Glorot algorithm are as follows:
[0116] 1) Determine the dimension of the input feature vector and set the length of the node voltage sequence to F.
[0117] 2) Determine the dimension of the output feature vector and set it according to the architecture of the GAT model, set it to F'.
[0118] 3) For each GAT layer, the weight matrix W is initialized using the Glorot initialization method, and the weights are randomly drawn from a normal distribution centered on 0, and the scale of the distribution is determined by the following formula.
[0119]
[0120] 4) The initialization formula is shown as follows:
[0121]
[0122] When calculating the attention coefficient, it is necessary to combine W with the node feature vector h i and h j Concatenate and multiply This is because The dimension of matches the concatenated feature vector dimension, so that a dot product operation can be performed to generate a scalar. fan in and fan out 2F' and 1 respectively.
[0123] It should be noted that the method of minimizing the cross entropy loss on the training node using the Adam SGD optimizer involved in step S1.6 of the model training phase is as follows:
[0124] The Adam SGD optimizer is an optimizer that combines the advantages of the Adam optimizer and the SGD optimizer. It can adaptively adjust the learning rate like the Adam optimizer, and can also maintain the stability of the learning rate like the SGD optimizer. Therefore, the Adam SGD optimizer has better results when training deep neural networks.
[0125] The Adam SGD optimizer combines the principles of the Adam optimizer and the SGD optimizer. It uses the Adam optimizer to calculate the gradient estimate and variance estimate of each parameter, and then uses the SGD optimizer to update the parameter value. Specifically, the AdamSGD optimizer updates the parameter value according to the following formula:
[0126]
[0127] Among them, θ t represents the parameter value of the tth iteration; θ t+1 represents the parameter value of the t+1th iteration; α represents the learning rate; m t represents the estimated gradient value of the tth iteration; v t represents the variance estimate of the t-th iteration; ε represents a small constant to prevent division by zero.
[0128] The specific steps of the Adam SGD algorithm are as follows:
[0129] 1) After initializing the GAT network parameters, initialize the first-order moment estimate m and the second-order moment estimate v to 0.
[0130] 2) Calculate the gradient: For each training sample, calculate the cross entropy loss function between the output of the GAT model and the true switch state. Then, calculate the cross entropy loss function with respect to the parameters W and The gradient of . :
[0131] 3) Update the first-order moment estimate and the second-order moment estimate: Use the formula of the Adam SGD algorithm to update m and v. As shown in the following formula.
[0132] m t+1 =β1m t +(1-β1)g t
[0133] v t+1 =β2v t+1 +(1-β2)g t 2
[0134] Among them, m t+1 represents the estimated gradient value of the t+1th iteration; v t+1 represents the variance estimate of the t+1th iteration, β1 is a hyperparameter called the “momentum term”, and its value is set to 0.9; β2 is a hyperparameter called the “learning rate decay term”, and its value is set to 0.999; g t is the gradient at the current moment. m_t is the first-order moment estimate at the previous moment.
[0135] 4) Correct the first-order moment estimate and the second-order moment estimate. Since both m and v are 0 at the time of initialization, they may be inaccurate in the initial stage. To solve this problem, m and v are usually corrected:
[0136]
[0137] Among them, m hat and v hat Represent the bias-corrected versions of the first-order moment estimate and the second-order moment estimate, respectively.
[0138] 5) Update the model parameters using the corrected first-order moment estimates and second-order moment estimates.
[0139] It should be noted that the method for determining when to terminate training using the Early Stopping technique in step S1.6 of the model training phase is as follows:
[0140] Early Stopping is a common technique to prevent neural networks from overfitting. It determines when to stop training by monitoring the performance of the model on the training set. When the performance of the model on the training set no longer improves or begins to decline, the training process will be terminated early, thereby preventing the model from learning the noise on the training set and improving the generalization ability of the model.
[0141] The specific steps of the Early Stopping algorithm are as follows:
[0142] 1) Set performance indicators and thresholds: Here, select accuracy as the monitoring variable, initially set patience to 10 epochs, and the minimum change in the monitoring variable to 0.001 to determine whether the model performance stops improving or starts to decline.
[0143] 2) Divide the data set: Divide the data set into training set, validation set and test set. The training set is used to train the model, the validation set is used for Early Stopping, and the test set is used to evaluate the generalization ability of the model.
[0144] 3) Training model: Use the training set to train the model. At the end of each epoch, use the validation set to evaluate the model performance.
[0145] 4) Determine whether to stop training: If the model's performance indicators do not improve or begin to decline within 10 consecutive epochs, stop training.
[0146] 5) Select the best model: During the training process, record the accuracy of the model in each epoch and select the model with the best accuracy as the final model.
[0147] 8. The model performance verification method involved in step 7 of the model training phase is as follows:
[0148] In order to comprehensively consider the relative error and absolute error between the repaired value and the true value, this paper uses the following evaluation indicators to measure the accuracy of model repair.
[0149] 1) Accuracy (ACC)
[0150] The calculation formula is as follows:
[0151]
[0152] 2) Test time
[0153] Running the model multiple times and calculating the average running time can more accurately reflect the performance of the model. The calculation formula is as follows:
[0154]
[0155] Among them, z is the total number of runs, t ave is the average running time.
[0156] Finally, it should be noted that the above embodiments are only used to illustrate and explain the present invention, and are not intended to limit the present invention to the scope of the described embodiments. In addition, those skilled in the art can understand that the present invention is not limited to the above embodiments, and more variations and modifications can be made according to the teachings of the present invention, and these variations and modifications all fall within the scope of the protection claimed by the present invention.
Claims
1. A low voltage area topology identification method based on graph attention network, characterized in that: The steps include: Step S1: Model training; details are as follows: Step S1.1: abstract the low-voltage distribution network into a network topology diagram, regard switches and household meters as nodes of the network topology diagram, and regard lines as branches of the network topology diagram; Step S1.2: Select the historical voltage measurement data of the low voltage area to construct a sample data set and obtain the input feature vector of each node; Step S1.3: construct a switch state label vector corresponding to the topological structure; Step S1.4: performing data preprocessing on the input feature vector of the node and the switch state label vector; Step S1.5: Establish a GAT model structure, including an attention layer and an attention head structure. The attention layer is a layer in the GAT model, which is used to update node features and learn the relationship between nodes using the attention mechanism; the attention head structure is a component of the attention layer, which is used to independently update features and learn the relationship between nodes; Step S1.6: Use the input feature vector and switch state label vector preprocessed in step S1.4 as input data and use Glorot to initialize the network parameter attention vector The weight matrix W of the feature vector is obtained, and the Adam SGD optimizer is used to minimize the cross entropy loss on the training node. The Early Stopping technique is used to determine when to terminate the training, and a low-voltage station topology identification model based on the graph attention network is obtained. Step S2: Topology identification; details are as follows: Step 2.1: construct a topological diagram of the low-voltage distribution network to be identified; Step 2.2: Obtain the real-time voltage measurement data collected by the low-voltage distribution, low-voltage outgoing line switches and low-voltage household meters of the low-voltage substation to be identified, and construct a node input feature vector; Step 2.3: Preprocess the node input feature vector as model input data, marked as The dimension is F, and the trained low-voltage area topology identification model based on the graph attention network is called to obtain the corresponding model output, that is, the probability vector of the switch state estimation, and is marked as The low voltage area topology is obtained.
2. According to claim 1, a low voltage area topology identification method based on graph attention network is characterized in that: The step S1 also includes step S1.7: by comparing and analyzing the GCN, DTW distance, and DNN models in terms of recognition accuracy and recognition time, the performance of the low-voltage substation topology recognition model based on the graph attention network is verified.
3. According to claim 1, a low voltage area topology identification method based on graph attention network is characterized in that: The step 2.1 specifically includes: abstracting the low-voltage distribution network to be identified into a network topology diagram, regarding switches and household meters as nodes of the network topology diagram, and regarding lines as branches of the network topology diagram.
4. According to claim 1, a low voltage area topology identification method based on graph attention network is characterized in that: In the step 2.2, a sample data set is constructed by selecting historical voltage measurement data of the low-voltage area to obtain an input feature vector for each node.
5. According to claim 1, a low voltage area topology identification method based on graph attention network is characterized in that: The step S1.5: establishing a GAT model structure specifically includes: Step S1.5.1: Construct a single-layer graph attention network; the input of each layer is a set of node features Where N is the number of nodes, F is the number of features in each node, and this layer produces a new set of node features. As the output of the network, F′ is the number of output features in each node; Step S1.5.2: Based on the known eigenvector The corresponding topological structure determines the first-order neighbor node j of node i, j∈N i , where N i is a neighborhood of node i in the graph; Step S1.5.3: As an initial step, the weight matrix W∈R F′×F , a parameterized shared linear transformation is applied to each node; then, a self-attention-shared attention machine a is performed on the node: R F′ ×R F′ →R, calculate the attention coefficient e ij , indicating the importance of node features of node j to node i. The attention coefficient formula is shown in formula (1): The attention mechanism is a single-layer feedforward neural network composed of a weight vector Parameterize and apply LeakyReLU function for nonlinear transformation, T represents transposition, || is the concatenation operation; Step S1.5.4: To make the coefficients between different nodes easier to compare, all choices of j are normalized using the softmax function, calculated as follows: Among them, α ij represents the normalized attention coefficient, e ik represents the kth first-order neighbor node of i; after full expansion, the coefficient calculated by the attention mechanism can be expressed as: Step S1.5.5: The normalized attention coefficient will be used to calculate the linear combination of the features corresponding to it, and nonlinearly activated with the σ function to enhance the representation ability and robustness of the model as the final output feature of each node: Step S1.5.6: Construct multi-head attention for the same input feature vector K independent attention mechanisms perform the above transformation in parallel, and then combine their features to obtain the following output feature representation: in, Indicates average, is the kth attention mechanism (a k ) calculated the normalized attention coefficient, W k is the weight matrix of the corresponding input linear transformation, and the final output returned is It will consist of the KF′ features of each node; Step S1.5.7: Construct a multi-head attention. The construction method is shown in equations (1)-(5). By stacking multiple attention heads, the GAT model can learn the local features in the node neighborhood and the global relationship between nodes, and obtain a richer node feature representation; Step S1.5.8: After the feature vector input to the second layer of the GAT network is updated once, it is set as the fully connected layer pair Perform a linear transformation, and then use the softmax function to convert the linearly transformed vector into a probability distribution represents the probability that switch i is closed.
6. According to claim 1, a low voltage area topology identification method based on graph attention network is characterized in that: The data preprocessing described in step S1.4 includes data denoising and data normalization.
Citation Information
Patent Citations
Graph data driven power distribution network topology identification method, electronic equipment and storage medium
CN115935262A
Medium voltage distribution network topology identification method and system based on graph attention network
CN117039889A
Power distribution area topological structure sensing method and system based on graph attention network
CN117609909A
Cited By
Multi-head attention dynamic optimization method oriented to power grid topology self-adaption
CN120146321A
Distribution area three-phase impedance matrix identification method based on self-supervised graph attention network
CN120357472A