A fast power control method for multi-microgrids based on multi-agent reinforcement learning
By applying multi-agent reinforcement learning methods in multi-microgrids, constructing state spaces and reward functions, and generating microgrid controllers, the problem of low sensitivity of traditional frequency regulation strategies to frequency deviation change rates is solved, and more efficient frequency stability is achieved. stability and fast power control.
Patent Information
- Application Number
- CN202410924396.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-11
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2044-07-11
AI Technical Summary
The traditional frequency regulation strategy based on synchronous generators has low sensitivity to the frequency deviation change rate, and it is difficult to effectively coordinate multiple microgrids for rapid power control, resulting in poor frequency stability.
A method based on multi-agent reinforcement learning is used to construct the state space, action space and reward function of the microgrid, build a reinforcement learning framework, generate a microgrid controller through training, and use the multi-agent flexible action assessment algorithm (MASAC) to conduct fast power control.
It improves the frequency stability and fast power control efficiency of the microgrid, enhances the sensitivity and anti-interference ability to the frequency deviation change rate, and improves the inertia level of the microgrid.
Smart Images

Figure CN118572729B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of multi-microgrid frequency control, and in particular to a multi-microgrid fast power control method, device and storage medium based on multi-agent reinforcement learning. Background Art
[0002] Due to the energy crisis in recent years, the penetration rate of renewable energy in the power system has been increasing. Microgrids containing multiple distributed power sources have been rapidly developed, especially in remote areas. The active power imbalance of the system will cause frequency fluctuations. Fast power control of microgrids is one of the important methods to solve frequency fluctuations and can effectively improve power quality.
[0003] However, the frequency stability of the entire microgrid is greatly affected by load changes, uncertainty in the output of distributed power sources, and the complexity of multi-microgrid networking. The traditional frequency regulation strategy based on synchronous generators can no longer meet the frequency stability requirements, and is less sensitive to the frequency deviation change rate, resulting in poor results in using new energy to participate in rapid power control and coordinating multiple microgrids for rapid power control. Summary of the invention
[0004] The present application provides a multi-microgrid fast power control method, device and storage medium based on multi-agent reinforcement learning, so as to improve the fast power control efficiency while improving the inertia level of the microgrid.
[0005] The present application provides a multi-microgrid fast power control method based on multi-agent reinforcement learning, which is applied to a multi-microgrid system, wherein the multi-microgrid system includes a plurality of microgrids, each of which is provided with a microgrid controller for controlling the power of the respective microgrid; each of the microgrids is connected to an external power grid or other microgrids through a tie line;
[0006] The method comprises:
[0007] Consider each microgrid as each intelligent agent;
[0008] According to the active power-frequency response model of the multi-microgrid system, the state space, action space and reward function required by each of the intelligent agents are constructed respectively;
[0009] According to the state space, action space and reward function required by each of the intelligent agents, a reinforcement learning framework is built for each of the intelligent agents;
[0010] Performing learning training on the reinforcement learning framework of each of the intelligent agents to obtain weight parameters of each of the microgrids, and generating a corresponding microgrid controller;
[0011] Each of the microgrid controllers is utilized to perform power control on a respective microgrid.
[0012] Furthermore, each of the microgrids includes a micro gas turbine, a wind turbine, energy storage, photovoltaics and a load.
[0013] Furthermore, the active power-frequency response model of the multi-microgrid system is expressed as:
[0014] ;
[0015] in, is the frequency deviation of the i-th microgrid, is the inertia time constant of the i-th microgrid, is the damping coefficient of the i-th microgrid, are the gas turbine output change, wind turbine output change, energy storage output change and photovoltaic output change of the i-th microgrid, is the load power disturbance of the i-th microgrid, is the power change of the interconnection line of the i-th microgrid, and the sign is positive when the power flows out of the microgrid.
[0016] Furthermore, the state space, action space and reward function required by each of the intelligent agents are constructed according to the active power-frequency response model of the multi-microgrid system, including:
[0017] According to the active power-frequency response model of the multi-microgrid system, the frequency deviation of each microgrid is obtained, and the frequency deviation is integrated and differentiated respectively;
[0018] According to the frequency deviation of the first microgrid, which is any microgrid in the multi-microgrid system, integrating and differentiating the frequency deviation of the first microgrid, and the gas turbine output change, wind turbine output change, energy storage output change, and photovoltaic output change of the first microgrid, a controllable power supply output change set of the first microgrid is constructed;
[0019] The expression of the controllable power output change set of the first microgrid is:
[0020] ;
[0021] in, is the set of controllable power output changes of the i-th microgrid, is the integral result of the frequency deviation of the i-th microgrid, is the result of the differentiation of the frequency deviation of the i-th microgrid;
[0022] The controllable power output change set of the first microgrid and the controllable power output change sets of other microgrids connected to the first microgrid are used as the state space of the first microgrid;
[0023] The state space expression of the first microgrid is: ;
[0024] in, is a set of controllable power output changes of other microgrids connected to the first microgrid, , is a set of controllable power output changes of the i-th microgrid connected to the first microgrid.
[0025] Furthermore, the state space, action space and reward function required by each of the intelligent agents are constructed according to the active power-frequency response model of the multi-microgrid system, and further includes:
[0026] According to the gas turbine output command value, wind turbine output command value, energy storage output command value and photovoltaic output command value of the first microgrid, a command set issued by the microgrid controller of the first microgrid to the local controllable power supply is constructed;
[0027] The expression of the instruction set issued by the microgrid controller of the first microgrid to the local controllable power supply is:
[0028] ;
[0029] in, is the set of instructions issued by the i-th microgrid controller to the local controllable power source, are the gas turbine output command value, wind turbine output command value, energy storage output command value and photovoltaic output command value of the i-th microgrid respectively;
[0030] The instruction set issued by the microgrid controller of the first microgrid to the local controllable power supply and the instruction set issued by the microgrid controllers of other microgrids connected to the first microgrid to the local controllable power supply are used as the action space of the first microgrid;
[0031] The expression of the action space of the first microgrid is: ;
[0032] in, is the action space of the i-th microgrid, A set of instructions issued by microgrid controllers of other microgrids connected to the first microgrid to the local controllable power supply, , is a set of controllable power output changes of the i-th microgrid connected to the first microgrid.
[0033] Furthermore, the state space, action space and reward function required by each of the intelligent agents are constructed according to the active power-frequency response model of the multi-microgrid system, and further includes:
[0034] According to the frequency deviation, frequency change rate, output cost of the micro gas turbine, output cost of the wind turbine, output cost of the energy storage and output cost of the photovoltaic power generation of the first microgrid, a reward function of the first microgrid is constructed. The expression of the reward function is:
[0035] ;
[0036] in, is the reward function of the i-th microgrid, are frequency deviation, frequency change rate and output cost penalty coefficient respectively, They are the output cost coefficients of micro gas turbine, wind turbine, energy storage and photovoltaic respectively.
[0037] Furthermore, according to the state space, action space and reward function required by each agent, a reinforcement learning framework for each agent is constructed, specifically:
[0038] Establishing a simulation model of a microgrid controller of a first microgrid;
[0039] The first microgrid is any microgrid in a multi-microgrid system; the simulation model of the microgrid controller of the first microgrid includes an execution network, an evaluation network, a target evaluation network and an experience recovery pool;
[0040] Among them, the execution network, the evaluation network and the target evaluation network are all deep neural networks.
[0041] Furthermore, the reinforcement learning framework of each of the intelligent agents is trained to obtain weight parameters of each of the microgrids, and a corresponding microgrid controller is generated, specifically:
[0042] Initialize the weight parameters of the execution network, evaluation network, and target evaluation network respectively;
[0043] Conduct learning and training on the weight parameters of the execution network, evaluation network, and target evaluation network;
[0044] When the number of training times reaches the preset number of training times, the training of the weight parameters of the execution network, the evaluation network and the target evaluation network is completed, and the microgrid controller of the first microgrid is obtained.
[0045] Furthermore, the weight parameters of the execution network, the evaluation network, and the target evaluation network are learned and trained, specifically:
[0046] inputting a random load disturbance into the simulation model;
[0047] Obtain the controllable power output change set and state space of the simulation model at the current moment;
[0048] According to the controllable power output change set of the simulation model, and using the execution network to execute the selected action, the reward function of the simulation model, as well as the controllable power output change set and state space of the simulation model at the next moment are obtained;
[0049] The expression of the action is: ;
[0050] is the inverse trigonometric tangent function, Is the execution network The weight coefficient is , the input is When , the value of the network output is executed. is a random variable that conforms to the normal distribution within the preset upper and lower limits;
[0051] According to the state space, action space, and reward function of the simulation model at the current moment, and the state space of the simulation model at the next moment, the experience in the experience recovery pool of the microgrid controller of the first microgrid is constructed, and stored in the experience recovery pool of the first microgrid;
[0052] Several experiences are taken out from the experience recycling pool, and the weight parameters of the execution network, the evaluation network and the target evaluation network are updated respectively to complete the training of the weight parameters of the execution network, the evaluation network and the target evaluation network.
[0053] Furthermore, a number of experiences are taken out from the experience recycling pool to update the weight parameters of the execution network, the evaluation network and the target evaluation network respectively, specifically:
[0054] The expression for updating the weight parameters of the execution network is:
[0055]
[0056] in, To execute the network The weight parameter, for The learning rate, To execute the network The loss function is Express about Find the gradient, Indicates that when executing the network The parameters are , the input is When The probability distribution of is the entropy regularization coefficient, m is the number of experiences taken out;
[0057] The expression for updating the weight parameters of the evaluation network is:
[0058]
[0059] in, To evaluate the network The weight parameter, for The learning rate, To evaluate the network The loss function is Express about Find the gradient, is the discount factor;
[0060] The expression for updating the weight parameters of the target evaluation network is:
[0061] ;
[0062] in, Evaluate the network for the target The weight parameter, The soft update value can be (0, 1).
[0063] As a preferred solution, this application proposes a multi-microgrid fast power control method based on a flexible action evaluation algorithm. It adopts a multi-agent reinforcement learning framework based on centralized training and decentralized execution (CTDE) to design a multi-agent flexible action evaluation algorithm (MASAC), and uses it in a microgrid controller to perform fast power control on multiple microgrids.
[0064] This application establishes the state space and action space of the multi-agent according to the frequency deviation of each sub-microgrid and the output of each distributed power source. Then, a reward function is established according to the frequency deviation, the frequency deviation change rate and the output cost of each power source. Through multiple learning and training, the appropriate neural network and training parameters are selected to generate a microgrid controller based on the multi-agent flexible action evaluation algorithm.
[0065] During the training process, the maximum entropy encouragement strategy exploration can achieve a greater probability of obtaining the global optimal solution. At the same time, the controller performs better than other typical controllers and has strong anti-interference ability. In addition, the MASAC algorithm can enhance the robustness of the controller, obtain the global optimal result during the learning process, and control multiple microgrids at the same time. Adding the frequency deviation change rate and power generation cost to the reward function can make the controller more sensitive to the frequency deviation change rate, and improve the efficiency of fast power control while improving the inertia level of the microgrid.
[0066] Accordingly, the present application also provides a multi-microgrid fast power control device based on multi-agent reinforcement learning, comprising: applied to a multi-microgrid system, the multi-microgrid system includes a plurality of microgrids, each of the microgrids is provided with a microgrid controller for controlling the power of the respective microgrid; each of the microgrids is connected to an external power grid or other microgrids through a tie line;
[0067] The device comprises: a calculation module, a construction module, a training module and a power control module;
[0068] The computing module is used to treat each microgrid as each intelligent agent;
[0069] According to the active power-frequency response model of the multi-microgrid system, the state space, action space and reward function required by each of the intelligent agents are constructed respectively;
[0070] The building module is used to build a reinforcement learning framework for each of the intelligent agents according to the state space, action space and reward function required by each of the intelligent agents;
[0071] The training module is used to perform learning and training on the reinforcement learning framework of each of the intelligent agents, obtain weight parameters of each of the microgrids, and generate a corresponding microgrid controller;
[0072] The power control module is used to utilize each of the microgrid controllers to perform power control on the respective microgrid.
[0073] Accordingly, the present application also provides a computer-readable storage medium, which includes a stored computer program; wherein, when the computer program is running, it controls the device where the computer-readable storage medium is located to execute a multi-microgrid rapid power control method based on multi-agent reinforcement learning as described in the content of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] Figure 1 It is a flow chart of an embodiment of a multi-microgrid fast power control method based on multi-agent reinforcement learning provided by the present application;
[0075] Figure 2 It is a schematic diagram of a fast power control model structure of a multi-microgrid system of an embodiment of a multi-microgrid fast power control method based on multi-agent reinforcement learning provided by the present application;
[0076] Figure 3 It is a flow chart of learning and training of a CTDE multi-agent reinforcement learning framework of an embodiment of a multi-microgrid fast power control method based on multi-agent reinforcement learning provided by the present application;
[0077] Figure 4 It is a structural schematic diagram of an embodiment of a multi-microgrid fast power control device based on multi-agent reinforcement learning provided in the present application. DETAILED DESCRIPTION
[0078] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions 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 are within the scope of protection of this application.
[0079] Embodiment 1
[0080] Please refer to Figure 1 , a multi-microgrid fast power control method based on multi-agent reinforcement learning provided in an embodiment of the present application is applied to a multi-microgrid system, wherein the multi-microgrid system includes a plurality of microgrids, each of which is provided with a microgrid controller for controlling the power of the respective microgrid; each of the microgrids is connected to an external power grid or other microgrids through a tie line;
[0081] The method comprises steps S101-S103:
[0082] Step S101: taking each microgrid as each intelligent agent; constructing the state space, action space and reward function required by each intelligent agent according to the active power-frequency response model of the multi-microgrid system;
[0083] Furthermore, each of the microgrids includes a micro gas turbine, a wind turbine, energy storage, photovoltaics and a load.
[0084] Please refer to Figure 2 , a schematic diagram of the fast power control model structure of a multi-microgrid system is provided. The multi-microgrid system includes n microgrids, each of which uses a MASAC fast power controller for power control to control the load, micro gas turbine, battery energy storage, photovoltaic station, wind farm and tie line power respectively.
[0085] Furthermore, the active power-frequency response model of the multi-microgrid system is expressed as:
[0086] ;
[0087] in, is the frequency deviation of the i-th microgrid, is the inertia time constant of the i-th microgrid, is the damping coefficient of the i-th microgrid, are the gas turbine output change, wind turbine output change, energy storage output change and photovoltaic output change of the i-th microgrid, is the load power disturbance of the i-th microgrid, is the power change of the interconnection line of the i-th microgrid, and the sign is positive when the power flows out of the microgrid.
[0088] In this embodiment, the i-th microgrid uses the MASAC fast power controller to send power to the micro gas turbine, battery energy storage, photovoltaic station and wind farm station respectively. , collect the change in gas turbine output of the i-th microgrid , Wind turbine output change , Energy storage output change and photovoltaic output changes and collect the load power disturbance , and the change in tie line power The frequency deviation of the i-th microgrid is calculated using the active power-frequency response model.
[0089] Further, according to the active power-frequency response model of the multi-microgrid system, the frequency deviation of each microgrid is obtained, and the frequency deviation is integrated and differentiated respectively;
[0090] According to the frequency deviation of the first microgrid, which is any microgrid in the multi-microgrid system, integrating and differentiating the frequency deviation of the first microgrid, and the gas turbine output change, wind turbine output change, energy storage output change, and photovoltaic output change of the first microgrid, a controllable power supply output change set of the first microgrid is constructed;
[0091] The expression of the controllable power output change set of the first microgrid is:
[0092] ;
[0093] in, is the set of controllable power output changes of the i-th microgrid, is the integral result of the frequency deviation of the i-th microgrid, is the result of the differentiation of the frequency deviation of the i-th microgrid;
[0094] The controllable power output change set of the first microgrid and the controllable power output change sets of other microgrids connected to the first microgrid are used as the state space of the first microgrid;
[0095] The state space expression of the first microgrid is: ;
[0096] in, is a set of controllable power output changes of other microgrids connected to the first microgrid, , is a set of controllable power output changes of the i-th microgrid connected to the first microgrid.
[0097] According to the gas turbine output command value, wind turbine output command value, energy storage output command value and photovoltaic output command value of the first microgrid, a command set issued by the microgrid controller of the first microgrid to the local controllable power supply is constructed;
[0098] The expression of the instruction set issued by the microgrid controller of the first microgrid to the local controllable power supply is:
[0099] ;
[0100] in, is the set of instructions issued by the i-th microgrid controller to the local controllable power source, are the gas turbine output command value, wind turbine output command value, energy storage output command value and photovoltaic output command value of the i-th microgrid respectively;
[0101] The instruction set issued by the microgrid controller of the first microgrid to the local controllable power supply and the instruction set issued by the microgrid controllers of other microgrids connected to the first microgrid to the local controllable power supply are used as the action space of the first microgrid;
[0102] The expression of the action space of the first microgrid is: ;
[0103] in, is the action space of the i-th microgrid, A set of instructions issued by microgrid controllers of other microgrids connected to the first microgrid to the local controllable power supply, , is a set of controllable power output changes of the i-th microgrid connected to the first microgrid.
[0104] According to the frequency deviation, frequency change rate, output cost of the micro gas turbine, output cost of the wind turbine, output cost of the energy storage and output cost of the photovoltaic power generation of the first microgrid, a reward function of the first microgrid is constructed. The expression of the reward function is:
[0105] ;
[0106] in, is the reward function of the i-th microgrid, are frequency deviation, frequency change rate and output cost penalty coefficient respectively, They are the output cost coefficients of micro gas turbine, wind turbine, energy storage and photovoltaic respectively.
[0107] Step S102: building a reinforcement learning framework for each of the intelligent agents according to the state space, action space and reward function required by each of the intelligent agents;
[0108] Furthermore, according to the state space, action space and reward function required by each agent, a reinforcement learning framework for each agent is constructed, specifically:
[0109] Establishing a simulation model of a microgrid controller of a first microgrid;
[0110] The first microgrid is any microgrid in a multi-microgrid system; the simulation model of the microgrid controller of the first microgrid includes an execution network, an evaluation network, a target evaluation network and an experience recovery pool;
[0111] Among them, the execution network, the evaluation network and the target evaluation network are all deep neural networks.
[0112] In this embodiment, the experience recovery pool Storing experiences from different periods ,in, is a piece of experience stored in the experience recycling pool of the i-th controller, For the next moment , used for subsequent reinforcement learning.
[0113] Step S103: performing learning training on the reinforcement learning framework of each of the intelligent agents to obtain weight parameters of each of the microgrids, and generating a corresponding microgrid controller;
[0114] Furthermore, the reinforcement learning framework of each of the intelligent agents is trained to obtain weight parameters of each of the microgrids, and a corresponding microgrid controller is generated, specifically:
[0115] Initialize the weight parameters of the execution network, evaluation network, and target evaluation network respectively;
[0116] Conduct learning and training on the weight parameters of the execution network, evaluation network, and target evaluation network;
[0117] When the number of training times reaches the preset number of training times, the training of the weight parameters of the execution network, the evaluation network and the target evaluation network is completed, and the microgrid controller of the first microgrid is obtained.
[0118] In this embodiment, the weight parameters of the execution network, the evaluation network, and the target evaluation network are initialized. , and , Experience Recycling Pool The data in the training set the total number of training times T. There are many initialization methods, including random initialization and initialization based on prior knowledge. This embodiment adopts random initialization and sets .
[0119] Furthermore, the weight parameters of the execution network, the evaluation network, and the target evaluation network are learned and trained, specifically:
[0120] inputting a random load disturbance into the simulation model;
[0121] Obtain the controllable power output change set and state space of the simulation model at the current moment;
[0122] According to the controllable power output change set of the simulation model, and using the execution network to execute the selected action, the reward function of the simulation model, as well as the controllable power output change set and state space of the simulation model at the next moment are obtained;
[0123] The expression of the action is: ;
[0124] is the inverse trigonometric tangent function, Is the execution network The weight coefficient is , the input is When , the value of the network output is executed. is a random variable that conforms to the normal distribution within the preset upper and lower limits;
[0125] According to the state space, action space, and reward function of the simulation model at the current moment, and the state space of the simulation model at the next moment, the experience in the experience recovery pool of the microgrid controller of the first microgrid is constructed, and stored in the experience recovery pool of the first microgrid;
[0126] Several experiences are taken out from the experience recycling pool, and the weight parameters of the execution network, the evaluation network and the target evaluation network are updated respectively to complete the training of the weight parameters of the execution network, the evaluation network and the target evaluation network.
[0127] Furthermore, a number of experiences are taken out from the experience recycling pool to update the weight parameters of the execution network, the evaluation network and the target evaluation network respectively, specifically:
[0128] The expression for updating the weight parameters of the execution network is:
[0129]
[0130] in, To execute the network The weight parameter, for The learning rate, To execute the network The loss function is Express about Find the gradient, Indicates that when executing the network The parameters are , the input is When The probability distribution of is the entropy regularization coefficient, m is the number of experiences taken out;
[0131] The expression for updating the weight parameters of the evaluation network is:
[0132]
[0133] in, To evaluate the network The weight parameter, for The learning rate, To evaluate the network The loss function is Express about Find the gradient, is the discount factor;
[0134] The expression for updating the weight parameters of the target evaluation network is:
[0135] ;
[0136] in, Evaluate the network for the target The weight parameter, The soft update value can be (0, 1).
[0137] In this embodiment, please refer to Figure 3 , a flow chart of the learning and training process of the CTDE multi-agent reinforcement learning framework, executing the network The weight parameter in is denoted as , evaluation network The weight parameter in is denoted as , target evaluation network The weight parameter in is denoted as .
[0138] Input random load disturbance into the simulation model and collect the simulation model and , execute the network according to Select Action And execute, get rewards , and the next moment and :
[0139] Decentralized Execution: Execution Network The input is , the output is , and get ; ;
[0140] Concentrated training: As an evaluation network The input is ;
[0141] When executing the network Issue , the state changes and the next step appears and , execute the network and then according to Generate the next step , then ; The target evaluation network is based on , output ;
[0142] store To the experience recycling pool. , The purpose of the inverse trigonometric tangent function is to scale the command value to between (-1, 1).
[0143] Step S104: Utilize each of the microgrid controllers to perform power control on the respective microgrid.
[0144] Implementing the embodiments of the present application has the following effects:
[0145] This application proposes a multi-microgrid fast power control method based on a flexible action evaluation algorithm. A multi-agent reinforcement learning framework based on centralized training and decentralized execution (CTDE) is adopted to design a multi-agent flexible action evaluation algorithm (MASAC), which is used in a microgrid controller to perform fast power control on multiple microgrids.
[0146] This application establishes the state space and action space of the multi-agent according to the frequency deviation of each sub-microgrid and the output of each distributed power source. Then, a reward function is established according to the frequency deviation, the frequency deviation change rate and the output cost of each power source. Through multiple learning and training, the appropriate neural network and training parameters are selected to generate a microgrid controller based on the multi-agent flexible action evaluation algorithm.
[0147] During the training process, the maximum entropy encouragement strategy exploration can achieve a greater probability of obtaining the global optimal solution. At the same time, the performance of the controller is better than other typical controllers and has a strong anti-interference ability. In addition, the MASAC algorithm can enhance the robustness of the controller, obtain the global optimal result during the learning process, and control multiple microgrids at the same time. Secondly, adding the frequency deviation change rate and power generation cost to the reward function can make the controller more sensitive to the frequency deviation change rate, and improve the efficiency of fast power control while improving the inertia level of the microgrid.
[0148] Embodiment 2
[0149] Please refer to Figure 4 , a multi-microgrid fast power control device based on multi-agent reinforcement learning provided in an embodiment of the present application is applied to a multi-microgrid system, wherein the multi-microgrid system includes a plurality of microgrids, each of which is provided with a microgrid controller for controlling the power of the respective microgrid; each of the microgrids is connected to an external power grid or other microgrids through a tie line;
[0150] The device comprises: a calculation module 201, a construction module 202, a training module 203 and a power control module 204;
[0151] The computing module is used to treat each microgrid as each intelligent agent;
[0152] According to the active power-frequency response model of the multi-microgrid system, the state space, action space and reward function required by each of the intelligent agents are constructed respectively;
[0153] The building module is used to build a reinforcement learning framework for each of the intelligent agents according to the state space, action space and reward function required by each of the intelligent agents;
[0154] The training module is used to perform learning and training on the reinforcement learning framework of each of the intelligent agents, obtain weight parameters of each of the microgrids, and generate a corresponding microgrid controller;
[0155] The power control module is used to utilize each of the microgrid controllers to perform power control on the respective microgrid.
[0156] The above-mentioned multi-microgrid fast power control device based on multi-agent reinforcement learning can implement the multi-microgrid fast power control method based on multi-agent reinforcement learning of the above-mentioned method embodiment. The options in the above-mentioned method embodiment are also applicable to this embodiment and will not be described in detail here. The rest of the contents of the embodiments of this application can refer to the contents of the above-mentioned method embodiment, and will not be repeated in this embodiment.
[0157] Embodiment 3
[0158] Accordingly, the present application also provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the multi-microgrid rapid power control method based on multi-agent reinforcement learning as described in any one of the above embodiments.
[0159] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program in the terminal device.
[0160] The terminal device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.
[0161] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the terminal device, and uses various interfaces and lines to connect various parts of the entire terminal device.
[0162] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the terminal device by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function, etc.; the data storage area can store data created according to the use of the mobile terminal, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0163] Wherein, if the module / unit integrated in the terminal device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal and software distribution medium, etc.
[0164] The specific embodiments described above further describe the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above description is only a specific embodiment of the present application and is not intended to limit the scope of protection of the present application. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of protection of the present application.
Claims
1. A fast power control method for multi-microgrids based on multi-agent reinforcement learning, It is characterized in that Applied to a multi-microgrid system, the multi-microgrid system includes a plurality of microgrids, each of which is provided with a microgrid controller for controlling the power of the respective microgrid; each of the microgrids is connected to an external power grid or other microgrids through a tie line; each of the microgrids includes a micro gas turbine, a wind turbine, energy storage, photovoltaics and a load; The method comprises: Consider each microgrid as each intelligent agent; According to the active power-frequency response model of the multi-microgrid system, the state space, action space and reward function required by each of the intelligent agents are constructed respectively; The active power-frequency response model of the multi-microgrid system is expressed as: ; in, is the frequency deviation of the i-th microgrid, is the inertia time constant of the i-th microgrid, is the damping coefficient of the i-th microgrid, are the gas turbine output change, wind turbine output change, energy storage output change and photovoltaic output change of the i-th microgrid, is the load power disturbance of the i-th microgrid, is the power change of the tie line of the i-th microgrid, and the sign is positive when the power flows out of the microgrid; s is the complex variable of Laplace transform; The state space, action space and reward function required by each of the intelligent agents are constructed respectively, specifically: The controllable power output change set of the first microgrid and the controllable power output change sets of other microgrids connected to the first microgrid are used as the state space of the first microgrid; The instruction set issued by the microgrid controller of the first microgrid to the local controllable power supply and the instruction set issued by the microgrid controllers of other microgrids connected to the first microgrid to the local controllable power supply are used as the action space of the first microgrid; According to the frequency deviation, frequency change rate, output cost of the micro gas turbine, output cost of the wind turbine, output cost of the energy storage and output cost of the photovoltaic power generation of the first microgrid, a reward function of the first microgrid is constructed. The expression of the reward function is: ; in, is the reward function of the i-th microgrid, are frequency deviation, frequency change rate and output cost penalty coefficient respectively, are the output cost coefficients of micro gas turbine, wind turbine, energy storage and photovoltaic respectively; According to the state space, action space and reward function required by each of the intelligent agents, a reinforcement learning framework is built for each of the intelligent agents; Performing learning training on the reinforcement learning framework of each of the intelligent agents to obtain weight parameters of each of the microgrids, and generating a corresponding microgrid controller; Each of the microgrid controllers is utilized to perform power control on a respective microgrid.
2. A multi-microgrid fast power control method based on multi-agent reinforcement learning as claimed in claim 1, It is characterized in that The state space, action space and reward function required by each of the intelligent agents are constructed according to the active power-frequency response model of the multi-microgrid system, including: According to the active power-frequency response model of the multi-microgrid system, the frequency deviation of each microgrid is obtained, and the frequency deviation is integrated and differentiated respectively; According to the frequency deviation of the first microgrid, which is any microgrid in the multi-microgrid system, integrating and differentiating the frequency deviation of the first microgrid, and the gas turbine output change, wind turbine output change, energy storage output change, and photovoltaic output change of the first microgrid, a controllable power supply output change set of the first microgrid is constructed; The expression of the controllable power output change set of the first microgrid is: ; in, is the set of controllable power output changes of the i-th microgrid, is the integral result of the frequency deviation of the i-th microgrid, is the result of the differentiation of the frequency deviation of the i-th microgrid; The controllable power output change set of the first microgrid and the controllable power output change sets of other microgrids connected to the first microgrid are used as the state space of the first microgrid; The state space expression of the first microgrid is: ; in, is a set of controllable power output changes of other microgrids connected to the first microgrid, , is a set of controllable power output changes of the i-th microgrid connected to the first microgrid.
3. A multi-microgrid fast power control method based on multi-agent reinforcement learning as claimed in claim 1, It is characterized in that The state space, action space and reward function required by each of the intelligent agents are constructed according to the active power-frequency response model of the multi-microgrid system, and further includes: According to the gas turbine output command value, wind turbine output command value, energy storage output command value and photovoltaic output command value of the first microgrid, a command set issued by the microgrid controller of the first microgrid to the local controllable power supply is constructed; The expression of the instruction set issued by the microgrid controller of the first microgrid to the local controllable power supply is: ; in, is the set of instructions issued by the i-th microgrid controller to the local controllable power source, are the gas turbine output command value, wind turbine output command value, energy storage output command value and photovoltaic output command value of the i-th microgrid respectively; The instruction set issued by the microgrid controller of the first microgrid to the local controllable power supply and the instruction set issued by the microgrid controllers of other microgrids connected to the first microgrid to the local controllable power supply are used as the action space of the first microgrid; The expression of the action space of the first microgrid is: ; in, is the action space of the i-th microgrid, A set of instructions issued by microgrid controllers of other microgrids connected to the first microgrid to the local controllable power supply, , is a set of controllable power output changes of the i-th microgrid connected to the first microgrid.
4. A multi-microgrid fast power control method based on multi-agent reinforcement learning as described in any one of claims 1 to 3, It is characterized in that According to the state space, action space and reward function required by each intelligent agent, a reinforcement learning framework for each intelligent agent is constructed respectively, specifically: Establishing a simulation model of a microgrid controller of a first microgrid; The first microgrid is any microgrid in a multi-microgrid system; the simulation model of the microgrid controller of the first microgrid includes an execution network, an evaluation network, a target evaluation network and an experience recovery pool; Among them, the execution network, the evaluation network and the target evaluation network are all deep neural networks.
5. A multi-microgrid fast power control method based on multi-agent reinforcement learning as claimed in claim 4, It is characterized in that The reinforcement learning framework of each of the intelligent agents is trained to obtain weight parameters of each of the microgrids and generate a corresponding microgrid controller, specifically: Initialize the weight parameters of the execution network, evaluation network, and target evaluation network respectively; Conduct learning and training on the weight parameters of the execution network, evaluation network, and target evaluation network; When the number of training times reaches the preset number of training times, the training of the weight parameters of the execution network, the evaluation network and the target evaluation network is completed, and the microgrid controller of the first microgrid is obtained.
6. A multi-microgrid fast power control method based on multi-agent reinforcement learning as claimed in claim 5, It is characterized in that The learning and training of the weight parameters of the execution network, the evaluation network, and the target evaluation network is specifically as follows: inputting a random load disturbance into the simulation model; Obtain the controllable power output change set and state space of the simulation model at the current moment; According to the controllable power output change set of the simulation model, and using the execution network to execute the selected action, the reward function of the simulation model, as well as the controllable power output change set and state space of the simulation model at the next moment are obtained; The expression of the action is: ; is the inverse trigonometric tangent function, Is the execution network The weight coefficient is , the input is When , the value of the network output is executed. is a random variable that conforms to the normal distribution within the preset upper and lower limits; According to the state space, action space, and reward function of the simulation model at the current moment, and the state space of the simulation model at the next moment, the experience in the experience recovery pool of the microgrid controller of the first microgrid is constructed, and stored in the experience recovery pool of the first microgrid; Several experiences are taken out from the experience recycling pool, and the weight parameters of the execution network, the evaluation network and the target evaluation network are updated respectively to complete the training of the weight parameters of the execution network, the evaluation network and the target evaluation network.
7. A multi-microgrid fast power control method based on multi-agent reinforcement learning as claimed in claim 6, It is characterized in that The process of taking out several pieces of experience from the experience recycling pool and updating the weight parameters of the execution network, the evaluation network and the target evaluation network respectively is as follows: The expression for updating the weight parameters of the execution network is: in, To execute the network The weight parameter, for The learning rate, To execute the network The loss function is Express about Find the gradient, Indicates that when executing the network The parameters are , the input is When The probability distribution of is the entropy regularization coefficient, m is the number of experiences taken out; is the state space of the i-th microgrid at the current moment; is the state space of the i-th microgrid at the next moment; The weight parameter of the i-th microgrid at the current moment is Evaluation network; The expression for updating the weight parameters of the evaluation network is: in, To evaluate the network The weight parameter, for The learning rate, To evaluate the network The loss function is Express about Find the gradient, is the discount coefficient; y is the intermediate quantity of the loss function; The weight parameter of the i-th microgrid at the next moment is Evaluation network; is the action space of the i-th microgrid at the next moment; Indicates that when executing the network The parameters are , the input is When The probability distribution of is the set of controllable power output changes of the i-th microgrid connected to the first microgrid at the next moment; is the set of instructions issued by the i-th microgrid controller to the local controllable power source at the next moment; The expression for updating the weight parameters of the target evaluation network is: ; in, Evaluate the network for the target The weight parameter, The soft update value can be (0, 1).
