Voltage prediction and layered regulation and control method based on SSA-LSTM
By fusing voltage data through a BP neural network, preprocessing the data using LOF-GMM and cubic spline interpolation, and combining SSA-LSTM and deep reinforcement learning algorithms, a hierarchical control system is constructed. This solves the problems of low data processing efficiency and insufficient prediction accuracy in traditional distribution network voltage management, achieves precise control of voltage fluctuations, and ensures the stable operation and intelligent level of the distribution network.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-31
- Publication Date
- 2026-03-31
AI Technical Summary
Traditional distribution network voltage management suffers from problems such as low data processing efficiency, insufficient prediction accuracy, and delayed control response, making it difficult to meet the real-time and precision requirements of modern distribution networks. This is especially true in harsh environments such as high-altitude and complex mountainous areas, where equipment aging is frequent, communication network coverage is limited, and voltage monitoring and control become more difficult.
A BP neural network is used for voltage-related data fusion, and the LOF-GMM anomaly data identification algorithm and cubic spline interpolation method are used for data preprocessing. The SSA-LSTM algorithm is combined to optimize voltage prediction, and a hierarchical control system with regional coordination and local autonomy is constructed. The equipment is dynamically adjusted through deep reinforcement learning algorithm to achieve hierarchical voltage control.
It improved voltage prediction accuracy, constructed high-quality voltage data, solved voltage fluctuation problems, ensured the stable operation and intelligence level of the distribution network, and enhanced the safety and stability of the power system.
Smart Images

Figure CN121769860A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of power system voltage control technology, and relates to a voltage prediction and hierarchical control method based on SSA-LSTM. Background Technology
[0002] With the continuous advancement of power grid construction, the distribution network, as a crucial link connecting the power system and users, directly impacts the reliability of power supply through its operational stability and voltage quality. Especially in special scenarios such as high-altitude and complex mountainous areas, the distribution network faces harsh natural conditions such as low temperatures, strong winds, and lightning strikes, accelerating equipment aging and leading to frequent failures. Simultaneously, complex terrain limits communication network coverage, further increasing the difficulty of voltage monitoring and control. Traditional distribution network voltage management relies on manual experience and analysis of single data sources, resulting in low data processing efficiency, insufficient prediction accuracy, and delayed control response, making it difficult to meet the real-time and precise requirements of modern distribution networks.
[0003] At the data level, the distribution network accumulates massive amounts of multi-source operational data (such as voltage, power, and temperature) through intelligent acquisition terminals. However, due to factors such as short-term sensor failures and transmission interference, the data often contains outliers and missing values. Traditional data cleaning methods rely on manually setting outlier thresholds, which is prone to misjudgments. Missing value imputation prioritizes accuracy over efficiency, resulting in lengthy processing times for massive amounts of data, making it difficult to support subsequent voltage analysis. In the voltage prediction stage, traditional time-series prediction models struggle to capture the nonlinear and long-period dependencies of voltage data, leading to large prediction errors and failing to provide reliable lead times for regulation. In the regulation stage, traditional "one-size-fits-all" control strategies do not consider voltage differences across the entire distribution network and rely solely on single-device regulation, which can easily result in untimely regulation or resource waste, making it difficult to cope with the increased voltage fluctuations in the distribution network after the integration of distributed photovoltaic and energy storage.
[0004] Furthermore, as a crucial component of power infrastructure, a dangerous power grid can cause enormous economic losses. Therefore, multi-stage risk early warning methods for power grid control have always been a key focus for researchers. In recent years, with the accelerating pace of power development, existing technologies have integrated analysis, assessment, and risk control into power grid risk early warning systems, effectively improving the safety of power grid operation. However, the power grid control process is complex, with varying degrees of risk at each stage. Therefore, risk early warning for power grid control has become a key research area in related fields.
[0005] Therefore, a new voltage prediction and control method is urgently needed to improve the operating efficiency and reliability of distribution networks. Summary of the Invention
[0006] In view of this, the purpose of this invention is to provide a voltage prediction and hierarchical control method based on SSA-LSTM. 1) For voltage prediction and control, this invention utilizes a BP neural network to fuse voltage-related data, solving the problem of inconsistent multi-source data. It proposes an automatic identification algorithm for LOF-GMM abnormal data and designs a cubic spline interpolation method to fill in missing values in voltage-related data. After this preprocessing, high-quality voltage data is provided for voltage prediction. 2) This invention utilizes the SSV algorithm to optimize key parameters of LSTM, improving the prediction accuracy of voltage time series data. It constructs a hierarchical control system with regional coordination and local autonomy, and dynamically adjusts equipment through a deep reinforcement learning algorithm to solve voltage limit exceedance problems, ensuring the stable operation of the distribution network. It provides a solution for voltage fluctuation range prediction and hierarchical control, which is of great significance for improving the intelligence level of the distribution network and ensuring the safe and stable operation of the power system.
[0007] To achieve the above objectives, the present invention provides the following technical solution: A voltage prediction and hierarchical control method based on SSA-LSTM specifically includes the following steps: Step 1: Data Preprocessing Stage: First, voltage-related data from multiple user equipment are collected and fused using a BP neural network; then, voltage anomaly data in the fused data is dynamically identified using LOF-GMM, and missing data is supplemented using cubic spline interpolation to complete the repair of time series data; where LOF represents local anomaly factor and GMM represents Gaussian mixture model. Step 2: Voltage Prediction and Control Stage: First, voltage prediction is performed using the SSA-LSTM algorithm; where SSA stands for Sparrow Search Algorithm and LSTM stands for Long Short-Term Memory Neural Network; then, a voltage control mathematical model is built, and deep reinforcement learning algorithms are used to achieve hierarchical voltage control of the distribution network.
[0008] Furthermore, in step 1, voltage-related data from multiple users are collected and fused using a BP neural network, specifically including the following steps: Step 101: Construct a BP neural network architecture, define the neuron output calculation rules, and realize the forward transmission of data from input to fusion result; Step 102: Optimize the network through backpropagation to output unified, non-redundant fused data.
[0009] Furthermore, in step 1, voltage anomaly data in the fused data is dynamically identified using LOF-GMM, and missing data is supplemented using cubic spline interpolation. This specifically includes the following steps: Step 111: Calculate the degree of outliers in the fused data using the Local Outlier Factor (LOF) algorithm, including calculating the k-th reachable distance, local reachability density, and LOF value; Step 112: Use a Gaussian mixture model (GMM) to perform cluster analysis on the LOF values, check the convergence conditions, and determine the outlier threshold; Step 113: Arrange the voltage and power data in chronological order and mark the time points where data is missing; Step 114: Construct a cubic spline function, input the missing time into the interpolation function, obtain the filling value for the missing data, and complete the time series data repair.
[0010] Furthermore, in step 111, the LOF algorithm is a representative unsupervised anomaly detection algorithm that determines data outliers based on data density. The determination criterion is to calculate the Local Anomaly Factor (LOF) value within the neighborhood of a data point, and then compare this LOF value with a threshold to determine whether the point is an outlier. The specific calculation process of the LOF algorithm is as follows: The k-th reachable distance between all points in the sample data is calculated using the following expression:
[0011] in, For point Time The k-th reachable distance, take and The maximum value; Point and points The distance between them Represents the distance point among all sample points. The k-th farthest point and point The distance between them, i.e., the k-th distance; Based on the obtained k-th reachable distance, the local reachability density of each data point is calculated, expressed as:
[0012] in, Point The density between the points and the surrounding points; Point The k-th distance neighborhood, i.e., point All points within the k-th distance; Finally, the LOF value for each data point in the sample is calculated using the following expression:
[0013] in, Point The k-th distance domain Locally accessible density and points within The average of the ratios of locally attainable densities. The larger, the more points The more likely it is to be an outlier data point.
[0014] Furthermore, in step 112, the parameters of a single Gaussian model in the GMM are obtained iteratively through the EM (Expectation Maximization) algorithm.
[0015] Furthermore, in step 2, voltage prediction is performed using the SSA-LSTM algorithm, specifically including the following steps: Step 201: Simulate sparrow behavior to classify roles and update. Through the exploration phase, tracking phase and attack phase, explore the possible optimal parameter region in the space to avoid getting trapped in local optima and further optimize parameter accuracy. Step 202: Iterative optimization, calculate the fitness of each "sparrow" and sort them, iteratively update the positions of discoverers, followers and attackers, recalculate the fitness, and update the optimal parameters; Step 203: Construct an LSTM network structure, and use the forget gate and input gate to update the gradient collaboratively, passing key information across multiple time steps to solve the gradient vanishing problem of traditional RNNs; Step 204: Input historical voltage data into the LSTM in time steps, and dynamically update the cell state and hidden layer output through the gating mechanism to minimize the error between the predicted value and the actual voltage value.
[0016] Furthermore, in step 2, a voltage control mathematical model is built, and a deep reinforcement learning algorithm is used to realize hierarchical voltage control of the distribution network. This specifically includes the following steps: Step 211: Construct a voltage control mathematical model and clarify the control objectives and constraints; Step 212: Adjust the transformer taps based on the DQN algorithm to achieve wide-range voltage correction and realize regional coordinated control; Step 213: Adjust based on the DDPG algorithm to achieve real-time autonomy and realize local autonomous control.
[0017] Furthermore, in step 211, a voltage control mathematical model is constructed, specifically including: when adjusting the voltage of the coordinated control node in the adjustment area, the control objective is set as the average value of the voltage exceedance limit of the entire distribution network bus node, expressed as:
[0018] in, This represents the average voltage of the busbar nodes in the entire distribution network. This refers to the average rated voltage of the distribution network. When adjusting the voltage of some nodes in a local autonomous region, the control target is set as the minimum over-limit value of the bus node voltage in the autonomous region, expressed as follows:
[0019] in, For the first i The node voltage of each node; This refers to the rated voltage value of the power distribution network in this area; M This refers to the number of busbar nodes in the distribution network of this area. The constraints are as follows: 1) The power flow balance constraint is:
[0020] in, and They are respectively in t Time Node i The active and reactive power consumed by the load; and They are respectively t Active and reactive power losses in the line at any given time: and These represent the active and reactive power transmitted from the main distribution network at time t, respectively. and They are respectively t The active and reactive power output of distributed photovoltaic systems at all times; for t Time Node i The upper energy storage outputs active power; The node at time t i The upper SVC outputs reactive power; SVC stands for Static Var Compensator. 2) The output constraint of SVC is:
[0021]
[0022] in, for t Time Node i The upper SVC outputs the reactive power change; and They are respectively t Time Node i The lower and upper limits of reactive power output from the upper SVC; and They are respectively t Time Node i The upper SVC outputs the lower and upper limits of reactive power ramping.
[0023] Furthermore, in step 212, the DQN algorithm for achieving regional coordinated control specifically includes: State space: If the bus node voltages are taken as the controlled objects, then the state space is the set of node voltages. :
[0024] in, Representative node i The per-unit value of voltage; N This refers to the number of busbar nodes in the entire distribution network. Action space: The position of the on-load transformer tap changer is set as the action space of the DQN algorithm. Assuming each device has n Each gear has the same adjustment range: Total range of gear adjustment ,Right now:
[0025] Reward function: Taking the point voltage exceeding the limit as the control objective, the reward function is designed as follows: :
[0026] in, These are the weighting coefficients. The average per-unit value of the bus node voltage in the global distribution network exceeds the value under normal conditions.
[0027] Furthermore, in step 213, the DDPG algorithm for achieving local autonomous control specifically includes: constructing the state space for distribution network voltage control by using the voltage, active power, and reactive power fluctuations of each node as state variables.
[0028] in, For nodes i Voltage fluctuations; For nodes i The active power; For nodes i Active power fluctuation; For nodes i reactive power; For nodes i Reactive power fluctuation; 1≤i≤M; The combined equipment operating output data It can be defined as the action space:
[0029] The node voltage exceedance and equipment output adjustment are used as reward functions. To update the policy network and value function network of the DDPG algorithm, i.e.:
[0030] in, This represents the penalty coefficient for the voltage deviation term; and The penalty coefficient represents the active and reactive power regulation terms of distributed photovoltaic output; This represents the penalty coefficient for the active power regulation term of energy storage output; This represents the penalty coefficient for the reactive power regulation term of the SVC output; bus node i The per-unit voltage value exceeding the limit; Indicates bus node i The change in active power; Indicates bus node i The change in reactive power; Indicates bus node i Changes in active power output from the upper energy storage unit; Indicates bus node i The SVC outputs the reactive power change.
[0031] The beneficial effects of this invention are as follows: This invention solves the problem of inconsistent multi-source data by fusing voltage-related data through a BP neural network; it uses the LOF-GMM algorithm to dynamically identify abnormal data and solve the problem of data discrepancies; and it uses a cubic sample bar interpolation algorithm to fill in missing values in voltage-related data, thereby achieving voltage data preprocessing and providing high-quality voltage data for voltage prediction.
[0032] This invention utilizes the SSV algorithm to optimize key parameters of LSTM, improving the prediction accuracy of voltage time series data. It constructs a hierarchical control system of "regional coordination + local autonomy," and dynamically adjusts equipment through a voltage hierarchical control strategy based on deep reinforcement learning (including a voltage control mathematical model, the DQN algorithm for regional coordination control, and the DDPG algorithm for local autonomy control). This solves the voltage limit exceedance problem, ensures the stable operation of the distribution network, and provides a solution for predicting voltage fluctuation ranges and realizing hierarchical control. It is of great significance for improving the intelligence level of the distribution network and ensuring the safe and stable operation of the power system.
[0033] Other advantages, objectives, and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination, or may be learned from practice of the invention. The objectives and other advantages of the invention can be realized and obtained through the following description. Attached Figure Description
[0034] To make the objectives, technical solutions, and advantages of the present invention clearer, the preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, wherein: Figure 1This is a flowchart of the voltage prediction and hierarchical control method based on SSA-LSTM of the present invention. Figure 2 This is a topology diagram of a BP neural network; Figure 3 It is an LSTM cell structure; Figure 4 Here is a flowchart of the SSA-LSTM algorithm; Figure 5 This is a flowchart of the voltage tiered control strategy. Detailed Implementation
[0035] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0036] Please see Figures 1-5 This invention provides a voltage prediction and hierarchical control method based on SSA-LSTM, which mainly includes the following technologies: 1. Distribution network voltage data processing technology based on big data 1) Voltage correlation data fusion based on BP neural network Power systems contain numerous electrical devices, and many electrical quantities exhibit redundancy and numerical discrepancies. Determining many electrical quantities requires analyzing multiple observable feature vectors. Data fusion can process data from different sources, times, locations, and patterns within the power system. This invention utilizes a backpropagation neural network (BPNN) from the field of artificial intelligence to collect and fuse voltage-related data from multiple sources, ultimately forming a unified data platform. The topology of the BP neural network is as follows... Figure 2 As shown, it includes an input layer, a hidden layer, and an output layer.
[0037] Figure 2 In this context, the input vector is represented as The output vector is represented as Where n represents the number of neurons in the input layer, m represents the number of neurons in the output layer, and the activation function is the Sigmoid function as shown in the following formula:
[0038] No. k The first layeri The output of each neuron is shown in the following formula:
[0039] Where k=1 represents the input layer, k=2 represents the hidden layer, k=3 represents the output layer, W represents the connection weight from the input layer to the hidden layer, and θ represents the threshold of the hidden layer or output layer unit.
[0040] The learning process of a BP neural network is as follows: errors occurring during training are attributed to thresholds or node connection weights in the connection layers. Then, the node errors in the output layer are propagated back to the input layer to calculate the reference error of each node. Finally, the connection weights are adjusted accordingly to obtain the desired output. In a multi-source fusion system for power big data, this approach is employed. One input node, This is expressed as the number of data points such as voltage, power, time, and temperature. There are 1 output layer node, and the hidden layer is set to 1.
[0041] 2) Dynamic identification of outlier data based on LOF-GMM The Loopholes-of-Flight (LOF) algorithm is a representative unsupervised anomaly detection algorithm that identifies outliers based on data density. The criterion is to calculate the Local Outlier Factor (LOF) value within the neighborhood of a data point and compare this LOF value with a threshold to determine whether the point is an outlier. The specific LOF algorithm process is as follows: Calculate the k-th reachable distance between all points in the sample data, using Point and points The distance between them, using Represents the distance point among all sample points. The k-th farthest point and point The distance between them is the k-th distance. For point Time The k-th reachable distance, take and The maximum value, i.e., the distance from the point The most recent k points, points The k-th reachable distance from them is equal to, and is equal to, their k-th reachable distances. As shown in the following formula:
[0042] Calculate the local reachability density of each data point based on the obtained k-th reachability distance. Point The k-th distance neighborhood, i.e., point All points within the k-th distance. Locally achievable density For point The k-th distance domain The reciprocal of the average reachable distance from all points within the region. The density between a point and its surrounding neighborhood points is represented by the following formula:
[0043] Finally, calculate the LOF value for each data point in the sample. The local anomaly factor is shown in the following formula:
[0044] In the formula, Point The k-th distance domain Locally accessible density and points within The average of the ratios of locally attainable densities. The larger, the more points The more likely it is to be an outlier data point.
[0045] After calculating the LOF values for each load point, the Gaussian Mixture Model (GMM) is used to perform cluster analysis on the LOF values, automatically determining the outlier threshold. GMM is an unsupervised clustering algorithm that linearly combines multiple single Gaussian models to fit more complex sample distributions. This is because the parameters of individual Gaussian models in the GMM model... These are all unknowns, and are typically obtained through iterative calculations using the EM (Expectation-Maximization) algorithm. The EM algorithm consists of two steps: calculating the expectation (E step) and maximizing the expectation (M step). The specific steps are as follows: First, the parameters of the EM algorithm are randomly initialized. Execute step E of the algorithm, as shown in the following formula:
[0046] In the formula, The weights of the k-th Gaussian model in the GMM; The mean is The covariance matrix is Given a single Gaussian model probability distribution function, calculate the LOF value for each sample point. The posterior probability of the Gaussian mixture model in the t-th iteration That is, each sample after this iteration The probability of belonging to the k-th Gaussian model.
[0047] The second step is to execute the M-step algorithm, as shown in the following formula:
[0048]
[0049]
[0050] The parameter estimates in the t-th iteration are obtained by calculating the maximum likelihood function of the parameters. Based on the results, update the relevant parameters in each Gaussian model to obtain the GMM model after the t-th iteration.
[0051] Calculate the logarithmic function of the GMM model after the t-th iteration. The algorithm alternately executes steps E and M until the likelihood function converges or the number of iterations reaches the set maximum value, at which point the algorithm terminates. The significance of this step is to estimate parameters by maximizing the joint probability of the LOF value sample set, thus selecting the optimal distribution model.
[0052]
[0053] 3) Filling missing values in voltage correlation data based on cubic spline interpolation Data such as voltage and load power are arranged in chronological order to locate missing data points. Using data before and after the missing points, a cubic spline interpolation function is applied to fill in the missing time points, resulting in time series data with missing values. The formula for filling in the missing values can be expressed as:
[0054] In the formula, For the time points where load data is missing, This is the cubic spline interpolation fitting function.
[0055] Cubic spline interpolation is a commonly used method for obtaining smooth curves. That is, the objective function f(x) has m+1 distinct nodes in the interval [a,b]. ,in The constructor f(x) satisfies the following equation:
[0056] In the formula, e = 0, 1, ..., m, and k(x) also satisfies the condition on each small interval. It is a polynomial of degree no more than three; the first and second derivatives of k(x) , It is continuous on [a,b]. k(x) is called the cubic spline interpolation function of f(x).
[0057] 2. Voltage prediction based on SSA-LSTM algorithm 1) SSA Algorithm Segmented Foraging Algorithm (SSA) is a metaheuristic optimization method that simulates the foraging and danger-avoidance behaviors of sparrows. This algorithm borrows from the foraging strategies of sparrows in nature and applies them to global optimization problems to find the optimal solution. In the iterative process of SSA, the sparrow colony continuously adjusts its position to find the optimal solution. This process can be summarized in the following stages: (1) Search phase Sparrows actively search for existing food resources within their range. In this process, those sparrows that successfully find food and demonstrate high adaptability are designated as "discoverers." As discoverers, they play a crucial role in exploring food sources and relaying the location information of their findings to the flock, providing guidance and direction for other sparrows in their search for food.
[0058] This behavior not only optimizes the survival chances of individuals but also improves the foraging efficiency of the entire population. By sharing food locations, the finder sparrows are essentially exchanging information. This communication mechanism allows the population to concentrate its efforts and move towards resource-rich areas, thereby increasing its overall adaptability and survival probability. This strategy is highly efficient for survival and reproduction in nature, and in optimization algorithms, it is abstracted and simulated as a search strategy to guide the algorithm's search process in the solution space in order to find the optimal solution.
[0059] The formula for updating the sparrow's position by the discoverer is:
[0060] In the formula, This represents the position of the i-th sparrow in the j-th dimension. T The maximum number of iterations, Q is a random number between [0, 1], and Q is a random number following a normal distribution. This is a warning value. As a safety threshold, Let be a 1×d dimensional matrix with all elements being 1, where d is the number of global optimization variables.
[0061] (2) Tracking phase During the tracking phase of the SSA algorithm, follower sparrows, based on information provided by the discoverer sparrows, begin to search within a smaller area, thus more accurately locating food sources. Following sparrows adjust their positions based on the high-fitness location information shared by the discoverer, gradually moving towards areas rich in food. Through this collaborative approach, the entire population can more efficiently focus on the most promising solution regions.
[0062] The position updates of follower sparrows depend not only on the location of the discoverer but also on other factors such as the abundance of food sources, the safety of the surrounding environment, and the behavior of other followers. This strategy helps prevent the group from getting stuck in local optima and propels it towards the global optimum. In this way, the SSA algorithm can effectively improve the global quality of solutions and achieve better performance when solving complex optimization problems.
[0063] The formula for updating the position of the follower sparrow is:
[0064] In the formula, For individual search, This is the worst possible position for the sparrow search. A For a 1×d matrix with randomly assigned ± values, N This refers to the population size.
[0065] (3) Attack Phase During the attack phase of the SSA algorithm, the attacker sparrows play the role of meticulous searching and optimization. These sparrows have identified potential food source locations, and their task is to conduct more intensive exploration in the vicinity of these locations to precisely find the richest food resources. The attacker sparrows utilize known information to quickly adjust their search paths, approaching and utilizing these resources in the most efficient way.
[0066] By conducting in-depth searches during the attack phase, the SSA algorithm ensures that the quality and accuracy of the solution are further refined and improved based on the global search, thereby achieving more ideal results when solving complex problems. This strategy allows the SSA algorithm not only to effectively explore the solution space but also to delve deeper into key regions, maximizing the probability of finding the optimal solution.
[0067] The attacker's formula for updating the sparrow's position is:
[0068] In the formula, The optimal location for a global search. Random numbers controlled by a step size. For random numbers that follow a normal distribution, To avoid the smallest constant with a denominator of 0, For the individual's optimal fitness, For the globally optimal fitness, This represents the worst fitness globally.
[0069] In the sparrow search algorithm, the roles of individual sparrows are not fixed but dynamic. During the algorithm's operation, any sparrow that finds a location closer to a food source has the opportunity to become a discoverer, leading other sparrows to converge in that direction. This mechanism ensures that the algorithm can continuously discover potential candidates for the optimal solution from the population, promoting dynamic balance and efficiency throughout the search process. The specific steps of the sparrow algorithm are as follows: ① Initialize the sparrow population and the number of iterations; ② Calculate the fitness of individuals and sort them from largest to smallest; ③ Update the positions of the discoverer and followers; ④ The sparrow that updates the attacker's location; ⑤ Calculate the new fitness and update the sparrow's position; ⑥ If the requirements are met, output the result; otherwise, repeat steps ② to ⑥.
[0070] 2) LSTM algorithm LSTM (Laser-Sensitive Memory) neural networks are an advanced recurrent neural network architecture that addresses the long-term dependency problem encountered by standard RNNs when processing sequential data. By introducing memory units and gating mechanisms, LSTM effectively preserves and transmits long-term information while suppressing unimportant information, significantly improving model performance in tasks such as sequence prediction and time series analysis. The LSTM network structure includes the following key components: (1) Input layer: Receives raw input data, which is a single data point or a part of the sequence data.
[0071] (2) Hidden layer: Composed of multiple LSTM units, each unit contains three gate structures: Input Gate: Determines which new information will be added to the cell state. Forget Gate: Determines which information should be forgotten or retained from the cellular state.
[0072] Output Gate: Determines the final output based on the cell state and input.
[0073] like Figure 3 As shown, at each time step, the LSTM unit updates its cell state through the coordinated work of these three gates, which can pass information across multiple time steps. The input gate allows new information to flow in, the forget gate evaluates and discards information that is no longer important, and the output gate generates an output based on the current cell state and the input data. This output is then passed to the next time step or used as the final output. The activation function tanh updates the state and output of memory storage units.
[0074] LSTM is a variant of Recurrent Neural Networks (RNNs) used to process time-series data. It introduces memory units and gating mechanisms into the traditional RNN to precisely control the transmission of information. This structural design of LSTM networks makes them excellent at handling time-dependent tasks, such as natural language processing, speech recognition, and complex time-series prediction. Through carefully designed gating mechanisms, LSTM can effectively learn long-term dependencies and avoid the gradient vanishing or exploding problems found in traditional RNNs.
[0075] Generally speaking, the common form of a gating mechanism can be expressed as:
[0076]
[0077] In the formula, It is the Sigmoid function, i.e., a non-linear activation function. The formulas for calculating the other parameters are:
[0078]
[0079]
[0080]
[0081]
[0082]
[0083] Where W is the weight matrix, b is the network bias vector, and tanh is the hyperbolic tangent function, whose output is between -1 and 1, and its function is to update the state and output of the memory storage unit. i, f, and O represent the input gate, forget gate, and output gate, respectively. The input and output vectors of the LSTM hidden layer at time t are respectively and The memory unit is The flowchart of the SSA-LSTM algorithm is as follows: Figure 4 As shown.
[0084] 3. Voltage hierarchical control strategy based on deep reinforcement learning 1) Voltage control mathematical model When adjusting the voltage of the control nodes in the coordinated area, the control objective is set as: the average value of the minimum voltage exceedance value of the entire distribution network bus nodes, expressed as:
[0085] In the formula, This represents the average voltage of the busbar nodes in the entire distribution network. This is the average rated voltage of the distribution network.
[0086] When adjusting the voltage of some nodes in a local autonomous region, the control target is set as the minimum over-limit value of the bus node voltage in the autonomous region, expressed as follows:
[0087] In the formula, Let be the node voltage of the i-th node; M represents the rated voltage of the distribution network in this area; M represents the number of busbar nodes in the distribution network in this area.
[0088] The constraints are as follows: (1) Power flow balance constraint:
[0089] In the formula, and These represent the active and reactive power consumed by the load at node i at time t, respectively. and These represent the active power loss and reactive power loss of the line at time t: and These represent the active and reactive power transmitted from the main distribution network at time t, respectively. and These represent the active and reactive power outputs of the distributed photovoltaic system at time t, respectively. The active power output of the energy storage at node i at time t; Let SVC output reactive power at node i at time t.
[0090] (2) SVC output constraint The output constraint of SVC is:
[0091]
[0092] In the formula, Output the reactive power change for SVC at node i; and These are the upper and lower limits of reactive power output by the SVC at node i, respectively. and These represent the upper and lower limits of reactive power ramping at node i at time t, respectively.
[0093] 2) Deep reinforcement learning algorithm design (1) DQN algorithm for regional coordinated control State space: If the bus node voltages are taken as the controlled objects, then the state space is the set of node voltages. :
[0094] In the formula, Representative node i The per-unit value of voltage; N This represents the number of busbar nodes in the entire distribution network.
[0095] Action space: The position of the on-load transformer tap changer is set as the action space of the DQN algorithm. Assuming each device has n Each gear has the same adjustment range: Total range of gear adjustment ,Right now:
[0096] Reward function: Taking the point voltage exceeding the limit as the control objective, the reward function is designed as follows: :
[0097] In the formula, These are the weighting coefficients. The average per-unit value of the bus node voltage in the global distribution network exceeds the value under normal conditions.
[0098] 3) Local Autonomous Control DDPG Algorithm By treating the voltage, active power, and reactive power fluctuations at each node as state variables, a state space for distribution network voltage control is constructed:
[0099] in, For nodes i Voltage fluctuations; For nodes i The active power; For nodes i Active power fluctuation; For nodes i reactive power; For nodes i Reactive power fluctuation; 1≤i≤M.
[0100] The combined equipment operating output data It can be defined as the action space:
[0101] The node voltage exceedance and equipment output adjustment are used as reward functions. To update the policy network and value function network of the DDPG algorithm, i.e.:
[0102] in, This represents the penalty coefficient for the voltage deviation term; and The penalty coefficient represents the active and reactive power regulation terms of distributed photovoltaic output; This represents the penalty coefficient for the active power regulation term of energy storage output; This represents the penalty coefficient for the reactive power regulation term of the SVC output; bus node i The per-unit voltage value exceeding the limit; Indicates bus node i The change in active power; Indicates bus node i The change in reactive power; Indicates bus node i Changes in active power output from the upper energy storage unit; Indicates bus node i The SVC outputs the reactive power change.
[0103] The distribution network voltage hierarchical coordinated control system consists of three parts: an active distribution network management system, a regional coordinated controller, and a local autonomous controller. Controllers are installed in each region, and voltage sensors at each load node are arranged adjacent to the controller's communication network. The distribution network voltage is predicted using the model from the previous section. When the average per-unit voltage deviation is determined to be in an emergency state, a signal is transmitted to the regional coordinated controller. The DQN algorithm is used for training to determine the optimal tap position of the voltage regulator. If the regional coordinated controller does not receive a signal or the voltage remains abnormal after control by the regional coordinated controller, the local autonomous controller adjusts the static var compensator (SVC). The DDPG algorithm is used for training to obtain the optimal control strategy, and then the control signal is sent to each voltage regulating device to achieve real-time autonomous voltage control. The overall control flow is shown in Figure 5.
[0104] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A voltage prediction and hierarchical control method based on SSA-LSTM, characterized in that, The method specifically includes: Data preprocessing stage: First, BP neural network is used to collect and fuse voltage-related data from multiple user equipment; then, LOF-GMM is used to dynamically identify voltage anomalies in the fused data, and cubic spline interpolation is used to supplement missing data to complete the repair of time series data; where LOF represents local anomaly factor and GMM represents Gaussian mixture model. Voltage prediction and control stage: First, voltage prediction is performed using the SSA-LSTM algorithm; where SSA stands for Sparrow Search and LSTM stands for Long Short-Term Memory Neural Network. Then, a voltage control mathematical model is built, and deep reinforcement learning algorithms are used to achieve hierarchical voltage control of the distribution network.
2. The voltage prediction and hierarchical control method according to claim 1, characterized in that, In the data preprocessing stage, a BP neural network is used to collect and fuse voltage-related data from multiple users, specifically including: Construct a BP neural network architecture, define the neuron output calculation rules, and realize the forward transmission of data from input to fusion result; By optimizing the network through backpropagation, unified and non-redundant fused data is output.
3. The voltage prediction and hierarchical control method according to claim 1, characterized in that, In the data preprocessing stage, LOF-GMM is used to dynamically identify voltage anomalies in the fused data, and cubic spline interpolation is used to supplement missing data. Specifically, this includes: The LOF algorithm is used to calculate the degree of outliers in the fused data, including calculating the k-th reachable distance, local reachability density, and LOF value; Cluster analysis of LOF values was performed using GMM to check convergence conditions and determine outlier thresholds. Arrange voltage and power data in chronological order, and mark the time points where data is missing; Construct a cubic spline function, input the missing time into the interpolation function, obtain the filling value of the missing data, and complete the time series data repair.
4. The voltage prediction and hierarchical control method according to claim 3, characterized in that, In the data preprocessing stage, the LOF algorithm is an unsupervised anomaly detection algorithm that identifies outliers based on data density. The judgment criterion is to calculate the Local Anomaly Factor (LOF) value within the neighborhood of a data point, and then compare this LOF value with a threshold to determine whether the point is an outlier. The specific calculation process of the LOF algorithm is as follows: The k-th reachable distance between all points in the sample data is calculated using the following expression: in, For point Time The k-th reachable distance, take and The maximum value; Point and points The distance between them Represents the distance point among all sample points. The k-th farthest point and point The distance between them, i.e., the k-th distance; Based on the obtained k-th reachable distance, the local reachability density of each data point is calculated, expressed as: in, Point The density between the points and the surrounding points; Point The k-th distance neighborhood, i.e., point All points within the k-th distance; Finally, the LOF value for each data point in the sample is calculated using the following expression: in, Point The k-th distance domain Locally accessible density and points within The average of the ratios of locally attainable densities. The larger, the more points The more likely it is to be an outlier data point.
5. The voltage prediction and hierarchical control method according to claim 3, characterized in that, During the data preprocessing stage, the parameters of a single Gaussian model in the GMM are obtained iteratively using the EM algorithm.
6. The voltage prediction and hierarchical control method according to claim 1, characterized in that, In the voltage prediction and control stage, the SSA-LSTM algorithm is used for voltage prediction, specifically including: Simulate sparrow behavior to classify roles and update parameters. Through exploration, tracking and attack phases, explore possible optimal parameter regions in the space to avoid getting trapped in local optima and further optimize parameter accuracy. Iterative optimization involves calculating and sorting the fitness of each "sparrow," cyclically updating the positions of discoverers, followers, and attackers, recalculating the fitness, and updating the optimal parameters. We construct an LSTM network structure and use the forget gate and input gate to update the gradients collaboratively, passing key information across multiple time steps to solve the gradient vanishing problem of traditional RNNs. Historical voltage data is input into the LSTM at time steps, and the cell state and hidden layer output are dynamically updated through a gating mechanism to minimize the error between the predicted value and the actual voltage value.
7. The voltage prediction and hierarchical control method according to claim 1, characterized in that, In the voltage prediction and control phase, a voltage control mathematical model is built, and deep reinforcement learning algorithms are used to achieve hierarchical voltage control of the distribution network, specifically including: Construct a voltage control mathematical model and clarify the control objectives and constraints; The DQN algorithm is used to adjust the transformer tap changer to achieve wide-range voltage correction and realize regional coordinated control. Based on the DDPG algorithm, real-time autonomy is achieved, thus realizing local autonomous control.
8. The voltage prediction and hierarchical control method according to claim 7, characterized in that, Constructing a voltage control mathematical model specifically includes: when coordinating the control node voltage in the regulation area, setting the control objective as the average value of the minimum over-limit values of the bus node voltage across the entire distribution network, expressed as: in, This represents the average voltage of the busbar nodes in the entire distribution network. This refers to the average rated voltage of the distribution network. When adjusting the voltage of some nodes in a local autonomous region, the control target is set as the minimum over-limit value of the bus node voltage in the autonomous region, expressed as follows: in, For the first i The node voltage of each node; This refers to the rated voltage value of the regional power distribution network. M This refers to the number of busbar nodes in the regional distribution network. The constraints are as follows: 1) The power flow balance constraint is: in, and They are respectively in t Time Node i The active and reactive power consumed by the load; and They are respectively t Active and reactive power losses in the line at any given time: and These represent the active and reactive power transmitted from the main distribution network at time t, respectively. and They are respectively t The active and reactive power output of distributed photovoltaic systems at all times; for t Time Node i The upper energy storage outputs active power; The node at time t i The upper SVC outputs reactive power; SVC stands for Static Var Compensator. 2) The output constraint of SVC is: in, for t Time Node i The upper SVC outputs the reactive power change; and They are respectively t Time Node i The lower and upper limits of reactive power output from the upper SVC; and They are respectively t Time Node i The upper SVC outputs the lower and upper limits of reactive power ramping.
9. The voltage prediction and hierarchical control method according to claim 8, characterized in that, The DQN algorithm for achieving coordinated regional control specifically includes: State space: If the bus node voltages are taken as the controlled objects, then the state space is the set of node voltages. : in, Representative node i The per-unit value of voltage; N This refers to the number of busbar nodes in the entire distribution network. Action space: The position of the on-load transformer tap changer is set as the action space of the DQN algorithm. Assuming each device has n Each gear has the same adjustment range: Total range of gear adjustment ,Right now: Reward function: Taking the point voltage exceeding the limit as the control objective, the reward function is designed as follows: : in, These are the weighting coefficients. The average per-unit value of the bus node voltage in the global distribution network exceeds the value under normal conditions.
10. The voltage prediction and hierarchical control method according to claim 9, characterized in that, The DDPG algorithm for achieving local autonomous control specifically includes: constructing a state space for distribution network voltage control by treating the voltage, active power, and reactive power fluctuations of each node as state variables. in, For nodes i Voltage fluctuations; For nodes i The active power; For nodes i Active power fluctuation; For nodes i reactive power; For nodes i Reactive power fluctuation; 1≤i≤M; The combined equipment operating output data Defined as action space: The node voltage exceedance and equipment output adjustment are used as reward functions. To update the policy network and value function network of the DDPG algorithm, i.e.: in, This represents the penalty coefficient for the voltage deviation term; and The penalty coefficient represents the active and reactive power regulation terms of distributed photovoltaic output; This represents the penalty coefficient for the active power regulation term of energy storage output; This represents the penalty coefficient for the reactive power regulation term of the SVC output; bus node i The per-unit voltage value exceeding the limit; Indicates bus node i The change in active power; Indicates bus node i The change in reactive power; Indicates bus node i Changes in active power output from the upper energy storage unit; Indicates bus node i The SVC outputs the reactive power change.