A risk prediction method and terminal for distribution network
By constructing a long-term memory neural network model based on timing attention mechanism and a probability flow method of semi-invariant method, the shortcomings of traditional distribution network risk assessment methods are solved, and efficient, real-time and accurate risk assessment of distribution network risk prediction is achieved.
Patent Information
- Application Number
- CN202211514333.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-29
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2042-11-29
AI Technical Summary
Traditional distribution network fault positioning technology and risk assessment methods are difficult to meet the needs of smart distribution networks. Especially when distributed power supplies are widely connected and electric vehicles are popular, the existing methods rely on subjective evaluation, low computing efficiency, insufficient accuracy, and cannot make full use of real-time data sets and historical operation and maintenance data, resulting in the impact of power supply safety and reliability.
A long-term memory neural network model based on the timing attention mechanism is adopted, combined with the semi-invariant method and Gram-Charlier series expansion, and an initial matrix is generated by real-time monitoring of data and historical data, load prediction and risk probability calculation are performed, and probability density function and cumulative distribution function of node voltage and branch current are determined.
It improves the effectiveness, real-time and accuracy of distribution network risk assessment, enhances prediction accuracy, and can better respond to the risk prediction needs of new energy power plants.
Smart Images

Figure CN115860212B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of distribution network risk prediction, and in particular to a distribution network risk prediction method and terminal. Background Art
[0002] Distribution networks directly serve consumers and undertake the critical function of distributing electricity. They play a vital role in ensuring power supply quality, improving grid efficiency, safety, and reliability, and facilitating the integration and integration of renewable energy sources such as photovoltaic and wind power. However, traditional fault location and management techniques struggle to adapt to the specific requirements of smart and transparent distribution networks. The widespread integration of distributed power sources and the increasing number of electric vehicles have profoundly impacted the operation of distribution lines, significantly impacting power supply security.
[0003] Currently, conventional distribution network load forecasting methods primarily rely on fuzzy algorithms, expert evaluation methods, and neural networks. The former two rely heavily on subjective evaluation matrices, and neural networks suffer from slow convergence and a tendency to fall into local optima. Support vector machines (SVMs) have low accuracy for multi-classification distribution network fault diagnosis. Conventional recurrent neural networks and long-short-term memory (LSTM) neural networks suffer from reliance on large amounts of data, low learning efficiency, lengthy computation times, and low accuracy, failing to fully utilize real-time datasets and historical operation and maintenance data.
[0004] As renewable energy continues to expand, the output of renewable energy power stations often exhibits strong correlations. Traditional stochastic power flow algorithms rarely consider these strongly correlated random variables. Within the digital twin framework, leveraging the advantages of intelligent algorithms and leveraging available information to improve the effectiveness, real-time nature, and accuracy of distribution network risk assessment remains a key technical challenge. Summary of the Invention
[0005] The technical problem to be solved by the present invention is to provide a risk prediction method and terminal for a distribution network, so as to improve the effectiveness, real-timeness and accuracy of distribution network risk assessment.
[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is:
[0007] A risk prediction method for a distribution network comprises the following steps:
[0008] S1. Acquire real-time monitoring data, historical data, and basic data associated with the historical data of distribution network equipment, and preprocess the historical data and the basic data to generate an initial matrix;
[0009] The basic data are external data that affect the safe operation of the distribution network;
[0010] S2. Input the real-time monitoring data and the initial matrix into a long short-term memory neural network model based on a temporal attention mechanism, and output a load forecast matrix;
[0011] S3. According to the load forecast matrix, the power flow calculation based on the semi-invariant method is adopted, and the probability density function and cumulative distribution function of the node voltage and branch power flow are obtained through Gram-Charlier series expansion approximation to determine the risk probability.
[0012] In order to solve the above technical problems, another technical solution adopted by the present invention is:
[0013] A risk prediction terminal for a distribution network includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0014] S1. Acquire real-time monitoring data, historical data, and basic data associated with the historical data of distribution network equipment, and preprocess the historical data and the basic data to generate an initial matrix;
[0015] The basic data are external data that affect the safe operation of the distribution network;
[0016] S2. Input the real-time monitoring data and the initial matrix into a long short-term memory neural network model based on a temporal attention mechanism, and output a load forecast matrix;
[0017] S3. According to the load forecast matrix, the power flow calculation based on the semi-invariant method is adopted, and the probability density function and cumulative distribution function of the node voltage and branch power flow are obtained through Gram-Charlier series expansion approximation to determine the risk probability.
[0018] The beneficial effects of the present invention are as follows: a distribution network risk prediction method and terminal of the present invention construct a long-short time memory neural network model based on a temporal attention mechanism, enhance the prediction accuracy through the temporal attention mechanism, adopt a probabilistic power flow method based on the semi-invariant method to calculate the risk probability of the distribution network, and obtain its probability density function and cumulative distribution function through Gram-Charlier series expansion approximation, thereby realizing risk prediction and improving the effectiveness, real-timeness and accuracy of distribution network risk assessment. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 This is a flow chart of a method for predicting risk in a distribution network according to an embodiment of the present invention;
[0020] Figure 2 This is a structural diagram of a risk prediction terminal for a distribution network according to an embodiment of the present invention;
[0021] Figure 3 This is a detailed flowchart of a method for predicting risk in a distribution network according to an embodiment of the present invention;
[0022] Figure 4 This is a diagram illustrating a structure of a long-short time memory network model for a method for predicting risk in a distribution network according to an embodiment of the present invention;
[0023] Figure 5 This is an example of a compliance prediction diagram of a risk prediction method for a distribution network according to an embodiment of the present invention;
[0024] Figure 6 This is an example diagram of calculation results of a method for predicting risk of a distribution network according to an embodiment of the present invention;
[0025] Description of labels:
[0026] 1. A risk prediction terminal for a distribution network; 2. A processor; 3. A memory. DETAILED DESCRIPTION
[0027] To illustrate the technical content, achieved objectives and effects of the present invention in detail, the following description is given in conjunction with the embodiments and accompanying drawings.
[0028] Please refer to Figure 1 , a risk prediction method for a distribution network, comprising the steps of:
[0029] S1. Acquire real-time monitoring data, historical data, and basic data associated with the historical data of distribution network equipment, and preprocess the historical data and the basic data to generate an initial matrix;
[0030] The basic data are external data that affect the safe operation of the distribution network;
[0031] S2. Input the real-time monitoring data and the initial matrix into a long short-term memory neural network model based on a temporal attention mechanism, and output a load forecast matrix;
[0032] S3. According to the load forecast matrix, the power flow calculation based on the semi-invariant method is adopted, and the probability density function and cumulative distribution function of the node voltage and branch power flow are obtained through Gram-Charlier series expansion approximation to determine the risk probability.
[0033] From the above description, it can be seen that the beneficial effects of the present invention are: a distribution network risk prediction method and terminal of the present invention construct a long-short time memory neural network model based on the temporal attention mechanism, enhance the prediction accuracy through the temporal attention mechanism, adopt a probabilistic power flow method based on the semi-invariant method to calculate the risk probability of the distribution network, and obtain its probability density function and cumulative distribution function through Gram-Charlier series expansion approximation to realize risk prediction and improve the effectiveness, real-time and accuracy of distribution network risk assessment.
[0034] Furthermore, the generation of the initial matrix is specifically as follows:
[0035] Initialize the historical data and the basic data to obtain the risk feature matrix:
[0036]
[0037] Among them, A k is the risk characteristic matrix of the distribution network at a certain time k, which is obtained by time series combination of one-dimensional matrices and divided into training set, validation set and test set;
[0038] The risk feature matrix is normalized, and the normalization formula is:
[0039]
[0040] Among them, S * is the normalized data, S is the original data, S max 、S min are the maximum and minimum values of the data;
[0041] Get the initial matrix.
[0042] As can be seen from the above description, the historical data and the basic data are initialized in the above manner to obtain an initial matrix.
[0043] Furthermore, the step S2 includes training the long short-term memory neural network model according to the initial matrix:
[0044] S21. Arrange the initial matrix into a continuous data set and import it into the long short-term memory neural network model. The calculation formula of its input gate is:
[0045]
[0046] Among them, f t is the output value of the forget gate; i t 、g t are the input gate output values respectively; o t is the output value of the output gate; c t-1、c t are the intermediate memory state values at time t-1 and time t respectively; a t-1 、a t are the output values at time t-1 and t respectively; x t Input value at time t; W i 、W g are the weight values in each gate respectively; b f 、b i 、b g 、b o are the bias terms in each gate respectively; σ represents the sigmoid function; tanh represents the tanh function;
[0047] S22. Input the local feature matrix obtained by the input gate into the forget gate. The calculation formula of the forget gate is:
[0048] f t =σ(W f [a t-1 x t ]+b f );
[0049] Among them, W f is the weight value in the forget gate, b f It is the bias term in the forget gate, which determines how much of the unit state at the previous moment can be retained at this moment;
[0050] S23. Input the sample matrix obtained by processing the input gate and the forget gate into the output gate through the memory unit and direct input to obtain the output matrix. The calculation formula of the output gate is:
[0051]
[0052] Among them, W o is the weight value in the output gate, b o is the bias term in the output gate;
[0053] S24, organizing the output matrix into a continuous data set for convolution calculation to highlight the local features of the data set. The convolution calculation formula is:
[0054]
[0055] Among them, x i,j is the element in row i and column j of the feature matrix in the dataset, w m,n It represents the weight element in the mth row and nth column of the convolution weight matrix, w b is the bias term of the neural network, and z is the dimension of the convolution matrix;
[0056] After convolution calculation, the matrix dimension calculation formula is:
[0057]
[0058] Among them, w is the feature matrix input dimension, k is the dimension of the convolution weight matrix, p is the number of zero-padding layers in the convolution calculation, and s is the stride size in the convolution calculation;
[0059] S25, after convolution calculation, enter the pooling calculation, the pooling calculation formula is:
[0060] b ij =max[w'(i*(f-1)+1,j*(f-1)+1)+...+w'(i*f,j*f)];
[0061] where b ij is the element in the i-th row and j-th column of the pooling matrix, w' is the dimension of the matrix after convolution calculation, and f is the dimension of the pooling matrix;
[0062] After pooling calculation, the matrix dimension calculation formula is:
[0063]
[0064] Where f is the dimension of the pooling matrix;
[0065] S26. Use the relu function to activate the matrix. The calculation formula of the relu function is:
[0066] f(x)=max(0,x);
[0067] S27. Calculate the similarity between the element value Value in each sequence element address Key of the matrix and the query element Query:
[0068] e ij =D(q i ,p j );
[0069] Where D(·) represents the dot product function, q i Represents the i-th element in the query element set, p j Represents the jth element in the element address set, e ij Indicates the similarity between elements i and j;
[0070] S28, normalizing the similarity, the normalization formula is:
[0071] α ij =softmax(e ij );
[0072] Among them, α ijrepresents the normalized similarity, and soft max(·) represents the normalized exponential function;
[0073] S29. Perform weighted summation on the normalized similarity data to obtain the hidden layer output value:
[0074]
[0075] From the above description, we can see that the tanh function is continuous, smooth, and strictly monotonic, and can map a real number to the interval (-1,1), preparing for the distribution network status assessment and classification. The tanh function and the sigmoid function as the excitation functions of the long-short time memory neural network can effectively nonlinearize the input-output relationship of the multi-layer neural network and give full play to the hidden layer function; through convolution calculation and pooling calculation, the matrix dimension can be reduced and the number of parameters can be reduced; after completing the local feature extraction, the required features are also extracted through the TPA mechanism (temporal attention mechanism) to operate on the hidden layer output value of the LSTM model. Compared with the LSTM model, it focuses on the correlation between the hidden layer output values at different times in the past and the hidden layer output value at the current moment, that is, by calculating the correlation between the two, the weight of the previous hidden layer output value is determined to obtain the final hidden layer output value, which is more superior.
[0076] Furthermore, the step S2 further includes the steps of:
[0077] The real-time monitoring data is input into the trained long short-term memory neural network model to obtain a load forecast matrix.
[0078] Furthermore, the step S3 is specifically as follows:
[0079] The load forecast matrix is input into the probabilistic power flow method based on the semi-invariant method to calculate the distribution network risk probability, and its probability density function and cumulative distribution function are obtained through series expansion approximation:
[0080] The semi-invariant is defined as follows:
[0081] Let F(x) be the distribution function of the random variable X, t be a real number, |e itx |=1, then function g(x)=e itx The characteristic function of the distribution of F(x) is integrable on (-∞, +∞) and the function of the real variable t corresponding to F(x) is as follows:
[0082]
[0083] Taking the logarithm of the above formula and expanding it according to the Maclaurin series formula, we get the following formula:
[0084]
[0085] Among them, the coefficient y r is an r-order semi-invariant, s represents the number of terms in the expanded expression, o(t s ) represents the remaining items;
[0086] For the normally distributed load power, the first-order semi-invariant is the mathematical expectation, the second-order semi-invariant is equal to the variance, and the third-order and higher-order semi-invariants are zero. The formula is:
[0087]
[0088] For the discrete distribution of coincident power, first solve the central moments according to the following formula:
[0089]
[0090] Among them, p i Take the load value x i The probability, p i =t i / T, where t i The load is equal to x i duration, T is the research period;
[0091] Assuming that the probability of a unit operating at rated capacity C is p, the probability of output power being zero is 1-p. Suppose there are N conventional generators installed at a certain node, and the probability that i of them are operating normally is p. i for:
[0092] p i =C N i p i (1-p) N-i ;
[0093] Then the moments of the total output power of N units are:
[0094] α r =p1C r +p2(2C) r +…+p N (NC) r ;
[0095] The Monte Carlo sampling method is used to calculate the semi-invariant of wind and solar power generation. First, N wind speed / light intensity sequences {a1, a2, ..., a N};
[0096] According to the output power characteristics of the wind turbine / optical machine, the active power sequence {P1, P2, ..., PN}, under the constant power factor control mode, the reactive power of the wind turbine / optical machine is proportional to the active power, thus obtaining the reactive power sequence {Q1,Q2,…,Q N};
[0097] The origin moments of each order of wind-solar generator set output power are:
[0098]
[0099] Among them, α P,r and α Q,r are the r-order origin moments of the active and reactive power output by the wind and solar generator sets;
[0100] The semi-invariant of wind turbine output is obtained based on the relationship between the origin moment and the semi-invariant;
[0101] When polar coordinates are used to represent node voltages, the power flow equation of the power system can be expressed as:
[0102]
[0103] Among them, P i , Q i is the active / reactive power of node i, V i 、V j is the voltage amplitude at node i / j, θ ij is the phase difference between node i and node j, that is, θ ij =θ i -θ j , G ij 、B ij They are the node admittance matrix Y ij The real and imaginary parts of
[0104] The node injection amount S and the state variable X are both random variables and can be written as:
[0105]
[0106] Where S0 and X0 are the reference values of S and X when the power system is at the reference operating point, i.e., the expected values; ΔS and ΔX are the random disturbances of the injected power and the random disturbances of the state variables caused by the random fluctuations of the injected power;
[0107] The branch power flow equation is linearized. When the state variables of each node are known, the system branch power flow calculation method is:
[0108]
[0109] Among them, P ij , Q ij is the active and reactive power flow on branch ij, tij is the transformer ratio, b ij0 is 1 / 2 line admittance;
[0110] In a distribution network containing distributed generation, the random factor is mainly the random disturbance of the power S injected by each node. The expression of the random disturbance ΔS is:
[0111]
[0112] According to the linearized power flow equation and using the properties of the semi-invariant, instead of the convolution calculation, the r-order semi-invariant ΔX of the node voltage and branch power flow can be obtained. (r) and ΔZ (r) ;
[0113] The coefficients of the series can be expressed as expressions of the semi-invariants of each order of the random variable. The simplified form of the series is defined as:
[0114]
[0115] Among them, g r is the r-order normalized semi-invariant, σ is the standard deviation;
[0116] For any random variable X, assuming its expected value and standard deviation are μ and σ respectively, its standardized form is:
[0117]
[0118] After using the Gram-Charlier series expansion, the cumulative distribution function of the random variable can be expressed as:
[0119]
[0120] in, is the normalized random variable, are the probability density function and cumulative distribution function of the standard normal distribution random variable, g r is the semi-invariant after normalization of order r, is the Hermite polynomial of order i.
[0121] From the above description, it can be seen that the power flow algorithm based on semi-invariants and Gram-Charlier series expansion has good convergence.
[0122] Please refer to Figure 2 A risk prediction terminal for a distribution network includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the following steps are implemented:
[0123] S1. Acquire real-time monitoring data, historical data, and basic data associated with the historical data of distribution network equipment, and preprocess the historical data and the basic data to generate an initial matrix;
[0124] The basic data are external data that affect the safe operation of the distribution network;
[0125] S2. Input the real-time monitoring data and the initial matrix into a long short-term memory neural network model based on a temporal attention mechanism, and output a load forecast matrix;
[0126] S3. According to the load forecast matrix, the power flow calculation based on the semi-invariant method is adopted, and the probability density function and cumulative distribution function of the node voltage and branch power flow are obtained through Gram-Charlier series expansion approximation to determine the risk probability.
[0127] From the above description, it can be seen that the beneficial effects of the present invention are: a distribution network risk prediction method and terminal of the present invention construct a long-short time memory neural network model based on the temporal attention mechanism, enhance the prediction accuracy through the temporal attention mechanism, adopt a probabilistic power flow method based on the semi-invariant method to calculate the risk probability of the distribution network, and obtain its probability density function and cumulative distribution function through Gram-Charlier series expansion approximation to realize risk prediction and improve the effectiveness, real-time and accuracy of distribution network risk assessment.
[0128] Furthermore, the generation of the initial matrix is specifically as follows:
[0129] Initialize the historical data and the basic data to obtain the risk feature matrix:
[0130]
[0131] Among them, A k is the risk characteristic matrix of the distribution network at a certain time k, which is obtained by time series combination of one-dimensional matrices and divided into training set, validation set and test set;
[0132] The risk feature matrix is normalized, and the normalization formula is:
[0133]
[0134] Among them, S * is the normalized data, S is the original data, S max 、S min are the maximum and minimum values of the data;
[0135] Get the initial matrix.
[0136] As can be seen from the above description, the historical data and the basic data are initialized in the above manner to obtain an initial matrix.
[0137] Furthermore, the step S2 includes training the long short-term memory neural network model according to the initial matrix:
[0138] S21. Arrange the initial matrix into a continuous data set and import it into the long short-term memory neural network model. The calculation formula of its input gate is:
[0139]
[0140] Among them, f t is the output value of the forget gate; i t 、g t are the input gate output values respectively; o t is the output value of the output gate; c t-1 、c t are the intermediate memory state values at time t-1 and time t respectively; a t-1 、a t are the output values at time t-1 and t respectively; x t Input value at time t; W i 、W g are the weight values in each gate respectively; b f 、b i 、b g 、b o are the bias terms in each gate respectively; σ represents the sigmoid function; tanh represents the tanh function;
[0141] S22. Input the local feature matrix obtained by the input gate into the forget gate. The calculation formula of the forget gate is:
[0142] f t =σ(W f [a t-1 x t ]+b f );
[0143] Among them, W f is the weight value in the forget gate, b f It is the bias term in the forget gate, which determines how much of the unit state at the previous moment can be retained at this moment;
[0144] S23. Input the sample matrix obtained by processing the input gate and the forget gate into the output gate through the memory unit and direct input to obtain the output matrix. The calculation formula of the output gate is:
[0145]
[0146] Among them, W o is the weight value in the output gate, b o is the bias term in the output gate;
[0147] S24, organizing the output matrix into a continuous data set for convolution calculation to highlight the local features of the data set. The convolution calculation formula is:
[0148]
[0149] Among them, x i,j is the element in row i and column j of the feature matrix in the dataset, w m,n It represents the weight element in the mth row and nth column of the convolution weight matrix, w b is the bias term of the neural network, and z is the dimension of the convolution matrix;
[0150] After convolution calculation, the matrix dimension calculation formula is:
[0151]
[0152] Among them, w is the feature matrix input dimension, k is the dimension of the convolution weight matrix, p is the number of zero-padding layers in the convolution calculation, and s is the stride size in the convolution calculation;
[0153] S25, after convolution calculation, enter the pooling calculation, the pooling calculation formula is:
[0154] b ij =max[w'(i*(f-1)+1,j*(f-1)+1)+...+w'(i*f,j*f)];
[0155] where b ij is the element in the i-th row and j-th column of the pooling matrix, w' is the dimension of the matrix after convolution calculation, and f is the dimension of the pooling matrix;
[0156] After pooling calculation, the matrix dimension calculation formula is:
[0157]
[0158] Where f is the dimension of the pooling matrix;
[0159] S26. Use the relu function to activate the matrix. The calculation formula of the relu function is:
[0160] f(x)=max(0,x);
[0161] S27. Calculate the similarity between the element value Value in each sequence element address Key of the matrix and the query element Query:
[0162] eij =D(q i ,p j );
[0163] Where D(·) represents the dot product function, q i Represents the i-th element in the query element set, p j Represents the jth element in the element address set, e ij Indicates the similarity between elements i and j;
[0164] S28, normalizing the similarity, the normalization formula is:
[0165] α ij =softmax(e ij );
[0166] Among them, α ij represents the normalized similarity, and soft max(·) represents the normalized exponential function;
[0167] S29. Perform weighted summation on the normalized similarity data to obtain the hidden layer output value:
[0168]
[0169] From the above description, we can see that the tanh function is continuous, smooth, and strictly monotonic, and can map a real number to the interval (-1,1), preparing for the distribution network status assessment and classification. The tanh function and the sigmoid function as the excitation functions of the long-short time memory neural network can effectively nonlinearize the input-output relationship of the multi-layer neural network and give full play to the hidden layer function; through convolution calculation and pooling calculation, the matrix dimension can be reduced and the number of parameters can be reduced; after completing the local feature extraction, the required features are also extracted through the TPA mechanism (temporal attention mechanism) to operate on the hidden layer output value of the LSTM model. Compared with the LSTM model, it focuses on the correlation between the hidden layer output values at different times in the past and the hidden layer output value at the current moment, that is, by calculating the correlation between the two, the weight of the previous hidden layer output value is determined to obtain the final hidden layer output value, which is more superior.
[0170] Furthermore, the step S2 further includes the steps of:
[0171] The real-time monitoring data is input into the trained long short-term memory neural network model to obtain a load forecast matrix.
[0172] Furthermore, the step S3 is specifically as follows:
[0173] The load forecast matrix is input into the probabilistic power flow method based on the semi-invariant method to calculate the distribution network risk probability, and its probability density function and cumulative distribution function are obtained through series expansion approximation:
[0174] The semi-invariant is defined as follows:
[0175] Let F(x) be the distribution function of the random variable X, t be a real number, |e itx |=1, then function g(x)=e itx The characteristic function of the distribution of F(x) is integrable on (-∞, +∞) and the function of the real variable t corresponding to F(x) is as follows:
[0176]
[0177] Taking the logarithm of the above formula and expanding it according to the Maclaurin series formula, we get the following formula:
[0178]
[0179] Among them, the coefficient y r is an r-order semi-invariant, s represents the number of terms in the expanded expression, o(t s ) represents the remaining items;
[0180] For the normally distributed load power, the first-order semi-invariant is the mathematical expectation, the second-order semi-invariant is equal to the variance, and the third-order and higher-order semi-invariants are zero. The formula is:
[0181]
[0182] For the discrete distribution of coincident power, first solve the central moments according to the following formula:
[0183]
[0184] Among them, p i Take the load value x i The probability, p i =t i / T, where t i The load is equal to x i duration, T is the research period;
[0185] Assuming that the probability of a unit operating at rated capacity C is p, the probability of output power being zero is 1-p. Suppose there are N conventional generators installed at a certain node, and the probability that i of them are operating normally is p. i for:
[0186] p i =C N i pi (1-p) N-i ;
[0187] Then the moments of the total output power of N units are:
[0188] α r =p1C r +p2(2C) r +…+p N (NC) r ;
[0189] The Monte Carlo sampling method is used to calculate the semi-invariant of wind and solar power generation. First, N wind speed / light intensity sequences {a1, a2, ..., a N};
[0190] According to the output power characteristics of the wind turbine / optical machine, the active power sequence {P1, P2, ..., P N}, under the constant power factor control mode, the reactive power of the wind turbine / optical machine is proportional to the active power, thus obtaining the reactive power sequence {Q1,Q2,…,Q N};
[0191] The origin moments of each order of wind-solar generator set output power are:
[0192]
[0193] Among them, α P,r and α Q,r are the r-order origin moments of the active and reactive power output by the wind and solar generator sets;
[0194] The semi-invariant of wind turbine output is obtained based on the relationship between the origin moment and the semi-invariant;
[0195] When polar coordinates are used to represent node voltages, the power flow equation of the power system can be expressed as:
[0196]
[0197] Among them, P i , Q i is the active / reactive power of node i, V i 、V j is the voltage amplitude at node i / j, θ ij is the phase difference between node i and node j, that is, θ ij =θ i -θ j , G ij 、B ij They are the node admittance matrix Y ijThe real and imaginary parts of
[0198] The node injection amount S and the state variable X are both random variables and can be written as:
[0199]
[0200] Where S0 and X0 are the reference values of S and X when the power system is at the reference operating point, i.e., the expected values; ΔS and ΔX are the random disturbances of the injected power and the random disturbances of the state variables caused by the random fluctuations of the injected power;
[0201] The branch power flow equation is linearized. When the state variables of each node are known, the system branch power flow calculation method is:
[0202]
[0203] Among them, P ij , Q ij is the active and reactive power flow on branch ij, t ij is the transformer ratio, b ij0 is 1 / 2 line admittance;
[0204] In a distribution network containing distributed generation, the random factor is mainly the random disturbance of the power S injected by each node. The expression of the random disturbance ΔS is:
[0205]
[0206] According to the linearized power flow equation and using the properties of the semi-invariant, instead of the convolution calculation, the r-order semi-invariant ΔX of the node voltage and branch power flow can be obtained. (r) and ΔZ (r) ;
[0207] The coefficients of the series can be expressed as expressions of the semi-invariants of each order of the random variable. The simplified form of the series is defined as:
[0208]
[0209] Among them, g r is the r-order normalized semi-invariant, σ is the standard deviation;
[0210] For any random variable X, assuming its expected value and standard deviation are μ and σ respectively, its standardized form is:
[0211]
[0212] After using the Gram-Charlier series expansion, the cumulative distribution function of the random variable can be expressed as:
[0213]
[0214] in, is the normalized random variable, are the probability density function and cumulative distribution function of the standard normal distribution random variable, g r is the semi-invariant after normalization of order r, is the Hermite polynomial of order i.
[0215] From the above description, it can be seen that the power flow algorithm based on semi-invariants and Gram-Charlier series expansion has good convergence.
[0216] A distribution network risk prediction method and terminal of the present invention are suitable for distribution network risk prediction including new energy power stations.
[0217] Please refer to Figure 1 as well as Figures 3 to 6 , embodiment 1 of the present invention is:
[0218] A risk prediction method for a distribution network comprises the following steps:
[0219] S1. Acquire real-time monitoring data, historical data, and basic data associated with the historical data of distribution network equipment, and preprocess the historical data and the basic data to generate an initial matrix;
[0220] The basic data are external data that affect the safe operation of the distribution network.
[0221] In this embodiment, based on the evaluation object, online real-time detection data is obtained from relevant equipment, and historical data and basic data are obtained from the database. The basic data is obtained by widely collecting distribution network related parameters, operating data, and other additional data that may affect the safe operation of the distribution network. The historical data and the basic data are shown in Table 1 below:
[0222] Table 1
[0223]
[0224] Among them, load is historical data, and other data such as dry bulb temperature and dew point temperature are basic data.
[0225] Initialize the historical data and basic data obtained from the power grid database and organize them to generate the initial matrix:
[0226] Initialize the basic data collected from the database and organize the obtained data into a table. The table matrix is:
[0227]
[0228] Among them, A k is the risk feature matrix of the distribution network at a certain time k. In order to fully learn the risk features using the convolutional neural network, it is necessary to combine the one-dimensional matrix in time series to form the 24×8 matrix required for training, and divide it into training set, validation set and test set.
[0229] Normalize the obtained table matrix:
[0230]
[0231] Where: S * is the normalized data; S is the original data; S max 、S min Is the limit value of the data. k Perform normalization and generate the initial matrix, as shown in Table 2 below:
[0232] Table 2
[0233] 0.007383 0.005611 0.000295 0 0.000295 0.001772 0.000886 0.007060 0.005525 0.000307 0 0.000614 0.001842 0.000921 0.006899 0.005644 0.000314 0 0.000941 0.001881 0.000941 0.006969 0.006018 0.000317 0 0.001267 0.001901 0.000950 0.007265 0.006001 0.000316 0 0.001579 0.001895 0.000948 0.007066 0.006144 0.000307 0 0.001843 0.001843 0.000922 0.007383 0.005611 0.000295 0 0.002067 0.001772 0.000886 … … … … … … …
[0234] The obtained initial matrix is organized into a continuous data set and input into the long-short time memory neural network based on the temporal attention mechanism for load forecasting.
[0235] S2. Input the real-time monitoring data and the initial matrix into a long short-term memory neural network model based on a temporal attention mechanism, and output a load forecast matrix;
[0236] In this city’s implementation, a long short-term memory neural network model based on the temporal attention mechanism is constructed to enhance the prediction accuracy through the temporal attention mechanism and output the load prediction matrix. Figure 4 shown.
[0237] The step S2 includes training the long short-term memory neural network model according to the initial matrix:
[0238] The initial matrix is organized into a continuous data set and imported into the long-short time neural network. The input gate calculation formula is:
[0239]
[0240] Among them, f t is the output value of the forget gate; i t 、g t are the input gate output values respectively; o t is the output value of the output gate; c t-1 、c t are the intermediate memory state values at time t-1 and time t respectively; a t-1 、at are the output values at time t-1 and t respectively; x t Input value at time t; W i 、W g are the weight values in each gate respectively; b f 、b i 、b g 、b o are the bias terms in each gate respectively; σ represents the sigmoid function; tanh represents the tanh function;
[0241] The calculation formula of the above sigmoid function is as follows:
[0242]
[0243] The sigmoid function is continuous, smooth, and strictly monotonic, and can map a real number to the interval (0, 1), preparing for distribution network status assessment and classification;
[0244] The calculation formula of the above tanh function is as follows:
[0245]
[0246] The tanh function is continuous, smooth, and strictly monotonic. It can map a real number to the interval (-1,1), preparing for the distribution network status assessment and classification. The tanh function and the sigmoid function as the excitation functions of the long-short time memory neural network can effectively nonlinearize the input-output relationship of the multi-layer neural network and give full play to the hidden layer function.
[0247] The local feature matrix also needs to be input into the forget gate. By learning from the human memory model, the setting of the forget gate optimizes the ordinary recurrent neural network. Its calculation formula is:
[0248] f t =σ(W f [a t-1 x t ]+b f );
[0249] Among them, W f is the weight value in the forget gate, b f It is the bias term in the forget gate, which determines how much of the unit state at the previous moment can be retained at this moment.
[0250] The sample matrix processed by the forget gate and input gate is input into the output gate through the memory unit and direct input to obtain the final evaluation result. The calculation formula is:
[0251]
[0252] Among them, W o is the weight value in the output gate, b o The LSTM (Long Short Time Memory) neural network uses the information contained in historical data to make predictions. However, the current data is not only related to the data sequence from the previous period, but also, due to the continuity of time series, the data sequence from the subsequent period also has a certain connection with the current data, containing certain regularities.
[0253] The output matrix of LSTM is organized into a continuous data set for convolution calculation to highlight the local features of the data set. The convolution calculation formula is:
[0254]
[0255] Where: x i,j is the element in row i and column j of the feature matrix in the dataset, w m,n It represents the weight element in the mth row and nth column of the convolution weight matrix, w b is the bias term of the neural network, and z is the dimension of the convolution matrix.
[0256] After convolution calculation, the matrix dimension calculation formula is:
[0257]
[0258] Among them, w is the feature matrix input dimension, k is the dimension of the convolution weight matrix, p is the number of zero-padding layers in the convolution calculation, and s is the stride size in the convolution calculation.
[0259] After the matrix is organized into a continuous data set for convolution calculation, the matrix is pooled. The pooling calculation formula is:
[0260] b ij =max[w'(i*(f-1)+1,j*(f-1)+1)+...+w'(i*f,j*f)];
[0261] Among them, b ij is the element in the i-th row and j-th column of the pooling matrix, w' is the dimension of the matrix after convolution calculation, and f is the dimension of the pooling matrix. Pooling calculation can greatly reduce the matrix dimension and the number of parameters;
[0262] After pooling calculation, the matrix dimension calculation formula is:
[0263]
[0264] Where f is the dimension of the pooling matrix.
[0265] After performing pooling calculation on the convolution matrix, the relu function is used to activate the matrix. The calculation formula of the excitation function is:
[0266] f(x)=max(0,x);
[0267] After convolution, pooling and excitation, the extraction of local features of the sample function has been completed, and the temporal features are extracted from the local features through the next step of temporal attention mechanism.
[0268] The output matrix sequence element value is Value, the sequence element address is Key, the query element is called Query, and the similarity between Query and the element value Value in each Key is calculated as:
[0269] e ij =D(q i ,p j );
[0270] Where D(·) represents the dot product function, q i 、p j Represents the query element and the i-th and j-th elements in the element address set, respectively, e ij Indicates the similarity between elements i and j.
[0271] The obtained similarity is normalized, and the normalization formula is:
[0272] α ij =softmax(e ij );
[0273] Among them, α ij represents the normalized similarity, and soft max(·) represents the normalized exponential function.
[0274] Perform weighted summation on the normalized data after normalization:
[0275]
[0276] The TPA mechanism is used to calculate the hidden layer output value of the LSTM model. Compared with the LSTM model, it focuses on the correlation between the hidden layer output values at different times in the past and the hidden layer output value at the current moment. That is, the weight of the previous hidden layer output value is determined by calculating the correlation between the two to obtain the final hidden layer output value.
[0277] The test results are as follows Figure 5 As shown, the mean absolute percentage error (MAPE) after training is 0.98%.
[0278] The real-time monitoring data is input into the trained long short-term memory neural network model to obtain a load forecast matrix.
[0279] S3. According to the load forecast matrix, the power flow calculation based on the semi-invariant method is adopted, and the probability density function and cumulative distribution function of the node voltage and branch power flow are obtained through Gram-Charlier series expansion approximation to determine the risk probability.
[0280] In this embodiment, multiple types of data are integrated, and a probabilistic power flow method based on the semi-invariant method is used to calculate the risk probability of the distribution network. Its probability density function and cumulative distribution function are obtained through Gram-Charlier series expansion approximation.
[0281] The forecast data (load forecast matrix) is input into the probabilistic power flow method based on the semi-invariant method to calculate the risk probability of the distribution network. The probability density function and cumulative distribution function are obtained through series expansion approximation to determine the risk probability of the distribution network.
[0282] The semi-invariant is defined as follows:
[0283] Let F(x) be the distribution function of the random variable X, t be a real number, |e itx |=1, then function g(x)=e itx The characteristic function of the distribution of F(x) is integrable on (-∞, +∞) and the function of the real variable t corresponding to F(x) is as follows:
[0284]
[0285] Taking the logarithm of the above formula and expanding it according to the Maclaurin series formula, we get the following formula:
[0286]
[0287] Among them, the coefficient y r is an r-order semi-invariant, s represents the number of terms in the expanded expression, o(t s ) represents the remaining items.
[0288] The random component of load is composed of load forecast errors and random load fluctuations, and can generally be described by random variables that obey a normal distribution. For a normally distributed load power, its first-order semi-invariant is the mathematical expectation, the second-order semi-invariant is equal to the variance, and the third-order and higher-order semi-invariants are zero. The formula is:
[0289]
[0290] For discretely distributed load power, first calculate the central moments of each order according to the following formula:
[0291]
[0292] Among them, pi Take the load value x i The probability, p i =t i / T, where t i The load is equal to x i The duration of the study is T.
[0293] Assuming that the probability of the unit operating at rated capacity C is p, the probability of the output power being zero is 1-p. Suppose there are N conventional generators installed at a node, and the probability that i of them are operating normally is p. i for:
[0294] p i =C N i p i (1-p) N-i ;
[0295] Then the moments of the total output power of N units are:
[0296] α r =p1C r +p2(2C) r +…+p N (NC) r .
[0297] The Monte Carlo sampling method is used to calculate the semi-invariant of wind and solar power generation. First, the Monte Carlo sampling technique is used to extract N wind speed / light intensity sequences {a1, a2, ..., a N}.
[0298] According to the output power characteristics of the wind turbine / optical machine, the active power sequence {P1, P2, ..., P N}, under the constant power factor control mode, the reactive power of the wind turbine / optical machine is proportional to the active power, thus obtaining the reactive power sequence {Q1,Q2,…,Q N}.
[0299] The origin moments of each order of wind-solar generator set output power are:
[0300]
[0301] Among them, α P,r and α Q,r are the r-order origin moments of the active and reactive power output of the wind and solar power generator sets, respectively. Based on the relationship between the origin moment and the semi-invariant, the semi-invariant of the wind turbine output can be obtained.
[0302] When polar coordinates are used to represent node voltages, the power flow equation of the power system can be expressed as:
[0303]
[0304] Where: P i , Q i is the active / reactive power of node i, V i 、V j is the voltage amplitude at node i / j, θ ij is the phase difference between node i and node j, that is, θ ij =θ i -θ j , G ij 、B ij They are the node admittance matrix Y ij The real and imaginary parts of .
[0305] The node injection amount S and the state variable X are both random variables and can be written as:
[0306]
[0307] Where: S0 and X0 are the reference values of S and X when the power system is at the reference operating point, that is, the expected values; ΔS and ΔX are the random disturbances of the injected power and the random disturbances of the state variables caused by the random fluctuations of the injected power.
[0308] Linearize the branch power flow equation. When the state variables of each node are known, the system branch power flow calculation method is:
[0309]
[0310] Among them, P ij , Q ij is the active and reactive power flow on branch ij, t ij is the transformer ratio, b ij0 is 1 / 2 line admittance.
[0311] The random factors in the distribution network containing distributed generation are mainly the random disturbance ΔS of the power injected S at each node, which is expressed as:
[0312]
[0313] Where, ΔS load Represents load fluctuation, ΔS wind represents the random output fluctuation of the wind turbine, ΔS pv represents the random output variation of the photovoltaic power generation system, and ⊕ represents the convolution calculation.
[0314] Semi-invariant ΔS of each order of node injection power (k) It can be expressed as the semi-invariant ΔS of the node load injection power of each orderload (r) and the semi-invariants of the distributed generation power injection power ΔS wind (r) ,ΔS pv (r) The algebraic sum of is expressed as:
[0315]
[0316] According to the linearized power flow equation and using the properties of the semi-invariant, instead of the convolution calculation, the r-order semi-invariant ΔX of the node voltage and branch power flow can be obtained. (r) and ΔZ (r) .
[0317] The coefficients of the series can be expressed as expressions of the semi-invariants of each order of the random variable. The simplified form of the series is defined as:
[0318]
[0319] Among them, g r is called the r-order normalized semi-invariant; σ is the standard deviation.
[0320] For any random variable X, assuming its expected value and standard deviation are μ and σ respectively, its standardized form is:
[0321]
[0322] After using the Gram-Charlier series expansion, the cumulative distribution function of the random variable can be expressed as:
[0323]
[0324] in: is the normalized random variable; are the probability density function and cumulative distribution function of the standard normal distribution random variable respectively; g r is the semi-invariant after normalization of order r; is the Hermite polynomial of order i.
[0325] Take the test result of node 33 as an example. Figure 6 shown.
[0326] The overall risk data is shown in Table 3 below:
[0327] Table 3
[0328]
[0329]
[0330] Please refer to Figure 2 , the second embodiment of the present invention is:
[0331] A risk prediction terminal 1 for a distribution network includes a processor 2, a memory 3, and a computer program stored in the memory 3 and executable on the processor 2. When the processor 2 executes the computer program, the steps of the risk prediction method for a distribution network described in the first embodiment are implemented.
[0332] In summary, the present invention provides a distribution network risk prediction method and terminal, constructs a long-short time memory neural network model based on the temporal attention mechanism, enhances the prediction accuracy through the temporal attention mechanism, adopts a probabilistic power flow method based on the semi-invariant method to calculate the distribution network risk probability, and obtains its probability density function and cumulative distribution function through Gram-Charlier series expansion approximation to achieve risk prediction and improve the effectiveness, real-time and accuracy of distribution network risk assessment.
[0333] In summary, the above prediction method preprocesses distribution network parameters and historical operation and maintenance data obtained from the database, and then extracts initial features from the risk data in combination with environmental factors. This model uses a long-short-term memory neural network to extract initial features from the risk data. A temporal attention mechanism and a convolutional neural network are combined to form a temporal attention layer, and the output results are used as the initial data for risk assessment. The expected and sensitivity matrices of node voltages and branch power flows are obtained through power flow calculations. The semi-invariants of the injected power at each node are converted into various-order semi-invariants of the node state vector and branch power flow vector. Finally, the Gram-Charlier series expansion is used to obtain the probability density function and probability distribution function of the node voltage.
[0334] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's description and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A risk prediction method for a distribution network, characterized in that: Including steps: S1. Acquire real-time monitoring data, historical data, and basic data associated with the historical data of distribution network equipment, and preprocess the historical data and the basic data to generate an initial matrix; The basic data are external data that affect the safe operation of the distribution network; S2. Input the real-time monitoring data and the initial matrix into a long short-term memory neural network model based on a temporal attention mechanism, and output a load forecast matrix; S3. Based on the load forecast matrix, a power flow calculation based on a semi-invariant method is used, and the probability density function and cumulative distribution function of the node voltage and branch power flow are obtained through Gram-Charlier series expansion approximation to determine the risk probability; The origin moments of each order of wind-solar generator set output power are: Among them, α P,r and α Q,r are the r-order origin moments of the active and reactive power output by the wind and solar generator sets; The semi-invariant of wind turbine output is obtained based on the relationship between the origin moment and the semi-invariant; When polar coordinates are used to represent node voltages, the power flow equation of the power system is expressed as: Among them, P i , Q i is the active / reactive power of node i, V i 、V j is the voltage amplitude at node i / j, θ ij is the phase difference between node i and node j, that is, θ ij =θ i -θ j , G ij 、B ij They are the node admittance matrix Y ij The real and imaginary parts of The node injection amount S and the state variable X are both random variables, written as: Where S0 and X0 are the reference values of S and X when the power system is at the reference operating point, i.e., the expected values; ΔS and ΔX are the random disturbances of the injected power and the random disturbances of the state variables caused by the random fluctuations of the injected power; The branch power flow equation is linearized. When the state variables of each node are known, the system branch power flow calculation method is: Among them, P ij , Q ij is the active and reactive power flow on branch ij, t ij is the transformer ratio, b ij0 is 1 / 2 line admittance; In a distribution network containing distributed generation, the random factor is mainly the random disturbance of the power S injected by each node. The expression of the random disturbance ΔS is: According to the linearized power flow equation, and using the properties of the semi-invariant, instead of the convolution calculation, the r-order semi-invariant ΔX of the node voltage and branch power flow to be determined is obtained. (r) and ΔZ (r) ; The coefficients of the series can be expressed as expressions of the semi-invariants of each order of the random variable. The simplified form of the series is defined as: Among them, g r is the r-order normalized semi-invariant, σ is the standard deviation; For any random variable X, assuming its expected value and standard deviation are μ and σ respectively, its standardized form is: After Gram-Charlier series expansion, the cumulative distribution function of the random variable is expressed as: in, is the normalized random variable, are the probability density function and cumulative distribution function of the standard normal distribution random variable, g r is the semi-invariant after normalization of order r, is the Hermite polynomial of order i.
2. A method for predicting risk of a distribution network according to claim 1, characterized in that: The generation of the initial matrix is specifically as follows: Initialize the historical data and the basic data to obtain the risk feature matrix: Among them, A k is the risk characteristic matrix of the distribution network at a certain time k, which is obtained by time series combination of one-dimensional matrices and divided into training set, validation set and test set; The risk feature matrix is normalized, and the normalization formula is: Among them, S * is the normalized data, S is the original data, S max 、S min are the maximum and minimum values of the data; Get the initial matrix.
3. The method for predicting risk of a distribution network according to claim 1, wherein: The step S2 includes training the long short-term memory neural network model according to the initial matrix: S21. Arrange the initial matrix into a continuous data set and import it into the long short-term memory neural network model. The calculation formula of its input gate is: Among them, f t is the output value of the forget gate; i t 、g t are the input gate output values respectively; o t is the output value of the output gate; c t-1 、c t are the intermediate memory state values at time t-1 and time t respectively; a t-1 、a t are the output values at time t-1 and t respectively; x t Input value at time t; W i 、W g are the weight values in each gate respectively; b f 、b i 、b g 、b o are the bias terms in each gate respectively; σ represents the sigmoid function; tanh represents the tanh function; S22. Input the local feature matrix obtained by the input gate into the forget gate. The calculation formula of the forget gate is: f t =σ(W f [a t-1 x t ]+b f ); Among them, W f is the weight value in the forget gate, b f It is the bias term in the forget gate, which determines how much of the unit state at the previous moment can be retained at this moment; S23. Input the sample matrix obtained by processing the input gate and the forget gate into the output gate through the memory unit and direct input to obtain the output matrix. The calculation formula of the output gate is: Among them, W o is the weight value in the output gate, b o is the bias term in the output gate; S24, organizing the output matrix into a continuous data set for convolution calculation to highlight the local features of the data set. The convolution calculation formula is: Among them, x i,j is the element in row i and column j of the feature matrix in the dataset, w m,n It represents the weight element in the mth row and nth column of the convolution weight matrix, w b is the bias term of the neural network, and z is the dimension of the convolution matrix; After convolution calculation, the matrix dimension calculation formula is: Among them, w is the feature matrix input dimension, k is the dimension of the convolution weight matrix, p is the number of zero-padding layers in the convolution calculation, and s is the stride size in the convolution calculation; S25, after convolution calculation, enter the pooling calculation, the pooling calculation formula is: b ij =max[w'(i*(f-1)+1,j*(f-1)+1)+…+w'(i*f,j*f)]; where b ij is the element in the i-th row and j-th column of the pooling matrix, w' is the dimension of the matrix after convolution calculation, and f is the dimension of the pooling matrix; After pooling calculation, the matrix dimension calculation formula is: Where f is the dimension of the pooling matrix; S26. Use the relu function to activate the matrix. The calculation formula of the relu function is: f(x)=max(0,x); S27. Calculate the similarity between the element value Value in each sequence element address Key of the matrix and the query element Query: e ij =D(q i ,p j ); Where D(·) represents the dot product function, q i Represents the i-th element in the query element set, p j Represents the jth element in the element address set, e ij Indicates the similarity between elements i and j; S28, normalizing the similarity, the normalization formula is: a ij =softmax(e ij ); Among them, α ij represents the normalized similarity, and soft max(·) represents the normalized exponential function; S29. Perform weighted summation on the normalized similarity data to obtain the hidden layer output value:
4. A method for predicting risk of a distribution network according to claim 3, characterized in that: The step S2 further comprises the steps of: The real-time monitoring data is input into the trained long short-term memory neural network model to obtain a load forecast matrix.
5. The method for predicting risk of a distribution network according to claim 1, wherein: The step S3 is specifically as follows: The load forecast matrix is input into the probabilistic power flow method based on the semi-invariant method to calculate the distribution network risk probability, and its probability density function and cumulative distribution function are obtained through series expansion approximation: The semi-invariant is defined as follows: Let F(x) be the distribution function of the random variable X, t be a real number, |e itx |=1, then function g(x)=e itx The characteristic function of the distribution of F(x) is integrable on (-∞, +∞) and the function of the real variable t corresponding to F(x) is as follows: Taking the logarithm of the above formula and expanding it according to the Maclaurin series formula, we get the following formula: Among them, the coefficient y r is an r-order semi-invariant, s represents the number of terms in the expanded expression, o(t s ) represents the remaining items; For the normally distributed load power, the first-order semi-invariant is the mathematical expectation, the second-order semi-invariant is equal to the variance, and the third-order and higher-order semi-invariants are zero. The formula is: For the discrete distribution of coincident power, first solve the central moments according to the following formula: Among them, p i Take the load value x i The probability, p i =t i / T, where t i The load is equal to x i duration, T is the research period; Assuming that the probability of a unit operating at rated capacity C is p, the probability of output power being zero is 1-p. Suppose there are N conventional generators installed at a certain node, and the probability that i of them are operating normally is p. i for: p i =C N i p i (1-p) N-i ; Then the moments of the total output power of N units are: α r sp1C r +p2(2C) r +...+p N (NC) r 100. The Monte Carlo sampling method is used to calculate the semi-invariant of wind and solar power generation. First, N wind speed / light intensity sequences {a1, a2, ..., a N }; According to the output power characteristics of the wind turbine / optical machine, the active power sequence {P1, P2, ..., P N }, under the constant power factor control mode, the reactive power of the wind turbine / optical machine is proportional to the active power, thus obtaining the reactive power sequence {Q1,Q2,…,Q N }.
6. A risk prediction terminal for a distribution network, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the following steps are implemented: S1. Acquire real-time monitoring data, historical data, and basic data associated with the historical data of distribution network equipment, and preprocess the historical data and the basic data to generate an initial matrix; The basic data are external data that affect the safe operation of the distribution network; S2. Input the real-time monitoring data and the initial matrix into a long short-term memory neural network model based on a temporal attention mechanism, and output a load forecast matrix; S3. Based on the load forecast matrix, a power flow calculation based on a semi-invariant method is used, and the probability density function and cumulative distribution function of the node voltage and branch power flow are obtained through Gram-Charlier series expansion approximation to determine the risk probability; The origin moments of each order of wind-solar generator set output power are: Among them, α P,r and α Q,r are the r-order origin moments of the active and reactive power output by the wind and solar generator sets; The semi-invariant of wind turbine output is obtained based on the relationship between the origin moment and the semi-invariant; When polar coordinates are used to represent node voltages, the power flow equation of the power system is expressed as: Among them, P i , Q i is the active / reactive power of node i, V i 、V j is the voltage amplitude at node i / j, θ ij is the phase difference between node i and node j, that is, θ ij =θ i -θ j , G ij 、B ij They are the node admittance matrix Y ij The real and imaginary parts of The node injection amount S and the state variable X are both random variables, written as: Where S0 and X0 are the reference values of S and X when the power system is at the reference operating point, i.e., the expected values; ΔS and ΔX are the random disturbances of the injected power and the random disturbances of the state variables caused by the random fluctuations of the injected power; The branch power flow equation is linearized. When the state variables of each node are known, the system branch power flow calculation method is: Among them, P ij , Q ij is the active and reactive power flow on branch ij, t ij is the transformer ratio, b ij0 is 1 / 2 line admittance; In a distribution network containing distributed generation, the random factor is mainly the random disturbance of the power S injected by each node. The expression of the random disturbance ΔS is: According to the linearized power flow equation, and using the properties of the semi-invariant, instead of the convolution calculation, the r-order semi-invariant ΔX of the node voltage and branch power flow to be determined is obtained. (r) and ΔZ (r) ; The coefficients of the series can be expressed as expressions of the semi-invariants of each order of the random variable. The simplified form of the series is defined as: Among them, g r is the r-order normalized semi-invariant, σ is the standard deviation; For any random variable X, assuming its expected value and standard deviation are μ and σ respectively, its standardized form is: After Gram-Charlier series expansion, the cumulative distribution function of the random variable is expressed as: in, is the normalized random variable, are the probability density function and cumulative distribution function of the standard normal distribution random variable, g r is the semi-invariant after normalization of order r, is the Hermite polynomial of order i.
7. A risk prediction terminal for a distribution network according to claim 6, characterized in that: The generation of the initial matrix is specifically as follows: Initialize the historical data and the basic data to obtain the risk feature matrix: Among them, A k is the risk characteristic matrix of the distribution network at a certain time k, which is obtained by time series combination of one-dimensional matrices and divided into training set, validation set and test set; The risk feature matrix is normalized, and the normalization formula is: Among them, S * is the normalized data, S is the original data, S max 、S min are the maximum and minimum values of the data; Get the initial matrix.
8. A risk prediction terminal for a distribution network according to claim 6, characterized in that: The step S2 includes training the long short-term memory neural network model according to the initial matrix: S21. Arrange the initial matrix into a continuous data set and import it into the long short-term memory neural network model. The calculation formula of its input gate is: Among them, f t is the output value of the forget gate; i t 、g t are the input gate output values respectively; o t is the output value of the output gate; c t-1 、c t are the intermediate memory state values at time t-1 and time t respectively; a t-1 、a t are the output values at time t-1 and t respectively; x t Input value at time t; W i 、W g are the weight values in each gate respectively; b f 、b i 、b g 、b o are the bias terms in each gate respectively; σ represents the sigmoid function; tanh represents the tanh function; S22. Input the local feature matrix obtained by the input gate into the forget gate. The calculation formula of the forget gate is: f t =σ(W f [a t-1 x t ]+b f ); Among them, W f is the weight value in the forget gate, b f It is the bias term in the forget gate, which determines how much of the unit state at the previous moment can be retained at this moment; S23. Input the sample matrix obtained by processing the input gate and the forget gate into the output gate through the memory unit and direct input to obtain the output matrix. The calculation formula of the output gate is: Among them, W o is the weight value in the output gate, b o is the bias term in the output gate; S24, organizing the output matrix into a continuous data set for convolution calculation to highlight the local features of the data set. The convolution calculation formula is: Among them, x i,j is the element in row i and column j of the feature matrix in the dataset, w m,n It represents the weight element in the mth row and nth column of the convolution weight matrix, w b is the bias term of the neural network, and z is the dimension of the convolution matrix; After convolution calculation, the matrix dimension calculation formula is: Among them, w is the feature matrix input dimension, k is the dimension of the convolution weight matrix, p is the number of zero-padding layers in the convolution calculation, and s is the stride size in the convolution calculation; S25, after convolution calculation, enter the pooling calculation, the pooling calculation formula is: b ij =max[w'(i*(f-1)+1,j*(f-1)+1)+…+w'(i*f,j*f)]; where b ij is the element in the i-th row and j-th column of the pooling matrix, w' is the dimension of the matrix after convolution calculation, and f is the dimension of the pooling matrix; After pooling calculation, the matrix dimension calculation formula is: Where f is the dimension of the pooling matrix; S26. Use the relu function to activate the matrix. The calculation formula of the relu function is: f(x)=max(0,x); S27. Calculate the similarity between the element value Value in each sequence element address Key of the matrix and the query element Query: e ij =D(q i ,p j ); Where D(·) represents the dot product function, q i Represents the i-th element in the query element set, p j Represents the jth element in the element address set, e ij Indicates the similarity between elements i and j; S28, normalizing the similarity, the normalization formula is: a ij =softmax(e ij ); Among them, α ij represents the normalized similarity, and soft max(·) represents the normalized exponential function; S29. Perform weighted summation on the normalized similarity data to obtain the hidden layer output value:
9. A risk prediction terminal for a distribution network according to claim 8, characterized in that: The step S2 further comprises the steps of: The real-time monitoring data is input into the trained long short-term memory neural network model to obtain a load forecast matrix.
10. A risk prediction terminal for a distribution network according to claim 6, characterized in that: The step S3 is specifically as follows: The load forecast matrix is input into the probabilistic power flow method based on the semi-invariant method to calculate the distribution network risk probability, and its probability density function and cumulative distribution function are obtained through series expansion approximation: The semi-invariant is defined as follows: Let F(x) be the distribution function of the random variable X, t be a real number, |e itx |=1, then function g(x)=e itx The characteristic function of the distribution of F(x) is integrable on (-∞, +∞) and the function of the real variable t corresponding to F(x) is as follows: Taking the logarithm of the above formula and expanding it according to the Maclaurin series formula, we get the following formula: Among them, the coefficient y r is an r-order semi-invariant, s represents the number of terms in the expanded expression, o(t s ) represents the remaining items; For the normally distributed load power, the first-order semi-invariant is the mathematical expectation, the second-order semi-invariant is equal to the variance, and the third-order and higher-order semi-invariants are zero. The formula is: For the discrete distribution of coincident power, first solve the central moments according to the following formula: Among them, p i Take the load value x i The probability, p i =t i / T, where t i The load is equal to x i duration, T is the research period; Assuming that the probability of a unit operating at rated capacity C is p, the probability of output power being zero is 1-p. Suppose there are N conventional generators installed at a certain node, and the probability that i of them are operating normally is p. i for: p i =C N i p i (1-p) N-i ; Then the moments of the total output power of N units are: α r sp1C r +p2(2C) r +...+p N (NC) r 100. The Monte Carlo sampling method is used to calculate the semi-invariant of wind and solar power generation. First, N wind speed / light intensity sequences {a1, a2, ..., a N }; According to the output power characteristics of the wind turbine / optical machine, the active power sequence {P1, P2, ..., P N }, under the constant power factor control mode, the reactive power of the wind turbine / optical machine is proportional to the active power, thus obtaining the reactive power sequence {Q1,Q2,…,Q N }.
Citation Information
Patent Citations
Risk product prediction method and device
CN113052511A
Active power distribution network operation situation prediction method based on IEMD-TA-LSTM model
CN115275991A