Method and device for optimizing active power and reactive power of power distribution network and computer program product
By constructing a Markov decision model in the distribution network and introducing a deep reinforcement learning algorithm with guidance rules, the output of the photovoltaic and energy storage systems is coordinated, which solves the problem of safety constraints in the optimization of active and reactive power in the distribution network and improves the performance of the power grid. stability and efficiency.
Patent Information
- Application Number
- CN202410749192.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2024-10-08
AI Technical Summary
In the existing technology, safety constraints cannot be guaranteed during the optimization process of active and reactive power in distribution networks, and methods based on deep reinforcement learning algorithms have high complexity and reduced performance when faced with multiple constraints.
A Markov decision model based on the Markov decision process is used to construct the distribution network, and guidance rules are introduced into the deep reinforcement learning algorithm to ensure that voltage over-limits are avoided while minimizing active power loss. Through improved deep reinforcement learning Algorithms coordinate the output of photovoltaic systems and energy storage systems to achieve voltage regulation.
It improves the safety and stability of voltage regulation in the distribution network, reduces active power loss, and enhances the stability and reliability of the grid when renewable energy is connected.
Smart Images

Figure CN118748411A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of distribution network, and in particular to a method for optimizing active and reactive power of a distribution network, an optimization device, a computer-readable storage medium and a computer program product. Background Art
[0002] In the field of distribution network management, with the widespread deployment of photovoltaic (PV) systems and other renewable energy sources, the operation mode of the distribution network is changing from a traditional passive grid to an active active grid. In this process, the inverter-driven PV system not only provides clean energy to the grid, but is also mobilized to provide reactive power support in order to adjust the voltage according to IEEE Standard 1547.8. At the same time, the installation of energy storage systems (ESS) in the distribution network can also complete the time and space transfer of energy and optimize the distribution network. Although PV and ESS have the advantages of fast and continuous control of the distribution network, with the increasing proportion of flexible loads and PV, the uncertainty of the distribution network power is becoming stronger, and the network loss and voltage limit are becoming more serious.
[0003] Traditional methods for optimizing active and reactive power in distribution networks usually adopt centralized optimization strategies based on detailed physical models. These strategies achieve voltage regulation by coordinating devices with different response speeds such as on-load tap changers, capacitor banks, and PV. For example, centralized control schemes often use model predictive control, optimization algorithms based on fully distributed alternating direction multipliers, or voltage regulation strategies that combine distributed and local control. However, these model-based methods rely on accurate knowledge of system models and parameters, which is impractical for modern large, complex distribution systems with limited measurement units. In response to these challenges, some researchers have proposed data-driven methods for optimizing active and reactive power in distribution networks based on deep reinforcement learning algorithms (DRL) in recent years, which reduce the reliance on accurate system parameters. DRL methods such as DDPG, PPO, and SAC have been applied to centralized power control, while algorithms such as MADDPG and MASAC are used for distributed control strategies. The existing active and reactive collaborative optimization methods based on the DRL algorithm lack security guarantees when executing the security constraints of the distribution network. Most studies deal with the security constraints of the distribution network by adding penalty functions. However, with the increase of constraints, the implementation complexity of this method also increases, and the penalty coefficient needs to be fine-tuned. At the same time, this method also reduces the performance of the DRL algorithm. Some studies have also proposed safe deep reinforcement learning algorithms, such as the constrained policy gradient algorithm, but this method only provides a probability of security and cannot ensure the security of the policy execution process. Summary of the invention
[0004] The main purpose of the present application is to provide a distribution network active and reactive power optimization method, optimization device, computer-readable storage medium and computer program product, so as to at least solve the problem that safety constraints cannot be guaranteed in the distribution network active and reactive power optimization process in the prior art.
[0005] In order to achieve the objective, according to one aspect of the present application, a method for optimizing active and reactive power of a distribution network is provided, comprising: constructing a Markov decision model of the distribution network based on a Markov decision process, the Markov decision process being used to describe a process of collaboratively optimizing the active power and reactive power of the distribution network, the Markov decision model being a model for collaboratively optimizing the active power and reactive power of the distribution network; introducing a guidance rule into a deep reinforcement learning algorithm, and updating parameters in the deep reinforcement learning algorithm to obtain an improved deep reinforcement learning algorithm, the deep reinforcement learning algorithm being used to learn to make the best decision by interacting with the environment of the distribution network, the guidance rule being used to ensure that the voltage of a line node in the distribution network does not exceed a limit while minimizing active power loss, the limit exceeding being that the voltage exceeds an upper voltage limit or a lower voltage limit; solving the Markov decision model using the improved deep reinforcement learning algorithm to obtain a voltage regulation strategy, and regulating and controlling the voltage according to the voltage regulation strategy, the voltage regulation strategy being to achieve voltage regulation by coordinating and optimizing the reactive power of a photovoltaic system and the active power of an energy storage system.
[0006] Optionally, before constructing a Markov decision model of the distribution network based on the Markov decision process, the method also includes: obtaining operating data of the distribution network, the operating data at least including the active power injection amount, reactive power injection amount and voltage amplitude of the line nodes of the distribution network at any time, the active power injection amount is the active power corresponding to the load injected into the line node, and the reactive power injection amount is the reactive power corresponding to the load injected into the line node; inputting the operating data into a power analysis tool, so as to use the power analysis tool to perform flow calculation on the operating data to obtain optimized operating data, the power analysis tool is at least used to perform power system flow analysis and load flow; and determining the environment for active and reactive power optimization of the distribution network according to the optimized operating data.
[0007] Optionally, constructing a Markov decision model of a distribution network based on a Markov decision process includes: acquiring a state space, an action space and a reward function, wherein the state space includes a plurality of states, wherein the states include the active power injection amount, the reactive power injection amount and the voltage amplitude of each of the line nodes of the distribution network at any time, the action space includes a plurality of actions, wherein the actions include the reactive output of the photovoltaic node and the active output of the energy storage node in the distribution network, and the reward function is used to judge the standard of executing the actions, wherein the photovoltaic node is a node in the line node connected to a photovoltaic power station, and the energy storage node is a node in the line node connected to an energy storage device; Execute the current action according to the current state to transfer the state and obtain the next state and reward value, wherein the current state is the state at the current moment, the current state is the action selected at the current moment, the reward value is the value obtained after the current action is executed at the current moment, and the next state is the state at the moment next to the current moment; form an experience trajectory according to the current state, the current action, the next state and the reward value, and the experience trajectory is a state sequence formed according to the state change after the action is executed; construct the Markov decision model according to the state space, the action space, the reward function and the experience trajectory.
[0008] Optionally, before introducing the guidance rules into the deep reinforcement learning algorithm, the method further includes: obtaining a first voltage sensitivity matrix and a second voltage sensitivity matrix, the first voltage sensitivity matrix being used to represent the relationship matrix between the voltage amplitude and the reactive power of the photovoltaic node, and the second voltage sensitivity matrix being used to represent the relationship matrix between the voltage amplitude and the active power of the energy storage node; when the voltage value of any of the line nodes is greater than the voltage upper limit value, determining a first guidance rule, the first guidance rule being to correct the reactive power output by the photovoltaic node and the active power output by the energy storage node according to a first formula, the first formula being: represents the corrected active power output by the energy storage node, Represents the reactive power output by the photovoltaic node after correction, V max Indicates the voltage upper limit, V min Indicates the voltage lower limit, represents the active power output by the energy storage node before correction, represents the reactive power output by the photovoltaic node before correction, S PV Denotes the first voltage sensitivity matrix, S QV Denotes the second voltage sensitivity matrix, V i,trepresents the voltage value of the ith line node at time t; when the voltage value of any line node is less than the voltage lower limit, a second guidance rule is determined, wherein the second guidance rule is to correct the reactive power output by the photovoltaic node and the active power output by the energy storage node according to a second formula, and the second formula is
[0009] Optionally, before updating the parameters in the deep reinforcement learning algorithm to obtain an improved reinforcement algorithm, the method further includes: obtaining a dangerous experience trajectory based on the experience trajectory in a first situation, the first situation being a situation where the voltage exceeds a limit when executing any one of the actions in the action space; obtaining a safe experience trajectory based on the experience trajectory in a second situation, the second situation being a situation where the action is executed after correcting the reactive power output by the photovoltaic node and the active power output by the energy storage node; and determining a mixed experience trajectory pool based on the dangerous experience trajectory and the safe experience trajectory.
[0010] Optionally, the parameters in the deep reinforcement learning algorithm are updated to obtain an improved deep reinforcement learning algorithm, including: initializing value parameters and policy parameters, the value parameters are parameters that need to be updated by the value network, the policy parameters are parameters that need to be updated by the policy network, the value network is used to map the state to the action through the mean and variance of the Gaussian distribution, and the policy network is used to map the state and the action to a scalar value to evaluate the performance of executing the action in the state; an acquisition step, acquiring a training state from the operating environment of the distribution network, and generating a corresponding training action through the value network, the training state is a state obtained during training, and the training action is an action corresponding to the training state during the training process; an execution step, executing the training action, A training reward value and a next training state are obtained; an evaluation step, using the policy network to evaluate the training state and the next training state, and obtain a first evaluation value and a second evaluation value respectively, the first evaluation value is the evaluation value of the training state, and the second evaluation value is the evaluation value of the next training state; a calculation step, calculating the training error according to the training reward value, the first evaluation value and the second evaluation value; an updating step, using the stochastic gradient method to update the parameters in the value network and the policy network; repeating the acquisition step, the execution step, the evaluation step, the calculation step and the update step at least once, until the training error is less than the set error, completing the updating of the parameters in the deep reinforcement learning algorithm, and obtaining an improved deep reinforcement learning algorithm.
[0011] Optionally, the parameters in the value network and the policy network are updated using the stochastic gradient method, including: determining a first loss function based on minimizing the Bellman residual, and determining a second loss function based on the errors of each of the actions, the first loss function being the loss function of the value network, and the second loss function being the loss function of the policy network; introducing the mixed experience trajectory pool into the first loss function and the second loss function to respectively determine a first gradient and a second gradient, the first gradient being the gradient of the first loss function, and the second gradient being the gradient of the second loss function; updating the parameters of the value network according to the first gradient, and updating the parameters of the policy network according to the second gradient.
[0012] According to another aspect of the present application, there is provided an optimization device for active and reactive power of a distribution network, the device comprising: a construction unit, for constructing a Markov decision model of the distribution network based on a Markov decision process, the Markov decision process being used to describe a process of collaboratively optimizing the active power and reactive power of the distribution network, the Markov decision model being a model for collaboratively optimizing the active power and reactive power of the distribution network; an updating unit, for introducing a guidance rule into a deep reinforcement learning algorithm, and updating parameters in the deep reinforcement learning algorithm to obtain an improved deep reinforcement learning algorithm, the guidance rule being used to ensure that the voltage of a line node in the distribution network does not exceed a limit while minimizing active power loss, the limit exceeding being that the voltage exceeds an upper voltage limit or a lower voltage limit; a solving unit, for solving the Markov decision model using the improved deep reinforcement learning algorithm to obtain a voltage regulation strategy, and regulating and controlling the voltage according to the voltage regulation strategy, the voltage regulation strategy being to achieve voltage regulation by coordinated optimization of the reactive power of a photovoltaic system and the active power of an energy storage system.
[0013] According to another aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute any one of the methods described.
[0014] According to another aspect of the present application, a computer program product is provided, comprising computer instructions, wherein when the computer instructions are executed by a processor, any one of the methods described above is implemented.
[0015] Applying the technical solution of the present application, in the optimization method of active and reactive power of a distribution network, first, a Markov decision model of the distribution network is constructed based on a Markov decision process. The Markov decision process is used to describe the process of collaborative optimization of the active power and reactive power of the distribution network. The Markov decision model is a model for collaborative optimization of the active power and reactive power of the distribution network; then, a guidance rule is introduced into a deep reinforcement learning algorithm, and the parameters in the deep reinforcement learning algorithm are updated to obtain an improved deep reinforcement learning algorithm. The deep reinforcement learning algorithm is used to learn to make the best decision by interacting with the environment of the distribution network. The guidance rule is used to ensure that the voltage of the line node in the distribution network does not exceed the limit while minimizing the active power loss. The limit is that the voltage exceeds the upper voltage limit or the lower voltage limit; finally, the improved deep reinforcement learning algorithm is used to solve the Markov decision model to obtain a voltage regulation strategy, and the voltage is regulated and controlled according to the voltage regulation strategy. The voltage regulation strategy is to achieve voltage regulation by coordinating and optimizing the reactive power of the photovoltaic system and the active power of the energy storage system. This application proposes an online active and reactive collaborative optimization framework, which uses an improved deep reinforcement learning algorithm to solve the reactive and active output strategies corresponding to the photovoltaic system inverter and energy storage system to ensure that the strategy can meet the operating constraints of the distribution network and increase the security of the deep reinforcement learning algorithm. This application solves the problem that the safety constraints cannot be guaranteed in the process of active and reactive optimization of the distribution network in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A hardware structure block diagram of a mobile terminal for performing a method for optimizing active and reactive power of a distribution network provided in an embodiment of the present application is shown;
[0017] Figure 2 A schematic flow chart of a method for optimizing active and reactive power of a distribution network provided according to an embodiment of the present application is shown;
[0018] Figure 3 A schematic diagram of a standard IEEE-33 node power distribution system provided according to an embodiment of the present application is shown;
[0019] Figure 4 The figure shows the evolution of the average cumulative discount reward during the HL-SAC algorithm training process provided in the embodiment of the present application;
[0020] Figure 5 A voltage optimization effect diagram of the HL-SAC algorithm provided according to an embodiment of the present application is shown;
[0021] Figure 6 The control effect diagram of ESS by the HL-SAC algorithm provided in the embodiment of the present application is shown;
[0022] Figure 7 A structural block diagram of a distribution network active and reactive power optimization device provided according to an embodiment of the present application is shown.
[0023] The above drawings include the following reference numerals:
[0024] 102, processor; 104, memory; 106, transmission device; 108, input and output devices. DETAILED DESCRIPTION
[0025] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0026] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0028] For the convenience of description, some nouns or terms involved in the embodiments of the present application are explained below:
[0029] Human in the loop: is an intelligent branch of artificial intelligence that uses humans and machines to create machine learning models;
[0030] HL-SAC algorithm: human-in-the-loop soft actor-critic algorithm, a deep learning algorithm based on human in the loop, is a deep learning algorithm proposed in this application;
[0031] Intelligent agent: also known as intelligent subject or intelligent agent, can be defined as an entity that can autonomously perceive information in its environment and make decisions based on this information to achieve specific goals or tasks;
[0032] A Markov decision process (MDP) is a discrete-time stochastic control that provides a mathematical framework for modeling decisions when the outcomes are partially random and partially controlled by the decision maker.
[0033] As introduced in the background technology, the existing active and reactive collaborative optimization methods based on the DRL algorithm in the prior art lack safety guarantees when executing the safety constraints of the distribution network. Most studies deal with the safety constraints of the distribution network by adding a penalty function. However, with the increase of constraints, the implementation complexity of this method also increases, and the penalty coefficient needs to be fine-tuned. At the same time, this method also reduces the performance of the DRL algorithm. Some studies have also proposed safe deep reinforcement learning algorithms, such as the constrained policy gradient algorithm, but this method only provides a probability of safety and cannot ensure the safety during the execution of the strategy. In order to solve the problem that safety constraints cannot be guaranteed during the optimization of the active and reactive power of the distribution network, the embodiments of the present application provide a distribution network active and reactive power optimization method, optimization device, computer-readable storage medium and computer program product.
[0034] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0035] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal of a method for optimizing active and reactive power of a distribution network according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0036] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the display method of device information in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the above method is implemented. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. The transmission device 106 is used to receive or send data via a network. The above-mentioned specific examples of the network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0037] In this embodiment, a method for optimizing active and reactive power of a distribution network running on a mobile terminal, a computer terminal or a similar computing device is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0038] Figure 2 1 is a flow chart of a method for optimizing active and reactive power of a distribution network according to an embodiment of the present application. Figure 2 As shown, the method comprises the following steps:
[0039] Step S201, constructing a Markov decision model of the distribution network based on the Markov decision process, the Markov decision process is used to describe the process of collaboratively optimizing the active power and reactive power of the distribution network, and the Markov decision model is a model for collaboratively optimizing the active power and reactive power of the distribution network.
[0040] Specifically, the active and reactive coordinated optimization problem of distributed photovoltaic (PV) high-penetration distribution network is described as a Markov decision (MDP) model. The state space, action space, reward function and state transition process of MDP are constructed based on the Markov decision process.
[0041] Step S202, introducing guidance rules into the deep reinforcement learning algorithm, and updating the parameters in the deep reinforcement learning algorithm to obtain an improved deep reinforcement learning algorithm, wherein the deep reinforcement learning algorithm is used to learn to make the best decision by interacting with the environment of the distribution network, and the guidance rules are used to ensure that the voltage of the line nodes in the distribution network does not exceed the limit while minimizing the active power loss, and the above-mentioned over-limit refers to that the above-mentioned voltage exceeds the upper voltage limit or the lower voltage limit.
[0042] Specifically, guidance rules based on voltage sensitivity are incorporated into the strategy selection process of the deep reinforcement learning algorithm, so that the strategy can ensure that the node voltage does not exceed the limit while minimizing the active power loss, and the parameters in the above-mentioned deep reinforcement learning algorithm are continuously updated to obtain an improved deep reinforcement learning algorithm. The above-mentioned improved deep reinforcement learning algorithm is a deep reinforcement learning algorithm that includes the finally trained parameters.
[0043] Step S203, using the above-mentioned improved deep reinforcement learning algorithm to solve the above-mentioned Markov decision model, obtain a voltage regulation strategy, and adjust and control the voltage according to the above-mentioned voltage regulation strategy. The above-mentioned voltage regulation strategy is to achieve voltage regulation by coordinating and optimizing the reactive power of the photovoltaic system and the active power of the energy storage system.
[0044] Specifically, the above-mentioned improved deep reinforcement learning algorithm is used to solve the above-mentioned Markov decision model to obtain a voltage regulation strategy to cope with the real-time uncertainty of the power of distributed photovoltaic power generation and energy storage equipment, and complete the online active and reactive coordinated optimization of the distribution network. It is possible to more effectively manage and optimize the voltage and power flow in the distribution network, reducing the uncertainty and power loss caused by the distributed photovoltaic system. This not only improves the operating efficiency of the power grid, but also enhances the stability and reliability of the power grid when facing a high proportion of renewable energy access. Through precise active and reactive coordinated control, the present invention can significantly reduce the loss of electric energy during transmission.
[0045] In this embodiment, first, a Markov decision model of the distribution network is constructed based on the Markov decision process. The Markov decision process is used to describe the process of collaborative optimization of the active power and reactive power of the distribution network. The Markov decision model is a model for collaborative optimization of the active power and reactive power of the distribution network. Then, a guidance rule is introduced into the deep reinforcement learning algorithm, and the parameters in the deep reinforcement learning algorithm are updated to obtain an improved deep reinforcement learning algorithm. The deep reinforcement learning algorithm is used to learn to make the best decision by interacting with the environment of the distribution network. The guidance rule is used to ensure that the voltage of the line node in the distribution network does not exceed the limit while minimizing the active power loss. The limit is exceeded when the voltage exceeds the upper voltage limit or the lower voltage limit. Finally, the Markov decision model is solved by using the improved deep reinforcement learning algorithm to obtain a voltage regulation strategy, and the voltage is regulated and controlled according to the voltage regulation strategy. The voltage regulation strategy is to achieve voltage regulation by coordinating and optimizing the reactive power of the photovoltaic system and the active power of the energy storage system. This application proposes an online active and reactive collaborative optimization framework, which uses an improved deep reinforcement learning algorithm to solve the reactive and active output strategies corresponding to the photovoltaic system inverter and energy storage system to ensure that the strategy can meet the operating constraints of the distribution network and increase the security of the deep reinforcement learning algorithm. This application solves the problem that the safety constraints cannot be guaranteed in the process of active and reactive optimization of the distribution network in the prior art.
[0046] In order to enable those skilled in the art to more clearly understand the technical solution of the present application, the implementation process of the method for optimizing active and reactive power of the distribution network of the present application will be described in detail below in combination with specific embodiments.
[0047] In order to avoid uncertainty in power flow calculation caused by uncertainty in the distribution network environment, in an optional implementation, before the above step S201, the method further includes:
[0048] Step S301, obtaining operation data of the distribution network, the operation data at least including the active power injection amount, reactive power injection amount and voltage amplitude of the line node of the distribution network at any time, the active power injection amount is the active power corresponding to the load injected into the line node, and the reactive power injection amount is the reactive power corresponding to the load injected into the line node;
[0049] Step S302, inputting the operation data into a power analysis tool, so as to use the power analysis tool to perform power flow calculation on the operation data to obtain optimized operation data, wherein the power analysis tool is at least used to perform power system power flow analysis and load flow;
[0050] Step S303: determining the environment for optimizing active and reactive power of the distribution network according to the above-mentioned optimization operation data.
[0051] In the above embodiment, the active and reactive power coordinated optimization problem of the distributed photovoltaic high penetration distribution network is described as a Markov decision (MDP) model. In each decision step of the distribution network, each node will inject the active power and reactive power of the load, as well as the active power generation of the photovoltaic node and other variables. These variables are uncertainty variables for each decision step, and then the uncertainty of variables such as active power and reactive power will also lead to the uncertainty of the distribution network flow. Each decision step controller adjusts the active power loss and voltage condition of the distribution network by controlling the reactive power of the system photovoltaic node inverter and the active power of the energy storage node. Based on the above settings, it is necessary to first obtain the operating data of the distribution network, and then use Python's PYPOWER toolkit to build the distribution network environment. After inputting each variable, the above environment performs flow calculation through the Runpf function of the PYPOWER toolkit to obtain the optimized operating data. The environment where the above optimized operating data is located is determined as the environment for active and reactive power optimization of the distribution network.
[0052] In order to ensure the accuracy of the Markov decision process, in an optional implementation manner, the above step S201 includes:
[0053] Step S2011, obtaining a state space, an action space and a reward function, wherein the state space includes a plurality of states, and the states include the active power injection amount, reactive power injection amount and voltage amplitude of each of the line nodes of the distribution network at any time, the action space includes a plurality of actions, and the actions include the reactive output of the photovoltaic node and the active output of the energy storage node in the distribution network, and the reward function is used to judge the standard of executing the actions, the photovoltaic node is a node in the line node connected to a photovoltaic power station, and the energy storage node is a node in the line node connected to an energy storage device;
[0054] Step S2012, executing the current action according to the current state to transfer the state, and obtaining the next state and reward value, wherein the current state is the state at the current moment, the current state is the action selected at the current moment, the reward value is the value obtained after executing the current action at the current moment, and the next state is the state at the next moment after the current moment;
[0055] Step S2013, forming an experience track according to the current state, the current action, the next state and the reward value, wherein the experience track is a state sequence formed according to state changes after the action is performed;
[0056] Step S2014, constructing the Markov decision model according to the state space, the action space, the reward function and the experience trajectory.
[0057] In the above embodiment, the state space S of the MDP is the state s that the DRL agent can observe at the decision step t. t , where s t = {P i,t , Q i,t , V i,t , i∈N},P i,t , Q i,t , V i,t They represent the net active power injection, net reactive power injection and voltage amplitude of the ith node at time t, respectively, and N is the number of line nodes in the distribution network. The action space A of MDP is the action a made by the DRL agent at the decision step t. t , where a t = {Q PV i,t , P ESS j,t , i∈N PV , j∈N ESS}, Q PV i,t represents the reactive power output of the ith photovoltaic node at time t, P ESS j,t Represents the active output of the jth energy storage node at time t. When a photovoltaic power station is configured on a line node, the line node will be used as a photovoltaic node. Similarly, when an energy storage device is configured on a line node, the line node will be used as an energy storage node. The reward function in MDP is the standard for evaluating the actions of the DRL agent and the goal of active and reactive power optimization. The above reward function is r t =-∑ ij∈ε l ij r ij , represents the negative value of active power loss, where ij represents the branch between node i and node j, ε represents the total number of branches in the distribution network, and l ij represents the square of the current in branch ij, r ij represents the resistance of branch ij. The DRL agent is in state s at time t. t Make an action t , action a t The reward value r is obtained by performing flow calculation in the distribution network environment. t and the state s at the next moment t+1 , this process is based on the state transition probability distribution The state transition process of each decision step will form an experience trajectory τ={s t , a t , r t ,s t+1}, the Markov decision model can be constructed based on the above state space, the above action space, the above reward function and the above experience trajectory.
[0058] In order to correct the infeasible action and improve the control performance, in an optional implementation manner, before the above step S202, the above method further includes:
[0059] Step S401, obtaining a first voltage sensitivity matrix and a second voltage sensitivity matrix, wherein the first voltage sensitivity matrix is used to represent a relationship matrix between the voltage amplitude and the reactive power of the photovoltaic node, and the second voltage sensitivity matrix is used to represent a relationship matrix between the voltage amplitude and the active power of the energy storage node;
[0060] Step S402, when the voltage value of any of the above-mentioned line nodes is greater than the voltage upper limit value, determine the first guidance rule, the above-mentioned first guidance rule is to correct the above-mentioned reactive power output by the above-mentioned photovoltaic node and the above-mentioned active power output by the above-mentioned energy storage node according to the first formula, and the above-mentioned first formula is represents the above active power output by the above energy storage node after correction, Represents the above reactive power output by the above photovoltaic node after correction, V max Indicates the upper limit of the voltage, V min Indicates the lower limit of the voltage above, represents the above active power output by the above energy storage node before correction, represents the reactive power output by the PV node before correction, S PV represents the first voltage sensitivity matrix, S QV Denotes the second voltage sensitivity matrix, V i,t represents the voltage value of the i-th line node at time t;
[0061] Step S403, when the voltage value of any of the above-mentioned line nodes is less than the voltage lower limit value, determine the second guidance rule, the above-mentioned second guidance rule is to correct the above-mentioned reactive power output by the above-mentioned photovoltaic node and the above-mentioned active power output by the above-mentioned energy storage node according to the second formula, and the above-mentioned second formula is
[0062] In the above embodiment, the Markov decision model constructed in step S201 ignores the voltage constraint of the distribution network in the process of active and reactive power optimization. Therefore, it is clear to introduce a guidance rule based on voltage sensitivity to correct infeasible actions and improve control performance. For any node, the relationship between its voltage and active and reactive power can be expressed by the voltage sensitivity matrix: ΔV i,t =S PVΔP i,t , ΔV i,t =S QV ΔQ i,t , S PV represents the voltage active sensitivity matrix, that is, the first voltage sensitivity matrix mentioned above, S QV represents the voltage reactive power sensitivity matrix, i.e., the second voltage sensitivity matrix mentioned above, ΔV i,t is the voltage deviation, ΔP i,t is the deviation of active power, ΔQ i,t is the deviation of reactive power. The controller can adjust the reactive power of photovoltaic and the active power of energy storage system according to the above relationship, aiming to correct the voltage over-limit action. When the action is executed and the node voltage exceeds the upper or lower limit, that is, V i,t >V max , V i,t <V min , the reactive power of photovoltaics and the active power of the energy storage system will be corrected according to the above-mentioned first guiding rule or the above-mentioned second guiding rule.
[0063] In order to promote the policy network in the deep reinforcement learning algorithm to learn in the direction of guided intervention, in an optional implementation, before the above step S202, the above method further includes:
[0064] Step S501, obtaining a dangerous experience trajectory according to the experience trajectory in the first case, wherein the first case is a case where the voltage exceeds the limit when performing any one of the actions in the action space;
[0065] Step S502, obtaining a safety experience trajectory according to the experience trajectory in the second case, wherein the second case is a case where the above action is performed after the above reactive power output by the above photovoltaic node and the above active power output by the above energy storage node are corrected;
[0066] Step S503: determining a mixed experience trajectory pool according to the dangerous experience trajectory and the safe experience trajectory.
[0067] In the above embodiment, a large number of experience trajectories need to be stored in the experience pool before updating the parameters in the deep reinforcement learning algorithm. However, the value network may not be able to learn the experience trajectories that have been manually intervened. For this reason, a mixed experience trajectory pool of dangerous and safe conversions is designed. The experience pool D can be expressed as: When the node voltage exceeds the limit, the experience pool D will store two experience trajectories D1 and D2, where D1 = {s t , a t , r t ,s t+1 ,σ(s t )=0,ifV i,t∈[V min , V max ]}, D2={s t , a t , r t v ,s t+1 ,σ(s t )=0}∪{s t , a t , r t ,s t+1 ,σ(s t )=1,else}, D1 indicates that the execution of the action did not cause the voltage to exceed the limit, and D2 indicates that the execution of the original action caused the voltage to exceed the limit, thus applying the safety experience stored after the guidance intervention, and the reward value in the D2 experience track is modified to r t v =r t -c, where r t is the reward value when the voltage exceeds the limit, and c is a constant used to adjust the reward value when the voltage exceeds the limit. This ensures that the performance of the guided intervention is always better than the DRL action, and further promotes the strategy network to learn in the direction of the guided intervention, where the guided intervention is to execute the above-mentioned first guiding rule and the above-mentioned second guiding rule to correct the reactive power and active power.
[0068] In order to find the best parameters to improve the performance of the algorithm, in an optional implementation, the above step S202 includes:
[0069] Step S2021, initializing value parameters and strategy parameters, the above value parameters are parameters that need to be updated by the value network, the above strategy parameters are parameters that need to be updated by the strategy network, the above value network is used to map the above state to the above action through the mean and variance of the Gaussian distribution, and the above strategy network is used to map the above state and the above action to a scalar value to evaluate the performance of executing the above action under the above state;
[0070] Step S2022, an acquisition step, acquiring a training state from the operating environment of the distribution network, and generating a corresponding training action through the value network, wherein the training state is a state acquired during training, and the training action is an action corresponding to the training state during the training process;
[0071] Step S2023, executing the above training action to obtain the training reward value and the next training state;
[0072] Step S2024, an evaluation step, using the policy network to evaluate the training state and the next training state, to obtain a first evaluation value and a second evaluation value, respectively, wherein the first evaluation value is an evaluation value of the training state, and the second evaluation value is an evaluation value of the next training state;
[0073] Step S2025, a calculation step, calculating a training error according to the training reward value, the first evaluation value and the second evaluation value;
[0074] Step S2026, an updating step, using a stochastic gradient method to update the parameters in the value network and the policy network;
[0075] Step S2027, repeat the above-mentioned acquisition step, the above-mentioned execution step, the above-mentioned evaluation step, the above-mentioned calculation step and the above-mentioned update step at least once, until the above-mentioned training error is less than the set error, complete the updating of the parameters in the above-mentioned deep reinforcement learning algorithm, and obtain the improved deep reinforcement learning algorithm.
[0076] In the above embodiment, based on the above guiding rules, the deep learning algorithm used in this example is the HL-SAC algorithm (human-in-the-loop soft actor-critic algorithm) to solve the active and reactive power optimization problem, which is improved on the basis of the standard SAC algorithm. θ (s t , a t ) as a value network, and the policy function π φ (a t |s t ) is regarded as a policy network, and the parameters of the value network and the policy network are θ and φ respectively. The policy network converts s into t Mapped to DRL action a t , the value network will (s t , a t ) is mapped to a scalar value to evaluate the action in state s t Next, perform action a t After adding the guidance rule, the HL-SAC algorithm sets up an online switching mechanism between the value network exploration action and the guidance intervention action. Under this mechanism, action a t It can be expressed as: In the above formula, a t To guide the action after intervention, σ(s t ) is a 0-1 binary variable, which is 0 when there is no intervention and 1 otherwise. Represents the action of guiding intervention, The action representing the output of the value network of the DRL algorithm. Select an optimization algorithm, such as stochastic gradient descent or Adam method. Calculate the loss function, which is usually the difference between the predicted value and the target value output by the value network and the policy network. For the value network, the loss function can be the Bellman residual; for the policy network, the loss function can be the cross entropy loss function, etc. According to the loss function and the optimization algorithm, calculate the gradient and update the parameters. For the parameters, according to the principle of gradient descent, the value of the parameter is continuously adjusted to minimize the loss function. Repeat the above acquisition step, the above execution step, the above evaluation step, the above calculation step and the above update step at least once until the above training error is less than the set error, complete the update of the parameters in the above HL-SAC algorithm, and obtain the improved HL-SAC algorithm. The above improved deep reinforcement learning algorithm is an HL-SAC algorithm including the optimal parameters, and the optimal parameters are the trained parameters obtained after updating the parameters of the value network and the parameters of the policy network.
[0077] In order to improve the accuracy of the solution of the algorithm, in an optional implementation manner, the above step S2026 includes:
[0078] Step S20261, determining a first loss function according to minimizing the Bellman residual, and determining a second loss function according to the errors of each of the above actions, wherein the first loss function is the loss function of the value network, and the second loss function is the loss function of the policy network;
[0079] Step S20262, introducing the mixed experience trajectory pool into the first loss function and the second loss function to respectively determine a first gradient and a second gradient, wherein the first gradient is the gradient of the first loss function, and the second gradient is the gradient of the second loss function;
[0080] Step S20263, updating the parameters of the value network according to the first gradient, and updating the parameters of the strategy network according to the second gradient.
[0081] In the above embodiment, the training goal of the HL-SAC algorithm is to find a strategy that maximizes the cumulative expected reward and entropy. The goal can be expressed as: In the formula, γ is the discount factor, α is the temperature parameter, α determines the relative importance of the entropy term and the reward, and E represents the expectation within all decision steps. In order to solve this expectation, we first minimize the Bellman residual to train the parameters of the value network, and determine the first loss function as follows: The parameter θ′ represents the parameter value of the target value network, V θ′ (s t+1 ) is the value function of the next state output of the policy network. The policy network can be expressed as: V θ (st )=E[Q(s t , a t )-αlog(π φ (a t |s t ))],π φ (a t |s t ) represents the policy network, Q(s t , a t ) represents the value network. And two value networks with the same structure are used to solve the overestimation problem, and the smaller estimate of the two value networks is reserved for Q(s t , a t ). The overestimation problem refers to the situation in reinforcement learning where the agent tends to choose certain actions due to overestimation of their value, thus affecting its learning and decision-making process. When using a single critic network, the value of certain actions may be overestimated, leading to the overestimation problem. To solve this problem, two value networks with the same structure are used for value estimation, which can reduce the probability of overestimation. The first loss function mentioned above can be optimized using stochastic gradient as: That is, the first gradient mentioned above, N b is the small batch experience trajectory sampled from the experience pool D. When the guidance intervenes, a t Will use , and the mini-batch experience trajectory is added to the first loss function mentioned above for update. However, if the loss function of the policy network is not changed and only the loss function of the value network is modified, it may have a negative impact on the performance of the guided intervention. This is because the value network is based on updated, while the policy network still relies on This leads to inconsistent update directions between the policy network and the value network. To solve this problem, the loss function of the policy network is defined as That is, the second loss function mentioned above, αlog(π φ (a t+1 |s t+1 )) and Q θ (s t , a t ) is calculated by the KL divergence between the expected values of the policy network and the value network, ω I is the factor that adjusts the weight of the guided intervention loss, and ||·||2 is the L2 norm, which represents the sum of the deviations of actions in each dimension. This can guide the behavior of the policy network to gradually approach human behavior, so that the update speed and direction of the policy network and the value network are consistent. Therefore, to correct π φ (a t |s t )and Therefore, the update method of the policy network parameters can be approximated as follows:
[0082] That is, the second gradient mentioned above. Therefore, based on the gradient update rules described by the first gradient and the second gradient mentioned above, the update formula of the value network parameter θ and the value network parameter φ can be expressed as: Among them, λ π and λ Q are the learning rates of the policy network and the value network, respectively, i∈{1,2} represents the number of value networks, θ i The parameters of the faster value network are updated, and the update formula of the parameters θ′ of the slower target value network is as follows: Among them, τ is a constant used to update the weights in the target network.
[0083] In another embodiment, in order to verify the beneficial effects of the present invention, scientific demonstration is performed through experiments. Figure 3 A standard test system of IEEE 33 nodes is shown. In this system, there are 3 PV power stations (photovoltaic power stations) located at nodes 14, 25, and 32, and 2 ESS (energy storage devices) located at nodes 17 and 32. Table 1 shows the configuration of PV and ESS, where the reactive output of PV can be calculated based on capacity and active power. In addition, there is a certain basic power load on each node. The active power and reactive power data of the load come from the actual power consumption in a certain area, including residential users and industrial users. The historical operation data with a resolution of 3 minutes for 365 days is selected to train and test the DRL agent.
[0084] Table 1 PV and ESS configuration parameters
[0085]
[0086] During the training phase, the HL-SAC algorithm was trained for 1000 rounds. In each round, the agent interacted with the environment for 480 decision steps. Each decision step represented exactly the 3-minute resolution of the load and PV data. Table 2 gives the hyperparameter settings of the improved deep reinforcement learning algorithm.
[0087] Table 2 Algorithm hyperparameter settings
[0088]
[0089]
[0090] Figure 4The evolution of the average cumulative discounted reward per round during the training process is shown. Due to the randomness of the DRL algorithm, three different random seeds are set in this example, and the DRL agent is trained three times. Figure 4 The mean (solid line) and variance (shaded) of this example after training are shown in . Figure 4 It can be seen from the figure that at the beginning of training, since the parameters of the policy network and the value network are randomly initialized, the policy network has not been updated at this time, so the action quality is poor, resulting in a large network loss. With the continuous update of parameters, the agent has learned a better strategy, and the average cumulative discounted reward is also increasing. The strategy of the agent is not stable from 100 to 600 rounds, which may be caused by the guidance intervention. The agent did not weigh the explored strategy and the guidance action in this process. After 600 rounds, the reward value obtained by the agent is further improved. At this time, the parameters of the strategy have been relatively fixed, and the agent has also received a higher reward and can make good actions.
[0091] Figure 5 The performance of the trained HL-SAC algorithm on a test day is shown. Figure 5 The figure shows the voltage of PV node 14 and PV-ESS node 32 in one day. It can be found that due to excessive PV power generation at noon, the voltage will exceed the upper limit without any control, while at night due to excessive load power consumption, the voltage will exceed the lower limit. The proposed deep enhancement algorithm can perfectly solve the voltage over-limit situation by controlling the reactive output of PV and the active output of ESS, which also proves the effectiveness of the proposed algorithm. Figure 6 The charging and discharging actions of two ESSs in one day are shown. It can be seen that at noon, the ESS is in a charging state to absorb excess PV power generation, while at night, most of the actions of the ESS are discharging to supply the power consumption of the load. The energy storage action proves that the proposed method can well control the charging and discharging actions of the ESS and complete the time transfer of energy, thereby reducing the active energy loss and voltage over-limit.
[0092] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0093] The embodiment of the present application also provides an optimization device for active and reactive power of a distribution network. It should be noted that the optimization device for active and reactive power of a distribution network in the embodiment of the present application can be used to execute the optimization method for active and reactive power of a distribution network provided in the embodiment of the present application. The device is used to implement the above-mentioned embodiments and preferred implementation modes, and those that have been described will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0094] The following is an introduction to the active and reactive power optimization device for the distribution network provided in an embodiment of the present application.
[0095] Figure 7 1 is a structural block diagram of a device for optimizing active and reactive power of a distribution network according to an embodiment of the present application. Figure 7 As shown, the device comprises:
[0096] The construction unit 10 is used to construct a Markov decision model of the distribution network based on the Markov decision process, wherein the Markov decision process is used to describe the process of collaboratively optimizing the active power and reactive power of the distribution network, and the Markov decision model is a model for collaboratively optimizing the active power and reactive power of the distribution network.
[0097] Specifically, the active and reactive coordinated optimization problem of distributed photovoltaic (PV) high-penetration distribution network is described as a Markov decision (MDP) model. The state space, action space, reward function and state transition process of MDP are constructed based on the Markov decision process.
[0098] The updating unit 20 is used to introduce guidance rules into the deep reinforcement learning algorithm and update the parameters in the deep reinforcement learning algorithm to obtain an improved deep reinforcement learning algorithm. The deep reinforcement learning algorithm is used to learn to make the best decision by interacting with the environment of the distribution network. The guidance rules are used to ensure that the voltage of the line nodes in the distribution network does not exceed the limit while minimizing the active power loss. The above-mentioned over-limit refers to that the above-mentioned voltage exceeds the upper voltage limit or the lower voltage limit.
[0099] Specifically, guidance rules based on voltage sensitivity are incorporated into the strategy selection process of the deep reinforcement learning algorithm, so that the strategy can ensure that the node voltage does not exceed the limit while minimizing the active power loss, and the parameters in the above-mentioned deep reinforcement learning algorithm are continuously updated to obtain an improved deep reinforcement learning algorithm. The above-mentioned improved deep reinforcement learning algorithm is a deep reinforcement learning algorithm that includes the finally trained parameters.
[0100] The solving unit 30 is used to solve the above-mentioned Markov decision model using the above-mentioned improved deep reinforcement learning algorithm to obtain a voltage regulation strategy, and adjust and control the voltage according to the above-mentioned voltage regulation strategy. The above-mentioned voltage regulation strategy is to achieve voltage regulation by coordinating and optimizing the reactive power of the photovoltaic system and the active power of the energy storage system.
[0101] Specifically, the above-mentioned improved deep reinforcement learning algorithm is used to solve the above-mentioned Markov decision model to obtain a voltage regulation strategy to cope with the real-time uncertainty of the power of distributed photovoltaic power generation and energy storage equipment, and complete the online active and reactive coordinated optimization of the distribution network. It is possible to more effectively manage and optimize the voltage and power flow in the distribution network, reducing the uncertainty and power loss caused by the distributed photovoltaic system. This not only improves the operating efficiency of the power grid, but also enhances the stability and reliability of the power grid when facing a high proportion of renewable energy access. Through precise active and reactive coordinated control, the present invention can significantly reduce the loss of electric energy during transmission.
[0102] In this embodiment, a construction unit is used to construct a Markov decision model of the distribution network based on a Markov decision process, the Markov decision process is used to describe the process of collaboratively optimizing the active power and reactive power of the distribution network, and the Markov decision model is a model for collaboratively optimizing the active power and reactive power of the distribution network; an updating unit is used to introduce a guidance rule into the reinforcement learning algorithm, and update the parameters in the reinforcement learning algorithm to obtain an improved reinforcement learning algorithm, the guidance rule is used to ensure that the voltage of the line node in the distribution network does not exceed the limit while minimizing the active power loss, and the above-mentioned limit-exceeding means that the above-mentioned voltage exceeds the upper voltage limit or the lower voltage limit; a solving unit is used to solve the Markov decision model using the improved reinforcement learning algorithm to obtain a voltage regulation strategy, and regulate and control the voltage according to the voltage regulation strategy, and the voltage regulation strategy is to achieve voltage regulation by coordinating and optimizing the reactive power of the photovoltaic system and the active power of the energy storage system. This application proposes an online active and reactive collaborative optimization framework, which uses an improved deep reinforcement learning algorithm to solve the reactive and active output strategies corresponding to the official photovoltaic system inverter and energy storage system to ensure that the strategy can meet the operating constraints of the distribution network and increase the security of the deep reinforcement learning algorithm. This application solves the problem that the safety constraints cannot be guaranteed in the process of active and reactive optimization of the distribution network in the prior art.
[0103] In order to avoid uncertainty in power flow calculation caused by uncertainty in the distribution network environment, in an optional implementation manner, the device further includes:
[0104] A first acquisition unit is used to acquire operation data of the distribution network before constructing a Markov decision model of the distribution network based on the Markov decision process, wherein the operation data at least includes the active power injection amount, reactive power injection amount and voltage amplitude of the line node of the distribution network at any time, the active power injection amount is the active power corresponding to the load injected into the line node, and the reactive power injection amount is the reactive power corresponding to the load injected into the line node;
[0105] An input-output unit, used for inputting the above-mentioned operation data into a power analysis tool, so as to use the above-mentioned power analysis tool to perform power flow calculation on the above-mentioned operation data to obtain optimized operation data, wherein the above-mentioned power analysis tool is used for performing at least power system power flow analysis and load flow;
[0106] The first determining unit is used to determine the environment for active and reactive power optimization of the distribution network according to the above-mentioned optimization operation data.
[0107] In the above embodiment, the active and reactive power coordinated optimization problem of the distributed photovoltaic high penetration distribution network is described as a Markov decision (MDP) model. In each decision step of the distribution network, each node will inject the active power and reactive power of the load, as well as the active power generation of the photovoltaic node and other variables. These variables are uncertainty variables for each decision step, and then the uncertainty of variables such as active power and reactive power will also lead to the uncertainty of the distribution network flow. Each decision step controller adjusts the active power loss and voltage condition of the distribution network by controlling the reactive power of the system photovoltaic node inverter and the active power of the energy storage node. Based on the above settings, it is necessary to first obtain the operating data of the distribution network, and then use Python's PYPOWER toolkit to build the distribution network environment. After inputting each variable, the above environment performs flow calculation through the Runpf function of the PYPOWER toolkit to obtain the optimized operating data. The environment where the above optimized operating data is located is determined as the environment for active and reactive power optimization of the distribution network.
[0108] In order to ensure the accuracy of the Markov decision process, in an optional implementation, the above-mentioned construction unit includes:
[0109] An acquisition module is provided to acquire a state space, an action space and a reward function, wherein the state space includes a plurality of states, and the states include the active power injection amount, the reactive power injection amount and the voltage amplitude of each of the line nodes of the distribution network at any time. The action space includes a plurality of actions, and the actions include the reactive output of the photovoltaic node and the active output of the energy storage node in the distribution network. The reward function is used to judge the standard of executing the actions. The photovoltaic node is a node in the line node connected to a photovoltaic power station, and the energy storage node is a node in the line node connected to an energy storage device.
[0110] A state transfer module performs a current action according to the current state to transfer the state and obtain a next state and a reward value, wherein the current state is the state at the current moment, the current state is the action selected at the current moment, the reward value is the value obtained after the current action is performed at the current moment, and the next state is the state at the next moment of the current moment;
[0111] A generation module, which forms an experience trajectory according to the current state, the current action, the next state and the reward value, wherein the experience trajectory is a state sequence formed according to the state change after the action is performed;
[0112] A construction module is used to construct the Markov decision model according to the state space, the action space, the reward function and the experience trajectory.
[0113] In the above embodiment, the state space S of the MDP is the state s that the DRL agent can observe at the decision step t. t , where s t = {P i,t , Q i,t , V i,t , i∈N},P i,t , Q i,t , V i,t They represent the net active power injection, net reactive power injection and voltage amplitude of the ith node at time t, respectively, and N is the number of line nodes in the distribution network. The action space A of MDP is the action a made by the DRL agent at the decision step t. t , where a t = {Q PV i,t , P ESS j,t , i∈N PV , j∈N Ess}, Q PV i,t represents the reactive power output of the ith photovoltaic node at time t, P ESS j,t Represents the active output of the jth energy storage node at time t. When a photovoltaic power station is configured on a line node, the line node will be used as a photovoltaic node. Similarly, when an energy storage device is configured on a line node, the line node will be used as an energy storage node. The reward function in MDP is the standard for evaluating the actions of the DRL agent and the goal of active and reactive power optimization. The above reward function is rt = -∑ ij∈ε l ij r ij , represents the negative value of active power loss, where ij represents the branch between node i and node j, ε represents the total number of branches in the distribution network, and l ijrepresents the square of the current in branch ij, r ij represents the resistance of branch ij. The DRL agent is in state s at time t. t Make an action t , action a t The reward value r is obtained by performing flow calculation in the distribution network environment. t and the state s at the next moment t+1 , this process is based on the state transition probability distribution The state transition process of each decision step will form an experience trajectory τ = {st, at, rt, s t+1}, the Markov decision model can be constructed based on the above state space, the above action space, the above reward function and the above experience trajectory.
[0114] In order to correct the infeasible action and improve the control performance, in an optional implementation, the above device further includes:
[0115] A second acquisition unit is used to acquire a first voltage sensitivity matrix and a second voltage sensitivity matrix before introducing the guidance rule into the deep reinforcement learning algorithm, wherein the first voltage sensitivity matrix is used to represent the relationship matrix between the voltage amplitude and the reactive power of the photovoltaic node, and the second voltage sensitivity matrix is used to represent the relationship matrix between the voltage amplitude and the active power of the energy storage node;
[0116] The second determination unit is used to determine a first guidance rule when the voltage value of any of the above-mentioned line nodes is greater than the voltage upper limit value. The above-mentioned first guidance rule is to correct the above-mentioned reactive power output by the above-mentioned photovoltaic node and the above-mentioned active power output by the above-mentioned energy storage node according to a first formula. The above-mentioned first formula is represents the above active power output by the above energy storage node after correction, Represents the above reactive power output by the above photovoltaic node after correction, V max Indicates the upper limit of the voltage, V min Indicates the lower limit of the voltage above, represents the above active power output by the above energy storage node before correction, represents the reactive power output by the PV node before correction, S PV represents the first voltage sensitivity matrix, S QV Denotes the second voltage sensitivity matrix, V i,a represents the voltage value of the i-th line node at time t;
[0117] The third determination unit is used to determine a second guidance rule when the voltage value of any of the above-mentioned line nodes is less than the voltage lower limit value. The above-mentioned second guidance rule is to correct the above-mentioned reactive power output by the above-mentioned photovoltaic node and the above-mentioned active power output by the above-mentioned energy storage node according to a second formula. The above-mentioned second formula is
[0118] In the above embodiment, the Markov decision model constructed in step S201 ignores the voltage constraint of the distribution network in the process of active and reactive power optimization. Therefore, it is clear to introduce a guidance rule based on voltage sensitivity to correct infeasible actions and improve control performance. For any node, the relationship between its voltage and active and reactive power can be expressed by the voltage sensitivity matrix: ΔV i,t =S PV ΔP i,t , ΔV i,t =S QV ΔQ i,t , S PV represents the voltage active sensitivity matrix, that is, the first voltage sensitivity matrix mentioned above, S QV represents the voltage reactive power sensitivity matrix, i.e., the second voltage sensitivity matrix mentioned above, ΔV i,t is the voltage deviation, ΔP i,t is the deviation of active power, ΔQ i,t is the deviation of reactive power. The controller can adjust the reactive power of photovoltaic and the active power of energy storage system according to the above relationship, aiming to correct the voltage over-limit action. When the action is executed and the node voltage exceeds the upper or lower limit, that is, V i,t >V max , V i,t <V min , the reactive power of photovoltaics and the active power of the energy storage system will be corrected according to the above-mentioned first guiding rule or the above-mentioned second guiding rule.
[0119] In order to promote the policy network in the deep reinforcement learning algorithm to learn in the direction of guided intervention, in an optional implementation, the above-mentioned device also includes:
[0120] A third acquisition unit is used to obtain a dangerous experience trajectory according to the experience trajectory in a first case before updating the parameters in the deep reinforcement learning algorithm to obtain the improved deep reinforcement algorithm, wherein the first case is a case where the voltage exceeds the limit when any one of the actions in the action space is executed;
[0121] a fourth acquisition unit, configured to obtain a safety experience trajectory according to the experience trajectory in the second case, wherein the second case is a case where the above action is performed after the above reactive power output by the above photovoltaic node and the above active power output by the above energy storage node are corrected;
[0122] The fourth determining unit is used to determine a mixed experience trajectory pool according to the dangerous experience trajectory and the safe experience trajectory.
[0123] In the above embodiment, a large number of experience trajectories need to be stored in the experience pool before updating the parameters in the deep reinforcement learning algorithm. However, the value network may not be able to learn the experience trajectories that have been manually intervened. For this reason, a mixed experience trajectory pool of dangerous and safe conversions is designed. The experience pool D can be expressed as: When the node voltage exceeds the limit, the experience pool D will store two experience trajectories D1 and D2, where D1 = {s t , a t , r t ,s t+1 ,σ(s t )=0,ifV i,t ∈[V min , V max ]}, D2={s t , a t , r t v ,s t+1 ,σ(s t )=0}∪{s t , a t , r t ,s t+1 ,σ(s t )=1,else}, D1 indicates that the execution of the action did not cause the voltage to exceed the limit, and D2 indicates that the execution of the original action caused the voltage to exceed the limit, thus applying the safety experience stored after the guidance intervention, and the reward value in the D2 experience track is modified to r t v =r t -c, where r t is the reward value when the voltage exceeds the limit, and c is a constant used to adjust the reward value when the voltage exceeds the limit. This ensures that the performance of the guided intervention is always better than the DRL action, and further promotes the strategy network to learn in the direction of the guided intervention, where the guided intervention is to execute the above-mentioned first guiding rule and the above-mentioned second guiding rule to correct the reactive power and active power.
[0124] In order to find the best parameters to improve the performance of the algorithm, in an optional implementation, the updating unit includes:
[0125] An initialization module is used to initialize value parameters and policy parameters. The value parameters are parameters that need to be updated by the value network, and the policy parameters are parameters that need to be updated by the policy network. The value network is used to map the state to the action through the mean and variance of the Gaussian distribution. The policy network is used to map the state and the action to a scalar value to evaluate the performance of executing the action under the state.
[0126] An acquisition module, used to execute the acquisition step, acquire the training state from the operating environment of the distribution network, and generate corresponding training actions through the above-mentioned value network, wherein the above-mentioned training state is the state acquired during training, and the above-mentioned training action is the action corresponding to the above-mentioned training state during the training process;
[0127] An execution module, used to execute the above execution steps, perform the above training actions, and obtain a training reward value and a next training state;
[0128] An evaluation module, used to execute the evaluation step, evaluate the training state and the next training state using the policy network, and obtain a first evaluation value and a second evaluation value respectively, wherein the first evaluation value is an evaluation value of the training state, and the second evaluation value is an evaluation value of the next training state;
[0129] A calculation module, used to execute a calculation step, and calculate a training error according to the training reward value, the first evaluation value and the second evaluation value;
[0130] The update module is used to perform the update step and update the parameters in the value network and the policy network using the stochastic gradient method;
[0131] The repeating module repeats the above acquisition step, the above execution step, the above evaluation step, the above calculation step and the above update step at least once until the above training error is less than the set error, and the parameters in the above deep reinforcement learning algorithm are updated to obtain an improved deep reinforcement learning algorithm.
[0132] In the above embodiment, based on the above guiding rules, the deep learning algorithm used in this example is the HL-SAC algorithm (human-in-the-loop soft actor-critic algorithm) to solve the active and reactive power optimization problem, which is improved on the basis of the standard SAC algorithm. θ (s t , a t ) as a value network, and the policy function π φ (a t |s t) is regarded as a policy network, and the parameters of the value network and the policy network are θ and φ respectively. The policy network converts s into t Mapped to DRL action a t , the value network will (s t , a t ) is mapped to a scalar value to evaluate the action in state s t Next, perform action a t After adding the guidance rule, the HL-SAC algorithm sets up an online switching mechanism between the value network exploration action and the guidance intervention action. Under this mechanism, action a t It can be expressed as: In the above formula, a t To guide the action after intervention, σ(s t ) is a 0-1 binary variable, which is 0 when there is no intervention and 1 otherwise. Represents the action of guiding intervention, The action representing the output of the value network of the DRL algorithm. Select an optimization algorithm, such as stochastic gradient descent or Adam method. Calculate the loss function, which is usually the difference between the predicted value and the target value output by the value network and the policy network. For the value network, the loss function can be the Bellman residual; for the policy network, the loss function can be the cross entropy loss function, etc. According to the loss function and the optimization algorithm, calculate the gradient and update the parameters. For the parameters, according to the principle of gradient descent, the value of the parameter is continuously adjusted to minimize the loss function. Repeat the above acquisition step, the above execution step, the above evaluation step, the above calculation step and the above update step at least once until the above training error is less than the set error, complete the update of the parameters in the above HL-SAC algorithm, and obtain the improved HL-SAC algorithm. The above improved deep reinforcement learning algorithm is an HL-SAC algorithm including the optimal parameters, and the optimal parameters are the trained parameters obtained after updating the parameters of the value network and the parameters of the policy network.
[0133] In order to improve the accuracy of the solution result of the algorithm, in an optional implementation manner, the above-mentioned updating module includes:
[0134] Determine a submodule, determine a first loss function according to minimizing the Bellman residual, and determine a second loss function according to the errors of each of the above actions, the first loss function is the loss function of the value network, and the second loss function is the loss function of the strategy network;
[0135] Introducing a submodule, introducing the mixed experience trajectory pool into the first loss function and the second loss function to respectively determine a first gradient and a second gradient, wherein the first gradient is the gradient of the first loss function, and the second gradient is the gradient of the second loss function;
[0136] The updating submodule updates the parameters of the value network according to the first gradient and updates the parameters of the strategy network according to the second gradient.
[0137] In the above embodiment, the training goal of the HL-SAC algorithm is to find a strategy that maximizes the cumulative expected reward and entropy. The goal can be expressed as: In the formula, γ is the discount factor, α is the temperature parameter, α determines the relative importance of the entropy term and the reward, and E represents the expectation within all decision steps. In order to solve this expectation, we first minimize the Bellman residual to train the parameters of the value network, and determine the first loss function as follows: The parameter θ′ represents the parameter value of the target value network, V θ′ (s t+1 ) is the value function of the next state output of the policy network. The policy network can be expressed as: V θ (s t )=E[Q(s t , a t )-αlog(π φ (a t |s t ))],π φ (a t |s t ) represents the policy network, Q(s t , a t ) represents the value network. And two value networks with the same structure are used to solve the overestimation problem, and the smaller estimate of the two value networks is reserved for Q(s t , a t ). The overestimation problem refers to the situation in reinforcement learning where the agent tends to choose certain actions due to overestimation of their value, thus affecting its learning and decision-making process. When using a single critic network, the value of certain actions may be overestimated, leading to the overestimation problem. To solve this problem, two value networks with the same structure are used for value estimation, which can reduce the probability of overestimation. The first loss function mentioned above can be optimized using stochastic gradient as: That is, the first gradient mentioned above, N b is the small batch experience trajectory sampled from the experience pool D. When the guidance intervenes, a t Will use , and the mini-batch experience trajectory is added to the first loss function mentioned above for update. However, if the loss function of the policy network is not changed, only the loss function of the value network may have a negative impact on the performance of the guided intervention, because the value network is based on updated, while the policy network still relies on This leads to inconsistent update directions between the policy network and the value network. To solve this problem, the loss function of the policy network is defined as That is, the second loss function mentioned above, αlog(π φ (a t+1 |s t+1 )) and Q θ (s t , a t ) is calculated by the KL divergence between the expected values of the policy network and the value network, ω I is the factor that adjusts the weight of the guided intervention loss, and ||·||2 is the L2 norm, which represents the sum of the deviations of actions in each dimension. This can guide the behavior of the policy network to gradually approach human behavior, so that the update speed and direction of the policy network and the value network are consistent. Therefore, to correct π φ (a t |s t )and Therefore, the update method of the policy network parameters can be approximated as follows:
[0138] That is, the second gradient mentioned above. Therefore, based on the gradient update rules described by the first gradient and the second gradient mentioned above, the update formula of the value network parameter θ and the value network parameter φ can be expressed as: Among them, λ π and λ Q are the learning rates of the policy network and the value network, respectively, i∈{1,2} represents the number of value networks, θ i The parameters of the faster value network are updated, and the update formula of the parameters θ′ of the slower target value network is as follows: Among them, τ is a constant used to update the weights in the target network.
[0139] In another embodiment, in order to verify the beneficial effects of the present invention, scientific demonstration is performed through experiments. Figure 3 A standard test system of IEEE 33 nodes is shown. In this system, there are 3 PV power stations (photovoltaic power stations) located at nodes 14, 25, and 32, and 2 ESS (energy storage devices) located at nodes 17 and 32. Table 1 shows the configuration of PV and ESS, where the reactive output of PV can be calculated based on capacity and active power. In addition, there is a certain basic power load on each node. The active power and reactive power data of the load come from the actual power consumption in a certain area, including residential users and industrial users. The historical operation data with a resolution of 3 minutes for 365 days is selected to train and test the DRL agent.
[0140] Table 1 PV and ESS configuration parameters
[0141]
[0142] During the training phase, the HL-SAC algorithm was trained for 1000 rounds. In each round, the agent interacted with the environment for 480 decision steps. Each decision step represented exactly the 3-minute resolution of the load and PV data. Table 2 gives the hyperparameter settings of the improved deep reinforcement learning algorithm.
[0143] Table 2 Algorithm hyperparameter settings
[0144] Parameter name Parameter Value Experience pool capacity 500000 actor network learning rate 0.0002 Critics network learning rate 0.0002 Hidden layer activation function re / u Discount Factor 0.97
[0145] Figure 4 The evolution of the average cumulative discounted reward per round during the training process is shown. Due to the randomness of the DRL algorithm, three different random seeds are set in this example, and the DRL agent is trained three times. Figure 4 The mean (solid line) and variance (shaded) of this example after training are shown in . Figure 4 It can be seen from the figure that at the beginning of training, since the parameters of the policy network and the value network are randomly initialized, the policy network has not been updated at this time, so the action quality is poor, resulting in a large network loss. With the continuous update of parameters, the agent has learned a better strategy, and the average cumulative discounted reward is also increasing. The strategy of the agent is not stable from 100 to 600 rounds, which may be caused by the guidance intervention. The agent did not weigh the explored strategy and the guidance action in this process. After 600 rounds, the reward value obtained by the agent is further improved. At this time, the parameters of the strategy have been relatively fixed, and the agent has also received a higher reward and can make good actions.
[0146] Figure 5 The performance of the trained HL-SAC algorithm on a test day is shown. Figure 5 The figure shows the voltage of PV node 14 and PV-ESS node 32 in one day. It can be found that due to excessive PV power generation at noon, the voltage will exceed the upper limit without any control, while at night due to excessive load power consumption, the voltage will exceed the lower limit. The proposed deep enhancement algorithm can perfectly solve the voltage over-limit situation by controlling the reactive output of PV and the active output of ESS, which also proves the effectiveness of the proposed algorithm. Figure 6 The charging and discharging actions of two ESSs in one day are shown. It can be seen that at noon, the ESS is in a charging state to absorb excess PV power generation, while at night, most of the actions of the ESS are discharging to supply the power consumption of the load. The energy storage action proves that the proposed method can well control the charging and discharging actions of the ESS and complete the time transfer of energy, thereby reducing the active energy loss and voltage over-limit.
[0147] The above-mentioned distribution network active and reactive power optimization device includes a processor and a memory, and the above-mentioned units are stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize the corresponding functions. The above-mentioned modules are all located in the same processor; or, the above-mentioned modules are located in different processors in any combination.
[0148] The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and the problem of the inability to ensure safety constraints in the active and reactive power optimization process of the distribution network in the prior art can be solved by adjusting kernel parameters.
[0149] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0150] An embodiment of the present invention provides a computer-readable storage medium, which includes a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute the method for optimizing active and reactive power of the distribution network.
[0151] An embodiment of the present invention provides a processor, and the processor is used to run a program, wherein the method for optimizing active and reactive power of a distribution network is executed when the program is run.
[0152] An embodiment of the present invention provides a distribution network active and reactive power optimization system, the distribution network active and reactive power optimization system includes a processor, a memory, and a program stored in the memory and executable on the processor, and when the processor executes the program, at least the following steps are implemented:
[0153] Step S201, constructing a Markov decision model of the distribution network based on a Markov decision process, wherein the Markov decision process is used to describe a process of collaboratively optimizing the active power and reactive power of the distribution network, and the Markov decision model is a model for collaboratively optimizing the active power and reactive power of the distribution network;
[0154] Step S202, introducing a guidance rule into the deep reinforcement learning algorithm, and updating the parameters in the deep reinforcement learning algorithm to obtain an improved deep reinforcement learning algorithm, wherein the deep reinforcement learning algorithm is used to learn to make the best decision by interacting with the environment of the distribution network, and the guidance rule is used to ensure that the voltage of the line node in the distribution network does not exceed the limit while minimizing the active power loss, and the above-mentioned limit-exceeding refers to the voltage exceeding the voltage upper limit or the voltage lower limit;
[0155] Step S203, using the above-mentioned improved deep reinforcement learning algorithm to solve the above-mentioned Markov decision model, obtain a voltage regulation strategy, and adjust and control the voltage according to the above-mentioned voltage regulation strategy. The above-mentioned voltage regulation strategy is to achieve voltage regulation by coordinating and optimizing the reactive power of the photovoltaic system and the active power of the energy storage system.
[0156] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program for initializing at least the following method steps:
[0157] Step S201, constructing a Markov decision model of the distribution network based on a Markov decision process, wherein the Markov decision process is used to describe a process of collaboratively optimizing the active power and reactive power of the distribution network, and the Markov decision model is a model for collaboratively optimizing the active power and reactive power of the distribution network;
[0158] Step S202, introducing a guidance rule into the deep reinforcement learning algorithm, and updating the parameters in the deep reinforcement learning algorithm to obtain an improved deep reinforcement learning algorithm, wherein the deep reinforcement learning algorithm is used to learn to make the best decision by interacting with the environment of the distribution network, and the guidance rule is used to ensure that the voltage of the line node in the distribution network does not exceed the limit while minimizing the active power loss, and the above-mentioned limit-exceeding refers to the voltage exceeding the voltage upper limit or the voltage lower limit;
[0159] Step S203, using the above-mentioned improved deep reinforcement learning algorithm to solve the above-mentioned Markov decision model, obtain a voltage regulation strategy, and adjust and control the voltage according to the above-mentioned voltage regulation strategy. The above-mentioned voltage regulation strategy is to achieve voltage regulation by coordinating and optimizing the reactive power of the photovoltaic system and the active power of the energy storage system.
[0160] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0161] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0162] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0163] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0164] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0165] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0166] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0167] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0168] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0169] From the above description, it can be seen that the above embodiments of the present application achieve the following technical effects:
[0170] 1) The optimization method of active and reactive power of the distribution network of the present application, first, a Markov decision model of the distribution network is constructed based on the Markov decision process, the Markov decision process is used to describe the process of collaborative optimization of the active power and reactive power of the distribution network, and the Markov decision model is a model for collaborative optimization of the active power and reactive power of the distribution network; then, a guidance rule is introduced into the deep reinforcement learning algorithm, and the parameters in the deep reinforcement learning algorithm are updated to obtain an improved deep reinforcement learning algorithm, the deep reinforcement learning algorithm is used to learn to make the best decision by interacting with the environment of the distribution network, and the guidance rule is used to ensure that the voltage of the line node in the distribution network does not exceed the limit while minimizing the active power loss, and the limit is that the voltage exceeds the upper voltage limit or the lower voltage limit; finally, the Markov decision model is solved by using the improved deep reinforcement learning algorithm to obtain a voltage regulation strategy, and the voltage is regulated and controlled according to the voltage regulation strategy, and the voltage regulation strategy is to achieve voltage regulation by coordinating and optimizing the reactive power of the photovoltaic system and the active power of the energy storage system. This application proposes an online active and reactive collaborative optimization framework, which uses an improved deep reinforcement learning algorithm to solve the reactive and active output strategies corresponding to the photovoltaic system inverter and energy storage system to ensure that the strategy can meet the operating constraints of the distribution network and increase the security of the deep reinforcement learning algorithm. This application solves the problem that the safety constraints cannot be guaranteed in the process of active and reactive optimization of the distribution network in the prior art.
[0171] 2) The active and reactive power optimization device of the distribution network of the present application, the construction unit is used to construct a Markov decision model of the distribution network based on the Markov decision process, the above-mentioned Markov decision process is used to describe the process of collaborative optimization of the active power and reactive power of the above-mentioned distribution network, and the above-mentioned Markov decision model is a model for collaborative optimization of the above-mentioned active power and the above-mentioned reactive power of the above-mentioned distribution network; the updating unit is used to introduce guidance rules into the reinforcement learning algorithm, and update the parameters in the above-mentioned reinforcement learning algorithm to obtain an improved reinforcement learning algorithm, the above-mentioned guidance rules are used to ensure that the voltage of the line nodes in the distribution network does not exceed the limit while minimizing the active power loss, and the above-mentioned limit exceeding is that the above-mentioned voltage exceeds the voltage upper limit or the voltage lower limit; the solving unit is used to solve the above-mentioned Markov decision model using the above-mentioned improved reinforcement learning algorithm to obtain a voltage regulation strategy, and adjust and control the voltage according to the above-mentioned voltage regulation strategy, and the above-mentioned voltage regulation strategy is to achieve voltage regulation by coordinating and optimizing the reactive power of the photovoltaic system and the active power of the energy storage system. This application proposes an online active and reactive collaborative optimization framework, which uses an improved deep reinforcement learning algorithm to solve the reactive and active output strategies corresponding to the official photovoltaic system inverter and energy storage system to ensure that the strategy can meet the operating constraints of the distribution network and increase the security of the deep reinforcement learning algorithm. This application solves the problem that the safety constraints cannot be guaranteed in the process of active and reactive optimization of the distribution network in the prior art.
[0172] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for optimizing active and reactive power of a distribution network, characterized in that: include: Constructing a Markov decision model of a distribution network based on a Markov decision process, wherein the Markov decision process is used to describe a process of collaboratively optimizing the active power and reactive power of the distribution network, and the Markov decision model is a model for collaboratively optimizing the active power and reactive power of the distribution network; Introducing guidance rules into a deep reinforcement learning algorithm, and updating parameters in the deep reinforcement learning algorithm to obtain an improved deep reinforcement learning algorithm, wherein the deep reinforcement learning algorithm is used to learn to make optimal decisions by interacting with the environment of the distribution network, and the guidance rules are used to ensure that the voltage of the line nodes in the distribution network does not exceed the limit while minimizing the active power loss, wherein the voltage exceeds the upper voltage limit or the lower voltage limit; The improved deep reinforcement learning algorithm is used to solve the Markov decision model to obtain a voltage regulation strategy, and the voltage is regulated and controlled according to the voltage regulation strategy. The voltage regulation strategy is to achieve voltage regulation by coordinating and optimizing the reactive power of the photovoltaic system and the active power of the energy storage system.
2. The method according to claim 1, characterized in that: Before constructing the Markov decision model of the distribution network based on the Markov decision process, the method further includes: Acquire operation data of the distribution network, the operation data at least including the active power injection amount, reactive power injection amount and voltage amplitude of the line node of the distribution network at any time, the active power injection amount is the active power corresponding to the load injected by the line node, and the reactive power injection amount is the reactive power corresponding to the load injected by the line node; Inputting the operating data into a power analysis tool to perform power flow calculation on the operating data using the power analysis tool to obtain optimized operating data, wherein the power analysis tool is used to perform at least power system power flow analysis and load flow; The environment for optimizing active and reactive power of the distribution network is determined according to the optimized operation data.
3. The method according to claim 1, characterized in that The Markov decision model of the distribution network is constructed based on the Markov decision process, including: Acquire a state space, an action space and a reward function, wherein the state space includes a plurality of states, wherein the states include the active power injection amount, the reactive power injection amount and the voltage amplitude of each of the line nodes of the distribution network at any time, the action space includes a plurality of actions, wherein the actions include the reactive output of the photovoltaic node and the active output of the energy storage node in the distribution network, and the reward function is used to judge the standard of executing the actions, wherein the photovoltaic node is a node in the line node connected to a photovoltaic power station, and the energy storage node is a node in the line node connected to an energy storage device; Execute the current action according to the current state to transfer the state, and obtain the next state and reward value, wherein the current state is the state at the current moment, the current state is the action selected at the current moment, the reward value is the value obtained after the current action is currently executed, and the next state is the state at the moment after the current moment; An experience track is formed according to the current state, the current action, the next state and the reward value, wherein the experience track is a state sequence formed according to state changes after executing an action; The Markov decision model is constructed according to the state space, the action space, the reward function and the experience trajectory.
4. The method according to claim 3, characterized in that Before introducing the guiding rules into the deep reinforcement learning algorithm, the method further includes: Obtain a first voltage sensitivity matrix and a second voltage sensitivity matrix, wherein the first voltage sensitivity matrix is used to represent a relationship matrix between the voltage amplitude and the reactive power of the photovoltaic node, and the second voltage sensitivity matrix is used to represent a relationship matrix between the voltage amplitude and the active power of the energy storage node; When the voltage value of any of the line nodes is greater than the voltage upper limit value, a first guidance rule is determined, wherein the first guidance rule is to correct the reactive power output by the photovoltaic node and the active power output by the energy storage node according to a first formula, wherein the first formula is: represents the corrected active power output by the energy storage node, Represents the reactive power output by the photovoltaic node after correction, V max Indicates the voltage upper limit, V min Indicates the voltage lower limit, represents the active power output by the energy storage node before correction, represents the reactive power output by the photovoltaic node before correction, S PV Denotes the first voltage sensitivity matrix, S QV Denotes the second voltage sensitivity matrix, V i,t represents the voltage value of the i-th line node at time t; When the voltage value of any of the line nodes is less than the voltage lower limit, a second guidance rule is determined, wherein the second guidance rule is to correct the reactive power output by the photovoltaic node and the active power output by the energy storage node according to a second formula, wherein the second formula is:
5. The method according to claim 4, characterized in that Before updating the parameters in the deep reinforcement learning algorithm to obtain an improved reinforcement algorithm, the method further includes: Obtaining a dangerous experience trajectory according to the experience trajectory in a first situation, wherein the first situation is a situation where the voltage exceeds the limit when any one of the actions in the action space is executed; A safety experience trajectory is obtained according to the experience trajectory in the second case, wherein the second case is a case where the action is performed after the reactive power output by the photovoltaic node and the active power output by the energy storage node are corrected; A mixed experience trajectory pool is determined according to the dangerous experience trajectory and the safe experience trajectory.
6. The method according to claim 3, characterized in that The parameters in the deep reinforcement learning algorithm are updated to obtain an improved deep reinforcement learning algorithm, including: Initialize value parameters and policy parameters, wherein the value parameters are parameters that need to be updated by the value network, and the policy parameters are parameters that need to be updated by the policy network. The value network is used to map the state to the action through the mean and variance of the Gaussian distribution, and the policy network is used to map the state and the action to a scalar value to evaluate the performance of executing the action under the state; an acquisition step, acquiring a training state from an operating environment of the distribution network, and generating a corresponding training action through the value network, wherein the training state is a state acquired during training, and the training action is an action corresponding to the training state during the training process; An execution step is to execute the training action to obtain a training reward value and a next training state; An evaluation step, using the policy network to evaluate the training state and the next training state, to obtain a first evaluation value and a second evaluation value, respectively, wherein the first evaluation value is an evaluation value of the training state, and the second evaluation value is an evaluation value of the next training state; a calculation step, calculating a training error according to the training reward value, the first evaluation value and the second evaluation value; Update step, using stochastic gradient method to update the parameters in the value network and policy network; Repeat the acquisition step, the execution step, the evaluation step, the calculation step and the update step at least once until the training error is less than the set error, and complete the updating of the parameters in the deep reinforcement learning algorithm to obtain an improved deep reinforcement learning algorithm.
7. The method according to claim 5, characterized in that The stochastic gradient method is used to update the parameters in the value network and the policy network, including: Determine a first loss function according to minimizing the Bellman residual, and determine a second loss function according to the error of each of the actions, wherein the first loss function is the loss function of the value network, and the second loss function is the loss function of the policy network; Introducing the mixed experience trajectory pool into the first loss function and the second loss function to respectively determine a first gradient and a second gradient, wherein the first gradient is the gradient of the first loss function, and the second gradient is the gradient of the second loss function; The parameters of the value network are updated according to the first gradient, and the parameters of the policy network are updated according to the second gradient.
8. A device for optimizing active and reactive power of a distribution network, characterized in that: The device comprises: A construction unit, configured to construct a Markov decision model of a distribution network based on a Markov decision process, wherein the Markov decision process is used to describe a process of collaboratively optimizing active power and reactive power of the distribution network, and the Markov decision model is a model for collaboratively optimizing the active power and reactive power of the distribution network; An updating unit, configured to introduce a guiding rule into a deep reinforcement learning algorithm and update parameters in the deep reinforcement learning algorithm to obtain an improved deep reinforcement learning algorithm, wherein the guiding rule is configured to ensure that a voltage of a line node in a distribution network does not exceed a limit while minimizing active power loss, wherein the voltage exceeds an upper voltage limit or a lower voltage limit; A solving unit is used to solve the Markov decision model using the improved deep reinforcement learning algorithm to obtain a voltage regulation strategy, and to adjust and control the voltage according to the voltage regulation strategy, wherein the voltage regulation strategy is to achieve voltage regulation by coordinating and optimizing the reactive power of the photovoltaic system and the active power of the energy storage system.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 7.
10. A computer program product comprising computer instructions, characterized in that: When the computer instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Novel power system multi-type resource coordination control method and system
CN119382249A
Dyeing process PH value self-optimization system based on multi-agent intelligent control
CN119645139A
Power system real-time low-carbon economic dispatching method and device based on parallel distributed flexible action device-evaluator, electronic equipment and storage medium
CN119651634A
Model establishment method for power distribution network node voltage control mode selection, dynamic selection method for power distribution network node voltage control mode, control system and power system
CN120675093A
