A reinforcement learning-based charging and discharging control method for electric vehicles and power grids
By employing a reinforcement learning-based method for electric vehicle and grid charging and discharging control, and combining a composite constraint guarantee mechanism of SOC, DOD, and C-rate, the charging and discharging strategy is optimized, thus solving the problem of dynamic balance control between electric vehicles and the power grid and achieving maximum user benefits and grid stability.
Patent Information
- Application Number
- CN202510991883.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-18
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2045-07-18
AI Technical Summary
The concentrated charging behavior of electric vehicles leads to fluctuations in grid load, and existing technologies make it difficult to achieve dynamic balance control between electric vehicles and the grid and maximize economic benefits.
A reinforcement learning-based electric vehicle and grid charging and discharging control method is adopted. The control system consists of an on-board battery management system, a two-way interactive management platform, and two-way charging and discharging piles. Combined with the composite constraint guarantee mechanism of SOC, DOD, and C-rate, the DDPG algorithm is used to optimize the charging and discharging strategy to maximize user benefits.
While ensuring the charging needs of electric vehicles, it maximizes user benefits, plays a role in peak shaving and valley filling of the power grid, protects battery health, and solves the problem of power grid load fluctuation.
Smart Images

Figure CN121105894B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of smart grid and electric vehicle collaborative control, and focuses on a charging and discharging control method for electric vehicles and the power grid. It proposes a real-time optimization control system and method for electric vehicle charging and discharging based on reinforcement learning. Background Technology
[0002] With the continuous development of new energy technologies, the number of electric vehicle users is constantly expanding, and the demand for electricity will continue to grow. Fluctuations in grid load pose a threat to grid security, and the more concentrated charging behavior of electric vehicles will further exacerbate grid load fluctuations.
[0003] Electric vehicles possess mobility and energy storage capabilities, but their charging time is long and their usage time is relatively short. Theoretically, they can be used as mobile energy storage units to regulate the power grid. By scheduling the charging of electric vehicles when the grid load is relatively low and the discharging when the load is relatively high, grid power can be optimized, achieving peak shaving and valley filling. Simultaneously, due to varying grid load conditions, electricity prices will dynamically change, resulting in price differences during charging and discharging, which offers certain economic benefits.
[0004] However, both the grid load and the state of electric vehicles are dynamically changing. Therefore, in order to achieve bidirectional interaction between electric vehicles and the grid, a complex intelligent control method is needed for coordinated control to achieve a balance between the two systems. Summary of the Invention
[0005] To address the aforementioned problems, this invention proposes a reinforcement learning-based method for controlling the charging and discharging of electric vehicles and the power grid, thereby resolving the dynamic issues in the two-way interaction. This invention aims to maximize the benefits for electric vehicle users while simultaneously meeting their daily travel needs.
[0006] This invention is achieved using the following technical solutions: A reinforcement learning-based method for electric vehicle and grid charging / discharging control comprises an on-board battery management system (BMS), a two-way interactive management platform, a two-way charging / discharging station, and a mobile terminal, forming a charging / discharging control system. The control method steps executed by this control system are as follows: Step 1: Obtain the vehicle's battery status through the vehicle battery management system. The vehicle's battery status includes state of charge (SOC), state of health (SOH), depth of charge / discharge (DOD), and charge / discharge current. Step 2: The two-way interactive management platform connects to the vehicle battery management system and makes decisions on the charging and discharging status based on the battery status obtained by the vehicle battery management system and the grid load and real-time electricity price obtained from the grid. Step 3: The bidirectional charging and discharging pile is connected to the bidirectional interactive management platform. The charging and discharging are adjusted according to the decisions of the bidirectional interactive management platform to control the direction and magnitude of the charging and discharging current. Step 4: The mobile terminal displays the vehicle's battery level and charging / discharging prices at different times in real time, allowing users to adjust their charging / discharging behavior according to their needs.
[0007] Specifically, the steps in step 2 where the two-way interactive management platform makes decisions regarding the charging and discharging status are as follows: Step 2.1, establish the electric vehicle user benefit function, as follows: (1) in, The total revenue for electric vehicle users is the revenue they receive in exchange for discharging electricity from their electric vehicles into the microgrid. The revenue obtained from absorbing the power output of new energy sources Compared to the benefits to users under normal attrition after introducing reinforcement learning algorithms The revenue consists of three parts; The first part discusses the benefits users receive by feeding electricity from their electric vehicles into the microgrid. middle, The real-time electricity price at time t is expressed in yuan / kWh. Let t be the total discharge power of electric vehicle users at time t. Under constant voltage, it is determined by the discharge current. The higher the current, the greater the discharge power. This is a time interval, set to 5 minutes. State of Charge (SOC) determines the upper limit of the battery's discharge capacity; therefore, if the SOC is too low... This will be limited, preventing the battery from discharging into the microgrid. Therefore, this part directly depends on the battery's current SOC and discharge capacity, reflecting the impact of battery state on immediate returns.
[0008] Part Two: Benefits from Absorbing New Energy Power middle, The sharing factor between wind and solar power plants and users for the benefits gained from reducing curtailment of solar and wind power is set to 0.5. Let be the real-time electricity price at time t; The battery is designed to absorb the power from renewable energy sources in electric vehicles. If the state of charge (SOC) is close to full, the battery cannot absorb any more renewable energy.
[0009] Part Three: The user's gains compared to normal losses after introducing reinforcement learning algorithms. middle, and These represent the average lifespan cost of electric vehicle batteries before and after optimization, per unit energy, in yuan / kWh. Let t be the total charging and discharging power of the electric vehicle at time t. Battery life cost. and Directly affected by SOH and DOD, a larger DOD results in more severe battery degradation and higher costs before optimization. Reinforcement learning optimization reduces DOD by controlling the charge / discharge strategy, thereby lowering battery lifespan costs. Constrained by SOC (State of Charge), excessively high or low SOC limits charging and discharging behavior, which is also determined by the charging and discharging current. Optimization strategies reduce battery loss by adjusting the current. This section demonstrates how optimization protects the long-term health of the battery by showing that battery life cost, charging and discharging power are closely related to SOC, SOH (State of Health), and DOD (Depth of Discharge).
[0010] Step 2.2, construct a composite constraint guarantee mechanism based on SOC, DOD, and C-rate, as follows: (2) The parameters in equation (2) are set as follows: , , , ; In this constraint mechanism, SOC represents the percentage of the battery's current charge relative to its rated capacity, and is the core indicator for measuring the battery's state of energy; DOD represents the degree to which the battery has been discharged, complementing SOC and directly affecting the battery's lifespan; C-rate represents the amount of current required to charge or discharge the battery to its rated capacity within a specified time, affecting the battery's performance and lifespan, and a high C-rate may accelerate battery aging; ECL refers to the battery cycle life, which is the number of charge and discharge cycles a battery can undergo under specified charge and discharge conditions before its capacity or performance drops to a certain specified percentage of its initial value (here set to 80%).
[0011] The mechanism works by real-time monitoring of SOC, DOD, and C-rate, combined with preset formulas and parameters, to calculate the battery's ECL under current conditions. By evaluating the ECL, the mechanism can determine the impact of current operating conditions on battery life and adjust the battery's charging and discharging behavior accordingly, thereby achieving a constraint protection function. The ECL calculation formula is as follows: (3) The formula for calculating the depth of discharge (DOD) is as follows: (4) In the formula, Let be the charging and discharging power of the electric vehicle at time t. Let t be the total battery capacity at time t.
[0012] Step 2.3, regarding the charging and discharging control method, the reinforcement learning algorithm DDPG (Deep Deterministic Policy Gradient) is used for decision-making, and the steps are as follows: Step 2.3.1, Initialize the Actor-Critic online and target networks: Randomly initialize the Critic network. and Actor Network , and Let s be the weights, s be the input system state, and a be the action corresponding to the decision. Initialize the Critic target policy network. and Actor Target Policy Network ,by and Initialize target policy network weights and Initialize the experience replay pool; Step 2.3.2: The Actor network interacts with the charge / discharge control system environment, sampling at one-minute intervals, based on the current battery and grid status. Generate corresponding charging and discharging behaviors : (5) This refers to the Actor network in the DDPG algorithm, which accepts the current state. As input, output action . It can be understood as a discrete value, representing different charging and discharging modes. When the value is 1, it indicates discharge; the larger the value, the greater the discharge power. When the value is 1, it indicates charging; the larger the absolute value, the greater the charging power. This indicates standby mode, meaning it's neither charging nor discharging. Different... The value will affect the discharge revenue, renewable energy absorption revenue, and battery life optimization revenue in formula (1), thereby realizing user benefits. Maximize. Because The value of can represent the charging and discharging power, and will affect the value in equation (4). Therefore, it is constrained by the composite guarantee mechanism in (2).
[0013] Step 2.3.3, perform the action. Observation Rewards and the next state , sample Deposit into the experience replay pool, rewards The calculation formula is as follows: (6) in, This is the penalty coefficient (yuan / kWh) for battery life loss, used to quantify the impact of charging and discharging on battery aging, with a value of 0.01; The reward coefficient (yuan / kWh) for renewable energy consumption is used to encourage batteries to consume renewable energy for charging, and its value is 0.05. , and All of them are parameters in formula (1).
[0014] Step 2.3.4: Randomly sample from the experience replay pool, drawing a small batch of N samples. The Actor target network is trained to calculate the state. The following action The formula is as follows: (7) Then, the target value Q is calculated using the Critic target network, as shown in the following formula: (8) in, As a discount factor, represents the Q-value of the Critic target network.
[0015] The loss function is the difference L between the current Q-value of the Critic network and the target Q-value. (9) The loss function is minimized using the gradient descent algorithm, and then the Critic network parameters are backpropagated. Then, updates are performed; based on the gradient of the Q-value output by the Critic network with respect to the action, the Actor network is guided on how to adjust the action to improve the Q-value, and then the Actor online network parameters are updated using gradient ascent. .
[0016] Perform a soft update on the target network, gradually synchronizing parameters as follows: (10) Among them, parameters <<1; Under the condition that formula (2) holds, iterate through step 2.3.4 until convergence. If the average Q value fluctuation is less than the threshold, or the number of training rounds reaches the target, the electric vehicle user benefit function in formula (1) is obtained. The optimal solution.
[0017] Step 2.3.5, the Actor determines the next battery and grid state. Generate corresponding charging and discharging behaviors And repeat steps 2.3.3 to 2.3.4.
[0018] The beneficial effects of this invention are: Compared with existing charging and discharging control methods, this invention can solve the dynamic scheduling problem in the charging and discharging control of electric vehicles and the power grid by leveraging reinforcement learning. It maximizes the charging and discharging benefits for users while ensuring the charging needs of electric vehicles, and also plays a role in peak shaving and valley filling for the power grid. This invention establishes a composite constraint guarantee mechanism, integrating action masking and adaptive reward reshaping technology to construct a three-dimensional constraint space combining SOC, DOD, and C-rate, thus avoiding dangerous actions outside the physically feasible domain during the policy exploration phase. Attached Figure Description
[0019] Figure 1 This is a diagram of the charging and discharging control system of the present invention; Figure 2 This is a diagram of the battery state monitoring and constraint module of the charging and discharging control system of the present invention. Figure 3 This is a diagram of the power grid load and real-time electricity price module of the charging and discharging control system of the present invention; Figure 4 This is a diagram of the user instruction analysis module of the charging and discharging control system of the present invention; Figure 5 This is a schematic diagram of the charging and discharging control method of the present invention. Detailed Implementation
[0020] To more clearly and completely illustrate the purpose and advantages of the present invention, the technical solutions of the embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the present invention, and not all of the embodiments.
[0021] In this invention, a reinforcement learning-based charging and discharging control system and a charging and discharging control method for electric vehicles and the power grid are designed for scenarios equipped with bidirectional charging piles. This system addresses the dynamic scheduling problem in the charging and discharging of electric vehicles and the power grid, thereby maximizing user benefits while meeting user needs and ensuring power grid safety.
[0022] Figure 1 This is an overall schematic diagram of a charging and discharging control system according to an embodiment of the present invention. The specific steps are as follows: Step 1: Obtain the vehicle's battery information status through the on-board battery management system, including state of charge (SOC), state of health (SOH), and depth of charge / discharge (DOD).
[0023] Step 2: Connect to the vehicle battery management system through the two-way interactive management platform, and make decisions on the charging and discharging status based on the obtained battery status, grid load, and real-time electricity price, and control the charging and discharging status.
[0024] Step 3: Connect the bidirectional charging and discharging pile to the bidirectional interactive management platform, and adjust the charging and discharging according to the decisions of the management platform to control the direction and magnitude of the charging and discharging current transmission.
[0025] Step 4: The mobile terminal displays the vehicle's battery level in real time and the charging and discharging electricity prices at different times, allowing users to adjust their charging and discharging behavior according to their needs.
[0026] The following section adds specific modules to each step to achieve modular control of the system designed in this invention. Figure 2 This is a diagram of a battery state monitoring and constraint module for a charge / discharge control system according to an embodiment of the present invention, used in step 1. The battery state monitoring module is used to acquire battery information of the electric vehicle, including the battery's state of charge, state of health, depth of charge / discharge, and charge / discharge current. The constraint module is used to impose conditional constraints on the acquired battery information of the electric vehicle, constructing a three-dimensional constraint space of SOC-DOD-power.
[0027] Figure 3 This is a diagram of a grid load and real-time electricity price module for a charging and discharging control system according to an embodiment of the present invention, used in step 2. The grid load module is used to interact with the grid in real time to obtain the grid load status, the grid's allocable power, and the available power to be connected. The real-time electricity price module is used to obtain the charging and discharging electricity prices for each time period from the grid.
[0028] Figure 4 This is a user instruction analysis module diagram of a charge / discharge control system according to an embodiment of the present invention, used in step 4. The user instruction analysis module is used to receive user instructions, including the user-selected charge / discharge start time, end time, and battery charging requirements.
[0029] The two-way interactive management module receives information from all the above modules, obtains battery information of electric vehicles through the battery status monitoring module, and obtains grid status and charging and discharging electricity price from the grid load module and real-time electricity price module. Combined with the user instruction analysis module, it calculates the optimal charging and discharging time period and power, and sends instructions to the charging and discharging pile to realize the scheduling of charging and discharging behavior.
[0030] Figure 5 This is an overall schematic diagram of a charging and discharging control method provided in an embodiment of the present invention, used for the charging and discharging state decision and control of the charging and discharging state of the bidirectional interactive platform in step 2. The specific steps are as follows: Step 2.1, establish the electric vehicle user benefit function, as follows: (1) in, The total revenue for electric vehicle users is the revenue they receive in exchange for discharging electricity from their electric vehicles into the microgrid. The revenue obtained from absorbing the power output of new energy sources Compared to the benefits to users under normal attrition after introducing reinforcement learning algorithms The revenue consists of three parts; The first part discusses the benefits users receive by feeding electricity from their electric vehicles into the microgrid. middle, The real-time electricity price at time t is expressed in yuan / kWh. Let t be the total discharge power of electric vehicle users at time t. Under constant voltage, it is determined by the discharge current. The higher the current, the greater the discharge power. This is a time interval, set to 5 minutes. State of Charge (SOC) determines the upper limit of the battery's discharge capacity; therefore, if the SOC is too low... This will be limited, preventing the battery from discharging into the microgrid. Therefore, this part directly depends on the battery's current SOC and discharge capacity, reflecting the impact of battery state on immediate returns.
[0031] Part Two: Benefits from Absorbing New Energy Power middle, The sharing factor between wind and solar power plants and users for the benefits gained from reducing curtailment of solar and wind power is set to 0.5. Let be the real-time electricity price at time t; The battery is designed to absorb the power from renewable energy sources in electric vehicles. If the state of charge (SOC) is close to full, the battery cannot absorb any more renewable energy.
[0032] Part Three: The user's gains compared to normal losses after introducing reinforcement learning algorithms. middle, and These represent the average lifespan cost of electric vehicle batteries before and after optimization, per unit energy, in yuan / kWh. Let t be the total charging and discharging power of the electric vehicle at time t. Battery life cost. and Directly affected by SOH and DOD, a larger DOD results in more severe battery degradation and higher costs before optimization. Reinforcement learning optimization reduces DOD by controlling the charge / discharge strategy, thereby lowering battery lifespan costs. Constrained by SOC (State of Charge), excessively high or low SOC limits charging and discharging behavior, which is also determined by the charging and discharging current. Optimization strategies reduce battery loss by adjusting the current. This section demonstrates how optimization protects the long-term health of the battery by showing that battery life cost, charging and discharging power are closely related to SOC, SOH (State of Health), and DOD (Depth of Discharge).
[0033] Step 2.2, construct a composite constraint guarantee mechanism based on SOC, DOD, and C-rate, as follows: (2) The parameters in equation (2) are set as follows: , , , ; In this constraint mechanism, SOC represents the percentage of the battery's current charge relative to its rated capacity, and is the core indicator for measuring the battery's state of energy; DOD represents the degree to which the battery has been discharged, complementing SOC and directly affecting the battery's lifespan; C-rate represents the amount of current required to charge or discharge the battery to its rated capacity within a specified time, affecting the battery's performance and lifespan, and a high C-rate may accelerate battery aging; ECL refers to the battery cycle life, which is the number of charge and discharge cycles a battery can undergo under specified charge and discharge conditions before its capacity or performance drops to a certain specified percentage of its initial value (here set to 80%).
[0034] The mechanism works by real-time monitoring of SOC, DOD, and C-rate, combined with preset formulas and parameters, to calculate the battery's ECL under current conditions. By evaluating the ECL, the mechanism can determine the impact of current operating conditions on battery life and adjust the battery's charging and discharging behavior accordingly, thereby achieving a constraint protection function. The ECL calculation formula is as follows: (3) The formula for calculating the depth of discharge (DOD) is as follows: (4) In the formula, Let be the charging and discharging power of the electric vehicle at time t. Let t be the total battery capacity at time t.
[0035] Step 2.3, regarding the charging and discharging control method, the reinforcement learning algorithm DDPG (Deep Deterministic Policy Gradient) is used for decision-making, and the steps are as follows: Step 2.3.1, Initialize the Actor-Critic online and target networks: Randomly initialize the Critic network. and Actor Network , and Let s be the weights, s be the input system state, and a be the action corresponding to the decision. Initialize the Critic target policy network. and Actor Target Policy Network ,by and Initialize target policy network weights and Initialize the experience replay pool; Step 2.3.2: The Actor network interacts with the charge / discharge control system environment, sampling at one-minute intervals, based on the current battery and grid status. Generate corresponding charging and discharging behaviors : (5) This refers to the Actor network in the DDPG algorithm, which accepts the current state. As input, output action . It can be understood as a discrete value, representing different charging and discharging modes. When the value is 1, it indicates discharge; the larger the value, the greater the discharge power. When the value is 1, it indicates charging; the larger the absolute value, the greater the charging power. This indicates standby mode, meaning it's neither charging nor discharging. Different... The value will affect the discharge revenue, renewable energy absorption revenue, and battery life optimization revenue in formula (1), thereby realizing user benefits. Maximize. Because The value of can represent the charging and discharging power, and will affect the value in equation (4). Therefore, it is constrained by the composite guarantee mechanism in (2).
[0036] Step 2.3.3, perform the action. Observation Rewards and the next state , sample Deposit into the experience replay pool, rewards The calculation formula is as follows: (6) in, This is the penalty coefficient (yuan / kWh) for battery life loss, used to quantify the impact of charging and discharging on battery aging, with a value of 0.01; The reward coefficient (yuan / kWh) for renewable energy consumption is used to encourage batteries to consume renewable energy for charging, and its value is 0.05. , and All of them are parameters in formula (1).
[0037] Step 2.3.4: Randomly sample from the experience replay pool, drawing a small batch of N samples. Training is performed, and the Actor target network calculates the state. The following action The formula is as follows: (7) Then, the target value Q is calculated using the Critic target network, as shown in the following formula: (8) in, As a discount factor, represents the Q-value of the Critic target network.
[0038] The loss function is the difference L between the current Q-value of the Critic network and the target Q-value. (9) The loss function is minimized using the gradient descent algorithm, and then the Critic network parameters are backpropagated. Then, updates are performed; based on the gradient of the Q-value output by the Critic network with respect to the action, the Actor network is guided on how to adjust the action to improve the Q-value, and then the gradient ascent method is used to update the parameters of the online Actor network. .
[0039] Perform a soft update on the target network, gradually synchronizing parameters as follows: (10) Among them, parameters <<1; Under the condition that formula (2) holds, iterate through step 2.3.4 until convergence. If the average Q value fluctuation is less than the threshold, or the number of training rounds reaches the target, the electric vehicle user benefit function in formula (1) is obtained. The optimal solution.
[0040] Step 2.3.5, the Actor determines the next battery and grid state. Generate corresponding charging and discharging behaviors And repeat steps 2.3.3 to 2.3.4.
[0041] Compared with existing charging and discharging control methods, this invention can solve the dynamic scheduling problem in the charging and discharging control of electric vehicles and the power grid by leveraging reinforcement learning. It maximizes the charging and discharging benefits for users while ensuring the charging needs of electric vehicles, and also plays a role in peak shaving and valley filling for the power grid. This invention establishes a composite constraint guarantee mechanism, integrating action masking and adaptive reward reshaping technology to construct a three-dimensional constraint space combining SOC, DOD, and C-rate, thus avoiding dangerous actions outside the physically feasible domain during the policy exploration phase.
[0042] The technical solution of this invention achieves modular control of the charging and discharging control system provided in this embodiment by setting up a battery status monitoring and constraint module, a grid load and real-time electricity price module, a user command analysis module, and a two-way interactive management module. Simultaneously, reinforcement learning is employed in the two-way interactive management module to overcome the problems of dynamic changes in grid load, grid electricity price, and electric vehicle status. This maximizes user benefits while meeting user needs and grid safety, designing an efficient charging and discharging control system and a charging and discharging control method for electric vehicles and the grid in scenarios equipped with two-way charging piles.
[0043] It should be understood that the steps in the various forms of the process described above can be reordered, added, or deleted. That is, as long as the steps described in this invention can achieve the expected results of the technical solution of this invention, they can be performed in the same or different order as in the technical solution. No restrictions are placed on the execution of the steps herein.
[0044] The specific implementation methods described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various combinations, modifications, and substitutions of the steps can be made according to design requirements and purposes. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A reinforcement learning-based electric vehicle and power grid charging and discharging control method, characterized by, The charging and discharging control system consists of an on-board battery management system, a two-way interactive management platform, a two-way charging and discharging pile, and a mobile terminal. The control method steps executed by this control system are as follows: Step 1: Obtain the vehicle's battery status through the vehicle battery management system. The vehicle's battery status includes the state of charge (SOC), state of health (SOH), depth of charge / discharge (DOD), and charge / discharge current. Step 2: The two-way interactive management platform connects to the vehicle battery management system and makes decisions on the charging and discharging status based on the battery status obtained by the vehicle battery management system and the grid load and real-time electricity price obtained from the grid. Step 3: The bidirectional charging and discharging pile is connected to the bidirectional interactive management platform. The charging and discharging are adjusted according to the decisions of the bidirectional interactive management platform to control the direction and magnitude of the charging and discharging current. Step 4: The mobile terminal displays the vehicle's battery level and charging / discharging prices at different times in real time, allowing users to adjust their charging / discharging behavior according to their needs. The specific steps in step 2 where the two-way interactive management platform makes charging and discharging status decisions are as follows: Step 2.1, establish the electric vehicle user benefit function, as follows: (1) wherein, Total income of the electric vehicle user, income obtained by the user from the micro-grid in exchange for electricity in the electric vehicle , income obtained by absorbing new energy output and the income of the user compared with the normal loss after introducing the reinforcement learning algorithm The income of the three parts; The first part discusses the benefits users receive by feeding electricity from their electric vehicles into the microgrid. middle, The real-time electricity price at time t is expressed in yuan / kWh. Let t be the total discharge power of electric vehicle users at time t. Under constant voltage, it is determined by the discharge current. The higher the current, the greater the discharge power. The time interval is 5 minutes; the state of charge (SOC) determines the upper limit of the battery's discharge energy, therefore, if the SOC is too low, This will be limited and unable to discharge to the microgrid; therefore, this part directly depends on the battery’s current state of charge (SOC) and discharge capacity, reflecting the impact of the battery’s state of charge on immediate benefits. Part Two: Benefits from Absorbing New Energy Power middle, The sharing factor between wind and solar power plants and users for the benefits gained from reducing curtailment of solar and wind power is set to 0.
5. Let be the real-time electricity price at time t; The battery is designed to absorb the power of new energy sources for electric vehicles; if the state of charge (SOC) is close to full load, the battery cannot absorb more new energy sources. Part Three: The user's gains compared to normal losses after introducing reinforcement learning algorithms. middle, and These represent the average lifespan cost of electric vehicle batteries before and after optimization, per unit energy, in yuan / kWh. The total charging and discharging power of the electric vehicle at time t; battery life cost. and Directly affected by State of Health (SOH) and Depth of Charge / Discharge (DOD), the larger the DOD, the more severe the battery degradation and the higher the cost before optimization. After reinforcement learning optimization, the DOD is reduced by controlling the charge and discharge strategy, thereby reducing the battery life cost. Constrained by the state of charge (SOC), excessively high or low SOC limits charging and discharging behavior, which is also determined by the charging and discharging current. The optimization strategy reduces battery loss by adjusting the current. This part is closely related to battery life cost, charging and discharging power, SOC, state of health (SOH), and depth of charge / discharge (DOD), reflecting the optimization's protection of the battery's long-term health. Step 2.2: Construct a composite constraint guarantee mechanism based on State of Charge (SOC), Depth of Charge (DOD), and C-rate, as follows: (2) The parameters in equation (2) are set as follows: , , , ; In this constraint guarantee mechanism, the State of Charge (SOC) represents the percentage of the battery's current charge relative to its rated capacity, and is the core indicator for measuring the battery's energy state; the Depth of Charge (DOD) represents the degree to which the battery has been discharged, complementing the SOC and directly affecting the battery's lifespan; the Charge-Rate (C-rate) represents the amount of current required to charge or discharge the battery to its rated capacity within a specified time, affecting the battery's performance and lifespan, and a high C-rate may accelerate battery aging; the Cycle Life (ECL) refers to the battery's cycle life, which is the number of charge-discharge cycles the battery can undergo after experiencing multiple full charge-discharge cycles under specified charge-discharge conditions, at a certain percentage of its initial capacity or performance (here set to 80%). The mechanism works by real-time monitoring of the State of Charge (SOC), Depth of Charge (DOD), and C-rate, combined with preset formulas and parameters, to calculate the Battery's ECL (Energy Capacity Limit) under current conditions. By evaluating the ECL, the mechanism can determine the impact of current operating conditions on battery life and adjust the battery's charging and discharging behavior accordingly, thereby achieving a constraint protection function. The ECL calculation formula is as follows: (3) The formula for calculating the depth of charge / discharge (DOD) is as follows: (4) In the formula, Let be the charging and discharging power of the electric vehicle at time t. Let be the total battery capacity at time t; Step 2.3: Regarding the charge / discharge control method, the reinforcement learning algorithm DDPG is used for decision-making to obtain the next state. Electric vehicle user benefit function in formula (1) The action corresponding to the optimal solution .
2. The electric vehicle and grid charging / discharging control method based on reinforcement learning according to claim 1, characterized in that, The specific steps for making decisions using the reinforcement learning algorithm DDPG in step 2.3 are as follows: Step 2.3.1, Initialize the Actor-Critic online and target networks: Randomly initialize the Critic network. and Actor Network , and Let s be the weights, s be the input system state, and a be the action corresponding to the decision. Initialize the Critic target policy network. and Actor Target Policy Network ,by and Initialize target policy network weights and Initialize the experience replay pool; Step 2.3.2: The Actor network interacts with the charge / discharge control system environment, sampling at one-minute intervals, based on the current battery and grid status. Generate corresponding charging and discharging behaviors : (5) This refers to the Actor network in the DDPG algorithm, which accepts the current state. As input, output action ; It can be understood as a discrete value representing different charging and discharging modes; When the value is 1, it indicates discharge; the larger the value, the greater the discharge power. When the value is 1, it indicates charging; the larger the absolute value, the greater the charging power. This indicates standby mode, meaning it's neither charging nor discharging; different... The value will affect the discharge revenue, renewable energy absorption revenue, and battery life optimization revenue in formula (1), thereby realizing user benefits. Maximize; because The value of can represent the charging and discharging power, and will affect the value in equation (4). Therefore, it is constrained by the composite protection mechanism in (2); Step 2.3.3, perform the action. Observation Rewards and the next state , sample Deposit into the experience replay pool, rewards The calculation formula is as follows: (6) in, This is a penalty coefficient for battery life loss, used to quantify the impact of charging and discharging on battery aging, with a value of 0.
01. The reward coefficient for renewable energy consumption is used to encourage batteries to consume renewable energy for charging, and its value is 0.
05. , and All of them are parameters in formula (1); Step 2.3.4: Randomly sample from the experience replay pool, drawing a small batch of N samples. The Actor target network is trained to calculate the state. The following action The formula is as follows: (7) Then, the target value Q is calculated using the Critic target network, as shown in the following formula: (8) in, As a discount factor, The Q-value of the Critic target network; The loss function is the difference L between the current Q-value of the Critic network and the target Q-value. (9) The loss function is minimized using the gradient descent algorithm, and then the Critic network parameters are backpropagated. Then, updates are performed; based on the gradient of the Q-value output by the Critic network with respect to the action, the Actor network is guided on how to adjust the action to improve the Q-value, and then the Actor online network parameters are updated using gradient ascent. ; Perform a soft update on the target network, gradually synchronizing parameters as follows: (10) Among them, parameters <<1; Under the condition that formula (2) holds, iterate through step 2.3.4 until convergence. If the average Q value fluctuation is less than the threshold, or the number of training rounds reaches the target, the electric vehicle user benefit function in formula (1) is obtained. The optimal solution; Step 2.3.5, the Actor determines the next battery and grid state. Generate corresponding charging and discharging behaviors And repeat steps 2.3.3 to 2.3.4.
Citation Information
Patent Citations
Electric vehicle charging guide strategy method based on hierarchical deep reinforcement learning
CN114117910A
Energy transaction system of multi-party game of multiple electric vehicles and multiple microgrids based on reinforcement learning and considering multiple constraints
CN115358783A
