Power distribution network state estimation method fusing neural network and attention mechanism
Through the distribution network state estimation method that integrates neural networks and attention mechanisms, the deep neural network and long-term memory network modules are used, and the attention mechanism is combined to achieve high-precision distribution network state estimation, solving the system in traditional methods Parameter dependence and overfitting and underfitting improve estimation accuracy and robustness.
Patent Information
- Application Number
- CN202411174108.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2024-12-06
AI Technical Summary
The traditional distribution network state estimation method relies on system structural parameters and is difficult to deal with the impact of source load equipment on system parameter changes, resulting in low accuracy and prone to overfitting and underfitting.
The distribution network state estimation method is adopted to integrate neural networks and attention mechanisms. The state estimation model is constructed through the deep neural network module, long-term memory network module and attention module, and the measurement data is used to perform high-precision state estimation, which avoids the system Dependency of parameters.
The accuracy and robustness of distribution network state estimation are improved, the underfitting and overfitting problems in traditional methods are solved, and the calculation efficiency is maintained.
Smart Images

Figure CN119093340A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of distribution network state estimation, and more specifically, relates to a distribution network state estimation method integrating a neural network and an attention mechanism. Background Art
[0002] The distribution network is a key hub connecting energy production and consumption. It is also a key link in the power system that directly faces end users. The efficient and stable operation of the distribution network directly affects the quality of life of residents. With the large-scale access of distributed energy, electric vehicles and other source-load devices to the distribution network, the traditional passive distribution network has been transformed into an active distribution network, resulting in a more complex and changeable operation of the distribution network. Compared with the stable operation of the power system, it is more difficult to estimate the state of the distribution network. The addition of source-load devices causes the system parameters of the distribution network to change, and the specific parameters of these devices are difficult to obtain in actual operation, which increases the difficulty of implementing the traditional physical model method that relies on the structural parameters of the distribution system. Therefore, it is necessary to invent a method that can achieve state estimation without relying on the system structure parameters.
[0003] The state estimation method of the distribution network is a method proposed based on the state estimation method of the power system and the characteristics of the distribution network itself. According to the time series relationship of the input data, it can be divided into static state estimation and dynamic state estimation. The input data of the static state estimation is real-time measurement data. The traditional algorithm is represented by the weighted least squares method (WLS). The overall state estimation of the distribution network is obtained by introducing system structure parameters for flow calculation. The dynamic state estimation introduces the system state parameters at the previous moment and adds real-time measurement data to estimate the state of the distribution network.
[0004] Artificial intelligence algorithms are widely used in the field of distribution network state estimation due to their own advantages such as learnability and high efficiency. Neural network algorithms are part of artificial intelligence algorithms. They can find the appropriate input-output correspondence by training historical data. In theory, the more training data there is, the more related elements there are, and the more accurate the output results are. Moreover, the neural network algorithm only analyzes the nonlinear relationship between input data and output data. When used in the field of distribution network state estimation, the training results are also related to the measurement data and have nothing to do with the system parameters, thus avoiding the impact of changes in system parameters on the accuracy of distribution network state estimation. However, the accuracy of using only traditional neural network algorithms is not high, and overfitting and underfitting may occur. Reasonable design of an intelligent algorithm architecture that better adapts to the needs of state estimation will effectively improve the accuracy and robustness of the results. Summary of the invention
[0005] The purpose of the present invention is to overcome the shortcomings of the prior art and provide a distribution network state estimation method that integrates a neural network algorithm and an attention mechanism, thereby realizing high-precision distribution network state estimation based on measured data through a distribution network state estimation model that integrates a neural network algorithm and an attention mechanism.
[0006] To achieve the above-mentioned object of the invention, the present invention provides a distribution network state estimation method integrating a neural network and an attention mechanism, characterized in that it comprises the following steps:
[0007] (1) Data collection;
[0008] Considering that the topology of the distribution network remains unchanged, the measurement data and status data of all known nodes in the distribution network at different times t are collected. The measurement data include: the active power P injected by the node i (t), node injected reactive power Q i (t), branch active power P ij (t), branch reactive power Q ij (t); The state data used for distribution network state estimation include: node voltage V i (t) and the node phase angle θ i (t); t=1,2,…,T, T is the total sampling time, i,j are the serial numbers of known nodes in the distribution network, i,j∈[1,N] and i≠j, N is the number of all known nodes in the distribution network;
[0009] (2) Constructing a training dataset;
[0010] The measured data at each moment constitutes the input data X = {x1, x2, ..., x t ,…,x T}, x t = {P i (t),Q i (t),P ij (t),Q ij (t)} i,j∈[1,N],i≠j , record the measured data x at each moment t The total number of elements in is M; the state data at each moment is used as the output data Y = {y1, y2, ..., y t ,…,y T},
[0011] The measurement data x at a single moment t and the state data y at the corresponding time t Form a set of training data to construct a training data set;
[0012] (3) Construct a distribution network state estimation model that integrates neural network algorithm and attention mechanism;
[0013] The distribution network state estimation model includes a deep neural network module DNN, a long short-term memory network module LSTM and an attention module Attention;
[0014] The DNN module includes two fully connected layers and two Relu activation functions. The output of each fully connected layer is connected to a Relu activation function. The number of neurons in the first fully connected layer and the number of neurons in the second fully connected layer are k1 and k2, respectively, satisfying: k1>M.
[0015] The LSTM module includes a fully connected layer, a Relu activation function, a neural network layer LSTM, a Relu activation function, and a data dimension conversion module connected in series, wherein the number of neurons in the fully connected layer is k1, and the number of neurons in the neural network layer LSTM is k3;
[0016] The Attention module includes a fully connected layer, a Softmax activation function, an attention layer, and a fully connected layer connected in series, where the number of neurons in the fully connected layer is n;
[0017] (4) Training the distribution network state estimation model;
[0018] (4.1) Randomly intercept the measurement data x at n consecutive moments in the training data set t and the state data y at the corresponding time t As a batch of training data, denoted as Then Input to the distribution network state estimation model;
[0019] (4.2) In the DNN module, measurement data After passing through two fully connected layers and the activation function Relu, a feature matrix S1 of size n*1*k1 is obtained;
[0020] (4.3) In the LSTM module, the measurement data First, after passing through the fully connected layer and the activation function Relu, a matrix of size n*1*k1 is obtained, and then after passing through the neural network layer LSTM and the Relu activation function, a matrix of size n*k3 is obtained; finally, the matrix of size n*k3 is dimensionally transformed through the data dimension conversion module to obtain a feature matrix S2 of the same size as the feature matrix S1;
[0021] (4.4) In the Attention module, the feature matrix S1 and the feature matrix S2 are simultaneously input into the Attention module, and are first processed by the fully connected layer and the Softmax activation function. The processed result is used as the Key value of the Attention layer. The feature matrix S2 is used as the Query value of the Attention layer, and then the allocation weight is calculated through the Attention layer. Finally, the prediction state at each moment is output through the fully connected layer according to the allocation weight.
[0022]
[0023] (4.5) Calculate the loss value after this round of training;
[0024] or
[0025] Among them, Loss MSE is the mean square error, Loss MAE is the mean absolute error;
[0026] (4.6) According to the loss value after this round of training, the Adam optimizer is used to update the weight of the distribution network state estimation model, and then the training is repeated until the distribution network state estimation model converges to obtain the trained distribution network state estimation model;
[0027] (5) Real-time estimation of distribution network status;
[0028] Collect the measurement data at the current moment, and then input the measurement data into the trained distribution network state estimation model to obtain the state estimation value at the current moment.
[0029] The object of the invention of the present invention is achieved in this way:
[0030] The present invention discloses a distribution network state estimation method integrating a neural network and an attention mechanism. First, a distribution network state estimation model integrating a neural network algorithm and an attention mechanism is constructed, and then input data for training is constructed. The input data is processed in two ways. One is directly connected to a traditional DNN, and the other needs to add a time series dimension to make it a three-dimensional data set connected to an LSTM network. Then, the output results of the two parallel modules are combined into the input of an attention module. Weights are allocated by this method to achieve accurate estimation of the distribution network state.
[0031] At the same time, the distribution network state estimation method integrating neural network and attention mechanism of the present invention also has the following beneficial effects:
[0032] (1) The present invention uses the traditional DNN algorithm and the LSTM algorithm in parallel, so that the model comprehensively considers the internal relationship of the data and the data association under different time series, and accurately quantifies the importance of the two relationships by assigning weights.
[0033] (2) The distribution network state estimation model constructed by the present invention solves the problems of underfitting and overfitting in the neural network training process by integrating three modules, and the accuracy of state estimation is also greatly improved. The training process is not slow due to the complexity of the model, and the computing efficiency is basically consistent with that of the traditional LSTM network. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 It is a flow chart of a distribution network state estimation method integrating a neural network and an attention mechanism according to the present invention;
[0035] Figure 2 It is the IEEE118 node model diagram;
[0036] Figure 3 It is a distribution network state estimation model diagram that integrates neural network algorithm and attention mechanism;
[0037] Figure 4 The following are the training results of the present invention and several other neural network methods, where (a) is the result of the DNN algorithm, (b) is the LSTM algorithm, and (c) is the algorithm of the present invention. DETAILED DESCRIPTION
[0038] The specific implementation of the present invention is described below in conjunction with the accompanying drawings so that those skilled in the art can better understand the present invention. It should be noted that in the following description, when the detailed description of known functions and designs may dilute the main content of the present invention, these descriptions will be omitted here.
[0039] Example
[0040] Figure 1 It is a flow chart of a distribution network state estimation method integrating a neural network and an attention mechanism according to the present invention.
[0041] In this embodiment, Figure 2 Taking the IEEE118 node model shown in FIG. 1 as an example, a distribution network state estimation method integrating a neural network and an attention mechanism is described in detail. Figure 1 As shown, the specific steps include:
[0042] S1, data collection;
[0043] Considering that the distribution network topology structure remains unchanged, select Figure 2The measurement data and status data of all known nodes in the distribution network at different times t are collected as shown, wherein the measurement data includes: the active power P injected by the node i (t), node injected reactive power Q i (t), branch active power P ij (t), branch reactive power Q ij (t); The state data used for distribution network state estimation include: node voltage V i (t) and the node phase angle θ i (t); t = 1, 2, ..., T, T is the total sampling time, i, j are the known node numbers in the distribution network, i, j ∈ [1, N] and i ≠ j, N is the number of all known nodes in the distribution network, and its value is 118;
[0044] S2, build training data set;
[0045] The measured data at each moment constitutes the input data X = {x1, x2, ..., x t ,…,x T}, x t = {P i (t),Q i (t),P ij (t),Q ij (t)} i,j∈[1,N],i≠j , record the measured data x at each moment t The total number of elements in is M = 500; the state data at each moment is used as the output data Y = {y1, y2, ..., y t ,…,y T}, N = 118;
[0046] The measurement data x at a single moment t and the state data y at the corresponding time t Form a set of training data to construct a training data set;
[0047] In this embodiment, in order to effectively reflect the impact of load fluctuation, we can also add 5% random disturbance to the measurement data.
[0048] S3. Construct a distribution network state estimation model that integrates neural network algorithm and attention mechanism;
[0049] like Figure 3 As shown, the distribution network state estimation model includes a deep neural network module DNN, a long short-term memory network module LSTM and an attention module Attention;
[0050] The DNN module includes two layers of fully connected layers Dense and two layers of Relu activation functions, and the output end of each fully connected layer is connected to a layer of Relu activation function; wherein the number of neurons in the first fully connected layer and the number of neurons in the second fully connected layer are k1=512 and k2=256 respectively; in this embodiment, the number of neurons k1 in the first fully connected layer is greater than the number of input parameters M, that is, k1>M is satisfied, thereby ensuring the correlation of associated input data; in addition, in order to ensure the nonlinear relationship between input and output, this embodiment also selects Relu as the activation function;
[0051] The LSTM module includes a fully connected layer, a Relu activation function, a neural network layer LSTM, a Relu activation function, and a data dimension conversion module connected in series in sequence, wherein the number of neurons in the fully connected layer is k1=512, and the number of neurons in the neural network layer LSTM is k3=256; in this embodiment, since there may be a lag of unknown duration between important events in the time series, and the LSTM network is very suitable for classification, processing, and prediction based on time series data, by building an LSTM network, the temporal relationship in the data can be effectively processed;
[0052] The Attention module includes a fully connected layer, a Softmax activation function, an attention layer, and a fully connected layer connected in series, where the number of neurons in the fully connected layer is n=118;
[0053] S4, training distribution network state estimation model;
[0054] S4.1. Randomly extract the measurement data x at n consecutive moments in the training data set. t and the state data y at the corresponding time t As a batch of training data, denoted as Then Input to the distribution network state estimation model;
[0055] S4.2. In the DNN module, measure the data After passing through two fully connected layers and the activation function Relu, a feature matrix S1 of size n*1*k1 is obtained;
[0056] S4.3. In the LSTM module, measure the data First, after passing through the fully connected layer and the activation function Relu, a matrix of size n*1*k1 is obtained, and then after passing through the neural network layer LSTM and the Relu activation function, a matrix of size n*k3 is obtained; finally, the matrix of size n*k3 is dimensionally transformed through the data dimension conversion module to obtain a feature matrix S2 of the same size as the feature matrix S1;
[0057] S4.4. In the Attention module, the feature matrix S1 and the feature matrix S2 are simultaneously input into the Attention module, and are first processed by the fully connected layer and the Softmax activation function. The processed result is used as the Key value of the Attention layer. The feature matrix S2 is used as the Query value of the Attention layer, and then the allocation weight is calculated through the Attention layer. Finally, the predicted state at each moment is output through the fully connected layer according to the allocation weight.
[0058]
[0059] S4.5. Calculate the loss value after this round of training;
[0060] or
[0061] Among them, Loss MSE is the mean square error, Loss MAE is the mean absolute error;
[0062] S4.6. Update the weight of the distribution network state estimation model using the Adam optimizer according to the loss value after this round of training, and then iterate the training repeatedly until the distribution network state estimation model converges to obtain a trained distribution network state estimation model;
[0063] S5, real-time estimation of distribution network status;
[0064] Collect the measurement data at the current moment, and then input the measurement data into the trained distribution network state estimation model to obtain the state estimation value at the current moment.
[0065] Example Simulation
[0066] In this embodiment, the DNN and LSTM algorithms are used as control groups, and the present invention is used to perform 100 iterations of learning in 1000 time series test data. The number of samples randomly selected from the entire training data set in each training iteration is 32, 80% of all the data is selected as the training set data, and the remaining 20% is used as the test set data. Figure 4(a) is the training result of the DNN algorithm, (b) is the training result of the LSTM algorithm, and (c) is the training result of the present invention. The left figure in Figures (a), (b), and (c) is the curve of the change in accuracy of the training set and test set data as the number of iterations increases, and the right figure is the curve of the change between the loss function value and the number of iterations during the training of the training set data and the test set data. The DNN algorithm structure in the control group is mainly composed of four fully connected Dense layers, and the number of neurons set in each layer is 512, 256, 256, and 118 respectively; the LSTM algorithm module is composed of 5 layers, which are arranged in order of LSTM layer, Dropout layer, LSTM layer, Dropout layer, and Dense layer. The number of neurons in the two LSTM layers and Dense layer of the model is 512, 256, and 118 from front to back, respectively. The Dropout layer parameter is set to 0.2, and the generalization ability of the LSTM algorithm model can be improved by ignoring some neurons through the Dropout layer. Figure 4 From the training and test curves in (a), we can see that the loss function of the traditional DNN algorithm decreases the fastest. However, during the iteration process, both the training data and the test data fluctuate between 0 and 1, indicating that this method has underfitting and overfitting. Figure 4 In (b), the loss function of the LSTM algorithm fluctuates with the number of training times. The accuracy of the training data is low in the early stage, but the accuracy of the test data has been slowly increasing, indicating that the LSTM algorithm has overfitting. Figure 4 (c) shows that the present invention does not change slowly in the early stage, but the accuracy changes drastically in the later stage of training. The accuracy of both training data and test data remains at a high level, and there is no underfitting or overfitting in the middle.
[0067] Table 1 compares the state estimation results of the voltage amplitude of the distribution network under the same conditions using several different neural network methods. Here, the least squares method (WLS algorithm) estimates the state results through the obtained measured data based on the known structural parameters of the distribution network model. Some of the cases where the state estimation results of the distribution network do not converge due to insufficient measured data are eliminated, and only the converged state estimation results are selected for comparison. It can be seen from Table 3 that the mean square error of the traditional WLS algorithm is 10^(-4) and the absolute error is 10^(-3); the mean square error of the DNN algorithm and the LSTM algorithm is 10^(-5) and the absolute error is 10^(-3); however, the mean square error of the present invention is 10^(-6) and the absolute error is 10^(-4). It is not difficult to see from the comparison results of these four methods that the results of the present invention are the most accurate and the model has the highest accuracy.
[0068] Table 1. Distribution network state estimation results
[0069] WLS DNN LSTM The present invention MSE 1.396*10^(-4) 1.926*10^(-5) 1.348*10^(-5) 1.805*10^(-6) MAE 9.2*10^(-3) 3.6*10^(-3) 1.2*10^(-3) 8.71*10^(-4)
[0070] Although the above describes the illustrative specific embodiments of the present invention to facilitate those skilled in the art to understand the present invention, it should be clear that the present invention is not limited to the scope of the specific embodiments. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations using the concept of the present invention are protected.
Claims
1. A distribution network state estimation method integrating neural network and attention mechanism, characterized in that: The following steps are involved: (1) Data collection; Considering that the topology of the distribution network remains unchanged, the measurement data and status data of all known nodes in the distribution network at different times t are collected. The measurement data include: the active power P injected by the node i (t), node injected reactive power Q i (t), branch active power P ij (t), branch reactive power Q ij (t); The state data used for distribution network state estimation include: node voltage V i (t) and the node phase angle θ i (t); t=1,2,…,T, T is the total sampling time, i,j are the serial numbers of known nodes in the distribution network, i,j∈[1,N] and i≠j, N is the number of all known nodes in the distribution network; (2) Constructing a training dataset; The measured data at each moment constitutes the input data X = {x1, x2, ..., x t ,…,x T }, x t = {P i (t),Q i (t),P ij (t),Q ij (t)} i,j∈[1,N],i≠j , record the measured data x at each moment t The total number of elements in is M; the state data at each moment is used as the output data Y = {y1, y2, ..., y t ,…,y T }, The measurement data x at a single moment t and the state data y at the corresponding time t Form a set of training data to construct a training data set; (3) Construct a distribution network state estimation model that integrates neural network algorithm and attention mechanism; The distribution network state estimation model includes a deep neural network module DNN, a long short-term memory network module LSTM and an attention module Attention; The DNN module includes two fully connected layers and two Relu activation functions. The output of each fully connected layer is connected to a Relu activation function. The number of neurons in the first fully connected layer and the number of neurons in the second fully connected layer are k1 and k2, respectively, satisfying: k1>M. The LSTM module includes a fully connected layer, a Relu activation function, a neural network layer LSTM, a Relu activation function, and a data dimension conversion module connected in series, wherein the number of neurons in the fully connected layer is k1, and the number of neurons in the neural network layer LSTM is k3; The Attention module includes a fully connected layer, a Softmax activation function, an attention layer, and a fully connected layer connected in series, where the number of neurons in the fully connected layer is n; (4) Training the distribution network state estimation model; (4.1) Randomly intercept the measurement data x at n consecutive moments in the training data set t and the state data y at the corresponding time t As a batch of training data, denoted as Then Input to the distribution network state estimation model; (4.2) In the DNN module, measurement data After passing through two fully connected layers and the activation function Relu, a feature matrix S1 of size n*1*k1 is obtained; (4.3) In the LSTM module, the measurement data First, after passing through the fully connected layer and the activation function Relu, a matrix of size n*1*k1 is obtained, and then after passing through the neural network layer LSTM and the Relu activation function, a matrix of size n*k3 is obtained; finally, the matrix of size n*k3 is dimensionally transformed through the data dimension conversion module to obtain a feature matrix S2 of the same size as the feature matrix S1; (4.4) In the Attention module, the feature matrix S1 and the feature matrix S2 are simultaneously input into the Attention module, and are first processed by the fully connected layer and the Softmax activation function. The processed result is used as the Key value of the Attention layer. The feature matrix S2 is used as the Query value of the Attention layer, and then the allocation weight is calculated through the Attention layer. Finally, the prediction state at each moment is output through the fully connected layer according to the allocation weight. (4.5) Calculate the loss value after this round of training; or Among them, Loss MSE is the mean square error, Loss MAE is the mean absolute error; (4.6) According to the loss value after this round of training, the Adam optimizer is used to update the weight of the distribution network state estimation model, and then the training is repeated until the distribution network state estimation model converges to obtain the trained distribution network state estimation model; (5) Real-time estimation of distribution network status; Collect the measurement data at the current moment, and then input the measurement data into the trained distribution network state estimation model to obtain the state estimation value at the current moment.
Citation Information
Cited By
Active power distribution network state estimation method and system based on GCN and Transform fusion
CN119765662A
