A two-stage reinforcement learning method and system for urban distribution network reconstruction operation
Through the two-stage reinforcement learning method screening and training, the problem that traditional reconstruction methods are difficult to handle high-dimensional switching action space is solved, the waste of computing resources and learning difficulty are reduced, and the efficiency and strategy optimization of dynamic reconstruction of distribution network are improved.
Patent Information
- Application Number
- CN202311811778.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-27
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2043-12-27
AI Technical Summary
The traditional model-based dynamic reconstruction method is difficult to handle the high-dimensional switching action space, resulting in slow solution speed, easy to fall into local solutions or failure to solve, and the low contribution of controllable switches in complex urban distribution networks leads to a waste of computing resources and learning The difficulty increases.
A two-stage reinforcement learning method for urban distribution network reconstruction and operation is proposed. By constructing a mathematical model and a Weighted QMIX multi-agent reinforcement learning model, switches with low contribution are screened and divided into two groups for reinforcement learning training. Centralized training, A decentralized execution approach that reduces the dimensionality of the action space and enhances awareness of important switches.
It achieves a substantial dimensionality reduction in the switching action space, improves training speed and optimization capabilities, avoids waste of computing resources, helps distribution network operators make quick decisions, and obtains optimal strategies.
Smart Images

Figure CN117748515B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of dynamic reconstruction of urban distribution networks, and in particular to a two-stage reinforcement learning method and system for reconstruction operation of urban distribution networks. Background Art
[0002] As the automation of urban distribution networks is gradually improved, reconstruction technology has begun to become a reliable means of optimizing the operation of distribution networks. By changing the topology of the distribution network to transfer the flow, it can reduce network losses and improve the economic efficiency of operation. It can also balance the loads in various regions and reduce local load losses. In addition, as the penetration rate of photovoltaics in urban distribution networks gradually increases, the use of reconstruction technology can also effectively improve the level of photovoltaic absorption.
[0003] However, as the scale of urban distribution networks grows, the number of controllable switches also increases greatly. Traditional model-based dynamic reconstruction methods are difficult to handle such a high-dimensional action space, resulting in slow solution speed, easy to fall into local solutions or even unable to solve; considering that the reinforcement learning method is directly driven by data and obtains the optimal strategy through frequent interactions with the environment, it has a strong strategy exploration ability and extremely fast solution speed. As the complexity of the environment increases, the advantages of reinforcement learning become more obvious, which can provide new ideas for the efficient solution of dynamic reconstruction strategies for complex urban distribution networks with gradually increasing scale; in addition, considering that there are a large number of controllable switches in large-scale distribution networks, but there are considerable A number of controllable switches will not actively participate in the reconstruction optimization, and may not even act during the entire scheduling cycle, that is, these switches do not contribute enough to the reconstruction optimization. However, the intelligent agent will still perform trial-and-error learning on these switches in the process of interacting with the environment, which will undoubtedly cause a huge waste of computing resources and increase the learning difficulty of the intelligent agent. Therefore, it is possible to consider abandoning these switches that do not contribute enough to the reconstruction optimization. This can not only greatly reduce the action space of the intelligent agent and increase the training speed, but also enhance the intelligent agent's perception of important switch actions and improve its optimization ability. Based on the above analysis, the reinforcement learning method for the reconstruction operation of urban distribution networks considering the contribution of switches is worthy of in-depth study. Summary of the invention
[0004] The present invention provides a two-stage reinforcement learning method for reconfiguration operation of an urban distribution network, which is used to solve the technical problem that the action space of existing distribution network switches is difficult to solve by traditional reconstruction methods.
[0005] The present invention is implemented by the following technical solution: a two-stage reinforcement learning method for reconfiguration operation of an urban distribution network, comprising the following steps:
[0006] Step 1: Construct a mathematical model for the dynamic reconstruction of the urban distribution network;
[0007] Step 2: quantify the switch contribution according to the photovoltaic absorption and power supply capacity, and then screen the switches based on the contribution value. During the reconstruction optimization, the screened switches with low contribution are ignored, thereby achieving a significant dimensionality reduction of the switch action space.
[0008] Step 3: Construct a Weighted QMIX multi-agent reinforcement learning model to deepen the agent's perception of the switch contribution, and propose a two-stage reinforcement learning framework to divide the screened switches into two groups according to the difference in contribution, and divide the reinforcement learning training process into two stages;
[0009] Step 4: Use the centralized training and decentralized execution method to train the Weighted QMIX multi-agent reinforcement learning model to obtain the optimal strategy for dynamic reconstruction operation of the urban distribution network.
[0010] Optionally, in order to better implement the present invention, the objective function of the urban distribution network dynamic reconstruction operation mathematical model is:
[0011] ;
[0012] Where: The number of hours in the cycle optimized for distribution network reconfiguration; for The amount of light abandoned at the moment; for The amount of load loss at the moment; for Network loss of the distribution network at any moment; for The number of switch operations at a given moment; , , and They are the abandoned light cost coefficient, the lost load cost coefficient, the network loss cost coefficient and the switch operation cost coefficient.
[0013] The specific calculation method of the abandoned light amount, the lost load amount, the network loss amount and the number of switch operations is as follows:
[0014] The calculation formula for the abandoned light amount is:
[0015] ;
[0016] Where: Represents the set of photovoltaic access nodes; express Time Node Photovoltaic output power; Indicated in The actual power of photovoltaic power connected to the grid at any moment;
[0017] The calculation formula of the load loss is:
[0018] ;
[0019] Where: represents the set of load-lost nodes; express Time Node Load forecast power; express The actual injection node at any time Power;
[0020] The calculation formula of the network loss is:
[0021] ;
[0022] Where: It is the collection of all branches of the distribution network; for Time branch The effective value of the current; For branch The resistance value;
[0023] The calculation formula for the number of switch operations is:
[0024] ;
[0025] Where: It is the collection of all switch branches of the distribution network; , Respectively Moment and The branch corresponding to the distribution network reconstruction at the moment The state of the upper switch, a value of 0 indicates a branch The switch is disconnected, and the value 1 indicates that the branch The switch is closed.
[0026] Optionally, in order to better implement the present invention, the constraint conditions of the dynamic reconstruction operation mathematical model of the urban distribution network include power flow constraint, safe operation constraint, reconstruction constraint, photovoltaic output constraint and load loss constraint, and the calculation formula of the power flow constraint is:
[0027] ;
[0028] ;
[0029] Where: and Respectively Inject nodes at all times Active power and reactive power; express Time Node The voltage between adjacent nodes is and ; is the voltage phase angle difference.
[0030] The calculation formula of the safe operation constraint is:
[0031] ;
[0032] ;
[0033] ;
[0034] The calculation formula of the reconstruction constraint is:
[0035] ;
[0036] ;
[0037] ;
[0038] ;
[0039] Where: Indicates the total number of branches in the grid that are always in a closed state and cannot be adjusted; To express is the set of branch terminal nodes of the initial node; Indicates The initial node set of the branch of the terminal node; Indicates the total number of system nodes; Indicates the number of substations of the optimization subject; the distribution network containing distributed photovoltaics may experience island operation under constraints, so it is necessary to supplement and inject power into non-substation nodes , and keep the nodes connected through simplified power flow constraints; express Time branch The auxiliary power flow active power on the .
[0040] The calculation formula of the photovoltaic output constraint is:
[0041] ;
[0042] Where: for Time period node The upper limit of active power output of photovoltaic power; for Time period node The lower limit of photovoltaic active output.
[0043] The calculation formula of the load loss constraint is:
[0044] ;
[0045] Where: For Node The proportionality factor of the load loss.
[0046] Optionally, in order to better implement the present invention, the switch contribution quantification method includes the following steps:
[0047] Monte Carlo simulation method Source-load samples are selected, and the phenomenon of photovoltaic abandonment and load reduction in the source-load samples is emphasized by adding noise. The mathematical model is dynamically reconstructed and operated through the urban distribution network. Source load sample generation Corresponding dynamically reconstructed switch action samples.
[0048] The substation to which the switch belongs As an environment for obtaining indicators.
[0049] For the dynamic reconstruction switch action sample, the quantitative method of photovoltaic consumption and power supply capacity improvement is put into the calculation formula as follows:
[0050] ;
[0051] ;
[0052] Where: Indicates substation All photovoltaic The proportion of photovoltaic power consumption at the time to the total power consumption, Indicates substation All load reductions on The proportion of power compensation at the moment to the total compensation; Indicates all substations PV nodes; express Photovoltaic nodes at all times of photovoltaic consumption; Indicates all substations load-loss node; express Load loss node The power compensation amount; Represents a sample of dynamic reconfiguration switch action.
[0053] To be obtained and Finally, the 24-hour photovoltaic absorption capacity and power supply capacity of the switch are quantified, and the calculation formula is as follows:
[0054] ;
[0055] ;
[0056] Where: Indicates switch exist Quantification of photovoltaic absorption capacity at each moment, Indicates switch exist The power supply capacity at the moment is quantified. Time switch If no action occurs, it is considered that the switch does not contribute to photovoltaic absorption and power supply improvement at this moment. Time switch If an action occurs, it is considered that the switch has contributed to the photovoltaic absorption and improved power supply at this moment.
[0057] Waiting to obtain the switch exist The sample obtained and After that, we accumulate them and find the average value to get The quantitative value of the photovoltaic absorption capacity and power supply improvement capacity of the switch under the sample is calculated as follows:
[0058] ;
[0059] ;
[0060] ;
[0061] Where: and Indicates based on Sample of contact switch Quantified values of photovoltaic absorption capacity and power supply improvement capacity; Indicates switch The final contribution quantified value.
[0062] After obtaining the contribution quantization values of all switches, the segment switches and tie switches are evaluated and screened respectively. The evaluation rule is: sort the contribution quantization values of the switches with a cutoff of 50%. When the contribution quantization value of the switch ranks higher than 50%, the switch is determined to be an important switch. When the contribution quantization value of the switch ranks lower than 50%, the switch is determined to be an unimportant switch. In the reconstruction optimization, the unimportant switches are ignored, that is, the unimportant segment switches are constantly closed, the unimportant tie switches are constantly open, and the action combination of the important switches is taken as the optimization object.
[0063] Optionally, in order to better implement the present invention, the calculation method of the Weighted QMIX multi-agent deep reinforcement learning model is:
[0064] A weight factor is introduced to adjust the contribution of different agents to the collective Q-value function.
[0065] for Operator, add weight function to it get:
[0066] ;
[0067] Among them, the parameters , and The update method is as follows:
[0068] (1) The loss function is:
[0069] ;
[0070] ;
[0071] (2) The loss function is:
[0072] ;
[0073] (3) The expression is:
[0074] ;
[0075] ;
[0076] By adding a weighting function, the action of each switch in the joint action space is weighted to highlight the different contributions of different switches.
[0077] Optionally, in order to better implement the present invention, a multi-agent interaction model is further included, wherein the multi-agent interaction model includes an observation space, a state space, an action space, a reward function, and a state transition probability, wherein the observation space represents the state value that each agent can observe from the environment, Moment Agent The observation space is defined as:
[0078] o n , t = [ P i , t , V i , t , I ij , t , w ij , t sw , t ], i ∈ B sub and ij ∈ Ω sub ;
[0079] Where: , , , and Respectively represent intelligent agents Substation to which the control switch belongs superior Time Node Power and voltage, branch The current and all switches The on / off status and time .
[0080] The state space represents the union of all agent observation spaces and is expressed as follows:
[0081] ;
[0082] Among them, the dynamic reconstruction problem of distribution network is set as a completely observable problem, that is, .
[0083] The action space represents the actions taken by each agent after obtaining the observation value at a certain moment. Moment Agent The action space is defined as:
[0084] a n , t = [ w ij , t sw ] ;
[0085] Where: express Moment Agent Controlled section switch The status value of .
[0086] The reward function represents a set of reward values obtained after the agent interacts with the environment. Moment Agent , the reward function is defined as:
[0087] ;
[0088] Where: , and They represent the two types of indicators mentioned in step 2, the network loss indicator and the switch action cost indicator, respectively. Indicates the penalty item for exceeding the limit.
[0089] ;
[0090] ;
[0091] ;
[0092] ;
[0093] The state transition probability P = S × A × S → [ 0 , 1 ] Describes the impact of multi-agent actions on the environment. Representing an Agent In Status Take action Transfer to state The probability that, under the current strategy The state transition probability under is:
[0094] .
[0095] Optionally, in order to better implement the present invention, the learning system includes:
[0096] A status detection module, which is used to detect real-time photovoltaic output data and real-time load demand data of the urban distribution network;
[0097] An information storage module, the information storage module is used to store data detected by the status detection module;
[0098] The switch contribution quantification module quantifies the contribution of each switch according to the photovoltaic absorption rate and load loss events, providing data basis for distribution network dispatchers to screen switches;
[0099] A switch contribution evaluation module, which is used to provide a method basis for distribution network dispatchers to screen switches;
[0100] A switch grouping module, which is used to group the screened switches to provide a basis for subsequent two-stage reinforcement learning optimization;
[0101] A multi-agent centralized training module, which is used to centrally train each agent in the two stages by sharing observation values;
[0102] The single-agent decentralized execution module independently runs each trained agent so that each agent can independently make its own reconstruction operation optimization strategy.
[0103] Compared with the prior art, the present invention has the following beneficial effects:
[0104] In the problem of distribution network reconstruction and operation optimization, the huge switch action space brought by the increasingly large-scale urban distribution network makes it difficult for traditional reconstruction methods to solve. Based on this, the present invention proposes a two-stage reinforcement learning method for urban distribution network reconstruction and operation, which can achieve a significant dimensionality reduction of the switch action space and help the multi-agent system to find the optimal nonlinear mapping between source and load data and reconstruction optimization schemes. Obtaining the decision results of the reconstruction operation scheme based on the deployed reinforcement learning model can help distribution network operators make quick decisions and avoid wasting computing resources, which has practical value. BRIEF DESCRIPTION OF THE DRAWINGS
[0105] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0106] Figure 1 It is a flow chart of the two-stage reinforcement learning method for distribution network reconstruction operation of the present invention;
[0107] Figure 2 It is a working principle diagram of the two-stage reinforcement learning system for distribution network reconstruction operation of the present invention;
[0108] Figure 3 It is a schematic diagram of selecting the research object of the present invention;
[0109] Figure 4 This is a schematic diagram of the corresponding allocation of multiple agents and switches of the present invention;
[0110] Figure 5 It is a structural diagram of the 297-node system used in the present invention;
[0111] Figure 6 This is a rendering of the method of considering switch contribution in the present invention;
[0112] Figure 7 This is a diagram showing the effect of the two-stage reinforcement learning framework verified by the present invention;
[0113] Figure 8 This is the effect diagram of the Weighted QMIX algorithm verified by the present invention;
[0114] Fig. 9 This is a comparison diagram of photovoltaic absorption effects under different methods of the present invention;
[0115] Fig.10 It is a comparison diagram of the power supply capacity improvement effect under different methods of the present invention. DETAILED DESCRIPTION
[0116] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be described in detail below. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other implementation methods obtained by ordinary technicians in this field without creative work are related to the scope of protection of the present invention for dynamic reconstruction of urban distribution network.
[0117] Embodiment 1:
[0118] This embodiment provides a two-stage reinforcement learning method for reconfiguration operation of an urban distribution network, wherein:
[0119] The two-stage reinforcement learning framework is: all switches participating in the optimization are divided into two groups, and they are sorted by the contribution of the switches. The group with higher contribution is group 1, and the group with lower contribution is group 2, with 50% as the dividing line. In the first stage, an agent is assigned to each switch in group 1, and all switches in group 2 are ignored. Their states are maintained at the action results of the previous moment. Then, the switches in group 1 are reconstructed and optimized. In this stage, the topological constraints of the distribution network do not need to be considered. The over-limit penalty in the reward function is taken from the over-limit penalty in the second stage. In the second stage, an agent is assigned to each switch in group 2, and all switches in group 1 are ignored. Their states are maintained at the action results of the first stage. Then, the switches in group 2 are reconstructed and optimized. In this stage, the topological constraints of the distribution network need to be considered.
[0120] like Figure 1As shown in the figure, a mathematical model for dynamic reconstruction and operation optimization in the context of large-scale urban distribution networks is proposed; on the basis of the mathematical model of distribution network reconstruction, the concept of switch contribution is proposed, the switch contribution is quantified from the two perspectives of photovoltaic absorption capacity and power supply capacity, and the switch is evaluated according to the contribution, and switches with low contribution are ignored during reconstruction optimization, thereby achieving a significant dimensionality reduction in the agent action space; a Weighted QMIX algorithm based on QMIX is proposed, which can assign different weights to different switch actions, so as to enhance the agent's perception of the importance of switches, and according to the difference in switch contribution obtained after screening, a two-stage reinforcement learning framework is proposed, in which the agent controls the action of switches with higher contribution in the first stage, and the agent controls the action of switches with lower contribution in the second stage, thereby avoiding the negative impact of imbalanced weight distribution of switch actions; a centralized training and decentralized execution training method is used to train the reinforcement learning model proposed in the present invention, that is, all agents share observations in the training stage, and all agents execute independently in the execution stage. After training, the optimal strategy for reconstruction and operation of urban distribution networks can be quickly obtained.
[0121] like Figure 2 As shown in the figure, the two-stage reinforcement learning system for distribution network reconstruction and operation includes a state detection module, an information storage module, a switch contribution quantification module, a switch contribution evaluation module, a switch grouping module, a multi-agent centralized training module, and a single-agent decentralized execution module. The state detection module is used to detect the real-time output data of photovoltaic power and the real-time demand data of load in the urban distribution network, and store them in the information storage module; the information storage module is used to store the historical data information of photovoltaic power and load; the switch contribution quantification module quantifies the contribution of each switch according to two types of indicators, and the result provides data basis for the distribution network dispatcher to screen the switch; the switch contribution evaluation module provides a method basis for the distribution network dispatcher to screen the switch; the switch grouping module is used to group the screened switches to provide a basis for the subsequent two-stage reinforcement learning optimization; the multi-agent centralized training module, for each agent in the two stages, is centralized for training by sharing observation values; the single-agent decentralized execution module runs each trained agent independently, and there is no interaction between the agents. Each agent independently makes its own reconstruction operation optimization strategy.
[0122] like Figure 3As shown, since different switches have different contributions, the calculation of switch contributions should be performed one by one. The present invention considers calculating the contributions of all switches in the distribution network one by one, that is, in one contribution calculation, the research object is concentrated on one switch. In the selection of contribution indicators, in view of the common problems of low photovoltaic absorption rate and frequent load loss events in large-scale distribution networks, the present invention focuses on the effect of switches on improving the photovoltaic absorption capacity and load power supply capacity of the distribution network, so the quantification method is described as follows:
[0123] (1) Use Monte Carlo method to simulate generation Source-load samples are added with noise to highlight the phenomenon of photovoltaic abandonment and load reduction in the samples. Through the model in step 1, Source load sample generation Dynamically reconstructed switch action samples corresponding to samples;
[0124] (2) Considering that the contribution of a single switch to the optimization of the entire urban distribution network is limited, and it is more reflected in the local optimization of the urban distribution network, the present invention divides the substation to which the switch belongs Rather than the entire distribution network as the environment for obtaining indicators. The quantitative method of indicators for photovoltaic consumption and power supply capacity improvement is as follows:
[0125] ;
[0126] ;
[0127] Where: Indicates substation All photovoltaic The proportion of photovoltaic power consumption at the time to the total power consumption, Indicates substation All load reductions on The proportion of power compensation at the moment to the total compensation; Indicates all substations PV nodes; express Photovoltaic nodes at all times of photovoltaic consumption; Indicates all substations load-loss node; express Load loss node The power compensation amount.
[0128] To be obtained and Finally, the 24-hour photovoltaic absorption capacity and power supply capacity of the switch are quantified as follows:
[0129] ;
[0130] ;
[0131] Where: Indicates switch exist Quantification of photovoltaic absorption capacity at each moment, Indicates switch exist The power supply capacity at the moment is quantified. Time switch If no action occurs, it is considered that the switch does not contribute to photovoltaic absorption and power supply improvement at this moment. Time switch If an action occurs, it is considered that the switch has contributed to the photovoltaic absorption and improved power supply at this moment.
[0132] Waiting to obtain the switch exist The sample obtained and After that, we accumulate them and find the average value to get The quantified values of the photovoltaic absorption capacity and power supply improvement capacity of the switch under the sample are shown in the following formula:
[0133] ;
[0134] ;
[0135] ;
[0136] Where: and Indicates based on Sample of contact switch Quantified values of photovoltaic absorption capacity and power supply improvement capacity; Indicates switch The final contribution quantified value.
[0137] (3) For the interconnecting switch between two substations, the average value is taken, and the calculation method is the same as above.
[0138] (4) After obtaining the quantitative values of the contribution of all switches, the switches need to be evaluated and screened. Considering the essential difference between section switches and tie switches, these two types of switches are evaluated separately.
[0139] The evaluation rule is: sort the contribution quantization values of the switches, with a cutoff of 50%. If the contribution quantization value of the switch ranks higher than 50%, it is considered an important switch, and if it ranks lower than 50%, it is considered an unimportant switch. In the reconstruction optimization, unimportant switches are ignored, that is, unimportant segment switches are always closed, and unimportant tie switches are always open, while the action combination of important switches is taken as the optimization object.
[0140] like Figure 4 As shown, the purpose of the dynamic reconstruction of the present invention is to obtain the optimal switch state combination scheme within 24 hours, which belongs to a sequential decision-making problem, and the decision-making scheme for the future period will not be affected by the past distribution network environment but only related to the distribution network environment in the current period. The problem of the present invention satisfies the Markov property. In addition, the optimization object can be regarded as a set of results composed of multiple independent individuals participating in the joint optimization. According to the above analysis, the distribution network dynamic reconstruction optimization problem based on multi-agent deep reinforcement learning can be transformed into a Markov model.
[0141] The Markov model is shown below:
[0142] ;
[0143] The above formula is derived from the state set , The action set of an agent , the reward function of each agent , the observation quantity of each agent and the state transition function The goal of each agent is to learn a strategy , so that the cumulative discount reward Maximum, where discount rate To balance short-term and long-term returns, is the total number of epochs for the optimization problem.
[0144] Since the optimization object can be regarded as a collection of results composed of multiple independent individuals participating in the joint optimization, and considering the important property that different switches have different contributions, the present invention assigns an agent to each switch participating in the reconstruction optimization, that is, the action space size of each agent at each moment is only 2, and the agent focuses on the action of the switch, without making action judgments on other switches. With the Weighted QMIX algorithm, this approach can improve the optimization efficiency of the model, which is more advantageous than the single agent method.
[0145] Example verification analysis:
[0146] like Figure 5As shown in the figure, the proposed method is verified by using an actual 297-node system, which consists of 2 substations, 4 transformers and 8 feeders. Substation 1 has 2 transformers T1 and T2; the low-voltage side of T1 is connected to 2 feeders S1T11 and S1T12; the low-voltage side of T2 is connected to two feeders S1T21 and S1T22. Substation 2 has two transformers T3 and T4; the low-voltage side of T3 is connected to 2 feeders S2T11 and S2T12; the low-voltage side of T4 is connected to 2 feeders S2T21 and S2T22.
[0147] like Figure 6 As shown, the effectiveness of the method of considering the switch contribution and screening the switches based on this is verified:
[0148] In order to verify the effectiveness of the method of considering switch contribution proposed in this invention, this method is compared with the method of directly optimizing without considering switch contribution, and the grouping method is the same as above. Figure 6 As shown, Figure (a) and Figure (b) are the training curves of the above two methods respectively. It should be pointed out that since the reward function of the second stage reflects the final optimization effect, the reward curves shown in the present invention are all reward curves of the second stage.
[0149] analyze Figure 6 The following conclusions can be drawn:
[0150] In the problem of the present invention, the reward curve of the method in Figure (a) can converge after 60,000 rounds of training, while the reward curve of the method in Figure (b) still cannot converge after the same rounds of training; in comparison, Figure (a) has an obvious advantage in convergence speed, and the reward curve has approached stability at about 42,000 rounds, and its reward value finally stabilizes at around -1800; while in Figure (b), not only is the jitter amplitude of the reward curve large, but it cannot converge reliably within the limited rounds, and the curve does not show a trend of convergence, and its reward value finally stays at around -2400, which indicates that within the limited rounds, the multi-agent reinforcement learning algorithm cannot efficiently optimize the dynamic reconstruction problem of the distribution network. In addition, analyzing the reward curves in the early stages of training, Figure (a) shows that the agent can learn useful strategies after about 2,000 rounds, and then the reward value begins to increase significantly. However, in Figure (b), the agent cannot explore useful strategies in the initial learning and frequently makes out-of-limit actions, so the reward curve fluctuates greatly, and the reward value does not begin to increase significantly until about 17,000 rounds.
[0151] The fundamental reason for the huge difference in the results of multi-agent reinforcement learning under the two methods lies in the difference in the joint action space of the agents. The joint action space of method (a) is the result of screening according to the contribution of switches under the premise of considering the dual improvement of photovoltaic absorption capacity and power supply capacity. Each agent controls switches that have a large contribution to the optimization of the distribution network and relatively frequent actions, so the scale of the joint action space is greatly reduced, which significantly improves the agent operation speed and model convergence speed; in addition, since the switch screening operation is a strict quantitative evaluation process, the connection between the switches will be closer, and the corresponding multi-agent coordination optimization ability will be improved, and each agent can learn better strategies more easily.
[0152] Depend on Figure 6 The analysis shows that the urban distribution network reconstruction operation model considering the switch contribution has achieved better results in both convergence speed and optimization effect, so the method proposed in the present invention is effective.
[0153] like Figure 7 As shown, the effectiveness of the two-stage reinforcement learning framework is verified:
[0154] In order to verify the effectiveness of the two-stage dynamic reconstruction method proposed in this invention, this method is compared with the method of directly performing reconstruction optimization after switch screening without considering grouping. Figure 7 As shown, Figure (a) and Figure (b) are the training curves of the above two methods respectively.
[0155] analyze Figure 7 The following conclusions can be drawn:
[0156] In the problem of the present invention, Figure 7 Both methods can converge within 60,000 rounds, and the final reward values are stable at around -1800, which shows that the method in Figure (b) can learn the optimal strategy within a limited number of rounds. However, in comparison, the method in Figure (a) not only has a smaller fluctuation in the reward value obtained during learning, but also converges much faster than the method in Figure (b), especially in the early stages of training.
[0157] The reason for the large difference in the training curves corresponding to the two methods is that the complexity of the optimization problem changes. The method proposed in the present invention adopts a two-stage dynamic reconstruction strategy, which is essentially a hierarchical reinforcement learning. It can well solve the problems of too sparse rewards, too large action space and marginal effects of multiple agents, and simplify complex problems. Compared with the control method, the method proposed in the present invention distinguishes two types of switches with large differences in contribution, and conducts two-stage reinforcement learning. While reducing the negative impact of the Weighted QMIX algorithm on the imbalance of switch weight distribution, it also greatly reduces the number of agents required for reconstruction optimization in each stage, thereby reducing the possibility of not learning excellent actions due to too sparse excellent rewards, and also avoiding the marginal effects caused by too many agents, so the difficulty of the agent to learn better strategies is also reduced.
[0158] Depend on Figure 7 The analysis shows that the method considering the two-stage reinforcement learning architecture has achieved better results in both convergence speed and optimization effect, so the method proposed in the present invention is effective.
[0159] like Figure 8 As shown, the effectiveness of the Weighted QMIX algorithm is verified:
[0160] To verify the effectiveness of the Weighted QMIX algorithm proposed in this paper, the algorithm is compared with the QMIX algorithm, QTRAN algorithm and DQN algorithm, which are also applicable to multi-agent reinforcement learning. The QMIX algorithm and QTRAN algorithm are both based on value function decomposition, while the DQN algorithm does not involve value function decomposition. For the problem of dynamic reconstruction of urban distribution networks, the performance comparison of the four methods is as follows: Figure 8 As shown in Figure (a) to (d) are the four algorithms Weighted QMIX, QMIX, QTRAN, and DQN respectively.
[0161] analyze Figure 8 The following conclusions can be drawn:
[0162] In the problem of the present invention, the three algorithms of Weighted QMIX, QMIX and QTRAN can converge within 60,000 rounds, while the convergence of DQN is very poor; Weighted QMIX has the fastest convergence speed and the highest reward value. QMIX converges at about 50,000 rounds, and the final reward value stabilizes at about -2000. QTRAN converges at about 55,000 rounds, and the final reward value stabilizes at about -2400, which is lower than Weighted QMIX and QMIX; DQN's reward curve is very unstable throughout the training cycle and is difficult to converge.
[0163] Comparing the results of (a), (b) and (c), it can be seen that the Weighted QMIX algorithm assigns different weights to different actions of each agent, further strengthening the characteristic that different switches in the distribution network have different importance. The operation of assigning weights brings great benefits to the learning of the agent, making it easier for the agent to learn better strategies. Therefore, compared with algorithms such as QMIX and QTRAN that have no concept of action weights, the Weighted QMIX algorithm not only converges faster, but also has better optimization results. In addition, it can be seen that since the constraints of the QTRAN algorithm are looser, the QTRAN algorithm converges faster than the Weighted QMIX algorithm in the early stage of training, but falls into the local optimal strategy around 30,000 rounds. Although the agent interacts with a better strategy around 43,000 rounds and gradually gets rid of the local solution, the final reward value is the lowest among the three, which shows that in the problem of the present invention, the performance of the QTRAN algorithm is poor.
[0164] Comparing the results of (a) and (d), it can be seen that the single-agent reinforcement learning method is relatively weak in dealing with the problem of the present invention and cannot converge within the limited rounds. This is because the dimension of the action space is too high and a single agent cannot cope with it. Therefore, it can be seen from the reward curve that the agent learning fluctuates greatly, converges slowly, and has poor optimization effect. In contrast, the method of assigning an agent to each switch proposed in the present invention has a more obvious effect, greatly reducing the action space of each agent. At the same time, it also eliminates the interference of other switches by relying on the cooperative reinforcement learning method, which enhances the agent's perception of the quality of the controlled switch action. Therefore, the Weighted QMIX algorithm not only converges much faster than the DQN algorithm, but also obtains a much higher reward value than the DQN algorithm.
[0165] Depend on Figure 8 The analysis shows that the Weighted QMIX algorithm has the best optimization effect and the best convergence speed, so the Weighted QMIX algorithm proposed in the present invention has the best performance.
[0166] like Fig. 9 , 10 , as shown in Table 1, verifying the effectiveness of the method proposed in the present invention compared with the traditional method:
[0167] In order to verify the performance advantage of the data-driven method proposed in the present invention over the traditional model-driven method, the method proposed in the present invention is compared with a three-level dynamic reconstruction method, a global reconstruction method based on a binary particle swarm, and a global reconstruction method based on a mathematical programming algorithm. The four types of methods headed by the method proposed in the present invention are now numbered 1 to 4 in sequence. In order to reflect the optimization effect, the operating results of the distribution network without reconstruction are added. In order to fully explore the performance of the four types of methods, the present invention sets the following operating scenarios: the photovoltaic output is large and cannot be fully absorbed, that is, the phenomenon of abandoned light occurs. At the same time, the load demand is high and exceeds the transmission capacity of the feeder, that is, the phenomenon of load loss occurs. In this scenario, the amount of abandoned light and the amount of load loss of the four types of methods are respectively as follows: Fig. 9 and Fig.10 The optimization results are shown in Table 1.
[0168] Table 1 Comparison of optimization results
[0169]
[0170] Combination Fig. 9 As shown in Table 1, compared with the non-reconfiguration operation, the four methods all significantly improved the photovoltaic absorption level. This shows that although Method 1 cannot guarantee the global optimality of the switch action due to the selection of switches, the photovoltaic absorption capacity index of the switch is quantified and the multi-agent system is fully aware of it. The photovoltaic absorption effect of Method 1 has exceeded the optimization accuracy of the global reconstruction. Compared with Methods 2, 3, and 4, the cost of abandoned light has decreased by 9.35%, 5.77%, and 2.38%, respectively. Fig.10 As can be seen from Table 1, compared with the non-reconfiguration operation, the four methods all improve the load power supply capacity. Among them, method 2 introduces the coordinated optimization of the reducible load, so the power supply capacity is improved the most. Compared with method 2, the cost of method 1 is increased by 11.24%, but lower than methods 3 and 4. This shows that the switches screened after quantifying the power supply capacity indicators of the switches can significantly enhance the agent's perception of the switch action strategy for improving the power supply capacity. Compared with methods 3 and 4, the load loss cost decreased by 56.01% and 51.46% respectively, which is a significant improvement.
[0171] As can be seen from Table 1, the network loss cost of method 1 is 2.03%, 4.57%, and 1.09% lower than that of methods 2, 3, and 4, respectively. This shows that for large-scale urban distribution networks, method 1 cannot guarantee the global optimal solution under any circumstances because of switch screening, but it also avoids large-scale switch actions, thereby reducing network loss methods; method 2 performs flexible switch hierarchical actions based on the structure of the distribution network, thereby reducing network loss costs; traditional global reconstruction methods such as methods 3 and 4 will cause numerous switch actions due to the lack of local flexibility of switches, which will bring about large-scale power flow transfer, which will not only increase the operating cost of the distribution network, but also bring operating risks. In addition, method 2 reduces the switch action dimension by determining the reconstruction level, so the solution time is much shorter than that of methods 3 and 4, but compared with method 1, the solution time of method 2 is more than 100 times slower, and as the scale of the distribution network expands, the solution speed advantage of method 1 over method 2 will further expand.
[0172] comprehensive Fig. 9 , Fig.10 Compared with the results in Table 1, the method proposed in the present invention has the best performance.
[0173] The above are only preferred embodiments of the present invention. It should be understood that the present invention is not limited to the form disclosed herein, and should not be regarded as excluding other embodiments, but can be used in various other combinations, modifications and environments, and can be modified within the scope of the present invention through the above teachings or the technology or knowledge of the relevant field. The changes and modifications made by those skilled in the art do not depart from the spirit and scope of the present invention, and should be within the scope of protection of the claims attached to the present invention.
[0174] Embodiment 2:
[0175] The learning system corresponding to the two-stage reinforcement learning method for reconstruction and operation of the urban distribution network provided in Example 1 includes a state detection module, an information storage module, a switch contribution quantification module, a switch contribution evaluation module, a switch grouping module, a multi-agent centralized training module and a single-agent decentralized execution module. The state detection module is used to detect the real-time photovoltaic output data and the real-time load demand data of the urban distribution network. The information storage module is used to store the data detected by the state detection module. The contribution of each switch is quantified according to the photovoltaic absorption rate and the load loss event to provide a data basis for the distribution network dispatching personnel to screen the switches. The switch contribution evaluation module is used to provide a method basis for the distribution network dispatching personnel to screen the switches; the switch grouping module is used to group the screened switches to provide a basis for the subsequent two-stage reinforcement learning optimization. The multi-agent centralized training module is used to centrally train each agent in the two stages by sharing observation values. The single-agent decentralized execution module independently runs each trained agent so that each agent can independently make its own reconstruction operation optimization strategy.
[0176] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope of the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A two-stage reinforcement learning method for reconfiguration of urban distribution network operation, characterized in that: The following steps are involved: Step 1: Construct a mathematical model for the dynamic reconstruction of the urban distribution network; Its function is: ; Where: The number of hours in the cycle optimized for distribution network reconfiguration; for The amount of light abandoned at the moment; for The amount of load loss at the moment; for Network loss of the distribution network at any moment; for The number of switch operations at a given moment; , , and They are the abandoned light cost coefficient, the lost load cost coefficient, the network loss cost coefficient and the switch operation cost coefficient; The specific calculation method of the abandoned light amount, the lost load amount, the network loss amount and the number of switch operations is as follows: The calculation formula for the abandoned light amount is: ; Where: Represents the set of photovoltaic access nodes; express Time Node Photovoltaic output power; Indicated in The actual power of photovoltaic power connected to the grid at any moment; The calculation formula of the load loss is: ; Where: represents the set of load-lost nodes; express Time Node Load forecast power; express The actual injection node at any time Power; The calculation formula of the network loss is: ; Where: It is the collection of all branches of the distribution network; for Time Branch The effective value of the current; For branch The resistance value; The calculation formula for the number of switch operations is: ; Where: It is the collection of all switch branches of the distribution network; , Respectively Moment and The branch corresponding to the distribution network reconstruction at the moment The state of the upper switch, a value of 0 indicates a branch The switch is disconnected, and the value 1 indicates that the branch The switch is closed; Step 2: quantify the switch contribution according to the photovoltaic absorption and power supply capacity, and then screen the switches based on the contribution value. During the reconstruction optimization, the screened switches with low contribution are ignored, thereby achieving a significant dimensionality reduction of the switch action space. Step 3: Construct a Weighted QMIX multi-agent reinforcement learning model to deepen the agent's perception of the switch contribution, and propose a two-stage reinforcement learning framework to divide the screened switches into two groups according to the difference in contribution, and divide the reinforcement learning training process into two stages; The calculation method of the Weighted QMIX multi-agent reinforcement learning model is: Introduce weight factors to adjust the contribution of different agents to the collective Q-value function; for Operator, add weight function to it get: ; Among them, the parameters , and The update method is as follows: (1) The loss function is: ; ; (2) The loss function is: ; (3) The expression is: ; ; By adding a weighting function, the action of each switch in the joint action space is weighted to highlight the different contributions of different switches; It also includes a multi-agent interaction model, which includes an observation space, a state space, an action space, a reward function, and a state transition probability. The observation space represents the state value that each agent can observe from the environment. Moment Agent The observation space is defined as: ; Where: , , , and Respectively represent intelligent agents Substation to which the control switch belongs superior Time Node Power and voltage, branch The current and all switches The on / off status and time ; The state space represents the union of all agent observation spaces and is expressed as follows: ; Among them, the dynamic reconstruction problem of distribution network is set as a completely observable problem, that is, ; The action space represents the actions taken by each agent after obtaining the observation value at a certain moment. Moment Agent The action space is defined as: ; Where: express Moment Agent Controlled section switch The status value of The reward function represents a set of reward values obtained after the agent interacts with the environment. Moment Agent , the reward function is defined as: ; Where: , and They represent the two types of indicators mentioned in step 2, the network loss indicator and the switch action cost indicator, respectively. Indicates the penalty item for exceeding the limit; ; ; ; ; The state transition probability Describes the impact of multi-agent actions on the environment. Representing an Agent In Status Take action Transfer to state The probability that, under the current strategy The state transition probability under is: ; Step 4: Use the centralized training and decentralized execution method to train the Weighted QMIX multi-agent reinforcement learning model to obtain the optimal strategy for dynamic reconstruction operation of the urban distribution network.
2. According to claim 1, a two-stage reinforcement learning method for urban distribution network reconstruction operation is characterized in that: The constraints of the dynamic reconstruction operation mathematical model of the urban distribution network include power flow constraints, safe operation constraints, reconstruction constraints, photovoltaic output constraints and load loss constraints. The calculation formula of the power flow constraints is: ; ; Where: and Respectively Inject nodes at all times Active power and reactive power; express Time Node The voltage between adjacent nodes is and ; is the voltage phase angle difference; The calculation formula of the safe operation constraint is: ; ; ; The calculation formula of the reconstruction constraint is: ; ; ; ; Where: Indicates the total number of branches in the grid that are always in a closed state and cannot be adjusted; To express is the set of branch terminal nodes of the initial node; Indicates The initial node set of the branch of the terminal node; Indicates the total number of system nodes; Indicates the number of substations of the optimization subject; the distribution network containing distributed photovoltaics may experience island operation under constraints, so it is necessary to supplement and inject power into non-substation nodes , and keep the nodes connected through simplified power flow constraints; express Time Branch Auxiliary power flow active power on The calculation formula of the photovoltaic output constraint is: ; Where: for Time period node The upper limit of active power output of photovoltaic power; for Time period node The lower limit of active power output of photovoltaic; The calculation formula of the load loss constraint is: ; Where: For Node The proportionality factor of the load loss.
3. A two-stage reinforcement learning method for urban distribution network reconstruction operation according to claim 2, characterized in that: The switch contribution quantification method comprises the following steps: Monte Carlo simulation method Source-load samples are selected, and the phenomenon of photovoltaic abandonment and load reduction in the source-load samples is emphasized by adding noise. The mathematical model is dynamically reconstructed and operated through the urban distribution network. Source load sample generation corresponding dynamically reconstructed switch action samples; the substation to which the switch belongs As an environment for obtaining indicators; For the dynamic reconstruction switch action sample, the quantitative method of photovoltaic consumption and power supply capacity improvement is put into the calculation formula as follows: ; ; Where: Indicates substation All photovoltaic The proportion of photovoltaic power consumption at the time to the total power consumption, Indicates substation All load reductions on The proportion of power compensation at the moment to the total compensation; Indicates all substations PV nodes; express Photovoltaic nodes at all times of photovoltaic consumption; Indicates all substations load-loss node; express Load loss node The power compensation amount; Represents a sample of dynamic reconfiguration switch actions; To be obtained and Finally, the 24-hour photovoltaic absorption capacity and power supply capacity of the switch are quantified, and the calculation formula is as follows: ; ; Where: Indicates switch exist Quantification of photovoltaic absorption capacity at each moment, Indicates switch exist Quantify the power supply capacity at the moment; if Time switch If no action occurs, it is considered that the switch does not contribute to photovoltaic absorption and power supply improvement at this moment. Time switch If an action occurs, it is considered that the switch has contributed to photovoltaic absorption and improved power supply at this moment; Waiting to obtain the switch exist The sample obtained and After that, we accumulate them and find the average value to get The quantitative value of the photovoltaic absorption capacity and power supply improvement capacity of the switch under the sample is calculated as follows: ; ; ; Where: and Indicates based on Sample of contact switch Quantified values of photovoltaic absorption capacity and power supply improvement capacity; Indicates switch The final contribution quantified value of After obtaining the contribution quantization values of all switches, the segment switches and tie switches are evaluated and screened respectively. The evaluation rule is: sort the contribution quantization values of the switches with a cutoff of 50%. When the contribution quantization value of the switch ranks higher than 50%, the switch is determined to be an important switch. When the contribution quantization value of the switch ranks lower than 50%, the switch is determined to be an unimportant switch. In the reconstruction optimization, the unimportant switches are ignored, that is, the unimportant segment switches are constantly closed, the unimportant tie switches are constantly open, and the action combination of the important switches is taken as the optimization object.
4. A learning system based on the two-stage reinforcement learning method for reconfiguration operation of urban distribution network according to any one of claims 1 to 3, characterized in that: include: A status detection module, which is used to detect real-time photovoltaic output data and real-time load demand data of the urban distribution network; An information storage module, the information storage module is used to store data detected by the status detection module; The switch contribution quantification module quantifies the contribution of each switch according to the photovoltaic absorption rate and load loss events, providing data basis for distribution network dispatchers to screen switches; A switch contribution evaluation module, which is used to provide a method basis for distribution network dispatchers to screen switches; A switch grouping module, which is used to group the screened switches to provide a basis for subsequent two-stage reinforcement learning optimization; A multi-agent centralized training module, which is used to centrally train each agent in the two stages by sharing observation values; The single-agent decentralized execution module independently runs each trained agent so that each agent can independently make its own reconstruction operation optimization strategy.
