Distribution network operation risk assessment method and system based on improved generative adversarial network
By improving the generative adversarial network and DTW K-medoids clustering algorithm, typical operating risk scenarios of distribution networks are generated, complexity of risk assessment in medium and low voltage distribution networks is solved, rapid and accurate risk assessment and early warning are achieved, and the reliability of distribution networks is improved.
Patent Information
- Application Number
- CN202510582418.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-08-15
AI Technical Summary
The operating conditions of medium and low voltage distribution networks are complex, the network is changing, the power supply quality and reliability need to be improved, and it is difficult for existing technology to effectively conduct risk warning and control.
The typical operating risk scenarios of the improved generative adversarial network generation distribution network are adopted, and the scenarios are reduced through the DTW K-medoids clustering algorithm, and the real-time data is used for rapid evaluation.
It realizes efficient and rapid assessment of distribution network operation risks, improves power supply reliability and stability, and supports timely early warning.
Smart Images

Figure CN120494501A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of distribution network optimization, and in particular to a distribution network operation risk assessment method and system based on an improved generative adversarial network. Background Art
[0002] my country's rapid economic development and increasing demand for electricity are accelerating the depletion of non-renewable energy and causing environmental pollution. Consequently, distributed power sources (DGs) are becoming increasingly common. However, medium- and low-voltage distribution networks incorporating DGs face complex operating conditions and a complex and volatile network. This leaves room for improvement in power supply quality and reliability. Providing early warning of operational risks in these networks and providing effective regulatory recommendations is a pressing issue. Summary of the Invention
[0003] In response to the shortcomings of the existing technology, the present invention proposes a distribution network operation risk assessment method and system based on an improved generative adversarial network, which can monitor the operating status of the distribution network in real time and accurately identify potential risks, thereby improving the reliability and stability of the distribution network.
[0004] The technical solution of the present invention is: a distribution network operation risk assessment method based on an improved generative adversarial network, comprising the following steps:
[0005] Step 1: Obtain historical distribution network operation data and preprocess the data;
[0006] Step 2: Generate typical operational risk scenarios using an improved generative adversarial network based on preprocessed historical data;
[0007] Step 3: Reduce the generated risk scenarios based on the DTW K-medoids clustering algorithm;
[0008] Step 4: Based on the improved generative adversarial network, the real-time operation data of the distribution network is input, and the operation status of the distribution network at the next moment is output. It is matched with the reduced typical operation risk scenario to achieve rapid assessment of the distribution network operation risk.
[0009] In step 1, the historical operation data of the distribution network is preprocessed, including:
[0010] First, the incremental mutation method is used to identify abnormal data, and the incremental slope of all data is solved to obtain abnormal data points. The formula is as follows:
[0011]
[0012] Where V t(i) is the sampling value at time i; V t(i-1) is the sampling value at the most recent moment i before; V t(i-2) is the sampling value at the most recent moment (i-1) ago; Vt(i-3) is the most recent sampling value before (i-2);
[0013] Double verification is used to determine whether the data is an abnormal data point. The formula is as follows:
[0014]
[0015] Where V t(i) is the sampling value at time i; V t(i+1) is the most recent sampling value after i; V t(i+2) is the most recent sampling value after (i+1); V t(i+3) is the most recent sampling value after (i+2);
[0016] Then, for the point of incremental anomaly, determine whether the same out-of-phase incremental anomaly exists at the next moment. If there is an out-of-phase incremental anomaly, continue to verify whether there is a value mutation. If the verification conditions are met, this time point is determined to be a data anomaly data point, and the identified abnormal data point is replaced.
[0017] In step 1, the historical operation data of the distribution network is preprocessed, which also includes:
[0018] Completing the low-voltage measurement data, using time interpolation and space interpolation dynamic fusion, outputting the interpolation results for:
[0019]
[0020] Where, is the predicted value of the time dimension, is the predicted value of the spatial dimension, and α is the weight;
[0021] in,
[0022]
[0023] Where m k is the missing node, L is the number of historical data nodes before the missing node, is the normalized time weight, u A,i is the mean of the node’s historical data;
[0024]
[0025] Where, is the real-time data value of the node adjacent to the missing node, is the offset of the adjacent node, is the reference coefficient of the adjacent nodes.
[0026] Step 2 includes the following steps:
[0027] Step 21: Establish three typical risk operation scenarios, including excessive grid loss, voltage exceeding the upper limit, and voltage exceeding the lower limit;
[0028] Step 22: Build an improved generative adversarial network model as follows:
[0029] Generative adversarial networks include generator G and discriminator D.
[0030] Among them, the input of the generator satisfies the probability distribution p z (z) noise z, the output satisfies the probability distribution p g (x) generates data G(z); the generator training goal is to make the generated data probability distribution p g (x) gradually fits the real data probability distribution p r (x);
[0031] The loss function L of the generator G for:
[0032]
[0033] Where E is the expectation;
[0034] The input of the discriminator is the real data x and the generated data G(z), and the output is the probability value D(x) that the discriminator judges that the generated data G(z) is the real data;
[0035] The loss function L of the discriminator D for:
[0036]
[0037] The zero-sum game objective function between the generator and the discriminator is:
[0038]
[0039] The Wasserstein distance is used to improve the generative adversarial network, which represents the distance W(D(x), D(G(z))) between the true distribution of the sample and the generated distribution, expressed as:
[0040]
[0041] Where, ||f D || L ≤1 represents the function f D It must satisfy 1-Lipschitz continuity, and the upper bound of the absolute value of its derivative is 1; the sup function represents the solution of the minimum upper bound;
[0042] Step 23: Based on historical data, improve the generative adversarial network model training to generate risk scenarios.
[0043] Step 23 includes:
[0044] For the training set, historical power and voltage data of similar historical typical scenarios are used as input:
[0045]
[0046] Among them, X is the training set input, V, P, Q are M×N bus The matrix is the node voltage, injected active power and reactive power of each historical typical scene, M is the number of historical typical scenes, N is the number of historical typical scenes, bus is the number of distribution network nodes;
[0047] The output of the training set is the matching degree of M typical historical scenes:
[0048]
[0049] Where Y is the training set output, the value of each row is the matching degree of the scene numbered in the row number among the M historical typical scenes, and the column with the maximum value in each row is the number of the historical typical scene matched by the scene numbered in the row number;
[0050] Define the test set input as real-time measurement data of the online state to be optimized:
[0051]
[0052] Among them, X' is the test set input, V', P', Q' are M'×N ob , M′ is the number of online states to be optimized, N ob To measure the number of nodes in real time;
[0053] The output of the test set is defined as:
[0054]
[0055] Among them, Y′ is the matching result of M′ online states to be optimized in M historical typical scenarios.
[0056] Step 3 includes:
[0057] Step 31: For the generated historical risk scenarios, randomly select K points as the original centroid points, and determine the number of K points using the elbow method;
[0058] Step 32: Calculate the DTW distance from each distributed resource output data point to the centroid in the risk scenario, and use the DTW distance as the distance between samples for clustering;
[0059] Step 33: Assign each risk scenario to the nearest class according to the DTW distance;
[0060] Step 34: Based on the classified clusters, recalculate the centroid of each cluster according to the absolute minimum error distance;
[0061] Step 35: Return to step 32 until the centroids of each cluster no longer change.
[0062] In step 32,
[0063] The calculation of DTW distance includes:
[0064] Let matrix P W Represents the power series data of distributed resources in the scenario library every day and every hour, specifically:
[0065]
[0066] Where, denote the DPV and EV charging station power at the tth hour of the sth scenario, respectively, where s = 1, 2, 3, …, M and t = 1, 2, 3, …, N;
[0067] Let vector P sPV 、P sEV is the power of DPV and EV charging station in the sth scenario, and the joint output vector P in the sth scenario is sDL =[P sPV P sEV ], then P W Expressed as:
[0068]
[0069] Define the distance matrix between any two distributed resources in the sth scenario as D DL , where element d ij for:
[0070]
[0071] Where, is the value of the mth row and ith column in the output matrix of any two distributed resources in the sth scenario, is the value of the nth row and jth column of the output of any two distributed resources in the sth scenario;
[0072] Define W = [w1,w2,w3,…w p …w l ] is the DTW path vector between any two distributed resource outputs in the sth scenario, where the DTW distance is as follows:
[0073]
[0074] The vector W needs to satisfy the following conditions:
[0075] Boundary constraint: w1=d 11 , w l =d 2n,2n ;
[0076] Path length l constraint: max(2N,2N)≤l≤2N+2N-1;
[0077] Path continuity constraint: If w p =d ij , w p+1 =d i’j’ , then 0≤i'-i≤1, 0≤j'-j≤1;
[0078] Among them, d ij is the distance element value at the current moment, d i’j’ is the distance element value at the next moment.
[0079] In step 4,
[0080] For the evaluation of online scene matching effect, two evaluation indicators are used: node matching deviation rate and system matching deviation rate.
[0081] Among them, the node matching deviation rate for:
[0082]
[0083] Where, L i is the actual value of node i, that is, the node voltage and active and reactive data in the online state; is the matching value of node i, i.e., the historical node voltage and active and reactive data of similar historical typical scenarios;
[0084] System matching deviation rateξ L for:
[0085]
[0086] Where N bus is the total number of system nodes.
[0087] The distribution network operation risk assessment system based on the improved generative adversarial network includes:
[0088] The preprocessing module is used to obtain the historical operation data of the distribution network and preprocess the data;
[0089] The scenario module is used to generate typical operational risk scenarios based on pre-processed historical data through an improved generative adversarial network;
[0090] The reduction module is used to reduce the generated risk scenarios based on the DTW K-medoids clustering algorithm;
[0091] The evaluation module is used to input the real-time operation data of the distribution network based on the improved generative adversarial network, output the operation status of the distribution network at the next moment, and match it with the reduced typical operation risk scenarios to achieve rapid evaluation of the distribution network operation risk.
[0092] In operation, the present invention first pre-processes historical operation data; secondly, uses an improved generative adversarial network to generate typical distribution network operation risk scenarios. This effectively generates a set of typical distribution network operation risk scenarios that conform to the data distribution without having to fit the probability distribution of the data in advance; then, considering that the large number of scenarios generated will cause the computational complexity of risk assessment to increase exponentially, resulting in excessively long calculation time, the generated distribution network historical operation risk scenarios are reduced through the DTW K-medoids clustering algorithm; finally, real-time data is input to quickly generate risks that match the risk scenarios.
[0093] The present invention can efficiently and quickly assess risks and facilitate early warning. BRIEF DESCRIPTION OF THE DRAWINGS
[0094] Figure 1 Flow chart of the method of the present invention. DETAILED DESCRIPTION
[0095] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. 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 making any creative efforts shall fall within the scope of protection of the present invention.
[0096] like Figure 1 As shown, the present invention provides a distribution network operation risk assessment method based on an improved generative adversarial network, comprising the following steps:
[0097] Step 1: Obtain historical distribution network operation data, pre-process the data, replace abnormal data, and complete missing low-voltage measurement data;
[0098] Step 2: Generate typical operational risk scenarios using an improved generative adversarial network based on preprocessed historical data;
[0099] Step 3: Reduce the generated risk scenarios based on the DTW K-medoids clustering algorithm;
[0100] Step 4: Input the real-time operation data of the distribution network, and output the operation status of the distribution network at the next moment through the improved generative adversarial network. This data is matched with the typical operation risk scenarios reduced in step 3 to achieve rapid assessment of the distribution network operation risk.
[0101] In step 1, the historical operation data of the distribution network is preprocessed as follows:
[0102] First, the incremental mutation method is used to identify abnormal data. In the normal time series, the data increment remains in a stable range (the increment of normal data is constant and the slope will not change much). The incremental slope of all data is solved to obtain abnormal data points. The slope solution formula is as follows:
[0103]
[0104] Where V t(i) is the sampling value at time i; V t(i-1) is the sampling value at the most recent moment i before; V t(i-2) is the sampling value at the most recent moment (i-1) ago; V t(i-3) is the most recent sampling value before (i-2);
[0105] A double verification method is used to determine whether the data is an abnormal data point or an actual fluctuation. The formula is as follows:
[0106]
[0107] Where V t(i) is the sampling value at time i; V t(i+1) is the most recent sampling value after i; V t(i+2) is the most recent sampling value after (i+1); V t(i+3) is the most recent sampling value after (i+2);
[0108] Then, for the point of incremental anomaly, determine whether the same out-of-phase incremental anomaly exists at the next moment. If there is an out-of-phase incremental anomaly, continue to verify whether there is a value mutation. If the verification conditions are met, this time point is determined to be a data anomaly data point, and the identified abnormal data point is replaced.
[0109] Out-of-phase increment refers to the increase between the value at the current moment and the data at the previous moment and the next moment. If the current data is 100, the previous moment is 10, and the next moment is 20, then its increments are +90 and -80 respectively.
[0110] The conventional method is to calculate the correlation between adjacent nodes. If the fluctuation range is large, the recognition may not be very accurate. The incremental mutation method has a small amount of calculation and is fast, which can accurately identify fluctuations.
[0111] If the data increment is normal, the slope is essentially the same, and can be viewed as a straight line. If the data increment is abnormal, the slope will change significantly, with a raised point. Therefore, the present invention verifies the data before and after this point, which is a double verification.
[0112] Complete the low voltage measurement data:
[0113] 1. Time interpolation based on sliding window exponentially weighted moving average
[0114] The core characteristic of time series data is the strong correlation between adjacent moments. In distribution networks, load changes often exhibit inertia (such as the gradual process of air conditioner startup and shutdown), which provides a theoretical basis for interpolation based on historical trends.
[0115] For each missing point m k , extract the data of the first L = 6 time points:
[0116]
[0117] Where, is the 6 historical data sets before the missing point, The sixth historical data before the missing point;
[0118] Usually, the data of the distribution network with a scale of 15 minutes is selected. A window with a length of 1.5 hours can cover the short-term fluctuation of voltage and avoid the interference of long-term historical data.
[0119] For historical data selected within the window, the closer the historical data is to the missing point, the more important it is. Conversely, the farther away from the missing point, the less important it is. Selecting recent data can avoid interference from older historical data and ensure the accuracy of interpolation in the time dimension.
[0120] The final time interpolation result is a weighted average:
[0121]
[0122] Where: w i is the time weight (unnormalized), is the normalized time weight, is the predicted value of the time dimension, m k is the missing node, L is the number of historical data nodes before the missing node, u A,i is the mean of the node’s historical data.
[0123] The calculation is efficient and performs well for stationary series. However, if the voltage changes stepwise due to network reconstruction (such as topology switching), the hysteresis effect may cause interpolation errors. In this case, it is necessary to confirm whether the system topology is consistent with the normal display of the system. If the grid topology changes, the hysteresis effect may cause interpolation errors.
[0124] 2. Spatial Dimension Interpolation Based on Robust Regression
[0125] Nodes in distribution networks are tightly electrically coupled, and voltages at adjacent nodes are often linearly correlated. For example, the voltage difference between node A at the end of a feeder and node B upstream is primarily determined by line impedance and power flow.
[0126] Ordinary least squares (OLS) is sensitive to outliers, and measurement data often contains noise. The Huber loss function is used to improve robustness:
[0127]
[0128] Where ρ(r) is the value of the loss function, r is the residual, and δ is the threshold parameter;
[0129] Threshold selection: δ is typically set to 1.345 times the residual standard deviation, ensuring that 95% of normal data falls within the quadratic loss region. A linear penalty is applied to outliers. This mechanism maintains model stability even when measurement anomalies at point B occur (e.g., PMU communication errors).
[0130] By minimizing the Huber loss to solve the parameters, the missing point prediction value expression is:
[0131]
[0132] Where, is the predicted value of the spatial dimension, is the offset of the adjacent node, is the reference coefficient of the adjacent nodes, is the real-time data value of the node adjacent to the missing node;
[0133] Through spatial interpolation, we can utilize the information of spatially adjacent nodes and maximize the use of the values at adjacent points by combining them with a robust regression model. For multiple connected points, we can solve each location separately and finally comprehensively consider the changes in all adjacent nodes to complete the interpolation of the spatial dimensions of the missing points.
[0134] 3. Dynamic fusion of temporal interpolation and spatial interpolation
[0135] Temporal and spatial interpolation each have their own advantages and disadvantages: temporal models are good at tracking gradual trends but lag behind sudden changes; spatial models reflect real-time associations but fail when the network is reconstructed.
[0136] By determining the coefficients, interpolation in the time dimension and interpolation in the space dimension can be fused through weighted summation, and finally the interpolation result is output. It is:
[0137]
[0138] In the formula, α is the weight.
[0139] The spatio-temporal two-dimensional data completion algorithm based on the comprehensive weight method proposed by the present invention deeply integrates time autocorrelation and spatial cross-correlation. The time dimension captures short-term load inertia, the spatial dimension utilizes node electrical coupling, and the dynamic weight mechanism adaptively adjusts the model confidence. The accuracy of high-precision completion of missing data in the distribution network can reach 97%, and the completion error is less than 5%.
[0140] In step 2, based on the preprocessed historical data, typical operation risk scenarios are generated through an improved generative adversarial network, including the following steps:
[0141] Step 21: Taking distribution network voltage control and network loss optimization as the goals, three typical risk operation scenarios are established: excessive network loss, voltage above the upper limit, and voltage below the lower limit. Among them, the phenomenon of voltage above the upper limit generally appears at noon when the photovoltaic output is high, which is a light load scenario; the situation of voltage below the lower limit is a heavy load scenario when the load is too large, such as a large number of EVs accessing the distribution network for charging. According to empirical values, the threshold of the total network loss rate for a 10kV distribution network is 10%. is the system network loss rate:
[0142]
[0143] Among them, P loss is the system active network loss, and P sup is the total supply power of the system.
[0144] Voltage below the lower limit: Vi < Vlow = 0.95 p.u.; Voltage above the upper limit: Vi > Vup = 1.05 p.u.
[0145] Among them, Vi is the voltage amplitude of node i, Vlow is the lower limit value of the node voltage, and Vup is the upper limit value of the node voltage.
[0146] Step 22: Establish an improved generative adversarial network model, specifically as follows:
[0147] Generative adversarial networks primarily consist of two neural networks: the generator G and the discriminator D. These networks are continuously optimized through a min-max zero-sum game, ultimately reaching a Nash equilibrium. The generator learns the distribution characteristics of real data and generates new samples that approximate the distribution of real data, thereby deceiving the discriminator. The discriminator, in turn, determines the authenticity of new samples. When the generator and discriminator reach a Nash equilibrium, the generator can generate new samples that match the distribution of real data.
[0148] The generator can be a variety of neural networks whose input satisfies the probability distribution p z (z) noise z, the output satisfies the probability distribution p g (x) generates data G(z). The training goal of the generator is to make the generated data probability distribution p g (x) gradually fits the real data probability distribution p r (x). The loss function L of the generator G for:
[0149]
[0150] Where E is the expectation.
[0151] The discriminator neural network should have a similar structure to the generator. Its input is the real data x and the generated data G(z). The output is the probability value D(x) that the discriminator judges that the generated data G(z) is the real data. The loss function L of the discriminator is: D for:
[0152]
[0153] The zero-sum game objective function between the generator and the discriminator is expressed as:
[0154]
[0155] In order to solve the problem of non-convergence of training in the original GAN model, the Wasserstein distance is used for improvement, which represents the distance W(D(x), D(G(z))) between the true distribution of the sample and the generated distribution, which can be expressed as:
[0156]
[0157] Where, ||f D || L ≤1 represents the function f D It must satisfy 1-Lipschitz continuity, and the upper bound of the absolute value of its derivative is 1; the sup function represents the solution of the minimum upper bound.
[0158] The present invention improves the conventional generative adversarial network by adopting the Wasserstein distance to solve the problem of non-convergence of training in the original GAN model, thereby improving the model training efficiency and the accuracy of risk scenario generation.
[0159] Generate typical distribution network operation risk scenarios based on an improved generative adversarial network, primarily involving two steps: model training and scenario generation. During model training, the DPV and EV charging station scenario data generated using Gaussian noise Z during training are combined with real-world DPV and EV charging station power data and transmitted to the discriminator for identification. The discriminator further calculates a loss function based on the network parameters and updates the network parameters through backpropagation.
[0160] Step 23: Based on historical data, improve the generative adversarial network model training to generate risk scenarios. The details are as follows:
[0161] The power flow and voltage distribution of a distribution network are related to the power distribution of each node in the actual topology. A unique implicit mapping exists between the power injected into a node and its voltage. This is known as the distribution network flow model. Using power and voltage data as input for scenario matching, this model not only incorporates scenario characteristics but also considers the distribution network flow distribution. Therefore, the improved generative adversarial network is trained on historical voltage and power data from typical historical scenarios of similar types. The training set learns the operating characteristics and flow information of these historical scenarios. The real-time measurement data of the online state to be evaluated is used as the test set to identify the historical scenario most similar to the online state.
[0162] For the training set, historical power and voltage data of similar historical typical scenarios are used as input:
[0163]
[0164] Among them, X is the training set input, V, P, Q are M×N bus The matrix is the node voltage, injected active power and reactive power of each historical typical scene, M is the number of historical typical scenes, N is the number of historical typical scenes, bus is the number of distribution network nodes;
[0165] The output of the training set is the matching degree of M typical historical scenes:
[0166]
[0167] Where Y is the training set output, the value of each row is the matching degree of the scene numbered in the row number among the M historical typical scenes, and the column with the maximum value in each row is the number of the historical typical scene matched by the scene numbered in the row number;
[0168] Define the test set input as real-time measurement data of the online state to be optimized:
[0169]
[0170] Among them, X' is the test set input, V', P', Q' are M'×N ob , M′ is the number of online states to be optimized, N ob To measure the number of nodes in real time;
[0171] The output of the test set is defined as:
[0172]
[0173] Among them, Y′ is the matching result of M′ online states to be optimized in M historical typical scenarios.
[0174] Considering that the large number of generated scenarios will lead to an exponential increase in the amount of risk assessment calculations, resulting in excessively long calculation time, the DTW K-medoids clustering algorithm is used to reduce the generated distribution network historical operation risk scenarios.
[0175] In step 3, the generated risk scenarios are reduced based on the DTW K-medoids clustering algorithm as follows:
[0176] Step 31: For the generated historical risk scenarios, randomly select K points as the original centroid points, and determine the number of K points using the elbow method;
[0177] Step 32: Calculate the DTW distance from each distributed resource output data point to the centroid in the risk scenario, and use the DTW distance as the distance between samples for clustering;
[0178] Step 33: Assign each risk scenario to the nearest class according to the DTW distance;
[0179] Step 34: Based on the classified clusters, recalculate the centroid of each cluster according to the absolute minimum error distance;
[0180] Step 35: Return to step 32 until the centroids of each cluster no longer change.
[0181] The present invention uses the DTW K-medoids clustering algorithm to reduce the historical operation risk scenarios of the distribution network. The DTW distance, which can measure the similarity of the overall dynamic characteristics of the distribution network's daily power curve, measures sample similarity, thereby improving the problem of insufficient precision of the Euclidean distance clustering level. At the same time, the DTW distance algorithm has low requirements for the time series values of the original data, and has higher adaptability than the calculation of conventional electrical distance and Euclidean distance, and the results of scenario clustering are more accurate.
[0182] The present invention adopts the K-medoids clustering algorithm instead of the traditional K-means clustering algorithm. By selecting the central sample as the cluster center, the sensitivity of outliers is reduced and the typicality of the historical operation risk scenarios of the distribution network is improved.
[0183] The present invention determines the optimal number of clusters by the elbow method, and then calculates the DTW distance. Clusters with similar distances are grouped into one category. Then, iterative calculations are performed continuously until the centroid does not change, and the clustering ends.
[0184] Step 31: Elbow method to determine the optimal number of clusters
[0185] The elbow method uses the ratio of the mean intra-cluster distance to the mean inter-cluster distance (SE) as a metric to describe clustering error. It further analyzes the relationship between the number of clusters and SE to determine the optimal number of clusters. Its core principle is that as the number of clusters K increases, the accuracy of sample partitioning improves and the clustering error (SE) decreases. Furthermore, when K is less than the optimal number of clusters, the decrease in clustering error increases significantly because increasing K significantly increases the degree of cluster aggregation. When K equals the optimal number of clusters, the decrease in SE decreases sharply. Therefore, the SE vs. K relationship graph forms an elbow curve, and the K corresponding to the elbow is the optimal number of clusters.
[0186] Step 32: DTW distance calculation
[0187] DTW distance can be used to match and map the time series of distribution network historical operation data by bending the time axis, thereby calculating similarity. The calculation steps are as follows:
[0188] Assume that the matrix P W Represents the power series data of distributed resources every day and every hour in the scenario library:
[0189]
[0190] Where, denote the DPV and EV charging station power at the tth hour of the sth scenario, respectively, where s=1,2,3,…,M and t=1,2,3,…,N. Assume that the vector P sPV 、P sEV is the power of DPV and EV charging station in the sth scenario, and the joint output vector P in the sth scenario is sDL =[P sPV P sEV ], then P W It can be expressed as:
[0191]
[0192] Therefore, the definition and P nDL The distance matrix between them is DDL , where element d ij for:
[0193]
[0194] Where, is the value of the mth row and ith column in the output matrix of any two distributed resources in the sth scenario, is the value of the nth row and jth column of the output of any two distributed resources in the sth scenario;
[0195] Define W = [w1,w2,w3,…w p …w l ]for and P nDL The DTW path vector between them, where the vector W needs to satisfy the following conditions:
[0196] Boundary constraint: w1=d 11 , w l =d 2n,2n ;
[0197] Path length constraint: max(2N,2N)≤l≤2N+2N-1;
[0198] Path continuity constraint: If w p =d ij , w p+1 =d i’j’ , then 0≤i'-i≤1, 0≤j'-j≤1;
[0199] Among them, d ij is the distance element value at the current moment, d i’j’ is the distance element value at the next moment;
[0200] Since the DTW path is not unique, the DTW distance is defined as the distance under the path that minimizes the total distance, as follows:
[0201]
[0202] In step 4, two evaluation indicators, node matching deviation rate and system matching deviation rate, are proposed to evaluate the online scene matching effect. for:
[0203]
[0204] Where, L i is the actual value of node i, that is, the node voltage and active and reactive data in the online state; is the matching value of node i, that is, the historical node voltage and active and reactive data of the same historical typical scenario.
[0205] Based on the node matching deviation rate, the system matching deviation rate ξ L for:
[0206]
[0207] Where N bus is the total number of system nodes.
[0208] The present invention also provides a distribution network operation risk assessment system based on an improved generative adversarial network, comprising:
[0209] The preprocessing module is used to obtain the historical operation data of the distribution network and preprocess the data;
[0210] The scenario module is used to generate typical operational risk scenarios based on pre-processed historical data through an improved generative adversarial network;
[0211] The reduction module is used to reduce the generated risk scenarios based on the DTW K-medoids clustering algorithm;
[0212] The evaluation module is used to input the real-time operation data of the distribution network based on the improved generative adversarial network, output the operation status of the distribution network at the next moment, and match it with the reduced typical operation risk scenarios to achieve rapid evaluation of the distribution network operation risk.
[0213] The present invention can monitor the operating status of the distribution network in real time and accurately identify potential risks, thereby improving the reliability and stability of the distribution network.
[0214] Throughout this specification, references to terms such as "one embodiment," "example," or "specific example" indicate that the specific features, structures, materials, or characteristics described in conjunction with that embodiment or example are included in at least one embodiment or example of the present invention. In this specification, schematic representations of these terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
[0215] The basic principles, main features, and advantages of the present invention are shown and described above. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions are merely illustrative of the principles of the present invention. Various changes and modifications may be made to the present invention without departing from the spirit and scope of the present invention, and such changes and modifications fall within the scope of the invention as claimed.
Claims
1. A distribution network operation risk assessment method based on an improved generative adversarial network is characterized by: The following steps are involved: Step 1: Obtain historical distribution network operation data and preprocess the data; Step 2: Generate typical operational risk scenarios using an improved generative adversarial network based on preprocessed historical data; Step 3: Reduce the generated risk scenarios based on the DTW K-medoids clustering algorithm; Step 4: Based on the improved generative adversarial network, the real-time operation data of the distribution network is input, and the operation status of the distribution network at the next moment is output. It is matched with the reduced typical operation risk scenario to achieve rapid assessment of the distribution network operation risk.
2. The distribution network operation risk assessment method based on improved generative adversarial network according to claim 1 is characterized in that: In step 1, the historical operation data of the distribution network is preprocessed, including: First, the incremental mutation method is used to identify abnormal data, and the incremental slope of all data is solved to obtain abnormal data points. The formula is as follows: Where V t(i) is the sampling value at time i; V t(i-1) is the sampling value at the most recent moment i before; V t(i-2) is the most recent sampling value before (i-1); V t(i-3) is the most recent sampling value before (i-2); Double verification is used to determine whether the data is an abnormal data point. The formula is as follows: Where V t(i) is the sampling value at time i; V t(i+1) is the most recent sampling value after i; V t(i+2) is the most recent sampling value after (i+1); V t(i+3) is the most recent sampling value after (i+2); Then, for the point of incremental anomaly, determine whether the same out-of-phase incremental anomaly exists at the next moment. If there is an out-of-phase incremental anomaly, continue to verify whether there is a value mutation. If the verification conditions are met, this time point is determined to be a data anomaly data point, and the identified abnormal data point is replaced.
3. The distribution network operation risk assessment method based on improved generative adversarial network according to claim 2 is characterized in that: In step 1, the historical operation data of the distribution network is preprocessed, which also includes: Completing the low-voltage measurement data, using time interpolation and space interpolation dynamic fusion, outputting the interpolation results for: Where, is the predicted value of the time dimension, is the predicted value of the spatial dimension, and α is the weight; in, Where m k is the missing node, L is the number of historical data nodes before the missing node, is the normalized time weight, u A,i is the mean of the node’s historical data; Where, is the real-time data value of the node adjacent to the missing node, is the offset of the adjacent node, is the reference coefficient of the adjacent nodes.
4. The distribution network operation risk assessment method based on improved generative adversarial network according to claim 1 is characterized in that: Step 2 includes the following steps: Step 21: Establish three typical risk operation scenarios, including excessive grid loss, voltage exceeding the upper limit, and voltage exceeding the lower limit; Step 22: Build an improved generative adversarial network model as follows: Generative adversarial networks include generator G and discriminator D. Among them, the input of the generator satisfies the probability distribution p z (z) noise z, the output satisfies the probability distribution p g (x) generates data G(z); the generator training goal is to make the generated data probability distribution p g (x) gradually fits the real data probability distribution p r (x); The loss function L of the generator G for: Where E is the expectation; The input of the discriminator is the real data x and the generated data G(z), and the output is the probability value D(x) that the discriminator judges that the generated data G(z) is the real data; The loss function L of the discriminator D for: The zero-sum game objective function between the generator and the discriminator is: The Wasserstein distance is used to improve the generative adversarial network, which represents the distance W(D(x), D(G(z))) between the true distribution of the sample and the generated distribution, expressed as: Where, ||f D || L ≤1 represents the function f D It must satisfy 1-Lipschitz continuity, and the upper bound of the absolute value of its derivative is 1; the sup function represents the solution of the minimum upper bound; Step 23: Based on historical data, improve the generative adversarial network model training to generate risk scenarios.
5. The distribution network operation risk assessment method based on improved generative adversarial network according to claim 4 is characterized in that: Step 23 includes: For the training set, historical power and voltage data of similar historical typical scenarios are used as input: Among them, X is the training set input, V, P, Q are M×N bus The matrix is the node voltage, injected active power and reactive power of each historical typical scene, M is the number of historical typical scenes, N is the number of historical typical scenes, bus is the number of distribution network nodes; The output of the training set is the matching degree of M typical historical scenes: Where Y is the training set output, the value of each row is the matching degree of the scene numbered in the row number among the M historical typical scenes, and the column with the maximum value in each row is the number of the historical typical scene matched by the scene numbered in the row number; Define the test set input as real-time measurement data of the online state to be optimized: Among them, X' is the test set input, V', P', Q' are M'×N ob , M′ is the number of online states to be optimized, N ob To measure the number of nodes in real time; The output of the test set is defined as: Among them, Y′ is the matching result of M′ online states to be optimized in M historical typical scenarios.
6. The distribution network operation risk assessment method based on improved generative adversarial network according to claim 1 is characterized in that: Step 3 includes: Step 31: For the generated historical risk scenarios, randomly select K points as the original centroid points, and determine the number of K points using the elbow method; Step 32: Calculate the DTW distance from each distributed resource output data point to the centroid in the risk scenario, and use the DTW distance as the distance between samples for clustering; Step 33: Assign each risk scenario to the nearest class according to the DTW distance; Step 34: Based on the classified clusters, recalculate the centroid of each cluster according to the absolute minimum error distance; Step 35: Return to step 32 until the centroids of each cluster no longer change.
7. The distribution network operation risk assessment method based on improved generative adversarial network according to claim 5 is characterized in that: In step 32, The calculation of DTW distance includes: Let matrix P W Represents the power series data of distributed resources in the scenario library every day and every hour, specifically: Where, denote the DPV and EV charging station power at the tth hour of the sth scenario, respectively, where s = 1, 2, 3, …, M and t = 1, 2, 3, …, N; Let vector P sPV 、P sEV is the power of DPV and EV charging station in the sth scenario, and the joint output vector P in the sth scenario is sDL =[P sPV P sEV ], then P W Expressed as: Define the distance matrix between any two distributed resources in the sth scenario as D DL , where element d ij for: Where, is the value of the mth row and ith column in the output matrix of any two distributed resources in the sth scenario, is the value of the nth row and jth column of the output of any two distributed resources in the sth scenario; Define W = [w1,w2,w3,…w p …w l ] is the DTW path vector between any two distributed resource outputs in the sth scenario, where the DTW distance is as follows:
8. The distribution network operation risk assessment method based on improved generative adversarial network according to claim 8 is characterized in that: The vector W needs to satisfy the following conditions: Boundary constraint: w1=d 11 , w l =d 2n,2n ; Path length l constraint: max(2N,2N)≤l≤2N+2N-1; Path continuity constraint: If w p =d ij , w p+1 =d i’j’ , then 0≤i'-i≤1, 0≤j'-j≤1; Among them, d ij is the distance element value at the current moment, d i’j’ is the distance element value at the next moment.
9. The distribution network operation risk assessment method based on improved generative adversarial network according to claim 1 is characterized in that: In step 4, For the evaluation of online scene matching effect, two evaluation indicators are used: node matching deviation rate and system matching deviation rate. Among them, the node matching deviation rate for: Where, L i is the actual value of node i, that is, the node voltage and active and reactive data in the online state; is the matching value of node i, i.e., the historical node voltage and active and reactive data of similar historical typical scenarios; System matching deviation rateξ L for: Where N bus is the total number of system nodes.
10. A distribution network operation risk assessment system based on an improved generative adversarial network is characterized by: include: The preprocessing module is used to obtain the historical operation data of the distribution network and preprocess the data; The scenario module is used to generate typical operational risk scenarios based on pre-processed historical data through an improved generative adversarial network; The reduction module is used to reduce the generated risk scenarios based on the DTW K-medoids clustering algorithm; The evaluation module is used to input the real-time operation data of the distribution network based on the improved generative adversarial network, output the operation status of the distribution network at the next moment, and match it with the reduced typical operation risk scenarios to achieve rapid evaluation of the distribution network operation risk.