Mobile micro-grid energy supplement strategy optimization method and system
By treating mobile microgrids as agents in a Markov decision process, a state space and reward function are designed, and the agent is trained using the DQN algorithm to optimize the energy replenishment strategy. This solves the problems of power system complexity and stability in energy replenishment of mobile microgrids, and achieves stability and cost optimization of energy replenishment.
Patent Information
- Application Number
- CN202310750126.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-21
- Publication Date
- 2026-11-20
- Estimated Expiration
- 2043-06-21
AI Technical Summary
Existing technologies fail to effectively consider the internal complexity of the power system in mobile microgrid energy replenishment strategies, resulting in large power fluctuations that affect the stability of the port power system, and also fail to balance energy replenishment costs with grid operation stability.
The mobile microgrid is treated as an agent in a Markov decision process. A state space, action space, and reward function are designed. The agent is trained using the DQN algorithm to optimize the energy replenishment strategy. Intelligent energy replenishment scheduling is achieved through deep reinforcement learning. The energy replenishment process is optimized by combining the SOC lower limit, energy replenishment cost, and reward function of grid power fluctuation.
It improves the adaptability of mobile microgrids to complex factors in the power system, realizes the stability and cost optimization of the energy replenishment process, and enhances the stability and flexibility of grid operation.
Smart Images

Figure CN116683513B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of electrical engineering and computer science, specifically to an optimization method and system for energy replenishment strategies in mobile microgrids. Background Technology
[0002] The electrification of transportation vehicles is an important part of the energy transition process. As a mobile microgrid, the energy replenishment process of electrified transportation vehicles involves many complex factors and cannot be controlled manually alone. It requires intelligent algorithms for automated control.
[0003] Currently, most research on optimization methods for mobile microgrid energy replenishment strategies focuses on electric vehicles, only addressing the energy replenishment process between electric vehicles and charging stations, without considering the complexity of the energy replenishment service provider's internal system. For electrified ships, the port power system providing energy replenishment services has complex operating states and components. Considering only an idealized charging station model not only fails to realize the potential for collaborative optimization but also easily causes significant power fluctuations, negatively impacting the stability of the port power system. Therefore, optimization methods for mobile microgrid energy replenishment strategies need to enhance their adaptability to complex power systems.
[0004] Existing comparative literature: Li Hang, Li Guojie, Wang Keyou. Real-time scheduling strategy for electric vehicles based on deep reinforcement learning [J]. Automation of Electric Power Systems, 2020, 44(22):161-167. Technical comparison: This literature proposes an energy replenishment strategy optimization method based on deep reinforcement learning for vehicle microgrids. This literature proposes an optimization method for electric vehicles that takes into account both energy replenishment cost and grid operation stability. However, this method assumes that the battery parameters of the microgrid are uniform constants and does not take into account the complex factors inside the power system that provides energy replenishment services, so it cannot be applied to the optimization of mobile microgrids such as electrified ships.
[0005] Existing comparative literature: Wei Z, Li Y, Cai L. Electric vehicle charging scheme for a park-and-charge system considering battery degradation costs[J]. IEEE Transactions on Intelligent Vehicles, 2018, 3(3): 361-373. Technical comparison: This literature designs an optimization method for the energy replenishment strategy of electric vehicles through mathematical programming. This method establishes a battery loss model, focusing on improving the battery life of electric vehicles. However, this literature does not consider the optimization needs of the power system providing energy replenishment services. When a large number of mobile microgrids are replenishing energy at the same time, it may lead to a serious negative impact on the operational stability of the power system.
[0006] Existing relevant comparative literature: Zhao Z, Lee CK M. Dynamic pricing for EV charging stations: A deep reinforcement learning approach[J]. IEEE Transactions on Transportation Electrification, 2021, 8(2): 2456-2468. Technical comparison: Key technical points comparison: This literature studies the optimization method of energy replenishment strategy for electric vehicles based on deep reinforcement learning. This literature takes into account the queuing process in the energy replenishment process of the vehicle, proposes the concept of "service quality" by comprehensively considering indicators such as queuing time, and designs an optimization method with service quality as the optimization objective using the Actor-Critic algorithm. However, this literature does not consider the optimization needs of the power system that provides energy replenishment services, and the Actor-Critic algorithm has disadvantages such as slow training and high model convergence difficulty compared with the DQN algorithm. Summary of the Invention
[0007] To address the shortcomings of existing technologies, this invention provides an optimization method and system for energy replenishment strategies in mobile microgrids.
[0008] According to the present invention, a method and system for optimizing energy replenishment strategies for mobile microgrids are provided, the scheme of which is as follows:
[0009] Firstly, a method for optimizing energy replenishment strategies for mobile microgrids is provided, the method comprising:
[0010] Characterizing the energy replenishment steps of a mobile microgrid: The mobile microgrid is regarded as an intelligent agent in a Markov decision process. Based on the Markov decision process, the state space, action space and reward function of intelligent energy replenishment regulation of the mobile microgrid are designed, and the energy replenishment power of the mobile microgrid is regarded as the action to be decided.
[0011] The optimization steps for training the energy replenishment strategy of a mobile microgrid are as follows: The mobile microgrid agent is trained using the DQN algorithm to obtain the optimal value function. The agent selects the action with the highest value based on its current state to obtain the optimal strategy.
[0012] The steps for deploying and training a mobile microgrid energy replenishment strategy are as follows: Based on the trained mobile microgrid agent, select the energy replenishment power according to the optimal value function obtained from the training, and realize the intelligent energy replenishment strategy of the mobile microgrid.
[0013] Preferably, the state-space design in the energy replenishment step of the mobile microgrid includes: pre-calculating the lower limit of the SOC of the energy storage battery at each moment required to meet the energy replenishment needs of the microgrid, and ensuring that the SOC will not fall below the lower limit during the energy replenishment process, thereby ensuring that the energy replenishment needs of the mobile microgrid are met when it leaves.
[0014] The lower limit of SOC is calculated as follows:
[0015]
[0016] Among them, e t,i Let t be the SOC of the energy storage battery of the i-th mobile microgrid at time t. a,i and t l,i The start and predetermined end times for replenishing energy to the i-th mobile microgrid. and P represents the actual charging efficiency and actual discharging efficiency of the i-th mobile microgrid, respectively. i dis,max and P i ch,max Let be the maximum discharge power and maximum charging power that the i-th mobile microgrid energy storage battery can withstand, respectively, and let Δt be the time interval between adjacent moments, c. i Let e be the energy storage battery capacity of the i-th mobile microgrid. i min e represents the minimum safety limit of the SOC of the i-th mobile microgrid energy storage battery. target,i Let S be the target SOC of the energy storage battery that the i-th mobile microgrid is expected to achieve upon departure;
[0017] The state space is defined as follows:
[0018]
[0019] Among them, s t,i Let t be the set of state variables of the i-th mobile microgrid at time t, where t is the current time. stay,i For the remaining energy replenishment time of the i-th mobile microgrid, P t,i sp Let p be the shore power load generated at time t when the i-th mobile microgrid is connected to the power system. ch,t Let P be the electricity price at time t. t RE P represents the total renewable energy output of the power system at time t. t L Let n be the normal load power of the power system at time t. b,t Let t be the total number of mobile microgrids that are being recharged at time t.
[0020] Preferably, the action space design in the energy replenishment step of the mobile microgrid includes: setting the energy replenishment power of the mobile microgrid as the action variable to be decided, and discretizing the charging and discharging power into several levels for selection, wherein positive values represent energy absorption from the power system and negative values represent energy release to the power system, and the action space is defined as follows:
[0021]
[0022] Among them, A t Let a be the action performed by the agent at time t. t,i Let P be the action variable of the i-th mobile microgrid at time t. t,i ch Let be the charging power of the i-th mobile microgrid at time t, and I be the set of serial numbers of all mobile microgrids connected to the power system.
[0023] Preferably, the reward function design in the energy replenishment step characterizing the mobile microgrid includes:
[0024] For the optimization objective of meeting energy replenishment requirements, the lower bound of SOC at each time step is calculated. However, during training, the action decisions made by the DQN algorithm may cause the SOC to fall below this lower bound or exceed the safety upper bound, requiring action correction. The correction formula is as follows:
[0025]
[0026] Among them, e i max e represents the maximum State of Charge (SOC) limit specified for the energy storage battery of the i-th mobile microgrid to ensure safe power replenishment. t,i Let c be the SOC of the energy storage battery of the i-th mobile microgrid at time t. iLet be the energy storage battery capacity of the i-th mobile microgrid. Let e be the actual charging efficiency of the i-th mobile microgrid. t+1.i pred For the i-th ship, due to uncorrected action a t,i The expected SOC at time t+1 is obtained. The correlation coefficient for ship charging and discharging efficiency, when e t,i <e t+1,i th,low hour otherwise
[0027] To guide the agent in selecting action amounts between the upper and lower limits, the difference between the action amounts before and after correction is calculated, and the negative of its absolute value is used as the action exceeding the limit reward function value. This negative reward value forces the agent to decide on action values that do not exceed the limits. The formula for the action exceeding the limit reward function is as follows:
[0028]
[0029] For the optimization objective of reducing energy replenishment costs, the negative of the replenishment cost is directly used as the reward function. The cost incurred when charging the mobile microgrid corresponds to a negative reward value, while the revenue earned when selling electricity corresponds to a positive reward value. The formula for the energy replenishment cost reward function is as follows:
[0030]
[0031] To optimize the goal of reducing grid power fluctuations, and to measure the contribution of mobile microgrids as virtual energy storage, the average value of exchange power data for each time period throughout the day is needed as a benchmark. The exchange power before the daytime energy replenishment power of mobile microgrids is taken into account. The specific calculation formula is as follows:
[0032]
[0033] in, For the exchange power of the mobile microgrid at time t of the previous day, neglecting the charging and discharging power of the mobile microgrid, P t L ,before This represents the load power within the power system providing energy replenishment services at time t of the previous day. For the total microgrid power load at time t of the previous day, excluding the mobile microgrid energy replenishment process, P t RE,before P represents the total renewable energy generation capacity within the power system that provides energy replenishment services at time t of the previous day. t ST,beforeP represents the output power of the energy storage power station within the power system that provides energy replenishment services at time t of the previous day. t,i sp,before The power system that provides energy replenishment services for the previous day at time t provides shore load power, P, to the power system equipped with the i-th mobile microgrid. t,j ch,before The power system providing energy replenishment services at time t of the previous day is the load power generated by the j-th energy storage battery swapped from the mobile microgrid, I. before J is the set of serial numbers of all mobile microgrids connected to the power system on the previous day. before This is the set of serial numbers of all energy storage batteries that were swapped out of the mobile microgrid on the previous day.
[0034] When measuring power fluctuations, the daily average value of the switching power of mobile microgrids (excluding the day-ahead average) is selected, and the difference is calculated between this average and the switching power at time t on the current day to measure the fluctuating power. The formula for calculating the fluctuating power, excluding the output of energy storage stations, is as follows:
[0035]
[0036] Among them, P t MG,nonST The grid exchange power at time t on that day, excluding the output of the energy storage power station;
[0037] The energy storage power station will determine its output after the intelligent agent makes a decision. The aim is to further minimize power fluctuations based on the output of the mobile microgrid. The output power calculation formula for the energy storage power station is as follows:
[0038]
[0039] Among them, E t,k ST Let η be the energy storage capacity of the k-th battery in the energy storage station at time t. ch,k and η dis,k c represents the charging efficiency and discharging efficiency of the k-th battery in the energy storage power station, respectively. k ST Let be the capacity of the k-th battery in the energy storage power station;
[0040] After obtaining the output of the energy storage power station, the formula for calculating the fluctuating power of the energy storage power station output is as follows:
[0041] P t f =P t f,nonST -P t ST
[0042] The formula for the power fluctuation reward function is as follows:
[0043]
[0044] Taking into account the over-limit reward function, the power replenishment cost reward function, and the power fluctuation reward function, the formula for the total reward function is as follows:
[0045] r t =σ exceed r t exceed +σ cost r t cost +σ fluc r t fluc
[0046] Where, σ exceed σ cost σ fluc These are the weighting coefficients for the action exceeding the limit reward function, the power replenishment cost reward function, and the power fluctuation reward function, respectively. The larger the coefficient, the more important the optimization objective corresponding to that reward function is.
[0047] Preferably, the optimization step of training the mobile microgrid energy replenishment strategy includes:
[0048] Neural networks are used to evaluate the action value function, and the DQN algorithm is used to train the mobile microgrid agent in order to gradually approach the optimal action value function and the optimal strategy through iteration.
[0049] The DQN algorithm introduces the current network Q(s,a,ω) and the target network... The target network is responsible for calculating the action value of the next state, while the current network is used to calculate the value of each action in the current state. The loss function after introducing the target network is as follows:
[0050]
[0051] Where M is the number of samples, R k Let γ be the reward value for the k-th sample, and γ be the discount factor. For the target network in state S k The value of taking action a, Q(S) k A k ,ω) represents the current state of the network in state S. k Take action A k The value of.
[0052] Preferably, the basic process of the DQN algorithm is as follows:
[0053] Step a: Randomly select parameters to initialize the current network Q(s,a,ω) and the target network.
[0054] Step b: Initialize the experience replay pool;
[0055] Step c: Begin a new interaction sequence and execute steps d through n;
[0056] Step d: Obtain the initial state S1 of the current sequence;
[0057] Step e: For each time step t = 1 → T in the sequence, execute steps f to m;
[0058] Step f: Derive the current state S from the current network. t The value of the action is determined, and the action A to be executed is selected by the ∈-greedy strategy. t The ∈-greedy strategy sets an ∈ value, randomly selects an action to be executed with a probability of ∈, and selects the action with the highest value with a probability of 1-∈.
[0059] Step g: Perform action A t Afterwards, you will receive reward R. t Transition to the next state S t+1 ;
[0060] Step h: Transfer the state transition sample (S) t A t ,R t ,S t+1 Stored in the experience replay pool;
[0061] Step i: If the number of samples in the experience replay pool exceeds a certain number, then proceed to steps j to l;
[0062] Step j: Randomly sample N samples from the experience replay pool;
[0063] Step k: Calculate the loss function from the sampled samples.
[0064] Step 1: Minimize the loss function value using gradient descent and update the parameters of the current network Q(s,a,ω) with a step size β;
[0065] Step m: At regular intervals, the target network is... Synchronize parameters with the current network Q(s,a,ω);
[0066] Step n: Return to step e until the termination state of the interaction sequence;
[0067] Step o: Return to step c until all interaction sequences have been executed;
[0068] After training the mobile microgrid agent using the DQN algorithm, the optimal value function is obtained. The agent selects the action with the highest value based on its current state, thus obtaining the optimal strategy.
[0069] Secondly, a mobile microgrid energy replenishment strategy optimization system is provided, the system comprising:
[0070] The energy replenishment module characterizes the mobile microgrid: the mobile microgrid is regarded as an intelligent agent in the Markov decision process. Based on the Markov decision process, the state space, action space and reward function of the intelligent energy replenishment regulation of the mobile microgrid are designed, and the energy replenishment power of the mobile microgrid is regarded as the action to be decided.
[0071] Training the mobile microgrid energy replenishment strategy optimization module: The mobile microgrid agent is trained using the DQN algorithm to obtain the optimal value function. The agent selects the action with the highest value based on its current state to obtain the optimal strategy.
[0072] Deployment and training of mobile microgrid energy replenishment strategy module: Based on the trained mobile microgrid agent, the energy replenishment power is selected according to the optimal value function obtained from the training, thereby realizing an intelligent energy replenishment strategy for the mobile microgrid.
[0073] Preferably, the state-space design in the energy replenishment module characterizing the mobile microgrid includes: pre-calculating the lower limit of the SOC of the energy storage battery at each moment required to meet the energy replenishment needs of the microgrid, and ensuring that the SOC will not fall below the lower limit during the energy replenishment process, thereby ensuring that the energy replenishment needs of the mobile microgrid are met when it leaves.
[0074] The lower limit of SOC is calculated as follows:
[0075]
[0076] Among them, e t,i Let t be the SOC of the energy storage battery of the i-th mobile microgrid at time t. a,i and t l,i The start and predetermined end times for replenishing energy to the i-th mobile microgrid. and P represents the actual charging efficiency and actual discharging efficiency of the i-th mobile microgrid, respectively. i dis,max and P i ch,max Let be the maximum discharge power and maximum charging power that the i-th mobile microgrid energy storage battery can withstand, respectively, and let Δt be the time interval between adjacent moments, c. i Let e be the energy storage battery capacity of the i-th mobile microgrid. imin e represents the minimum safety limit of the SOC of the i-th mobile microgrid energy storage battery. target,i Let S be the target SOC of the energy storage battery that the i-th mobile microgrid is expected to achieve upon departure;
[0077] The state space is defined as follows:
[0078]
[0079] Among them, s t,i Let t be the set of state variables of the i-th mobile microgrid at time t, where t is the current time. stay,i For the remaining energy replenishment time of the i-th mobile microgrid, P t,i sp Let p be the shore power load generated at time t when the i-th mobile microgrid is connected to the power system. ch,t Let P be the electricity price at time t. t RE P represents the total renewable energy output of the power system at time t. t L Let n be the normal load power of the power system at time t. b,t The total number of mobile microgrids that are being recharged at time t;
[0080] The action space design in the energy replenishment module characterizing the mobile microgrid includes: setting the mobile microgrid energy replenishment power as the action variable to be decided, and discretizing the charging and discharging power into several levels for selection, where positive values represent energy absorption from the power system and negative values represent energy release to the power system. The action space is defined as follows:
[0081]
[0082] Among them, A t Let a be the action performed by the agent at time t. t,i Let P be the action variable of the i-th mobile microgrid at time t. t,i ch Let be the charging power of the i-th mobile microgrid at time t, and I be the set of serial numbers of all mobile microgrids connected to the power system;
[0083] The reward function design in the energy replenishment module characterizing the mobile microgrid includes:
[0084] For the optimization objective of meeting energy replenishment requirements, the lower bound of SOC at each time step is calculated. However, during training, the action decisions made by the DQN algorithm may cause the SOC to fall below this lower bound or exceed the safety upper bound, requiring action correction. The correction formula is as follows:
[0085]
[0086] Among them, e i max e represents the maximum State of Charge (SOC) limit specified for the energy storage battery of the i-th mobile microgrid to ensure safe power replenishment. t,i Let c be the SOC of the energy storage battery of the i-th mobile microgrid at time t. i Let be the energy storage battery capacity of the i-th mobile microgrid. Let e be the actual charging efficiency of the i-th mobile microgrid. t+1.i pred For the i-th ship, due to uncorrected action a t,i The expected SOC at time t+1 is obtained. The correlation coefficient for ship charging and discharging efficiency, when e t,i <e t+1,i th,low hour otherwise
[0087] To guide the agent in selecting action amounts between the upper and lower limits, the difference between the action amounts before and after correction is calculated, and the negative of its absolute value is used as the action exceeding the limit reward function value. This negative reward value forces the agent to decide on action values that do not exceed the limits. The formula for the action exceeding the limit reward function is as follows:
[0088]
[0089] For the optimization objective of reducing energy replenishment costs, the negative of the replenishment cost is directly used as the reward function. The cost incurred when charging the mobile microgrid corresponds to a negative reward value, while the revenue earned when selling electricity corresponds to a positive reward value. The formula for the energy replenishment cost reward function is as follows:
[0090]
[0091] To optimize the goal of reducing grid power fluctuations, and to measure the contribution of mobile microgrids as virtual energy storage, the average value of exchange power data for each time period throughout the day is needed as a benchmark. The exchange power before the daytime energy replenishment power of mobile microgrids is taken into account. The specific calculation formula is as follows:
[0092]
[0093] in, For the exchange power of the mobile microgrid at time t of the previous day, neglecting the charging and discharging power of the mobile microgrid, P t L ,before This represents the load power within the power system providing energy replenishment services at time t of the previous day. For the total microgrid power load at time t of the previous day, excluding the mobile microgrid energy replenishment process, P t RE,before P represents the total renewable energy generation capacity within the power system that provides energy replenishment services at time t of the previous day. t ST,before P represents the output power of the energy storage power station within the power system that provides energy replenishment services at time t of the previous day. t,i sp,before The power system that provides energy replenishment services for the previous day at time t provides shore load power, P, to the power system equipped with the i-th mobile microgrid. t,j ch,before The power system providing energy replenishment services at time t of the previous day is the load power generated by the j-th energy storage battery swapped from the mobile microgrid, I. before J is the set of serial numbers of all mobile microgrids connected to the power system on the previous day. before This is the set of serial numbers of all energy storage batteries that were swapped out of the mobile microgrid on the previous day.
[0094] When measuring power fluctuations, the daily average value of the switching power of mobile microgrids (excluding the day-ahead average) is selected, and the difference is calculated between this average and the switching power at time t on the current day to measure the fluctuating power. The formula for calculating the fluctuating power, excluding the output of energy storage stations, is as follows:
[0095]
[0096] Among them, P t MG,nonST The grid exchange power at time t on that day, excluding the output of the energy storage power station;
[0097] The energy storage power station will determine its output after the intelligent agent makes a decision. The aim is to further minimize power fluctuations based on the output of the mobile microgrid. The output power calculation formula for the energy storage power station is as follows:
[0098]
[0099] Among them, E t,k ST Let η be the energy storage capacity of the k-th battery in the energy storage station at time t. ch,k and η dis,k c represents the charging efficiency and discharging efficiency of the k-th battery in the energy storage power station, respectively. k ST Let be the capacity of the k-th battery in the energy storage power station;
[0100] After obtaining the output of the energy storage power station, the formula for calculating the fluctuating power of the energy storage power station output is as follows:
[0101] P t f =P t f,nonST -P t ST
[0102] The formula for the power fluctuation reward function is as follows:
[0103]
[0104] Taking into account the over-limit reward function, the power replenishment cost reward function, and the power fluctuation reward function, the formula for the total reward function is as follows:
[0105] r t =σ exceed r t exceed +σ cost r t cost +σ fluc r t fluc
[0106] Where, σ exceed σ cost σ fluc These are the weight coefficients for the action exceeding the limit reward function, the power replenishment cost reward function, and the power fluctuation reward function, respectively. The larger the coefficient, the more important the optimization objective corresponding to the reward function is.
[0107] The training mobile microgrid energy replenishment strategy optimization module includes:
[0108] Neural networks are used to evaluate the action value function, and the DQN algorithm is used to train the mobile microgrid agent in order to gradually approach the optimal action value function and the optimal strategy through iteration.
[0109] The DQN algorithm introduces the current network Q(s,a,ω) and the target network... The target network is responsible for calculating the action value of the next state, while the current network is used to calculate the value of each action in the current state. The loss function after introducing the target network is as follows:
[0110]
[0111] Where M is the number of samples, R k Let γ be the reward value for the k-th sample, and γ be the discount factor. For the target network in state S k The value of taking action a, Q(S) k A k,ω) represents the current state of the network in state S. k Take action A k Value;
[0112] The basic process of the DQN algorithm is as follows:
[0113] Step a: Randomly select parameters to initialize the current network Q(s,a,ω) and the target network.
[0114] Step b: Initialize the experience replay pool;
[0115] Step c: Begin a new interaction sequence and execute steps d through n;
[0116] Step d: Obtain the initial state S1 of the current sequence;
[0117] Step e: For each time step t = 1 → T in the sequence, execute steps f to m;
[0118] Step f: Derive the current state S from the current network. t The value of the action is determined, and the action A to be executed is selected by the ∈-greedy strategy. t The ∈-greedy strategy sets an ∈ value, randomly selects an action to be executed with a probability of ∈, and selects the action with the highest value with a probability of 1-∈.
[0119] Step g: Perform action A t Afterwards, you will receive reward R. t Transition to the next state S t+1 ;
[0120] Step h: Transfer the state transition sample (S) t A t ,R t ,S t+1 Stored in the experience replay pool;
[0121] Step i: If the number of samples in the experience replay pool exceeds a certain number, then proceed to steps j to l;
[0122] Step j: Randomly sample N samples from the experience replay pool;
[0123] Step k: Calculate the loss function from the sampled samples.
[0124] Step 1: Minimize the loss function value using gradient descent and update the parameters of the current network Q(s,a,ω) with a step size β;
[0125] Step m: At regular intervals, the target network is... Synchronize parameters with the current network Q(s,a,ω);
[0126] Step n: Return to step e until the termination state of the interaction sequence;
[0127] Step o: Return to step c until all interaction sequences have been executed;
[0128] After training the mobile microgrid agent using the DQN algorithm, the optimal value function is obtained. The agent selects the action with the highest value based on its current state, thus obtaining the optimal strategy.
[0129] Thirdly, a computer-readable storage medium storing a computer program is provided, which, when executed by a processor, implements the steps of the mobile microgrid energy replenishment strategy optimization method.
[0130] Fourthly, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the mobile microgrid energy replenishment strategy optimization method.
[0131] Compared with the prior art, the present invention has the following beneficial effects:
[0132] 1. The energy replenishment strategy optimization method proposed in this invention can improve the adaptability to complex factors within the power system that provides energy replenishment services, and can achieve general optimization capabilities for various scenarios;
[0133] 2. This invention designs a coupling relationship between a mobile microgrid and an energy replenishment service provider, and designs a collaborative optimization mechanism between the two, thereby taking into account the optimization needs of both and achieving a better optimization effect.
[0134] 3. This invention proposes an intelligent optimization system for energy replenishment strategies that uses deep reinforcement learning. It only requires knowledge of some state variables of the mobile microgrid and the energy replenishment service provider, without the need for precise modeling of the specific structure, making it easy to deploy.
[0135] 4. The solution proposed in this invention is not limited to optimizing energy replenishment costs and power system operation stability; it can be flexibly adapted to new optimization objectives by modifying the reward function.
[0136] Other beneficial effects of the present invention will be explained in detail through the introduction of specific technical features and technical solutions in specific embodiments. Those skilled in the art should be able to understand the beneficial technical effects brought about by these technical features and technical solutions through the introduction of these technical features and technical solutions. Attached Figure Description
[0137] Other features, objects, and advantages of the present invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:
[0138] Figure 1 Intelligent optimization process for energy replenishment strategies of mobile microgrids;
[0139] Figure 2 Optimize the basic process for energy replenishment strategies for mobile microgrids based on deep reinforcement learning;
[0140] Figure 3 This is a schematic diagram of the training process;
[0141] Figure 4 Comparison of energy replenishment costs;
[0142] Figure 5 The results show the comparison of power fluctuations in the power grid. Detailed Implementation
[0143] The present invention will now be described in detail with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the present invention, but do not limit the invention in any way. It should be noted that those skilled in the art can make several changes and improvements without departing from the concept of the present invention. These all fall within the protection scope of the present invention.
[0144] This invention provides a method for optimizing energy replenishment strategies in mobile microgrids. It employs deep reinforcement learning to deploy an intelligent optimization system for energy replenishment strategies in mobile microgrids. Focusing on the coupling relationship between the mobile microgrid and the power system providing energy replenishment services, the energy replenishment process of the mobile microgrid is represented as a Markov decision process. Based on three optimization objectives—meeting energy replenishment needs, reducing energy replenishment costs, and improving the operational stability of the power system—corresponding state spaces, action spaces, and reward functions are designed. The DQN algorithm is used to train the mobile microgrid agent to obtain the optimal energy replenishment strategy, thereby achieving intelligent energy replenishment scheduling for mobile microgrids. (Refer to...) Figure 1 As shown, the invention includes the following:
[0145] Characterizing the energy replenishment steps of a mobile microgrid: The mobile microgrid is regarded as an intelligent agent in a Markov decision process. Based on the Markov decision process, the state space, action space and reward function of intelligent energy replenishment regulation of the mobile microgrid are designed, and the energy replenishment power of the mobile microgrid is regarded as the action to be decided.
[0146] The optimization steps for training the energy replenishment strategy of a mobile microgrid are as follows: The mobile microgrid agent is trained using the DQN algorithm to obtain the optimal value function. The agent selects the action with the highest value based on its current state to obtain the optimal strategy.
[0147] The steps for deploying and training a mobile microgrid energy replenishment strategy are as follows: Based on the trained mobile microgrid agent, select the energy replenishment power according to the optimal value function obtained from the training, and realize the intelligent energy replenishment strategy of the mobile microgrid.
[0148] Specifically, the state-space design in the energy replenishment step of a mobile microgrid includes: pre-calculating the lower limit of the SOC of the energy storage battery at each moment required to meet the energy replenishment needs of the microgrid, and ensuring that the SOC will not fall below the lower limit during the energy replenishment process, thereby ensuring that the energy replenishment needs of the mobile microgrid are met when it leaves.
[0149] The lower limit of SOC is calculated as follows:
[0150]
[0151] Among them, e t,i Let t be the SOC of the energy storage battery of the i-th mobile microgrid at time t. a,i and t l,i The start and predetermined end times for replenishing energy to the i-th mobile microgrid. and P represents the actual charging efficiency and actual discharging efficiency of the i-th mobile microgrid, respectively. i dis,max and P i ch,max Let be the maximum discharge power and maximum charging power that the i-th mobile microgrid energy storage battery can withstand, respectively, and let Δt be the time interval between adjacent moments, c. i Let e be the energy storage battery capacity of the i-th mobile microgrid. i min e represents the minimum safety limit of the SOC of the i-th mobile microgrid energy storage battery. target ,i is the target SOC of the energy storage battery that the i-th mobile microgrid is expected to achieve when it leaves;
[0152] The state space is defined as follows:
[0153]
[0154] Among them, s t,i Let t be the set of state variables of the i-th mobile microgrid at time t, where t is the current time. stay,i For the remaining energy replenishment time of the i-th mobile microgrid, P t,i sp Let p be the shore power load generated at time t when the i-th mobile microgrid is connected to the power system. ch,t Let P be the electricity price at time t. t RE P represents the total renewable energy output of the power system at time t.t L Let n be the normal load power of the power system at time t. b,t Let t be the total number of mobile microgrids that are being recharged at time t.
[0155] The action space design in the energy replenishment step of a mobile microgrid includes: setting the energy replenishment power of the mobile microgrid as the action variable to be decided, and discretizing the charging and discharging power into several levels for selection, where positive values represent energy absorption from the power system and negative values represent energy release to the power system. The action space is defined as follows:
[0156]
[0157] Among them, A t Let a be the action performed by the agent at time t. t,i Let P be the action variable of the i-th mobile microgrid at time t. t,i ch Let be the charging power of the i-th mobile microgrid at time t, and I be the set of serial numbers of all mobile microgrids connected to the power system.
[0158] The design of the reward function in the energy replenishment process of a mobile microgrid includes:
[0159] For the optimization objective of meeting energy replenishment requirements, the lower bound of SOC at each time step is calculated. However, during training, the action decisions made by the DQN algorithm may cause the SOC to fall below this lower bound or exceed the safety upper bound, requiring action correction. The correction formula is as follows:
[0160]
[0161] Among them, e i max e represents the maximum State of Charge (SOC) limit specified for the energy storage battery of the i-th mobile microgrid to ensure safe power replenishment. t,i Let c be the SOC of the energy storage battery of the i-th mobile microgrid at time t. i Let be the energy storage battery capacity of the i-th mobile microgrid. Let e be the actual charging efficiency of the i-th mobile microgrid. t+1.i pred For the i-th ship, due to uncorrected action a t,i The expected SOC at time t+1 is obtained. The correlation coefficient for ship charging and discharging efficiency, when e t,i <e t+1,i th,low hour otherwise
[0162] To guide the agent in selecting action amounts between the upper and lower limits, the difference between the action amounts before and after correction is calculated, and the negative of its absolute value is used as the action exceeding the limit reward function value. This negative reward value forces the agent to decide on action values that do not exceed the limits. The formula for the action exceeding the limit reward function is as follows:
[0163]
[0164] For the optimization objective of reducing energy replenishment costs, the negative of the replenishment cost is directly used as the reward function. The cost incurred when charging the mobile microgrid corresponds to a negative reward value, while the revenue earned when selling electricity corresponds to a positive reward value. The formula for the energy replenishment cost reward function is as follows:
[0165]
[0166] To optimize the goal of reducing grid power fluctuations, and to measure the contribution of mobile microgrids as virtual energy storage, the average value of exchange power data for each time period throughout the day is needed as a benchmark. The exchange power before the daytime energy replenishment power of mobile microgrids is taken into account. The specific calculation formula is as follows:
[0167]
[0168] in, For the exchange power of the mobile microgrid at time t of the previous day, neglecting the charging and discharging power of the mobile microgrid, P t L ,before This represents the load power within the power system providing energy replenishment services at time t of the previous day. For the total microgrid power load at time t of the previous day, excluding the mobile microgrid energy replenishment process, P t RE,before P represents the total renewable energy generation capacity within the power system that provides energy replenishment services at time t of the previous day. t ST,before P represents the output power of the energy storage power station within the power system that provides energy replenishment services at time t of the previous day. t,i sp,before The power system that provides energy replenishment services for the previous day at time t provides shore load power, P, to the power system equipped with the i-th mobile microgrid. t,j ch,before The power system providing energy replenishment services at time t of the previous day is the load power generated by the j-th energy storage battery swapped from the mobile microgrid, I. before J is the set of serial numbers of all mobile microgrids connected to the power system on the previous day. beforeThis is the set of serial numbers of all energy storage batteries that were swapped out of the mobile microgrid on the previous day.
[0169] When measuring power fluctuations, the daily average value of the switching power of mobile microgrids (excluding the day-ahead average) is selected, and the difference is calculated between this average and the switching power at time t on the current day to measure the fluctuating power. The formula for calculating the fluctuating power, excluding the output of energy storage stations, is as follows:
[0170]
[0171] Among them, P t MG,nonST The grid exchange power at time t on that day, excluding the output of the energy storage power station;
[0172] The energy storage power station will determine its output after the intelligent agent makes a decision. The aim is to further minimize power fluctuations based on the output of the mobile microgrid. The output power calculation formula for the energy storage power station is as follows:
[0173]
[0174] Among them, E t,k ST Let η be the energy storage capacity of the k-th battery in the energy storage station at time t. ch,k and η dis,k c represents the charging efficiency and discharging efficiency of the k-th battery in the energy storage power station, respectively. k ST Let be the capacity of the k-th battery in the energy storage power station;
[0175] After obtaining the output of the energy storage power station, the formula for calculating the fluctuating power of the energy storage power station output is as follows:
[0176] P t f =P t f,nonST -P t ST
[0177] The formula for the power fluctuation reward function is as follows:
[0178]
[0179] Taking into account the over-limit reward function, the power replenishment cost reward function, and the power fluctuation reward function, the formula for the total reward function is as follows:
[0180] r t =σ exceed r t exceed +σ cost r t cost +σfluc r t fluc
[0181] Where, σ exceed σ cost σ fluc These are the weighting coefficients for the action exceeding the limit reward function, the power replenishment cost reward function, and the power fluctuation reward function, respectively. The larger the coefficient, the more important the optimization objective corresponding to that reward function is.
[0182] The optimization steps for training mobile microgrid energy replenishment strategies include:
[0183] Neural networks are used to evaluate the action value function, and the DQN algorithm is used to train the mobile microgrid agent in order to gradually approach the optimal action value function and the optimal strategy through iteration.
[0184] The DQN algorithm introduces the current network Q(s,a,ω) and the target network... The target network is responsible for calculating the action value of the next state, while the current network is used to calculate the value of each action in the current state. The loss function after introducing the target network is as follows:
[0185]
[0186] Where M is the number of samples, R k Let γ be the reward value for the k-th sample, and γ be the discount factor. For the target network in state S k The value of taking action a, Q(S) k A k ,ω) represents the current state of the network in state S. k Take action A k The value of.
[0187] The basic process of the DQN algorithm is as follows:
[0188] Step a: Randomly select parameters to initialize the current network Q(s,a,ω) and the target network.
[0189] Step b: Initialize the experience replay pool;
[0190] Step c: Begin a new interaction sequence and execute steps d through n;
[0191] Step d: Obtain the initial state S1 of the current sequence;
[0192] Step e: For each time step t = 1 → T in the sequence, execute steps f to m;
[0193] Step f: Derive the current state S from the current network. tThe value of the action is determined, and the action A to be executed is selected by the ∈-greedy strategy. t The ∈-greedy strategy sets an ∈ value, randomly selects an action to be executed with a probability of ∈, and selects the action with the highest value with a probability of 1-∈.
[0194] Step g: Perform action A t Afterwards, you will receive reward R. t Transition to the next state S t+1 ;
[0195] Step h: Transfer the state transition sample (S) t A t ,R t ,S t+1 Stored in the experience replay pool;
[0196] Step i: If the number of samples in the experience replay pool exceeds a certain number, then proceed to steps j to l;
[0197] Step j: Randomly sample N samples from the experience replay pool;
[0198] Step k: Calculate the loss function from the sampled samples.
[0199] Step 1: Minimize the loss function value using gradient descent and update the parameters of the current network Q(s,a,ω) with a step size β;
[0200] Step m: At regular intervals, the target network is... Synchronize parameters with the current network Q(s,a,ω);
[0201] Step n: Return to step e until the termination state of the interaction sequence;
[0202] Step o: Return to step c until all interaction sequences have been executed;
[0203] After training the mobile microgrid agent using the DQN algorithm, the optimal value function is obtained. The agent selects the action with the highest value based on its current state, thus obtaining the optimal strategy.
[0204] The present invention will now be described in more detail.
[0205] To achieve a universal intelligent energy replenishment strategy for mobile microgrids, reduce energy replenishment costs, and minimize the negative impact of energy replenishment on the stability of the power system providing the replenishment service, this invention proposes an optimization method for mobile microgrid energy replenishment strategies based on reinforcement learning. This method leverages the coupling relationship between the mobile microgrid and the power system providing the energy replenishment service to maximize their potential for synergistic optimization, achieving an optimization effect that balances the needs of both. The method includes the following:
[0206] Characterizing the energy replenishment process of mobile microgrids based on Markov decision processes:
[0207] The key to intelligent scheduling of energy replenishment for mobile microgrids lies in making optimal decisions based on the current status and specific needs of the mobile microgrid and the connected power system, coordinating the demand balance between the two, so as to minimize the cost of energy replenishment while ensuring the operational stability of the power system.
[0208] The energy replenishment process of a mobile microgrid can be abstracted as a sequential decision problem within a finite time domain. The current state of the mobile microgrid and its connected power system depends only on the previous state and the energy replenishment power used, satisfying the Markov property and thus representing a Markov decision process. In this invention, the mobile microgrid is considered as an agent in a Markov decision process, with the energy replenishment power as the action to be decided. The microgrid agent interacts with the environment formed by the connected power system through the energy replenishment power action and obtains the corresponding reward value based on the interaction result.
[0209] In Markov decision-making, the agent takes actions based on the current state in the environment, receives corresponding rewards based on the actions taken and the next state to which it transitions, and continuously improves its strategy based on feedback rewards from the environment. The specific interaction process is as follows: Figure 1 As shown.
[0210] A Markov decision process can be uniquely determined by a quintuple (S, A, T, r, γ). S is the state space, containing all possible states in the environment; A is the action space, containing all executable actions of the agent; T is the state transition function, where T(s'|s,a) represents the probability that the agent transitions to state s' after performing action a in state s; r is the reward function, which needs to be manually set and corresponds to the optimization objective; γ is the discount factor, with a value between [0,1). A larger value indicates a greater focus on long-term cumulative rewards, while a smaller value indicates a greater focus on short-term current rewards.
[0211] As the optimization object in reinforcement learning, the agent's policy can be modeled as the probability of taking a certain action in a certain state, mathematically expressed as:
[0212]
[0213] Among them, S t and A t These represent the state and action of the agent at time t, respectively.
[0214] The expected value of the reward obtained by an agent when it performs a given action in a given state, and then performs actions according to a given policy, and finally reaches the terminal state, is defined as the action value function, which is mathematically expressed as:
[0215]
[0216] Where t is the current time, G t S is the reward at time t. t Let A be the state of the agent at time t. t Let R be the action performed by the agent at time t. t+k This is the reward at time t+k.
[0217] The action-value function under the optimal policy is called the optimal action-value function, denoted as Q. * (s,a), its mathematical expression is:
[0218]
[0219] The key to applying deep reinforcement learning methods to solve for the optimal energy replenishment strategy of mobile microgrids lies in clarifying the optimization objective of the intelligent optimization system for energy replenishment strategy, as well as the known state variables required to achieve the optimization objective. Therefore, it is necessary to design the state space, action space, and reward function of intelligent energy replenishment regulation for mobile microgrids based on Markov decision processes.
[0220] (1) Power system analysis:
[0221] This invention abstracts the power system that provides energy replenishment services into four aspects: "source, grid, load, and storage," thereby constructing a general power system model that makes the proposed optimization method applicable to various types of power systems.
[0222] Regarding power system power sources, this invention examines the renewable energy generation within the power system itself. For example, port power systems providing energy replenishment services for electrified ships often include both solar and wind power. To ensure universality across various power systems, the optimization method proposed in this invention only involves the total renewable energy output of the target power system at a specific moment, without considering the specific components and principles of renewable energy generation in each power system.
[0223] Regarding the public power grid connected to the power system, this invention focuses on the power exchange between the public power grid and the power system. Large fluctuations in exchange power increase the power regulation pressure on the public power grid, thereby jeopardizing operational stability. The formula for calculating the exchange power of a microgrid is:
[0224] P t MG =P tL +P t EB -P t RE -P t ST
[0225] Among them, P t MG Let P be the exchange power of the power system connected to the public grid at time t. t L Let P be the normal load power of the power system at time t. t EB Let P be the total load power of the mobile microgrid connected to the power system at time t (positive values represent energy absorbed from the power system, and negative values represent energy released to the power system). t RE The total output of renewable energy sources such as wind and solar power systems, P t ST The output of the power system's energy storage station (positive value is the energy released by the energy storage station, negative value is the energy absorbed by the energy storage station).
[0226] Regarding the electrified load of the power system, in addition to providing energy replenishment services, the power system itself also generates electrified loads. For example, the port power system needs to handle the electrified loads caused by logistics transportation, including cargo handling equipment such as rubber-tired gantry cranes and rail-mounted gantry cranes, as well as transportation equipment with electrification capabilities such as stacker cranes and automated guided vehicles. All of these require power from the port. This type of load is the conventional load of the power system and can be regarded as a variable P independent of the mobile microgrid. t L .
[0227] Mobile microgrids add three new types of electrification loads to the power system: charging loads, battery swapping loads, and shore power access loads. Charging loads refer to the electrical energy consumed by mobile microgrids when they are connected to the power system's charging stations. The specific load power depends on the charging power of the mobile microgrid and is closely related to factors such as the battery capacity, maximum charging power, target SOC, and docking time. Battery swapping loads refer to the electrical energy consumed by the power system during the charging process of the replacement batteries after the mobile microgrid has been recharged via battery swapping. The load amount is related to the number of mobile microgrids using battery swapping within a certain period. Shore power access loads refer to the electrical energy consumed by the power system supplying power to the onboard electrical equipment of the mobile microgrid during the recharge process. For example, a port power system often supplies power to the ship's electrical system while charging an electrified vessel. The formula for calculating the load of a mobile microgrid is:
[0228]
[0229] Where I is the set of serial numbers of all mobile microgrids connected to the power system, and m i Let P be the 0-1 energy replenishment method decision variable for the i-th mobile microgrid (1 represents charging, 0 represents battery swapping). t,i ch Let P be the charging power of the i-th mobile microgrid at time t. t,i sp Let be the shore power access load power of the i-th mobile microgrid at time t, and J be the set of sequence numbers of all batteries swapped out of the mobile microgrid.
[0230] In the area of energy storage in power systems, this invention unifies and abstracts various energy storage methods into the form of energy storage power stations, and characterizes the specific differences between these methods as differences in battery parameters such as battery capacity and charging / discharging power. The output of an energy storage power station involves changes in the amount of stored electrical energy. The formula for calculating the electrical energy storage capacity of an energy storage power station is as follows:
[0231]
[0232] Where K is the set of serial numbers of the batteries in the energy storage power station, and E t,k ST Let η be the energy storage of the k-th battery in the energy storage station at time t, and θ be a 0-1 decision variable for the energy storage station (1 represents energy absorption by the energy storage station, and 0 represents energy release by the energy storage station). ch,k and η dis,k P represents the charging efficiency and discharging efficiency of the k-th battery in the energy storage power station, respectively. t,k ST,ch and P t,k ST,dis Let be the charging power and discharging power of the k-th battery in the energy storage station at time t, respectively, and Δt be the time interval between adjacent times (set to 1 hour in this invention). k ST Let be the capacity of the k-th battery in the energy storage power station.
[0233] Mobile microgrids can also serve as a form of "virtual energy storage" for the power system. Specifically, mobile microgrids with ample time can actively sell electricity to the power system, earning revenue and reducing the cost of replenishing power. Compared to renewable energy generation, using mobile microgrids to supply power to the power system offers greater controllability, mitigating the uncertainty of renewable energy sources and sharing the burden of power regulation. Furthermore, electricity prices are higher during peak hours and lower during off-peak hours. By allowing mobile microgrids to discharge during peak hours and charge during off-peak hours, the economic benefits of mobile microgrid owners can be maximized from the price difference, while also serving as a "peak shaving and valley filling" mechanism for the public grid, thus satisfying the interests of both the mobile microgrid and the power system.
[0234] (2) Transition space design:
[0235] To ensure that the energy replenishment needs of mobile microgrids are met, this invention pre-calculates the minimum State of Charge (SOC) of the energy storage battery at various times required to meet the microgrid's energy replenishment needs, and guarantees that the SOC will not fall below this minimum limit during energy replenishment, thus ensuring that the energy replenishment needs of the mobile microgrid are met when it leaves the site. The SOC minimum limit is calculated as follows: The microgrid is first discharged at maximum discharge power until the battery SOC reaches the minimum safe limit, at which point discharge stops. After a certain period, it is then charged at maximum charging power, ensuring that the microgrid reaches the required SOC just before leaving the site. The specific calculation formula is as follows:
[0236]
[0237] Among them, e t,i Let t be the SOC of the energy storage battery of the i-th mobile microgrid at time t. a,i and t l,i The start and predetermined end times for replenishing energy to the i-th mobile microgrid. and P represents the actual charging efficiency and actual discharging efficiency of the i-th mobile microgrid, respectively. i dis,max and P i ch,max Let be the maximum discharge power and maximum charging power that the i-th mobile microgrid energy storage battery can withstand, respectively, and Δt be the time interval between adjacent moments (set to 1 hour in this invention). i Let e be the energy storage battery capacity of the i-th mobile microgrid. i min e represents the minimum safety limit of the SOC of the i-th mobile microgrid energy storage battery. target,i Let S be the target SOC of the energy storage battery that the i-th mobile microgrid is expected to achieve when it leaves.
[0238] The selection of state variables needs to characterize the various states involved in the energy replenishment process of mobile microgrids. To reflect the energy replenishment demand and cost of mobile microgrids, state variables such as the current state of charge (SOC) of the microgrid's energy storage battery, the remaining energy replenishment time, and the electricity price need to be selected. Furthermore, due to significant differences in the parameters of energy storage batteries used by various mobile microgrids, macroscopic battery parameters such as battery capacity and charge / discharge efficiency of each microgrid need to be included in the state variables. In addition to meeting the energy replenishment demand of the microgrid, the optimization goal of reducing power fluctuations in the power system providing energy replenishment services also needs to be achieved. The power system itself often has conventional electrified loads such as logistics loads, which are partially offset by renewable energy generation and the output of energy storage stations. The remaining load is then handled by the public grid as exchange power. The output of the energy storage station can be determined after the energy replenishment power is decided; therefore, the renewable energy generation power and conventional load power of the power system are selected as state variables to characterize the fluctuations in exchange power. In addition, since multiple mobile microgrids may be replenishing energy at the same time, the state variables also need to include the total number of microgrids currently replenishing energy.
[0239] In summary, the state space is defined as follows:
[0240]
[0241] Among them, s t,i Let t be the set of state variables of the i-th mobile microgrid at time t, where t is the current time. stay,i For the remaining energy replenishment time of the i-th mobile microgrid, P t,i sp Let p be the shore power load generated at time t when the i-th mobile microgrid is connected to the power system. ch,t Let P be the electricity price at time t. t RE P represents the total renewable energy output of the power system at time t. t L Let n be the normal load power of the power system at time t. b,t Let t be the total number of mobile microgrids that are being recharged at time t.
[0242] (3) Motion space design:
[0243] This invention sets the energy replenishment power of the mobile microgrid as the action variable to be decided. Since the DQN algorithm can only handle discrete actions, the charging and discharging power is discretized into several levels for selection. Positive values represent energy absorption from the power system, and negative values represent energy release to the power system. The action space is defined as follows:
[0244]
[0245] Among them, A t Let a be the action performed by the agent at time t. t,i Let P be the action variable of the i-th mobile microgrid at time t. t,i ch Let be the charging power of the i-th mobile microgrid at time t, and I be the set of serial numbers of all mobile microgrids connected to the power system.
[0246] (4) Reward function design:
[0247] The optimization objectives of the strategy optimization method proposed in this invention are to meet the energy replenishment needs of mobile microgrids, reduce energy replenishment costs, and address power fluctuations in the power system that provides energy replenishment services. Therefore, reward functions should be designed for each of these three objectives.
[0248] For optimization objectives that satisfy energy replenishment requirements, the energy replenishment requirement guarantee method proposed in this invention can be used to calculate the lower limit of SOC at each time step. However, during training, the action decisions made by the DQN algorithm may cause the SOC to fall below this lower limit or exceed the safety upper limit, requiring action correction. The correction formula is as follows:
[0249]
[0250] Among them, e i max e represents the maximum State of Charge (SOC) limit specified for the energy storage battery of the i-th mobile microgrid to ensure safe power replenishment. t,i Let c be the SOC of the energy storage battery of the i-th mobile microgrid at time t. i Let be the energy storage battery capacity of the i-th mobile microgrid. Let e be the actual charging efficiency of the i-th mobile microgrid. t+1.i pred For the i-th ship, due to uncorrected action a t,i The expected SOC at time t+1 is obtained. The correlation coefficient for ship charging and discharging efficiency, when e t,i <e t+1,i th,low hour otherwise
[0251] To guide the agent in selecting action amounts between the upper and lower limits, the difference between the action amounts before and after correction is calculated, and the negative of its absolute value is used as the action exceeding the limit reward function value. This negative reward value forces the agent to decide on action values that do not exceed the limits. The formula for the action exceeding the limit reward function is as follows:
[0252]
[0253] For the optimization objective of reducing energy replenishment costs, the negative of the replenishment cost is directly used as the reward function. The cost incurred when charging the mobile microgrid corresponds to a negative reward value, while the revenue earned when selling electricity corresponds to a positive reward value. The formula for the energy replenishment cost reward function is as follows:
[0254]
[0255] To optimize the reduction of grid power fluctuations, this invention treats mobile microgrids as "virtual energy storage" for the power system. By switching between charging and electricity sales modes, it "shaving off peaks and filling valleys" for the power system providing energy replenishment services. To measure the contribution of mobile microgrids as virtual energy storage, the average of exchange power data for each time period throughout the day is needed as a benchmark. This invention uses the exchange power before the daytime energy replenishment power of mobile microgrids as the basis, and the specific calculation formula is as follows:
[0256]
[0257] in, For the exchange power of the mobile microgrid at time t of the previous day, neglecting the charging and discharging power of the mobile microgrid, P t L ,before This represents the load power within the power system providing energy replenishment services at time t of the previous day. For the total microgrid power load at time t of the previous day, excluding the mobile microgrid energy replenishment process, P t RE,before P represents the total renewable energy generation capacity within the power system that provides energy replenishment services at time t of the previous day. t ST,before P represents the output power of the energy storage power station within the power system that provides energy replenishment services at time t of the previous day. t,i sp,before The power system that provides energy replenishment services for the previous day at time t provides shore load power, P, to the power system equipped with the i-th mobile microgrid. t,j ch,before The power system providing energy replenishment services at time t of the previous day is the load power generated by the j-th energy storage battery swapped from the mobile microgrid, I. before J is the set of serial numbers of all mobile microgrids connected to the power system on the previous day. before This is the set of serial numbers of all energy storage batteries that were swapped out of the mobile microgrid on the previous day.
[0258] To accurately measure the positive impact of mobile microgrids on reducing power fluctuations during their integration into the power system, this invention selects the daily average value of the exchange power of the mobile microgrid (excluding its own power) before the current day and calculates the difference between this average and the exchange power at time t on that day to measure the fluctuating power. The formula for calculating the fluctuating power, excluding the output of the energy storage station, is as follows:
[0259]
[0260] Among them, P t MG,nonST The grid exchange power at time t on that day does not take into account the output of the energy storage power station.
[0261] The method proposed in this invention assigns additional tasks to energy storage power stations in power systems that provide energy replenishment services. The energy storage power station determines its output after the agent makes a decision, with the aim of further minimizing power fluctuations based on the output of the mobile microgrid. The output power calculation formula of the energy storage power station is as follows:
[0262]
[0263] Among them, E t,k ST Let η be the energy storage capacity of the k-th battery in the energy storage station at time t. ch,k and η dis,k c represents the charging efficiency and discharging efficiency of the k-th battery in the energy storage power station, respectively. k ST Let be the capacity of the k-th battery in the energy storage power station.
[0264] After obtaining the output of the energy storage power station, the formula for calculating the fluctuating power of the energy storage power station output is as follows:
[0265] P t f =P t f,nonST -P t ST
[0266] The formula for the power fluctuation reward function is as follows:
[0267]
[0268] Taking into account the over-limit reward function, the power replenishment cost reward function, and the power fluctuation reward function, the formula for the total reward function is as follows:
[0269] r t =σ exceed r t exceed +σ cost r tcost +σ fluc r t fluc
[0270] Where, σ exceed σ cost σ fluc These are the weighting coefficients for the action exceeding the limit reward function, the power replenishment cost reward function, and the power fluctuation reward function, respectively. The larger the coefficient, the more important the optimization objective corresponding to that reward function is.
[0271] Intelligent optimization system for mobile microgrid energy replenishment strategy trained based on DQN algorithm:
[0272] The core of the intelligent optimization system for deploying mobile microgrid energy replenishment strategies lies in continuously iterating the action value function based on environmental feedback, and ultimately deriving the optimal strategy based on the optimal value function. However, in reality, due to the complexity and uncertainty of the environment, it is impossible to directly solve for the optimal value function. Therefore, this invention uses a neural network to evaluate the action value function and employs a Deep Q Network (DQN) algorithm to train the mobile microgrid agent, aiming to gradually approach the optimal action value function and the optimal strategy through iteration.
[0273] The DQN algorithm introduces the current network Q(s,a,ω) and the target network... The concept is that the target network is a copy of the current network, but the difference is that the current network updates its parameters after each training session, while the target network only synchronizes its parameters with the current network at regular intervals. The target network is responsible for calculating the action value of the next state, while the current network is used to calculate the value of each action in the current state. Since the parameters of the target network do not change in real time with each training session, the stability of the training process is enhanced. The loss function after introducing the target network is as follows:
[0274]
[0275] Where M is the number of samples, R k Let γ be the reward value for the k-th sample, and γ be the discount factor. For the target network in state S k The value of taking action a, Q(S) k A k ,ω) represents the current state of the network in state S. k Take action A k The value of.
[0276] The basic flow of the DQN algorithm is shown in steps a to o:
[0277] Step a: Randomly select parameters to initialize the current network Q(s,a,ω) and the target network.
[0278] Step b: Initialize the experience replay pool;
[0279] Step c: Begin a new interaction sequence and execute steps d through n;
[0280] Step d: Obtain the initial state S1 of the current sequence;
[0281] Step e: For each time step t = 1 → T in the sequence, execute steps f to m;
[0282] Step f: Derive the current state S from the current network. t The value of the action is determined, and the action A to be executed is selected by the ∈-greedy strategy. t The ∈-greedy strategy sets an ∈ value, randomly selects an action to be executed with a probability of ∈, and selects the action with the highest value with a probability of 1-∈.
[0283] Step g: Perform action A t Afterwards, you will receive reward R. t Transition to the next state S t+1 ;
[0284] Step h: Transfer the state transition sample (S) t A t ,R t ,S t+1 Stored in the experience replay pool;
[0285] Step i: If the number of samples in the experience replay pool exceeds a certain number, then proceed to steps j to l;
[0286] Step j: Randomly sample N samples from the experience replay pool;
[0287] Step k: Calculate the loss function from the sampled samples.
[0288] Step 1: Minimize the loss function value using gradient descent and update the parameters of the current network Q(s,a,ω) with a step size β;
[0289] Step m: At regular intervals, the target network is... Synchronize parameters with the current network Q(s,a,ω);
[0290] Step n: Return to step e until the termination state of the interaction sequence;
[0291] Step o: Return to step c until all interaction sequences have been executed;
[0292] After training the mobile microgrid agent using the DQN algorithm, the optimal value function is obtained. The agent selects the action with the highest value based on its current state, thus obtaining the optimal strategy.
[0293] In summary, the mobile microgrid energy replenishment strategy optimization method based on deep reinforcement learning provided by this invention first characterizes the energy replenishment process of the mobile microgrid as a Markov decision process considering environmental uncertainties, and designs the state space, action space, and reward function of the mobile microgrid. Next, it employs the DQN algorithm, which combines deep learning and reinforcement learning, to train an intelligent optimization system for the mobile microgrid's energy replenishment strategy, learning from historical data to capture the coupling relationship between the mobile microgrid and the power system providing energy replenishment services. Finally, based on the trained intelligent optimization system for the mobile microgrid's energy replenishment strategy, an intelligent energy replenishment strategy for the mobile microgrid is implemented. Its basic process is as follows: Figure 2 As shown.
[0294] For example:
[0295] This invention uses data from a port's energy replenishment for berthed electrified vessels within a single day as an example. A DQN algorithm is constructed according to the parameters in Table 1, and the ship's intelligent agent is trained using 60,000 interaction sequences. The training process is as follows: Figure 3 As shown in the figure. The trained ship real-time energy management intelligent decision-making system was tested in a test scenario, and the results were compared with those of the methods of "always charging at maximum power" and "using a random strategy to decide the charging power". The test results are as follows. Figure 4 and Figure 5 As shown.
[0296] Table 1. Q-network and hyperparameter design
[0297] parameter numerical values parameter numerical values Learning rate 0.0001 Neuron activation function ReLU Discount factor 0.95 Number of hidden layers 2 Experience replay pool capacity 10000 Number of neurons in each hidden layer 40、20 Number of samples in a small batch 128 Target network update cycle 100
[0298] As can be seen, during the online decision-making process, this method achieved optimal performance in both the energy replenishment cost and grid power fluctuation objectives, significantly outperforming the results of disordered charging. Specifically, in terms of energy replenishment cost, this patented method reduced it by approximately 5% compared to traditional disordered charging; and in terms of grid power fluctuation, it reduced it by nearly 25%, demonstrating the powerful optimization capability of this patented method.
[0299] This example illustrates that the intelligent optimization system for mobile microgrid energy replenishment strategy trained based on the DQN algorithm can realize online decision-making during the microgrid energy replenishment process, and can adapt to the complexity of the power system providing energy replenishment services. It can balance the two major optimization objectives of microgrid energy replenishment cost and power system operation stability while ensuring the energy replenishment needs of the microgrid.
[0300] This invention provides a method and system for optimizing energy replenishment strategies for mobile microgrids, aiming to adapt to the complexity within the power system providing energy replenishment services, and to ensure that the proposed solution can meet the needs of both the mobile microgrid and the power system providing energy replenishment services.
[0301] This solution has the following characteristics:
[0302] 1. Not limited to optimization methods that only consider ideal charging pile models, this invention proposes an optimization method for energy replenishment strategies of mobile microgrids that involves the internal complexity of power systems providing energy replenishment services. This method helps to further reduce energy replenishment costs and improve the economy of electrified transportation through collaborative optimization.
[0303] 2. Unlike existing optimization methods for energy replenishment strategies in mobile microgrids, this method subdivides the power system providing energy replenishment services into four parts: "source, grid, load, and storage". It examines in detail the coupling relationship and interaction mechanism between the mobile microgrid and the connected power system, and realizes a general optimization method that can balance the economic efficiency of energy replenishment with the stability of power system operation.
[0304] 3. This invention provides an algorithmic framework for an intelligent optimization system for deploying energy replenishment strategies based on deep reinforcement learning. By using neural networks to evaluate the action value function involving continuous state parameters, the optimal strategy can be more effectively derived from complex models.
[0305] Those skilled in the art will understand that, besides implementing the system and its various devices, modules, and units provided by this invention in the form of purely computer-readable program code, the same functions can be achieved entirely through logical programming of the method steps, making the system and its various devices, modules, and units of this invention function in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, the system and its various devices, modules, and units provided by this invention can be considered as a hardware component, and the devices, modules, and units included therein for implementing various functions can also be considered as structures within the hardware component; alternatively, the devices, modules, and units for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.
[0306] Specific embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art can make various changes or modifications within the scope of the claims, which do not affect the essence of the present invention. Unless otherwise specified, the embodiments and features described in this application can be arbitrarily combined with each other.
Claims
1. An optimization method for energy replenishment strategy of mobile microgrids, characterized in that, include: Characterizing the energy replenishment steps of a mobile microgrid: The mobile microgrid is regarded as an intelligent agent in a Markov decision process. Based on the Markov decision process, the state space, action space and reward function of intelligent energy replenishment regulation of the mobile microgrid are designed, and the energy replenishment power of the mobile microgrid is regarded as the action to be decided. The optimization steps for training the energy replenishment strategy of a mobile microgrid are as follows: The mobile microgrid agent is trained using the DQN algorithm to obtain the optimal value function. The agent selects the action with the highest value based on its current state to obtain the optimal strategy. The steps for deploying and training a mobile microgrid energy replenishment strategy are as follows: Based on the trained mobile microgrid agent, select the energy replenishment power according to the optimal value function obtained from the training, and realize the intelligent energy replenishment strategy of the mobile microgrid. The state-space design in the energy replenishment step of the mobile microgrid includes: pre-calculating the lower limit of the SOC of the energy storage battery at each moment required to meet the energy replenishment needs of the microgrid, and ensuring that the SOC will not fall below the lower limit during the energy replenishment process, thereby ensuring that the energy replenishment needs of the mobile microgrid are met when it leaves. The lower limit of SOC is calculated as follows: in, Let SOC be the state of charge (SOC) of the energy storage battery of the i-th mobile microgrid at time t. and The start and predetermined end times for replenishing energy to the i-th mobile microgrid. and Let be the actual charging efficiency and the actual discharging efficiency of the i-th mobile microgrid, respectively. and These are the maximum discharge power and maximum charging power that the i-th mobile microgrid energy storage battery can withstand, respectively. The time interval between adjacent moments. Let be the energy storage battery capacity of the i-th mobile microgrid. Let SOC be the minimum safety limit for the i-th mobile microgrid energy storage battery. Let S be the target SOC of the energy storage battery that the i-th mobile microgrid is expected to achieve upon departure; The state space is defined as follows: in, Let be the set of state variables of the i-th mobile microgrid at time t. For the current moment, The remaining energy replenishment time for the i-th mobile microgrid. Let be the shore power load generated at time t when the i-th mobile microgrid is connected to the power system. Let be the electricity price at time t. The sum of renewable energy output at time t in the power system. Let be the normal load power of the power system at time t. The total number of mobile microgrids that are being recharged at time t; The reward function includes an action limit violation reward function, an energy replenishment cost reward function, and a power fluctuation reward function; To optimize the goal of reducing grid power fluctuations, and to measure the contribution of mobile microgrids as virtual energy storage, the average value of exchanged power data for each time period of the day is needed as a benchmark. The calculation formula for power fluctuations, excluding those of the energy storage station output, is as follows: in, The grid exchange power at time t on that day does not take into account the output of the energy storage power station. The exchange power of the mobile microgrid charging and discharging power is not considered at time t of the previous day; The energy storage power station will determine its output after the intelligent agent makes a decision. The aim is to further minimize power fluctuations based on the output of the mobile microgrid. The output power calculation formula for the energy storage power station is as follows: in, Let be the energy storage capacity of the k-th battery in the energy storage power station at time t. and Let be the charging efficiency and discharging efficiency of the k-th battery in the energy storage power station, respectively. Let be the capacity of the k-th battery in the energy storage power station; After obtaining the output of the energy storage power station, the formula for calculating the fluctuating power of the energy storage power station output is as follows: The formula for the power fluctuation reward function is as follows: 。 2. The method for optimizing energy replenishment strategy for mobile microgrids according to claim 1, characterized in that, The action space design in the energy replenishment step of the mobile microgrid includes: setting the energy replenishment power of the mobile microgrid as the action variable to be decided, and discretizing the charging and discharging power into several levels for selection, where positive values represent energy absorption from the power system and negative values represent energy release to the power system. The action space is defined as follows: in, Let t be the action performed by the agent. Let be the action variable of the i-th mobile microgrid at time t. Let be the charging power of the i-th mobile microgrid at time t. This is the set of serial numbers for all mobile microgrids connected to the power system.
3. The method for optimizing energy replenishment strategy for mobile microgrids according to claim 2, characterized in that, The design of the reward function in the energy replenishment step of the mobile microgrid includes: For the optimization objective of meeting energy replenishment requirements, the lower bound of SOC at each time step is calculated. However, during training, the action decisions made by the DQN algorithm may cause the SOC to fall below this lower bound or exceed the safety upper bound, requiring action correction. The correction formula is as follows: in, Let SOC be the maximum SOC limit specified for the energy storage battery of the i-th mobile microgrid to ensure the safety of power replenishment. Let SOC be the state of charge (SOC) of the energy storage battery of the i-th mobile microgrid at time t. Let be the energy storage battery capacity of the i-th mobile microgrid. Let be the actual charging efficiency of the i-th mobile microgrid. For the i-th ship, due to uncorrected actions The results obtained Expected SOC at any given moment The correlation coefficient for ship charging and discharging efficiency, when hour ,otherwise ; To guide the agent in selecting action amounts between the upper and lower limits, the difference between the action amounts before and after correction is calculated, and the negative of its absolute value is used as the action exceeding the limit reward function value. This negative reward value forces the agent to decide on action values that do not exceed the limits. The formula for the action exceeding the limit reward function is as follows: For the optimization objective of reducing energy replenishment costs, the negative of the replenishment cost is directly used as the reward function. The cost incurred when charging the mobile microgrid corresponds to a negative reward value, while the revenue earned when selling electricity corresponds to a positive reward value. The formula for the energy replenishment cost reward function is as follows: Based on the current exchange power, which does not take into account the energy replenishment power of mobile microgrids, the specific calculation formula is as follows: in, The exchange power of the mobile microgrid at time t on the previous day is not considered, which is the charging and discharging power of the mobile microgrid. This represents the load power within the power system providing energy replenishment services at time t of the previous day. The total microgrid power load at time t of the previous day, excluding the energy replenishment process of mobile microgrids. The total renewable energy generation capacity within the power system that provides energy replenishment services at time t of the previous day. The output power of energy storage stations within the power system that provide energy replenishment services at time t of the previous day. The power system that provides energy replenishment services for time t of the previous day provides shore load power to the power system equipped with the i-th mobile microgrid. The power system providing energy replenishment services at time t of the previous day is the load power generated by the energy storage battery swapped from the mobile microgrid by the j-th battery in a battery swapping manner. This is the set of serial numbers of all mobile microgrids connected to the power system on the previous day. This is the set of serial numbers of all energy storage batteries that were swapped out of the mobile microgrid on the previous day. When measuring power fluctuations, the daily average value of the switching power of mobile microgrids is selected before the date, and the difference between it and the switching power at time t on the current day is calculated to measure the fluctuating power. Taking into account the over-limit reward function, the power replenishment cost reward function, and the power fluctuation reward function, the formula for the total reward function is as follows: in, , , These are the weighting coefficients for the action exceeding the limit reward function, the power replenishment cost reward function, and the power fluctuation reward function, respectively. The larger the coefficient, the more important the optimization objective corresponding to that reward function is.
4. The method for optimizing energy replenishment strategy for mobile microgrids according to claim 1, characterized in that, The optimization steps for the training mobile microgrid energy replenishment strategy include: Neural networks are used to evaluate the action value function, and the DQN algorithm is used to train the mobile microgrid agent in order to gradually approach the optimal action value function and the optimal strategy through iteration. The DQN algorithm is introduced into the current network. With the target network The target network is responsible for calculating the action value of the next state, while the current network is used to calculate the value of each action in the current state. The loss function after introducing the target network is as follows: in, The number of samples collected. The reward value for the k-th sample. As a discount factor, For the target network in state Take action below value, For the current network in state Take action below The value of.
5. The mobile microgrid energy replenishment strategy optimization method according to claim 4, characterized in that, The basic process of the DQN algorithm is as follows: Step a: Randomly select parameters to initialize the current network. With the target network ; Step b: Initialize the experience replay pool; Step c: Begin a new interaction sequence and execute steps d through n; Step d: Obtain the initial state of the current sequence. ; Step e: For each time step in the sequence Execute steps f to m; Step f: Derive the current state from the current network. The value of the action below, and by - Greedy strategy selects the action to be executed. , - Greedy strategy sets one Value, in The action to be performed is randomly selected with a probability of 1- The probability of choosing the action with the highest value; Step g: Perform the action Afterwards, you will receive a reward. Transition to the next state ; Step h: Transfer state transition samples Stored in the experience replay pool; Step i: If the number of samples in the experience replay pool exceeds a certain number, then proceed to steps j to l; Step j: Randomly sample N samples from the experience replay pool; Step k: Calculate the loss function from the sampled samples. ; Step 1: Minimize the loss function value using gradient descent, with a step size of 1. Update the current network Parameters; Step m: At regular intervals, the target network is... With the current network Synchronization parameters; Step n: Return to step e until the termination state of the interaction sequence; Step o: Return to step c until all interaction sequences have been executed; After training the mobile microgrid agent using the DQN algorithm, the optimal value function is obtained. The agent selects the action with the highest value based on its current state, thus obtaining the optimal strategy.
6. A mobile microgrid energy replenishment strategy optimization system, characterized in that, include: The energy replenishment module characterizes the mobile microgrid: the mobile microgrid is regarded as an intelligent agent in the Markov decision process. Based on the Markov decision process, the state space, action space and reward function of the intelligent energy replenishment regulation of the mobile microgrid are designed, and the energy replenishment power of the mobile microgrid is regarded as the action to be decided. Training the mobile microgrid energy replenishment strategy optimization module: The mobile microgrid agent is trained using the DQN algorithm to obtain the optimal value function. The agent selects the action with the highest value based on its current state to obtain the optimal strategy. Deployment and training of mobile microgrid energy replenishment strategy module: Based on the trained mobile microgrid agent, the energy replenishment power is selected according to the optimal value function obtained from the training, so as to realize the intelligent energy replenishment strategy of mobile microgrid. The state-space design of the energy replenishment module characterizing the mobile microgrid includes: pre-calculating the lower limit of the SOC of the energy storage battery at each moment required to meet the energy replenishment needs of the microgrid, and ensuring that the SOC will not fall below the lower limit during the energy replenishment process, thereby ensuring that the energy replenishment needs of the mobile microgrid are met when it leaves. The lower limit of SOC is calculated as follows: in, Let SOC be the state of charge (SOC) of the energy storage battery of the i-th mobile microgrid at time t. and The start and predetermined end times for replenishing energy to the i-th mobile microgrid. and Let be the actual charging efficiency and the actual discharging efficiency of the i-th mobile microgrid, respectively. and These are the maximum discharge power and maximum charging power that the i-th mobile microgrid energy storage battery can withstand, respectively. The time interval between adjacent moments. Let be the energy storage battery capacity of the i-th mobile microgrid. Let SOC be the minimum safety limit for the i-th mobile microgrid energy storage battery. Let S be the target SOC of the energy storage battery that the i-th mobile microgrid is expected to achieve upon departure; The state space is defined as follows: in, Let be the set of state variables of the i-th mobile microgrid at time t. For the current moment, The remaining energy replenishment time for the i-th mobile microgrid. Let be the shore power load generated at time t when the i-th mobile microgrid is connected to the power system. Let be the electricity price at time t. The sum of renewable energy output at time t in the power system. Let be the normal load power of the power system at time t. The total number of mobile microgrids that are being recharged at time t; The reward function includes an action limit violation reward function, an energy replenishment cost reward function, and a power fluctuation reward function; To optimize the goal of reducing grid power fluctuations, and to measure the contribution of mobile microgrids as virtual energy storage, the average value of exchanged power data for each time period of the day is needed as a benchmark. The calculation formula for power fluctuations, excluding those of the energy storage station output, is as follows: in, The grid exchange power at time t on that day does not take into account the output of the energy storage power station. The exchange power of the mobile microgrid charging and discharging power is not considered at time t of the previous day; The energy storage power station will determine its output after the intelligent agent makes a decision. The aim is to further minimize power fluctuations based on the output of the mobile microgrid. The output power calculation formula for the energy storage power station is as follows: in, Let be the energy storage capacity of the k-th battery in the energy storage power station at time t. and Let be the charging efficiency and discharging efficiency of the k-th battery in the energy storage power station, respectively. Let be the capacity of the k-th battery in the energy storage power station; After obtaining the output of the energy storage power station, the formula for calculating the fluctuating power of the energy storage power station output is as follows: The formula for the power fluctuation reward function is as follows: 。 7. The mobile microgrid energy replenishment strategy optimization system according to claim 6, characterized in that, The action space design in the energy replenishment module characterizing the mobile microgrid includes: setting the mobile microgrid energy replenishment power as the action variable to be decided, and discretizing the charging and discharging power into several levels for selection, where positive values represent energy absorption from the power system and negative values represent energy release to the power system. The action space is defined as follows: in, Let t be the action performed by the agent. Let be the action variable of the i-th mobile microgrid at time t. Let be the charging power of the i-th mobile microgrid at time t. This is the set of serial numbers for all mobile microgrids connected to the power system. The reward function design in the energy replenishment module characterizing the mobile microgrid includes: For the optimization objective of meeting energy replenishment requirements, the lower bound of SOC at each time step is calculated. However, during training, the action decisions made by the DQN algorithm may cause the SOC to fall below this lower bound or exceed the safety upper bound, requiring action correction. The correction formula is as follows: in, Let SOC be the maximum SOC limit specified for the energy storage battery of the i-th mobile microgrid to ensure the safety of power replenishment. Let SOC be the state of charge (SOC) of the energy storage battery of the i-th mobile microgrid at time t. Let be the energy storage battery capacity of the i-th mobile microgrid. Let be the actual charging efficiency of the i-th mobile microgrid. For the i-th ship, due to uncorrected actions The results obtained Expected SOC at any given moment The correlation coefficient for ship charging and discharging efficiency, when hour ,otherwise ; To guide the agent in selecting action amounts between the upper and lower limits, the difference between the action amounts before and after correction is calculated, and the negative of its absolute value is used as the action exceeding the limit reward function value. This negative reward value forces the agent to decide on action values that do not exceed the limits. The formula for the action exceeding the limit reward function is as follows: For the optimization objective of reducing energy replenishment costs, the negative of the replenishment cost is directly used as the reward function. The cost incurred when charging the mobile microgrid corresponds to a negative reward value, while the revenue earned when selling electricity corresponds to a positive reward value. The formula for the energy replenishment cost reward function is as follows: Based on the current exchange power, which does not take into account the energy replenishment power of mobile microgrids, the specific calculation formula is as follows: in, The exchange power at time t of the previous day, excluding the charging and discharging power of the mobile microgrid, is... This represents the load power within the power system providing energy replenishment services at time t of the previous day. The total microgrid power load at time t of the previous day, excluding the energy replenishment process of mobile microgrids. The total renewable energy generation capacity within the power system that provides energy replenishment services at time t of the previous day. The output power of energy storage stations within the power system that provide energy replenishment services at time t of the previous day. The power system that provides energy replenishment services for time t of the previous day provides shore load power to the power system equipped with the i-th mobile microgrid. The power system providing energy replenishment services at time t of the previous day is the load power generated by the energy storage battery swapped from the mobile microgrid by the j-th battery in the form of a battery swapping device. This is the set of serial numbers of all mobile microgrids connected to the power system on the previous day. This is the set of serial numbers of all energy storage batteries that were swapped out of the mobile microgrid on the previous day. When measuring power fluctuations, the daily average value of the switching power of mobile microgrids is selected before the date, and the difference between it and the switching power at time t on the current day is calculated to measure the fluctuating power. Taking into account the over-limit reward function, the power replenishment cost reward function, and the power fluctuation reward function, the formula for the total reward function is as follows: in, , , These are the weight coefficients for the action exceeding the limit reward function, the power replenishment cost reward function, and the power fluctuation reward function, respectively. The larger the coefficient, the more important the optimization objective corresponding to the reward function is. The training mobile microgrid energy replenishment strategy optimization module includes: Neural networks are used to evaluate the action value function, and the DQN algorithm is used to train the mobile microgrid agent in order to gradually approach the optimal action value function and the optimal strategy through iteration. The DQN algorithm is introduced into the current network. With the target network The target network is responsible for calculating the action value of the next state, while the current network is used to calculate the value of each action in the current state. The loss function after introducing the target network is as follows: in, The number of samples collected. The reward value for the k-th sample. As a discount factor, For the target network in state Take action below value, For the current network in state Take action below Value; The basic process of the DQN algorithm is as follows: Step a: Randomly select parameters to initialize the current network. With the target network ; Step b: Initialize the experience replay pool; Step c: Begin a new interaction sequence and execute steps d through n; Step d: Obtain the initial state of the current sequence. ; Step e: For each time step in the sequence Execute steps f to m; Step f: Derive the current state from the current network. The value of the action below, and by - Greedy strategy selects the action to be executed. , - Greedy strategy sets one Value, in The action to be performed is randomly selected with a probability of 1- The probability of choosing the action with the highest value; Step g: Perform the action Afterwards, you will receive a reward. Transition to the next state ; Step h: Transfer state transition samples Stored in the experience replay pool; Step i: If the number of samples in the experience replay pool exceeds a certain number, then proceed to steps j to l; Step j: Randomly sample N samples from the experience replay pool; Step k: Calculate the loss function from the sampled samples. ; Step 1: Minimize the loss function value using gradient descent, with a step size of... Update the current network Parameters; Step m: At regular intervals, the target network is... With the current network Synchronization parameters; Step n: Return to step e until the termination state of the interaction sequence; Step o: Return to step c until all interaction sequences have been executed; After training the mobile microgrid agent using the DQN algorithm, the optimal value function is obtained. The agent selects the action with the highest value based on its current state, thus obtaining the optimal strategy.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the mobile microgrid energy replenishment strategy optimization method as described in any one of claims 1 to 5.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the computer program is executed by the processor, it implements the steps of the mobile microgrid energy replenishment strategy optimization method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Microgrid energy scheduling method based on double-Q-value network deep reinforcement learning
CN112117760A
Microgrid energy storage scheduling method, device and equipment based on deep reinforcement learning
CN112529727A
