Deep neural network probabilistic load flow calculation method and system

By introducing a multi-head self-attention mechanism and a semi-invariant-guided deep neural network model into probabilistic power flow calculation, combined with chance constraints, the shortcomings of traditional methods in terms of efficiency and accuracy are solved, and accurate quantitative evaluation of probabilistic power flow and reliable decision support for safe system operation are achieved.

CN120999637AActive Publication Date: 2025-11-21EAST CHINA JIAOTONG UNIVERSITY

Patent Information

Application Number
CN202511493264.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-20
Publication Date
2025-11-21
Estimated Expiration
2045-10-20

AI Technical Summary

Technical Problem

Existing probabilistic power flow calculation methods are insufficient in terms of computational efficiency and accuracy, especially when dealing with complex power systems. The traditional Newton-Raphson method is inefficient in iteratively solving the Jacobian matrix, and deep neural networks are insufficient in terms of computational accuracy and efficiency in complex situations. Furthermore, existing methods fail to accurately quantify the uncertainty of probabilistic power flow.

Method used

A deep neural network model based on multi-head self-attention mechanism and semi-invariant guidance is adopted. The branch admittance is embedded as physical information into the neural network. Combined with chance constraints, the iterative process is replaced by a forward inference. The contribution of branch parameters to the output variable is dynamically quantified by multi-head self-attention mechanism and quantitatively evaluated by semi-invariant method.

Benefits of technology

It significantly improves computational efficiency and prediction accuracy, can accurately identify the mutual influence between nodes with long electrical distances, realizes quantitative assessment of probabilistic power flow, improves the transparency and interpretability of analysis results, and provides a reliable decision-making basis for the safe operation of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120999637A_ABST
    Figure CN120999637A_ABST
Patent Text Reader

Abstract

The invention discloses a deep neural network probabilistic load flow calculation method and system, and belongs to the field of power system analysis. The method comprises the following steps: acquiring power system parameters and confidence levels, and determining state variables and orders; establishing and linearizing a nonlinear power flow equation to obtain a Jacobian matrix; a node voltage vector is used as input, branch admittance is used as physical information to be embedded into a deep neural network model based on a multi-head self-attention mechanism and semi-invariant guidance, a Jacobian matrix is solved, and a sensitivity matrix is calculated; calculating and aggregating semi-invariants, and transmitting the semi-invariants to a state variable; and after standardization, obtaining a distribution function by using a six-order Cornish-Fisher series, and calculating a fluctuation interval in combination with a confidence level under opportunity constraint to realize quantitative evaluation. According to the method, the probability load flow calculation complexity is reduced, the limitation of a traditional method in processing the network topology complexity problem is solved, and quantitative evaluation of the probability load flow is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of power system analysis technology and relates to a deep neural network probabilistic power flow calculation method and system. Background Technology

[0002] The large-scale grid connection of renewable energy sources, such as wind and solar power, has accelerated the transformation of modern power systems. However, the inherent randomness and intermittency of renewable energy introduce significant uncertainties into the operation of these new power systems. In these renewable energy-dominated systems, accurate analysis of the probability distribution of power flow through probabilistic power flow calculations and the quantification of the impact of renewable energy uncertainties on power flow are crucial for the safe and reliable operation of the system.

[0003] Currently, probabilistic power flow calculation methods are mainly divided into simulation methods, approximation methods, and analytical methods. Monte Carlo simulation (MCS)-based probabilistic power flow calculation is a representative of simulation methods. This method requires a large number of samples for simulation calculation, consuming a significant amount of time and resulting in high time costs. Point estimation method (PEM)-based probabilistic power flow calculation can be considered a representative of approximation methods. PEM constructs representative samples using a small number of samples to quickly obtain the probability information of state variables, thus requiring less time than MCS. However, the selection of sample points greatly affects the accuracy of the calculation results. Semi-invariant method (CM)-based probabilistic power flow calculation is a representative of analytical methods. CM simplifies convolution operations, enabling results to be obtained with fewer operations while maintaining accuracy. Its computational accuracy is better than PEM, and its computational efficiency is better than MCS. However, CM typically uses the cumbersome Newton-Raphson method to obtain the Jacobian matrix, requiring numerous iterative calculations, thus still exhibiting low efficiency.

[0004] With the rapid development of machine learning, neural networks have made significant achievements in power flow calculation, optimal power flow, and probabilistic power flow. Deep neural networks (DNNs) have been applied to power flow calculation, and well-trained DNN models can completely replace traditional methods in some areas to achieve higher efficiency. However, although DNN models can extract more abstract and complex features from data by deepening the neural network layers, their computational accuracy and efficiency can be insufficient in complex situations. In such cases, the underlying physical model of the system also needs to be considered, leading to the development of Physically Guided Deep Neural Network (PGDNN) models. These models encode the structural characteristics of power flow equations, system topology, and other physical knowledge in the power system into the neural network, ensuring that feature transmission within the neural network follows physical laws, thereby improving the performance of the neural network. Summary of the Invention

[0005] To achieve faster and more accurate probabilistic power flow calculation, this invention proposes a deep neural network probabilistic power flow calculation method and system. It embeds inter-branch admittance as physical knowledge into a deep neural network with a multi-head self-attention mechanism. Through adaptive weight allocation, it dynamically quantifies the contribution of different inter-branch parameters to the output variable. Based on this, it combines this neural network with the semi-invariant method to construct a novel deep neural network model based on multi-head self-attention and semi-invariant guidance for probabilistic power flow calculation, addressing the low efficiency and poor performance of traditional Newton-Raphson methods and ordinary deep neural network models when applied to probabilistic power flow calculation. Furthermore, given that existing probabilistic power flow methods fail to accurately quantify the uncertainty interval of probabilistic power flow, this invention further proposes introducing chance constraints into the semi-invariant method probabilistic power flow calculation model. Confidence intervals are used to describe the uncertainty of state variables, thereby enabling quantitative evaluation of probabilistic power flow and improving the transparency and interpretability of probabilistic power flow analysis results.

[0006] In a first aspect, the present invention provides a method for calculating probabilistic power flow using a deep neural network, comprising the following steps: Step 1: Obtain the node types, branch admittances, and probability distribution parameters and confidence levels of wind power, photovoltaic output and load of the power system; determine the state variables in the rectangular coordinate system, and set the highest order of the semi-invariants and Cornish-Fisher series expansion; Step 2: Establish the nonlinear power flow equations of injected power and node voltage vectors in a rectangular coordinate system, and linearize the nonlinear power flow equations to obtain the linearized power flow equations and the corresponding Jacobian matrix. Step 3: Using the node voltage vector as input, embed the branch admittance as physical information into a deep neural network model based on multi-head self-attention mechanism and semi-invariant guidance, and solve for the Jacobian matrix; Step 4: Calculate the inverse matrix based on the Jacobian matrix to obtain the sensitivity matrix; Step 5: Based on the probability density functions of photovoltaic active power output, wind turbine active power output and load active power, calculate the moments and semi-invariants of each order respectively, and use the additivity of the semi-invariants to aggregate the semi-invariants to obtain the semi-invariants of the node injection power. Step 6: Use the sensitivity matrix to transfer the semi-invariants of the nodal injected power to the state variables, and obtain the semi-invariants corresponding to the voltage amplitude and phase angle; Step 7: Standardize the semi-invariants of the state variables, approximate their quantile functions using a sixth-order Cornish-Fisher series expansion, and obtain the cumulative distribution function and probability density function through inversion operations; Step 8: At a given confidence level Under chance constraints, the fluctuation range of state variables is calculated based on quantile functions; by setting confidence levels in a stratified manner, a quantitative assessment of probabilistic power flow is achieved.

[0007] Specifically, the deep neural network model based on multi-head self-attention mechanism and semi-invariant guidance includes: Input layer receives node voltage vectors; The physical information embedding layer will include branch admittance. Embedded as prior knowledge in network parameters; For the electrical conductance between each node, The susceptance between each node; Using a multilayer perceptron, the input node voltage vector is learned through nonlinear activation functions and physical information embedding. The mapping to the output Jacobian matrix is ​​then performed, and the output features are fed into the normalization layer for processing. Next, the output of the normalization layer is subjected to feature embedding and multi-head splitting to construct the query matrix Q, key matrix K, and value matrix V in the multi-head self-attention mechanism. Then, scaled dot product attention is performed, and the attention of each attention head is calculated. After that, feature fusion and residual connection are performed, and finally the Jacobian matrix is ​​generated through the output layer.

[0008] Specifically, in step five, the photovoltaic active power output is based on the Beta distribution, and the moments of each order are calculated using shape parameters and gamma functions; The active power output of wind turbines is based on the Weibull distribution, combined with the wind speed-power piecewise function, and the moments of each order are derived through the characteristic function of the three-parameter Weibull distribution. The active power of the load is based on a normal distribution, and its central moments of each order are calculated directly. By using the transformation relationship between moments and semi-invariants, the semi-invariants of each random variable can be obtained.

[0009] Specifically, the fluctuation range of the state variable is represented as follows: ; In the formula: For state variables, The fluctuation range of the state variable; The expected value of the state variable; and These are the upper and lower limits of the confidence interval, respectively.

[0010] Secondly, the present invention provides a deep neural network probabilistic power flow calculation system, comprising: The data acquisition module is used to acquire the node types, branch admittances, and probability distribution parameters and confidence levels of wind power, photovoltaic output and load of the power system; and to determine the state variables in the rectangular coordinate system. The power flow equation modeling module is used to establish nonlinear power flow equations of injected power and node voltage vectors in a rectangular coordinate system, and to linearize the nonlinear power flow equations to obtain linearized power flow equations and corresponding Jacobian matrices. The neural network computation module is used to take the node voltage vector as input, embed the branch admittance as physical information into a deep neural network model based on multi-head self-attention mechanism and semi-invariant guidance, and solve the Jacobian matrix. The semi-invariant calculation module is used to calculate the moments and semi-invariants of photovoltaic active power output, wind turbine active power output, and load active power respectively based on the probability density functions. It then aggregates the semi-invariants using the additivity of the semi-invariants to obtain the semi-invariants of the node-injected power. Based on the Jacobian matrix, its inverse matrix is ​​calculated to obtain the sensitivity matrix. The sensitivity matrix is ​​used to transfer the semi-invariants of the node-injected power to the state variables, obtaining the semi-invariants corresponding to the voltage amplitude and phase angle. The semi-invariants of the state variables are standardized, and their quantile functions are approximated using a sixth-order Cornish-Fisher series expansion. Finally, the cumulative distribution function and probability density function are obtained through an inversion operation. The chance constraint analysis module is used to set the highest order of the semi-invariants and Cornish-Fisher series expansion at a given confidence level. Below, the fluctuation range of state variables is calculated based on the quantile function.

[0011] Specifically, the neural network computing module is trained using the mean squared error loss function and the Adam optimizer, and the learning rate is dynamically adjusted using an equal-interval learning rate scheduler.

[0012] Thirdly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the deep neural network probabilistic power flow calculation method.

[0013] Fourthly, the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the deep neural network probabilistic power flow calculation method.

[0014] Compared with the prior art, the present invention has the following significant advantages and beneficial effects: Traditional semi-invariant methods rely on the cumbersome Newton-Raphson method to iteratively solve the Jacobian matrix, requiring numerous iterative iterations and resulting in low efficiency. This invention, by constructing a deep neural network model based on a multi-head self-attention mechanism and semi-invariant guidance, replaces the traditional iterative process with a single forward inference, significantly reducing computational complexity.

[0015] This invention significantly improves the model's representation ability and prediction accuracy by embedding physical information such as branch admittance into a deep neural network model and combining it with a multi-head self-attention mechanism to dynamically quantify the contribution of different branch parameters to the output variable.

[0016] The multi-head self-attention mechanism introduced in this invention, through adaptive weight allocation, endows the model with a powerful global vision and dynamic feature focusing capability, which can accurately identify the mutual influence between nodes with large electrical distances, and solves the limitations of traditional methods in dealing with network topology complexity.

[0017] This invention innovatively introduces chance constraints into the semi-invariant probabilistic power flow calculation model, describing the uncertainty of state variables through confidence intervals, and achieving, for the first time, a quantitative assessment of probabilistic power flow. This breakthrough greatly improves the transparency and interpretability of the analysis results, providing a more reliable decision-making basis for the safe operation of the system. Attached Figure Description

[0018] Figure 1 This is a schematic diagram of a deep neural network model based on multi-head self-attention mechanism and semi-invariant guidance. Detailed Implementation

[0019] To facilitate a complete understanding of the technical concept of this invention, the invention will be further explained in detail below.

[0020] First, this embodiment elucidates the probabilistic power flow calculation model with chance constraints from three aspects: semi-invariant method, stochastic model of node injected power, probability distribution of state variables, and chance constraint analysis.

[0021] Probabilistic power flow calculation based on the semi-invariant method (CM) first requires linearizing the power flow equations. Then, the system state variables are represented as a linear sum of node injected power through the sensitivity matrix. The additivity of semi-invariants is used to replace the convolution operation, and finally, the probability density function of the state variables is calculated.

[0022] In existing research, power flow equations can be represented using two different coordinate systems. This invention adopts the rectangular coordinate system representation: (1); In the formula: and They are nodes Active power injection and reactive power injection at the location; For nodes voltage vector, and They are nodes The real and imaginary parts of the voltage vector; and They are nodes With nodes The electrical conductance and susceptance between them; This indicates the total number of system nodes.

[0023] The power flow equations are linearized as follows: (2); In the formula: Inject power random variables into the nodes; It is a Jacobian matrix; For node state variables.

[0024] The Jacobian matrix can be represented as Jacobian blocks. In form, The Jacobian block elements differ for different node types: (3); (4); in, The deviation injected into the active power at node i. The deviation is the amount of reactive power injected at node i. Let be the deviation of the voltage amplitude at node i. This refers to a node where the active power P and reactive power Q are given, but the voltage amplitude and phase angle are unknown; this is typically a load node. A node is a node where the active power P and voltage amplitude V are given, but the reactive power Q and phase angle are unknown; it is usually a generator node.

[0025] Existing computational methods (CMs) typically rely on the complex Newton-Raphson method to compute the Jacobian matrix. However, this method consumes significant computational resources in high-dimensional problems, potentially leading to issues such as insufficient memory, inefficiency, and excessive storage costs.

[0026] Further transformation of equation (2) yields: (5); Where: Sensitivity matrix The inverse of the Jacobian matrix , Inject a power random variable into the node.

[0027] Node-injected power random variables It mainly consists of random variables of nodal generator injected power and load injected power, as shown in the following formula: (6); In the formula: Inject a random power variable into the generator; Inject a random power variable into the load; symbol This represents the convolution operation.

[0028] Assuming the random variables of the injected power at each node are independent, the additivity of semi-invariants can be used to transform complex convolution operations into simple addition and subtraction operations, i.e.: (7); In the formula: , and These are the node injection power, generator injection power, and load injection power, respectively. Semi-invariant of order.

[0029] Combining equation (7), equation (5) can be further transformed into: (8); In the formula: Representing node state variables Order-semi-invariant; Sensitivity matrix elements A matrix composed of powers.

[0030] calculate Need to calculate various injection powers The moment is then calculated from the relationship between the semi-invariants and the moment. Therefore, it is first necessary to establish a corresponding stochastic model for the injected power and load, and then calculate the moment using the parameters in the model.

[0031] The stochastic models for node injected power include photovoltaic power generation models, wind power generation models, and load stochastic models.

[0032] Photovoltaic power generation model: Since the intensity of sunlight is random, the output power is also random. Within a certain time period, the intensity of sunlight can be regarded as a Beta distribution. Then, the probability density function of photovoltaic active power output can be expressed as follows: (9); In the formula: Let be the probability density function of the photovoltaic active power output at time t. for Photovoltaics are constantly generating power; Rated power of photovoltaic power; and for The shape parameters of the time-varying Beta distribution; This is a gamma function.

[0033] Wind power generation model: Wind speed often follows a Weibull distribution over a certain period of time, and its probability density function can be expressed as: (10); In the formula: Let be the probability density function of the wind speed at time t. and They are respectively The shape and scale parameters of the Weibull distribution at time step; for The wind speed at any given moment.

[0034] The relationship between the active power output of a wind turbine and wind speed can be described by the following piecewise function: (11); (12); (13); In the formula: Let t be the active power output of the wind turbine. This represents the slope of the segment showing the linear relationship between wind turbine output and wind speed. The intercept of the linear relationship between wind turbine output and wind speed is determined by both the cut-in wind speed and the slope. This refers to the rated power of the wind turbine generator set; Rated wind speed; and These are the cut-in and cut-out wind speeds, respectively. When the wind speed is lower than the cut-in wind speed... At that time, the system was in a shutdown state, but when the wind speed exceeded... Entering the effective working area At that time, the output power showed a significant positive correlation with the wind speed, and when the wind speed reached the rated value... Afterwards, the wind turbine enters constant power operation mode. It is worth noting that when the wind speed exceeds the cut-out wind speed... In order to avoid damage to critical components due to overload, the wind turbine will execute a safety shutdown procedure, at which point the output power will return to zero.

[0035] Statistical analysis shows that wind speed remains within the effective operating range most of the time. Combining the wind speed probability density function with the relationship between wind turbine generators and wind speed, the probability density function of the active power output of the wind turbine generators can be calculated as follows: (14); in, Let be the probability density function of the active power output of the wind turbine at time t.

[0036] Load stochastic model: The load can be considered to approximately follow a normal distribution, and the probability density function of the load's active power is: (15); In the formula: Let be the probability density function of the system load active power at time t. for Active power of system load at any given time; and They are respectively The expected value and standard deviation of the active power of the load at any given time.

[0037] The methods for calculating the moments for various models are as follows: When the probability distribution of a random variable is known, its moments and central moments can be calculated. For continuous random variables... Let its probability density function be... Then its Step Moment It can be obtained from the following formula: (16); when When, a random variable can be obtained. First moment That is, its expected value.

[0038] It can be calculated from the expected value. center distances of each order : (17); For photovoltaic power generation models, according to Average light intensity at time and variance The relevant parameters of the Beta distribution can be obtained, and the formula is as follows: (18); (19); After obtaining the shape parameters of the Beta distribution, the moments of the Beta distribution can be obtained by combining them with equation (16). The order moments are as follows: (20); in, Let k be the k-th moment of the photovoltaic active power output at time t; For wind power generation models, let Then we can obtain a standard three-parameter Weibull distribution, as shown in the following equation: (twenty one); Where a, b, and c are the location parameter, scale parameter, and shape parameter of the three-parameter Weibull distribution, respectively; The characteristic function of the three-parameter Weibull distribution can be obtained by integration: (twenty two); In the formula: The characteristic function of the three-parameter Weibull distribution is... represents an imaginary number; Indicates from Take from different elements The number of combinations of elements.

[0039] The torques of the active power output of the wind turbine can then be derived from the characteristic function as follows: (twenty three); in, Let k be the k-th order torque of the active power output of the wind turbine at time t; For the load model, since it can be approximated as following a normal distribution, the center distances of each order can be calculated according to equation (17): (twenty four); in, Let k be the center-to-center distance of the system load active power at time t; Indicates double factorial; Calculate the injection power After obtaining the order moments or center distances, the corresponding semi-invariants of each order can be calculated using the following formula: (25); (26); in, Injecting power into the node Order-semi-invariant, Injecting power into the node Order-semi-invariant, Let k+1 be the moment of the random variable. Let K be the (k+1)th order central moments of the random variable. Indicates from Take from different elements The number of combinations of elements.

[0040] Determining the probability distribution of state variables and performing chance constraint analysis: Calculate Then, the node state variables can be calculated according to equation (8). Order semi-invariants Then, by expanding using the Cornish-Fisher series, the inverse cumulative distribution function (CDF) of the state variable can be obtained. Further inverse calculation yields the CDF. For non-normally distributed random variables, this series provides higher accuracy than the Gram-Charlier series in fitting the probability distribution. This invention uses a sixth-order Cornish-Fisher series for fitting, and its calculation formula is as follows: (27); In the formula: It is the probability quantile of the node state variable. quantile function at point; It is the inverse function of the standard normal distribution function; It is standardized Order-semi-invariant, When, corresponding These are normalized second-order semi-invariants; the same applies to others. .

[0041] According to the formula The state variables can be calculated. Distribution function , Let be the distribution function. Further differentiation of the distribution function yields the probability density function of the state variable.

[0042] Furthermore, in order to achieve accurate quantitative analysis of the uncertainty interval of probabilistic power flow, this invention introduces chance constraints into the model, using confidence levels and confidence intervals to describe the uncertainty of state variables. Given a confidence level... ,in Indicating the significance level, the fluctuation range of the state variable can be described as follows according to the chance constraint: (28); In the formula: For the fluctuation range of state variables (such as voltage amplitude, angle); The expected value of the state variable; and These are the upper and lower limits of the confidence interval, respectively.

[0043] The Physically Guided Deep Neural Network (CGDNN) is a hybrid modeling framework that integrates Physically Guided Deep Neural Networks (PGDNN) and the semi-invariant method (CM). Its core idea lies in deeply embedding domain-specific physical laws (such as circuit principles and electromagnetism) as prior knowledge into the traditional data-driven neural network architecture. This framework aims to overcome the limitations of purely data-driven models in terms of interpretability and generalization ability. By synergistically utilizing physical mechanisms, CGDNN significantly enhances its ability to model complex systems, thereby achieving a systematic improvement in prediction accuracy, training efficiency, and model interpretability.

[0044] Based on the probabilistic power flow calculation model using a semi-invariant method with chance constraints, it can be found that the elements in the Jacobian matrix are all derived from the nodal voltage vectors. and the branch admittance between each node composition, Let be the real part of the voltage vector at the node. Let be the imaginary part of the voltage vector at the node. For the electrical conductance between each node, Let be the susceptance between nodes. Since the branch admittance remains constant in each iteration, is chosen as . As the input feature vector of a deep neural network model guided by semi-invariants, and As physical information, it is embedded into a semi-invariant-guided deep neural network model, and finally, the Jacobian matrix is ​​used as the output feature vector of the semi-invariant-guided deep neural network model.

[0045] Based on the above framework, this invention constructs a simplified CGDNN model using a multilayer perceptron (MLP). In the simplified CGDNN model, each linear layer contains several neurons, and these neurons are fully connected from the previous layer to the current layer through learnable weight parameters. Furthermore, except for the output layer, the outputs of neurons in each layer are typically transformed using a non-linear activation function to enhance the model's representational ability; the calculation formula is as follows: (29); In the formula: For the first Output features of linear layers; For the first Output features of linear layers; and For the first Layer linear layer to the first Weights and biases between linear layers; This is the activation function.

[0046] Although basic MLPs can learn the input node voltage vector through nonlinear activation functions and physical information embedding The mapping to the output Jacobian matrix is ​​possible, but its inherent layer-by-layer feedforward and static weighting characteristics have fundamental limitations. Power system networks are essentially complex graph structures where highly nonlinear interactions exist between node voltage states; these interactions depend not only on branch admittance. It is more dependent on the global operating state of the system. A small voltage fluctuation at one node can have a significant impact on nodes that are electrically distant through complex network topology, and traditional MLP models have limited ability to handle such nonlocal, high-dimensional nonlinear coupling relationships.

[0047] The introduction of multi-head self-attention mechanism is precisely to overcome the aforementioned bottlenecks, endowing the model with a powerful global perspective and dynamic feature focusing capability. Unlike the fixed connection weights of MLP, attention weights are calculated and generated in real time based on the information of the current input. This dynamic weight allocation mechanism enables the model to adaptively identify the inter-node coupling relationships and their degree of influence that are crucial to the prediction of the current Jacobian matrix.

[0048] It is important to note that self-attention mechanisms do not replace branch admittance. It does not embed physical information, but works in conjunction with it. Branch admittance The basic topology of physical connections between nodes is defined, and the multi-head self-attention mechanism further learns how these physical connections dynamically modulate the sensitivity of mutual influence between node voltages in the global state.

[0049] The structure of a deep neural network model based on multi-head self-attention mechanism and semi-invariant guidance is as follows: Figure 1 As shown, in the deep neural network model based on multi-head self-attention mechanism and semi-invariant guidance, the calculation formula for the first n linear layers is consistent with that of the simplified CGDNN model. The features output by the linear layers are then fed into the normalization layer for processing. This layer can significantly improve the training efficiency and generalization performance of the model and stabilize the output of the multi-head self-attention mechanism. Its calculation formula is as follows: (30); In the formula: This is the output of the normalization layer; This represents the mean of the input data; Indicates the variance of the input data; It is a small constant to avoid division by zero; and The scaling and translation parameters are learned during training, which give the network more flexibility.

[0050] Next, the output of the normalization layer is subjected to feature embedding and multi-head splitting to construct the three core matrices in the multi-head self-attention mechanism: query matrix Q, key matrix K, and value matrix V. (31); In the formula: This indicates the number of heads into which the attention layer is segmented. This represents the query matrix of the h-th attention head. This represents the key matrix of the h-th attention head. This represents the value matrix of the h-th attention head. This represents the weight matrix of the query matrix in the h-th attention head. This represents the weight matrix of the key matrix in the h-th attention head. The weight matrix represents the median matrix of the h-th attention head. This represents the bias term of the query matrix in the h-th attention head. This represents the bias term of the key matrix in the h-th attention head. This represents the bias term of the median matrix of the h-th attention head.

[0051] After calculating Q, K, and V for each attention head, scaled dot product attention is performed, with the following formula: (32); In the formula: This is the calculation result of the h-th attention head; It is the dimension of K in the h-th attention head, and its function is to prevent the gradient from vanishing due to the excessively large dot product result; This represents the transpose of the h-th attention headkey matrix.

[0052] After calculating the attention of each attention head, feature fusion and residual connections are performed. Residual connections preserve the original input features and prevent the attention layer from over-modifying existing features. The calculation formula is as follows: (33); In the formula: This represents the result of a residual join; Concat indicates a concatenation operation. To output the projection matrix, it linearly combines the outputs of multiple attention heads to ensure that the dimensionality of the attention output is consistent with the linearity of the projection matrix. Maintain consistency.

[0053] The specifications of the input feature vector are set as follows: The output feature vector is set to . The variable represents the amount of data in each batch of training. Various forms of mini-batch gradient descent algorithms are often used for optimization in neural networks. By choosing an appropriate batch size, available computing resources can be used to the best of our ability for fast model training.

[0054] The model uses the ReLU function as the activation function, whose positive derivative is a constant value. Therefore, using ReLU can effectively avoid the vanishing gradient problem. However, in the last layer of the neural network, a linear activation function is usually used instead of ReLU because the non-negativity of ReLU may limit the output range of the neural network and fail to generate the desired result. This approach has also been widely used in other machine learning problems, providing a wider range of values ​​for the output.

[0055] In selecting the optimizer and loss function, this invention adopts the mean squared error loss function MSELoss as the model's loss function, which achieves a global constraint on the model output by minimizing the squared deviation between the predicted and true values. Addressing the issues of gradient sparsity and objective non-stationarity in parameter optimization, the Adam optimizer achieves a balance by inheriting AdaGrad's ability to handle sparse gradients and RMSProp's ability to handle non-stationary objectives. Its core mechanism lies in dynamically estimating the first and second moments of the gradient using exponential moving averages.

[0056] Traditional training paradigms for neural networks generally employ a constant learning rate strategy. While this strategy has significant advantages in reducing algorithm implementation complexity and simplifying debugging processes, it has some limitations when dealing with high-dimensional output problems: a constant learning rate often causes the neural network to get stuck in local optima or saddle points during the optimization process, especially in complex high-dimensional spaces; using a constant learning rate may cause the model to continue updating with relatively large step sizes even when it is close to the optimal solution, thus missing the opportunity for fine-tuning.

[0057] To address the aforementioned issues, this invention employs the StepLR scheduler, which dynamically adjusts the learning rate based on the current iteration count, thereby effectively improving model performance during optimization. In the early stages of training, a larger learning rate is used for more aggressive parameter updates to overcome local minima. As the model gradually approaches the optimal solution, the learning rate is gradually reduced to narrow the parameter search range, thus achieving fine-tuning.

[0058] The adjustment formula for the StepLR scheduler with equal learning rates is: (34); In the formula: It is the learning rate; It is the attenuation factor; This is the current iteration number; It is an adjustment interval, that is, every [time]. Adjust the learning rate once.

[0059] Based on the above theory, this embodiment proposes a deep neural network probabilistic power flow calculation method, the steps of which are as follows: Step 1: Obtain the node type and branch admittance of the power system And the probability distribution parameters and confidence levels of wind power and solar power output and load. Determine the state variables in a Cartesian coordinate system, and set the semi-invariants and the highest order of the Cornish-Fisher series expansion. ; Step 2: Establish the injected power and node voltage vectors in a rectangular coordinate system using equation (1). The nonlinear power flow equation is obtained and linearized to obtain the linearized power flow equation (Equation (2)). The Jacobian matrix J formed in the linearization process is composed of small blocks corresponding to different node types according to Equations (3)-(4). This step approximates the nonlinear power flow problem as a local linear mapping, which provides a basis for the subsequent derivation of the sensitivity matrix; Step 3: Using node voltage vectors As input, branch admittance is embedded as physical information into a deep neural network model based on multi-head self-attention mechanism and semi-invariant guidance. The output of the CGDNN model is normalized and then subjected to feature embedding and multi-head splitting to construct query Q, key K, and value V. The scaling dot product attention mechanism is used to model the global coupling and non-local interaction between nodes. Then, the Jacobian matrix J is output through multi-head combination and residual connection. The traditional Newton-Raphson iteration process of finding the Jacobian matrix J is replaced by a single forward inference, which balances efficiency and accuracy.

[0060] Step 4: Obtain the sensitivity matrix based on the Jacobian matrix J obtained in Step 3. The sensitivity matrix S characterizes the linear sensitivity relationship between the injected power and the state variables, serving as the core operator for transferring uncertainties from the injection side to the state side.

[0061] Step 5: Model the illumination as a Beta distribution, calculate the shape parameters using equations (18)-(19) based on the mean and variance, and obtain the moment of photovoltaic active power output using equations (16) and (20); model the wind speed as a Weibull distribution and combine it with the power curve, derive the moment of wind turbine active power output through three-parameter transformation and characteristic function; the load active power approximately follows a normal distribution, and obtain the center distance using equation (24). Transform the moments or center moments of each random variable into semi-invariants according to equations (25)-(26), and aggregate them using the additivity of semi-invariants to obtain the node injection power. Order semi-invariants ; Step 6: Use the sensitivity matrix to transfer the semi-invariants of each order of injected power to the state variables, and obtain the semi-invariants corresponding to the voltage amplitude and phase angle; Step 7: Standardize the semi-invariants of the state variables, approximate their quantile functions using a sixth-order Cornish-Fisher series expansion, obtain the cumulative distribution function through inversion, and further differentiate to obtain the probability density function; Step 8: At a given confidence level Under chance constraints, the fluctuation range of state variables is calculated based on quantile functions; by setting confidence levels in layers, the system operating boundary under different security requirements is effectively quantified, and a quantitative assessment of probabilistic power flow is achieved.

[0062] Another embodiment of the present invention provides a deep neural network probabilistic power flow calculation system, comprising: The data acquisition module is used to acquire the node types, branch admittances, and probability distribution parameters and confidence levels of wind power, photovoltaic output and load of the power system; and to determine the state variables in the rectangular coordinate system. The power flow equation modeling module is used to establish nonlinear power flow equations of injected power and node voltage vectors in a rectangular coordinate system, and to linearize the nonlinear power flow equations to obtain linearized power flow equations and corresponding Jacobian matrices. The neural network computation module is used to take the node voltage vector as input, embed the branch admittance as physical information into a deep neural network model based on multi-head self-attention mechanism and semi-invariant guidance, and solve the Jacobian matrix. The neural network computation module is trained using the mean square error loss function and Adam optimizer, and dynamically adjusts the learning rate using an equal interval learning rate scheduling strategy. The semi-invariant calculation module is used to calculate the moments and semi-invariants of photovoltaic active power output, wind turbine active power output, and load active power respectively based on the probability density functions. It then aggregates the semi-invariants using the additivity of the semi-invariants to obtain the semi-invariants of the node-injected power. Based on the Jacobian matrix, its inverse matrix is ​​calculated to obtain the sensitivity matrix. The sensitivity matrix is ​​used to transfer the semi-invariants of the node-injected power to the state variables, obtaining the semi-invariants corresponding to the voltage amplitude and phase angle. The semi-invariants of the state variables are standardized, and their quantile functions are approximated using a sixth-order Cornish-Fisher series expansion. Finally, the cumulative distribution function and probability density function are obtained through an inversion operation. The chance constraint analysis module is used to set the highest order of the semi-invariants and Cornish-Fisher series expansion at a given confidence level. Below, the fluctuation range of state variables is calculated based on the quantile function.

[0063] Another embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the deep neural network probabilistic power flow calculation method.

[0064] Another embodiment of the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the deep neural network probabilistic power flow calculation method.

[0065] The above description merely illustrates preferred embodiments of the present invention and is not intended to limit the invention in any other way. Any person skilled in the art may make modifications or alterations to the above-disclosed content to create equivalent embodiments. However, any simple modifications, equivalent changes, and alterations made to the above embodiments based on the technical essence of the present invention, without departing from the scope of the present invention, shall still fall within the protection scope of the present invention.

Claims

1. A deep neural network probabilistic power flow calculation method, characterized in that, Includes the following steps: Step 1: Obtain the node types, branch admittances, and probability distribution parameters and confidence levels of wind power, photovoltaic output, and load of the power system; determine the state variables in the rectangular coordinate system, and set the highest order of the semi-invariants and Cornish-Fisher series expansion; Step 2: Establish the nonlinear power flow equations of injected power and node voltage vectors in a rectangular coordinate system, and linearize the nonlinear power flow equations to obtain the linearized power flow equations and the corresponding Jacobian matrix. Step 3: Using the node voltage vector as input, embed the branch admittance as physical information into a deep neural network model based on multi-head self-attention mechanism and semi-invariant guidance, and solve for the Jacobian matrix; Step 4: Calculate the inverse matrix based on the Jacobian matrix to obtain the sensitivity matrix; Step 5: Based on the probability density functions of photovoltaic active power output, wind turbine active power output and load active power, calculate the moments and semi-invariants of each order respectively, and use the additivity of the semi-invariants to aggregate the semi-invariants to obtain the semi-invariants of the node injection power. Step 6: Use the sensitivity matrix to transfer the semi-invariants of the nodal injected power to the state variables, and obtain the semi-invariants corresponding to the voltage amplitude and phase angle; Step 7: Standardize the semi-invariants of the state variables, approximate their quantile functions using a sixth-order Cornish-Fisher series expansion, and obtain the cumulative distribution function and probability density function through inversion operations; Step 8: At a given confidence level Under chance constraints, the fluctuation range of state variables is calculated based on quantile functions; by setting confidence levels in a stratified manner, a quantitative assessment of probabilistic power flow is achieved.

2. The method according to claim 1, characterized in that, The deep neural network model based on multi-head self-attention mechanism and semi-invariant guidance includes: Input layer receives node voltage vectors; The physical information embedding layer will guide the branch admittance. Embedded as prior knowledge in network parameters; For the electrical conductance between each node, The susceptance between each node; Using a multilayer perceptron, the input node voltage vector is learned through nonlinear activation functions and physical information embedding. The mapping to the output Jacobian matrix is ​​then performed, and the output features are fed into the normalization layer for processing. Next, the output of the normalization layer is subjected to feature embedding and multi-head splitting to construct the query matrix, key matrix, and value matrix in the multi-head self-attention mechanism. Then, scaled dot product attention is performed, and the attention of each attention head is calculated before feature fusion and residual connection are performed. Finally, the Jacobian matrix is ​​generated through the output layer.

3. The method according to claim 1, characterized in that, Photovoltaic active power output is based on a Beta distribution, and moments of each order are calculated using shape parameters and gamma functions. The active power output of wind turbines is based on the Weibull distribution, combined with the wind speed-power piecewise function, and the moments of each order are derived through the characteristic function of the three-parameter Weibull distribution. The active power of the load is based on a normal distribution, and its central moments of each order are calculated directly. By using the transformation relationship between moments and semi-invariants, the semi-invariants of each random variable can be obtained.

4. The method according to claim 1, characterized in that, The fluctuation range of the state variable is represented as follows: ; In the formula: For state variables, The fluctuation range of the state variable; The expected value of the state variable; and These are the upper and lower limits of the confidence interval, respectively.

5. The method according to claim 2, characterized in that, Using a multilayer perceptron, the input node voltage vector is learned through nonlinear activation functions and physical information embedding. The mapping to the output Jacobian matrix is ​​then performed, and the output features are subsequently fed into a normalization layer for processing. The specific process is as follows: ; ; In the formula: For the first Output features of linear layers; For the first Output features of linear layers; and For the first Linear layer to the first Weights and biases between linear layers; For activation functions; This is the output of the normalization layer; This represents the mean of the input data; Indicates the variance of the input data; It is a constant; and The scaling and translation parameters are learned during the training process.

6. The method according to claim 2, characterized in that, The deep neural network model based on multi-head self-attention mechanism and semi-invariant guidance is trained using mean squared error loss function and Adam optimizer, and the learning rate is dynamically adjusted using an equal-interval learning rate scheduler.

7. A deep neural network probabilistic power flow calculation system, characterized in that, include: The data acquisition module is used to acquire the node type, branch admittance, and probability distribution parameters and confidence levels of wind power, photovoltaic output and load of the power system. Determine the state variables in a Cartesian coordinate system; The power flow equation modeling module is used to establish nonlinear power flow equations of injected power and node voltage vectors in a rectangular coordinate system, and to linearize the nonlinear power flow equations to obtain linearized power flow equations and corresponding Jacobian matrices. The neural network computation module is used to take the node voltage vector as input, embed the branch admittance as physical information into a deep neural network model based on multi-head self-attention mechanism and semi-invariant guidance, and solve the Jacobian matrix. The semi-invariant calculation module is used to calculate the moments and semi-invariants of photovoltaic active power output, wind turbine active power output, and load active power respectively based on the probability density functions, and to aggregate the semi-invariants of node injected power using the additivity of the semi-invariants to obtain the semi-invariants of node injected power; to calculate its inverse matrix based on the Jacobian matrix to obtain the sensitivity matrix; and to use the sensitivity matrix to transfer the semi-invariants of node injected power to the state variables to obtain the semi-invariants corresponding to voltage amplitude and phase angle. The semi-invariants of the state variables are standardized, and their quantile functions are approximated by a sixth-order Cornish-Fisher series expansion. The cumulative distribution function and probability density function are obtained through inversion. The chance constraint analysis module is used to set the highest order of the semi-invariants and Cornish-Fisher series expansion at a given confidence level. Below, the fluctuation range of state variables is calculated based on the quantile function.

8. The system according to claim 7, characterized in that, The neural network computing module is trained using the mean squared error loss function and the Adam optimizer, and the learning rate is dynamically adjusted using an equal-interval learning rate scheduler.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 6.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method for calculating multimachine balance probability power flow

    CN104268435A

  • On-line calculation method of probabilistic power flow based on BP neural network

    CN109117951A

  • Power distribution network risk prediction method and terminal

    CN115860212A

  • Probabilistic load flow calculation method based on long-term prediction model and considering distributed power generation

    CN117411004A

  • Comprehensive energy system rapid energy flow analysis method based on physical mechanism guidance and multi-head map attention mechanism

    CN119830130A

Cited By

  • Probability carbon flow calculation method and system based on data-physical fusion driving

    CN122311647A

  • Load flow calculation method, system and equipment of admittance coding embedded neural network

    CN122315700A