A method, system, medium and device for energy storage charging and discharging control
Patent Information
- Application Number
- CN202611055342.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-16
- Publication Date
- 2026-10-09
AI Technical Summary
当用户在短时间内因大功率设备启停、生产线切换、空压机或冷机启动、光伏出力骤降等因素产生尖峰负荷时,即使尖峰持续时间较短,也可能抬高整个月的计费需量,导致用户承担较高的基本电费或需量电费
[0016]与现有技术相比,本发明的一种储能充放电控制方法的有益效果如下:通过构建包括月度层、日前层和日内实时层的分层动态阈值控制框架,并基于该框架构建充放电控制模型,使充放电控制模型在输出控制指令时能够随动态生成目标用电阈值而灵活调整,进而在保证储能安全运行的前提下实现削峰填谷和电费优化。
Smart Images

Figure CN122890504A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of microgrid management technology, and in particular to an energy storage charging and discharging control method, system, medium, and equipment. Background Technology
[0002] Electricity bills for industrial and commercial users typically consist of two parts: electricity consumption charge and demand charge. The demand charge is related to the maximum demand or peak load within the billing period, and power companies charge based on monthly peak load. When users experience peak loads within a short period due to factors such as the start-up and shutdown of high-power equipment, production line switching, air compressor or chiller startup, or a sudden drop in photovoltaic output, even if the peak duration is short, it can still increase the billed demand for the entire month, resulting in higher basic electricity charges or demand charges for the user.
[0003] Existing peak shaving and valley filling control methods for industrial and commercial energy storage mainly include fixed threshold control. Fixed threshold control usually sets a peak shaving threshold in advance. When the net load exceeds the threshold, the energy storage discharges, and when the electricity price is low or the load is low, the energy storage charges. This method is simple to implement, but the load of industrial and commercial users is significantly uncertain. The start-up and shutdown of production equipment may cause short-term high peaks. The fixed threshold cannot be dynamically adjusted according to the load pattern of the day and the monthly peak values that have occurred. This leads to over-discharge during non-critical peak periods and insufficient energy storage capacity during critical peak periods, resulting in reduced peak shaving effect and reduced electricity cost optimization benefits.
[0004] Therefore, there is an urgent need for a dynamic threshold generation method for energy storage charging and discharging control, so that the energy storage system no longer operates according to fixed thresholds, in order to achieve peak shaving and valley filling and electricity cost optimization while ensuring the safe operation of energy storage. Summary of the Invention
[0005] In order to overcome the shortcomings of the prior art, the present invention aims to provide an energy storage charging and discharging control method, system, medium and device, which can dynamically generate thresholds so that the energy storage system no longer operates according to fixed thresholds, so as to achieve peak shaving and valley filling and electricity cost optimization while ensuring the safe operation of energy storage.
[0006] This invention is implemented according to the following scheme: A method for controlling the charging and discharging of energy storage is provided, including: Obtain net load data, energy storage data, electricity price data, and real-time data; Based on the net load data, the energy storage data, and the electricity price data, a charge-discharge control model with a hierarchical dynamic threshold control framework is constructed. The hierarchical dynamic threshold control framework includes a monthly layer for determining the monthly target peak boundary, a day-ahead layer for determining the daily threshold range under the constraints of the monthly layer, and an intraday real-time layer for dynamically generating the target electricity consumption threshold within the daily threshold range. The real-time data is input into the charge-discharge control model, and the charge-discharge control model outputs the charge-discharge control command of the energy storage system in the current control cycle.
[0007] Optionally, based on the net load data, the energy storage data, and the electricity price data, a charge-discharge control model with a hierarchical dynamic threshold control framework is constructed, including: Based on the net load data, the energy storage data, and the electricity price data, a state space is constructed. Based on the energy storage data, an action space is constructed, and the action space outputs charging and discharging control actions to control the energy storage system. Based on the net load data, the energy storage data, and the electricity price data, a reward function is constructed to evaluate the charging and discharging control actions; The charging and discharging control model is constructed based on the state space, the action space, and the reward function.
[0008] Optionally, the real-time data is input into the charge-discharge control model, and the charge-discharge control model outputs charge-discharge control commands for the energy storage system in the current control cycle, including: The monthly layer determines the monthly target peak boundary based on the net load data, the energy storage data, and the electricity price data; The day-ahead layer determines the daily threshold range based on the net load data, the energy storage data, and the monthly target peak boundary; The intraday real-time layer dynamically generates the target electricity consumption threshold based on the net load data, the electricity price data, the real-time data, the monthly target peak boundary, and the daily threshold range; The charging and discharging control command is determined based on the energy storage data, the electricity price data, the real-time data, and the target electricity consumption threshold.
[0009] Optionally, the net load data includes the historical load percentile for the same month and the maximum demand that has occurred this month; the energy storage data includes the rated power of energy storage and the available capacity of energy storage; and the electricity price data includes the demand electricity price per unit. The monthly tier determines the monthly target peak boundary based on the net load data, the energy storage data, and the electricity price data, including: Determine the remaining billing days for this month based on the total number of days in the month and the current date; The monthly target peak boundary is determined based on the historical load percentile for the same month, the maximum demand already incurred this month, the rated power of energy storage, the available capacity of energy storage, the unit price of demand electricity, and the remaining billing days for this month.
[0010] Optionally, the electricity price data includes time-of-use electricity prices, and the real-time data includes available energy stored in energy storage. The day-ahead layer determines the daily threshold range based on the net load data, the electricity price data, the real-time data, and the monthly target peak boundary, including: Based on the net load data, a predicted net load curve is obtained; Determine the peak shaving energy demand based on the predicted net load curve and the monthly target peak boundary; The lower limit of the daily threshold is determined based on the peak shaving energy demand, the available energy storage capacity, and the time-of-use electricity price. The daily threshold upper limit is determined based on the monthly target peak boundary, the time-of-use electricity price, and the preset charging safety margin; The daily threshold range is determined based on the daily lower threshold and the daily upper threshold.
[0011] Optionally, the net load data includes the maximum demand that has occurred this month and the historical load window, the electricity price data includes time-of-use electricity price, and the real-time data includes the current time, the current net load data, and the current energy storage charge status. The intraday real-time layer dynamically generates the target electricity consumption threshold based on the net load data, the electricity price data, the real-time data, the monthly target peak boundary, and the daily threshold range, including: The current electricity price is determined based on the current time and the time-of-use electricity price. The threshold adjustment amount is determined based on the historical load window, the current net load, the current energy storage state of charge, the current electricity price, the maximum demand that has occurred this month, and the monthly target peak boundary; The initial electricity consumption threshold is obtained based on the threshold adjustment amount and the preset benchmark threshold. The initial electricity consumption threshold is mapped to the daily threshold range to obtain the target electricity consumption threshold.
[0012] Optionally, the energy storage data includes the maximum discharge power of the energy storage; the electricity price data includes time-of-use electricity price; and the real-time data includes the current time, current net load data, and current energy storage state of charge. Based on the energy storage data, the electricity price data, the real-time data, and the target electricity consumption threshold, the charging and discharging control command is determined, including: Determine the off-peak electricity price period based on the time-of-use electricity price; When the current net load data is greater than the target power consumption threshold, the difference between the current net load data and the target power consumption threshold is taken as the theoretical discharge demand of energy storage, and the discharge power is determined based on the theoretical discharge demand of energy storage, the maximum discharge power of energy storage, and the remaining discharge energy. When the current net load is less than or equal to the target electricity consumption threshold, the current time is during the off-peak electricity price period, and the current energy storage state of charge is lower than the preset state of charge, the charging power is determined according to the preset charging safety constraints. The charge / discharge control command is determined based on the discharge power or the charging power.
[0013] A storage charging and discharging control system is also provided, which applies the aforementioned storage charging and discharging control method, including: The data acquisition module is used to acquire net load data, energy storage data, electricity price data, and real-time data. The model building module constructs a charge-discharge control model with a hierarchical dynamic threshold control framework based on the net load data, the energy storage data, and the electricity price data. The hierarchical dynamic threshold control framework includes a monthly layer for determining the monthly target peak boundary, a day-ahead layer for determining the daily threshold range under the constraints of the monthly layer, and an intraday real-time layer for dynamically generating the target electricity consumption threshold within the daily threshold range. The instruction generation module is used to input the real-time data into the charge-discharge control model, and the charge-discharge control model outputs the charge-discharge control instructions of the energy storage system in the current control cycle.
[0014] A computer-readable storage medium is also provided, which is a computer-readable storage medium storing a computer program thereon, wherein the computer program, when executed, implements the energy storage charging and discharging control method described above.
[0015] A computer device is also provided, including a processor and a memory, wherein the memory stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor to implement the energy storage charging and discharging control method described above.
[0016] Compared with the prior art, the beneficial effects of the energy storage charging and discharging control method of the present invention are as follows: by constructing a hierarchical dynamic threshold control framework including a monthly layer, a day-ahead layer and an intraday real-time layer, and constructing a charging and discharging control model based on the framework, the charging and discharging control model can flexibly adjust according to the dynamically generated target electricity consumption threshold when outputting control commands, thereby achieving peak shaving and valley filling and electricity cost optimization under the premise of ensuring the safe operation of energy storage. Attached Figure Description
[0017] Figure 1 This is a flowchart of the control method of the present invention. Detailed Implementation
[0018] The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.
[0019] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of this application are not limited to the described order of actions, because according to the embodiments of this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of this application.
[0020] In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims. In the description of this application, it should be understood that the terms "first," "second," "third," etc., are used only to distinguish similar objects and are not necessarily used to describe a specific order or sequence, nor should they be construed as indicating or implying relative importance. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.
[0021] See Figure 1 As shown, an energy storage charging and discharging control method of the present invention includes: S1: Obtain net load data, energy storage data, electricity price data, and real-time data; specifically, this is obtained through industrial and commercial user-side meters, microgrid energy management systems, photovoltaic inverters, energy storage converters, battery management systems, and plant monitoring systems.
[0022] In one embodiment of the present invention, net load data is used to represent the actual power demand seen by industrial and commercial users from the grid side. The net load data is obtained by subtracting photovoltaic output from total load and is also obtained by the metering equipment at the grid connection point. The net load data includes, but is not limited to, historical net load sequence, maximum demand that has occurred this month, historical load percentile for the same month, and historical load window.
[0023] In one embodiment of the present invention, the energy storage data includes, but is not limited to, battery state of charge (SOC), maximum energy storage charging power, maximum energy storage discharging power, rated energy storage capacity, rated energy storage power, energy storage charge / discharge efficiency, battery temperature, available energy storage capacity, fault status, rated energy storage power, available energy storage capacity, available energy storage energy, maximum energy storage discharging power, remaining discharge energy, and energy storage state of charge.
[0024] In one embodiment of the present invention, the electricity price data includes, but is not limited to, peak electricity price, flat electricity price, off-peak electricity price, start and end times of each electricity price period, start and end times of the billing cycle, time-of-use electricity price, demand-based electricity price, and off-peak electricity price period.
[0025] In one embodiment of the present invention, after acquiring data from the different sources mentioned above, the data is aligned according to a unified time granularity. For a demand-based billing scenario with a granularity of 30 minutes, the control period can be set to 5 minutes, 15 minutes, or 30 minutes, and matched with the billing rules through a sliding average, maximum value retention, or interpolation method. Then, abnormal data is processed, including: missing value imputation, negative value filtering, communication interruption marking, data removal exceeding the device's rated capacity, and spike retention.
[0026] S2: Based on net load data, energy storage data and electricity price data, a charging and discharging control model with a hierarchical dynamic threshold control framework is constructed. The hierarchical dynamic threshold control framework includes a monthly layer for determining the monthly target peak boundary, a day-ahead layer for determining the daily threshold range under the constraints of the monthly layer, and an intraday real-time layer for dynamically generating the target electricity consumption threshold within the daily threshold range. In one embodiment of the present invention, a charge-discharge control model with a hierarchical dynamic threshold control framework is constructed based on net load data, energy storage data, and electricity price data. This includes: constructing a state space based on net load data, energy storage data, and electricity price data; constructing an action space based on energy storage data, wherein the action space outputs charge-discharge control actions performed by the energy storage system; constructing a reward function for evaluating the charge-discharge control actions based on net load data, energy storage data, and electricity price data; and constructing a charge-discharge control model based on the state space, action space, and reward function.
[0027] In one embodiment of the present invention, the state space is used to represent the current and predicted operating status of the energy storage system, including the current net load, current grid-connected power, current energy storage state of charge, current time characteristics, current time-of-use price, current monthly maximum demand, monthly target peak boundary, remaining days of the current billing cycle and the number of remaining demand billing periods, daily threshold range, daily energy storage discharge energy budget and charging energy budget, predicted net load sequence for the next M control cycles, historical net load sequence for the past N control cycles, load ramp-up value and ramp-up percentile index, photovoltaic fluctuation index, remaining dischargeable energy and remaining rechargeable capacity of energy storage, current dynamic target electricity consumption threshold, and the health status of the energy storage system.
[0028] In one embodiment of the present invention, the action space adopts a continuous action space or a discrete action space; the actions set based on the maximum charge and discharge power and the state of charge boundary in the energy storage data include the adjustment action of the dynamic target power consumption threshold and the control action of the energy storage charge and discharge power; wherein the energy storage charge and discharge power is a continuous value or a discrete level, and the dynamic target power consumption threshold adjustment amount is used to correct the target power consumption threshold of the current control cycle.
[0029] In one embodiment of the present invention, the reward function includes a demand reduction reward, an energy arbitrage reward, a peak shaving success reward, a battery loss penalty, a constraint violation penalty, and a frequent switching penalty; wherein the demand reduction reward is calculated based on the monthly maximum demand change in the net load data, the energy arbitrage reward is calculated based on the time-of-use price and energy storage charging / discharging power in the electricity price data, the peak shaving success reward is calculated based on the difference between the net load and the dynamic target electricity consumption threshold in the net load data, and the battery loss penalty and constraint violation penalty are calculated based on parameters such as charging / discharging power and state of charge in the energy storage data.
[0030] In one embodiment of the present invention, the expression for the reward function is as follows: r_t=w1 R_demand,t+w2 R_energy,t+w3 R_peak,t-w4 C_deg,t-w5 C_violate,t-w6 C_switch,t R_demand,t=K_demand (D_base,t-D_t) R_peak,t=max(0,P_load,t-T_t)-max(0,P_grid,t-T_t) C_deg,t=K_deg (P_ch,t+P_dis,t) Δt Where r_t is the comprehensive reward value for the t-th control period; w1 to w6 are the preset weight coefficients corresponding to the demand reduction reward, power arbitrage reward, peak shaving success reward, battery loss penalty, constraint violation penalty, and frequent switching penalty, respectively; R_demand,t is the demand reduction reward, K_demand is the demand price coefficient, D_base,t is the maximum monthly demand under baseline control, and D_t is the maximum monthly demand after control; R_energy,t is the power arbitrage reward, C_energy,t is the current electricity price, P_dis,t is the energy storage discharge power, and P_ch,t is the energy storage charging power. Electric power, Δt is the control cycle length; R_peak,t is the peak shaving success reward, P_load,t is the current net load, T_t is the current dynamic target power consumption threshold, P_grid,t is the grid-connected power after control; C_deg,t is the battery loss penalty, K_deg is the battery loss coefficient; C_violate,t is the constraint over-limit penalty, including penalties for over-limit of state of charge, over-limit of power, grid-connected power exceeding contract capacity, new peak value caused by off-peak charging, and action output under energy storage fault state; C_switch,t is the frequent switching penalty, used to suppress the energy storage to frequently switch charging and discharging states within adjacent control cycles.
[0031] In one embodiment of the present invention, a charging and discharging control model is constructed based on a state space, an action space, and a reward function, including: using the state space as the input of a reinforcement learning policy model, the action space as the output of the reinforcement learning policy model, and the reward function as the optimization objective during the training of the reinforcement learning policy model.
[0032] When the action space is a continuous action space, the reinforcement learning policy model is trained using Deep Deterministic Policy Gradient (DDPG), Double Delayed Deep Deterministic Policy Gradient (TD3), Soft Actor Critic (SAC), or Proximal Policy Optimization (PPO) algorithms. When the action space is a discrete action space, the reinforcement learning policy model is trained using Deep Q-Network (DQN), Dual DQN, or Dueling DQN algorithms with competing network structures.
[0033] During the training process, each billing cycle is treated as a training round. In the training data consisting of the state space, action space, and reward function, scenarios such as photovoltaic output disturbance, equipment start-up and shutdown peak disturbance, electricity price period disturbance, and energy storage capacity disturbance are added to enhance the data. The actions are also safely projected to ensure that the actions performed by the final energy storage system can meet the constraints of energy storage state of charge, power, and grid connection capacity, thus obtaining the charge and discharge control model.
[0034] S3: Input real-time data into the charge / discharge control model, and the charge / discharge control model outputs charge / discharge control commands for the energy storage system in the current control cycle, including: monthly layer determining the monthly target peak boundary based on net load data, energy storage data, and electricity price data; day-ahead layer determining the daily threshold range based on net load data, energy storage data, and the monthly target peak boundary; intraday real-time layer dynamically generating the target electricity consumption threshold based on net load data, electricity price data, real-time data, the monthly target peak boundary, and the daily threshold range; and determining the charge / discharge control commands based on energy storage data, electricity price data, real-time data, and the target electricity consumption threshold.
[0035] In one embodiment of the present invention, the net load data includes the historical load percentile for the same month and the maximum demand already incurred this month; the energy storage data includes the rated power of energy storage and the available capacity of energy storage; and the electricity price data includes the demand electricity price per unit. The monthly layer determines the monthly target peak boundary based on the net load data, energy storage data, and electricity price data, including: determining the remaining billing days for the month based on the total number of days in the month and the current date; and determining the monthly target peak boundary based on the historical load percentile for the same month, the maximum demand already incurred this month, the rated power of energy storage, the available capacity of energy storage, the demand electricity price per unit, and the remaining billing days for the month.
[0036] This invention dynamically determines the monthly target peak boundary based on the maximum demand that has occurred within the billing cycle and the remaining billing days at the monthly level. It also adjusts the target based on the comparison results between the maximum demand that has occurred and the historical high percentile load, so that the energy storage system prioritizes serving the key peak periods that may reduce demand charges and avoids over-discharging for historical peaks that cannot be changed, thereby achieving effective control of monthly demand charges.
[0037] In one embodiment of the present invention, the electricity price data includes time-of-use electricity price, and the real-time data includes available energy for energy storage. The day-ahead layer determines the daily threshold range based on net load data, electricity price data, real-time data, and the monthly target peak boundary, including: obtaining a predicted net load curve based on the net load data; determining peak-shaving energy demand based on the predicted net load curve and the monthly target peak boundary; determining the daily lower threshold based on the peak-shaving energy demand, available energy for energy storage, and time-of-use electricity price; determining the daily upper threshold based on the monthly target peak boundary, time-of-use electricity price, and a preset charging safety margin; and determining the daily threshold range based on the daily lower threshold and the daily upper threshold.
[0038] This invention combines predicted net load, time-of-use pricing, and monthly target peak boundaries at the day-ahead level. It allocates the daily energy storage budget according to the rules of demand billing window priority, large over-limit priority, long duration priority, and high price priority, thereby determining the daily threshold range. This ensures that the energy storage capacity is prioritized for high-risk periods that are likely to increase monthly demand, avoiding premature depletion of energy during non-critical peak periods and ensuring peak shaving capacity during critical peak periods.
[0039] In one embodiment of the present invention, the net load data includes the maximum demand that has occurred this month and the historical load window, the electricity price data includes the time-of-use price, and the real-time data includes the current time, the current net load data, and the current energy storage state of charge. The intraday real-time layer dynamically generates a target electricity consumption threshold based on the net load data, the electricity price data, the real-time data, the monthly target peak boundary, and the daily threshold range. This includes: determining the current electricity price based on the current time and the time-of-use price; determining the threshold adjustment amount based on the historical load window, the current net load, the current energy storage state of charge, the current electricity price, the maximum demand that has occurred this month, and the monthly target peak boundary; obtaining the initial electricity consumption threshold based on the threshold adjustment amount and a preset benchmark threshold; and mapping the initial electricity consumption threshold to the daily threshold range to obtain the target electricity consumption threshold.
[0040] This invention outputs threshold adjustment amounts based on real-time net load, energy storage state of charge, current electricity price, and load ramping characteristics through a daily real-time layer. It also dynamically corrects the target electricity consumption threshold within the daily threshold range, enabling the peak shaving target to be flexibly adjusted according to real-time peak fluctuations and remaining energy storage capacity. At the same time, it is subject to the hierarchical constraints of the daily threshold range and the monthly target boundary, achieving rapid response and precise peak shaving for short-term disturbances and continuous high loads.
[0041] In one embodiment of the present invention, the energy storage data includes the maximum energy storage discharge power; the electricity price data includes time-of-use electricity price; the real-time data includes the current time, the current net load data, and the current energy storage state of charge; based on the energy storage data, the electricity price data, the real-time data, and the target electricity consumption threshold, a charging and discharging control command is determined, including: determining the off-peak electricity price period based on the time-of-use electricity price; when the current net load data is greater than the target electricity consumption threshold, the difference between the current net load data and the target electricity consumption threshold is taken as the theoretical energy storage discharge demand, and the discharge power is determined based on the theoretical energy storage discharge demand, the maximum energy storage discharge power, and the remaining discharge energy; when the current net load is less than or equal to the target electricity consumption threshold, the current time is during an off-peak electricity price period, and the current energy storage state of charge is lower than a preset state of charge, the charging power is determined based on a preset charging safety constraint; and the charging and discharging control command is determined based on the discharge power or the charging power.
[0042] This invention utilizes a hierarchical dynamic threshold control framework comprised of a monthly layer, a day-ahead layer, and an intraday real-time layer. This allows energy storage systems to move away from relying on fixed thresholds and instead dynamically generate target electricity consumption thresholds that change over time based on the monthly target peak boundary (used to represent monthly demand billing targets), the day-ahead predicted energy budget, and real-time peak risk. This enables the output of charging and discharging power commands, overcoming the shortcomings of fixed threshold control in adapting to load fluctuations and monthly peak changes. Under the premise of ensuring the safe operation of energy storage, this invention effectively reduces demand charges and total electricity costs for industrial and commercial users.
[0043] To verify the technical effect of the present invention, a simulation test was conducted based on a set of historical net load data for industrial and commercial enterprises. The sampling interval of the historical net load data was 30 minutes, and the time range was from November 1, 2025 to January 1, 2026, with a total of 2851 records. In this set of data, the minimum net load was approximately 2460 kW, the maximum was approximately 12610 kW, the average was approximately 7519.63 kW, the 95th percentile load was approximately 10650 kW, the 99th percentile load was approximately 11660 kW, and the maximum increase between adjacent sampling points was approximately 3290 kW.
[0044] The following energy storage system and electricity price data are used: The energy storage system has a rated power of 2 MW, a rated capacity of 4 MWh, a minimum state of charge (SOC) of 10% and a maximum state of charge (SOC) of 90%, an initial SOC of 50%, a charging efficiency of 95% and a discharging efficiency of 95%, allows the energy storage system to be charged from the grid, does not allow backfeeding to the grid, and has a control cycle of 30 minutes.
[0045] The electricity price data uses the Malaysian TNB industrial and commercial TOU electricity price as the simulation assumption: Peak electricity pricing is applied from 8:00 AM to 10:00 PM, Monday to Friday, at $0.0666 / kWh. Off-peak pricing applies at the remaining time, at $0.0580 / kWh. Demand charges are $22 / kW, calculated only for loads during the period from 2:00 PM to 10:00 PM, Monday to Friday, using the maximum grid-connected power during this period within the billing month. Battery degradation penalties are included in the reward function based on equivalent throughput, with $0.03 / kWh throughput used as the training penalty parameter. Electricity charges only include both energy consumption and demand charges. Battery life is presented separately as the equivalent number of cycles.
[0046] The following three control strategies will be compared: 1) No energy storage control: The net load is directly used as grid-connected power, and no energy storage charging and discharging control is performed; The electricity cost simulation results are as follows: the billable demand in November 2025 is 12,200 kW, and in December 2025 it is 12,610 kW, with a total billable demand of 24,810 kW for the two months. The demand cost is US$545,820.00, the electricity cost is US$660,990.38, and the total electricity cost is US$1,206,810.38.
[0047] The simulation results of energy storage operation indicators are as follows: the charging capacity and the discharging capacity are both 0 kWh, the minimum and maximum SOC values are both 50%, and the equivalent cycle number is 0.
[0048] 2) Fixed threshold control: Set a fixed peak shaving threshold. When the net load exceeds the threshold during the demand billing period, the energy storage will discharge and the energy storage will charge during the off-peak electricity price period. The threshold is selected as 11100 kW after threshold scanning. The electricity cost simulation results are as follows: the billable demand for November and December 2025 is 11,100 kW each, the total billable demand for the two months is 22,200 kW, the demand cost is US$488,400.00, the electricity cost is US$661,072.06, and the total electricity cost is US$1,149,472.06. Under the same energy storage power and capacity constraints, fixed threshold control saves $57,338.32 compared to no energy storage control, a saving of 4.75%.
[0049] The simulation results of energy storage operation indicators are as follows: charging capacity is 9279.78 kWh, discharging capacity is 6855.00 kWh, minimum SOC is 12.6%, maximum SOC is 90.0%, and equivalent cycle count is 2.02.
[0050] 3) Dynamic threshold control of the present invention: The model dynamically outputs peak shaving threshold and energy storage power based on the billing month, SOC, predicted load, peak demand that has occurred and the electricity price period.
[0051] The electricity cost simulation results are as follows: the billable demand in November 2025 is 10,200 kW, the billable demand in December 2025 is 11,100 kW, the total billable demand for the two months is 21,300 kW, the demand cost is US$468,600.00, the electricity cost is US$661,067.92, and the total electricity cost is US$1,129,667.92. Under the same energy storage power and capacity constraints, the dynamic threshold control of the present invention saves $77,142.46 compared with no energy storage control, a saving ratio of 6.39%, and saves an additional $19,804.14 compared with fixed threshold control.
[0052] The simulation results of energy storage operation indicators are as follows: charging capacity is 11246.54 kWh, discharging capacity is 8630.00 kWh, minimum SOC is 12.6%, maximum SOC is 90.0%, and equivalent cycle count is 2.48.
[0053] Simulation results of energy storage operation indicators for the three control strategies show that dynamic threshold control operates within the safe range of SOC and does not reach the upper or lower limits of SOC. Compared with fixed threshold control, dynamic threshold control of the present invention increases the effective utilization of energy storage, but the equivalent cycle number is still at a low level, making it suitable for peak shaving scenarios in industrial and commercial sectors that are mainly based on monthly demand management.
[0054] Taking December 10, 2025 as a typical day, a significant peak load occurred between 14:30 and 16:00 on that day. Using the dynamic threshold control of this invention, a target threshold of approximately 11,100 kW was output during the demand-based billing period, and the energy storage discharge was controlled, resulting in the following:
[0055] The results above show that when the net load exceeds the target threshold, the energy storage discharges at the peak over-limit to reduce the grid-connected power to near the target threshold; when the net load is below the target threshold, the energy storage stops discharging to retain power and avoid excessive discharge when not needed.
[0056] As can be seen from the above simulation test results, the dynamic threshold control strategy of the present invention can adaptively adjust the peak shaving target according to the load peak characteristics and energy storage SOC status of different months. Compared with the traditional fixed threshold control, it can further reduce the billing demand and total electricity cost. In practical engineering applications, the charging and discharging control model can be retrained according to the local electricity price policy, energy storage equipment parameters and user production plan to adapt to different scenarios.
[0057] The present invention provides an energy storage charging and discharging control system, which applies the above-mentioned energy storage charging and discharging control method, comprising: The data acquisition module is used to acquire net load data, energy storage data, electricity price data, and real-time data. The model building module constructs a charging and discharging control model with a hierarchical dynamic threshold control framework based on net load data, energy storage data, and electricity price data. The hierarchical dynamic threshold control framework includes a monthly layer for determining the monthly target peak boundary, a day-ahead layer for determining the daily threshold range under the constraints of the monthly layer, and an intraday real-time layer for dynamically generating the target electricity consumption threshold within the daily threshold range. The instruction generation module is used to input real-time data into the charge-discharge control model, and the charge-discharge control model outputs the charge-discharge control instructions of the energy storage system in the current control cycle.
[0058] This invention discloses a computer-readable storage medium storing a computer program thereon, which, when executed, implements the energy storage charging and discharging control method.
[0059] Optionally, the computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), solid-state drives (SSDs), or optical discs, etc. The random access memory may include resistive random access memory (ReRAM) and dynamic random access memory (DRAM).
[0060] The computer device of the present invention includes a processor and a memory. The memory stores at least one instruction, at least one program, code set, or instruction set. The at least one instruction, at least one program, code set, or instruction set is loaded and executed by the processor to implement the above-described energy storage charging and discharging control method.
[0061] The processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0062] The memory can be used to store the computer program or module. The processor implements various functions of the energy storage charging and discharging control method by running or executing the computer program or module stored in the memory and calling the data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function, etc.; the data storage area may store data created based on the use of the mobile phone, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0063] The above are merely preferred embodiments of this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for controlling the charging and discharging of energy storage, characterized in that, include: Obtain net load data, energy storage data, electricity price data, and real-time data; Based on the net load data, the energy storage data, and the electricity price data, a charge-discharge control model with a hierarchical dynamic threshold control framework is constructed. The hierarchical dynamic threshold control framework includes a monthly layer for determining the monthly target peak boundary, a day-ahead layer for determining the daily threshold range under the constraints of the monthly layer, and an intraday real-time layer for dynamically generating the target electricity consumption threshold within the daily threshold range. The real-time data is input into the charge-discharge control model, and the charge-discharge control model outputs the charge-discharge control command of the energy storage system in the current control cycle.
2. The energy storage charging and discharging control method according to claim 1, characterized in that, Based on the net load data, the energy storage data, and the electricity price data, a charge-discharge control model with a hierarchical dynamic threshold control framework is constructed, including: Based on the net load data, the energy storage data, and the electricity price data, a state space is constructed. Based on the energy storage data, an action space is constructed, and the action space outputs charging and discharging control actions to control the energy storage system. Based on the net load data, the energy storage data, and the electricity price data, a reward function is constructed to evaluate the charging and discharging control actions; The charging and discharging control model is constructed based on the state space, the action space, and the reward function.
3. The energy storage charging and discharging control method according to claim 1, characterized in that, The real-time data is input into the charge-discharge control model, and the charge-discharge control model outputs charge-discharge control commands for the energy storage system in the current control cycle, including: The monthly layer determines the monthly target peak boundary based on the net load data, the energy storage data, and the electricity price data; The day-ahead layer determines the daily threshold range based on the net load data, the energy storage data, and the monthly target peak boundary; The intraday real-time layer dynamically generates the target electricity consumption threshold based on the net load data, the electricity price data, the real-time data, the monthly target peak boundary, and the daily threshold range; The charging and discharging control command is determined based on the energy storage data, the electricity price data, the real-time data, and the target electricity consumption threshold.
4. The energy storage charging and discharging control method according to claim 3, characterized in that, The net load data includes the historical load percentile for the same month and the maximum demand that has occurred this month; the energy storage data includes the rated power of energy storage and the available capacity of energy storage; and the electricity price data includes the demand-based electricity price. The monthly tier determines the monthly target peak boundary based on the net load data, the energy storage data, and the electricity price data, including: Determine the remaining billing days for this month based on the total number of days in the month and the current date; The monthly target peak boundary is determined based on the historical load percentile for the same month, the maximum demand already incurred this month, the rated power of energy storage, the available capacity of energy storage, the unit price of demand electricity, and the remaining billing days for this month.
5. The energy storage charging and discharging control method according to claim 3, characterized in that, The electricity price data includes time-of-use electricity prices, and the real-time data includes available energy stored in energy storage. The day-ahead layer determines the daily threshold range based on the net load data, the electricity price data, the real-time data, and the monthly target peak boundary, including: Based on the net load data, a predicted net load curve is obtained; Determine the peak shaving energy demand based on the predicted net load curve and the monthly target peak boundary; The lower limit of the daily threshold is determined based on the peak shaving energy demand, the available energy storage capacity, and the time-of-use electricity price. The daily threshold upper limit is determined based on the monthly target peak boundary, the time-of-use electricity price, and the preset charging safety margin; The daily threshold range is determined based on the daily lower threshold and the daily upper threshold.
6. The energy storage charging and discharging control method according to claim 3, characterized in that, The net load data includes the maximum demand that has occurred this month and historical load windows; the electricity price data includes time-of-use electricity prices; and the real-time data includes the current time, current net load data, and current energy storage charge status. The intraday real-time layer dynamically generates the target electricity consumption threshold based on the net load data, the electricity price data, the real-time data, the monthly target peak boundary, and the daily threshold range, including: The current electricity price is determined based on the current time and the time-of-use electricity price. The threshold adjustment amount is determined based on the historical load window, the current net load, the current energy storage state of charge, the current electricity price, the maximum demand that has occurred this month, and the monthly target peak boundary; The initial electricity consumption threshold is obtained based on the threshold adjustment amount and the preset benchmark threshold. The initial electricity consumption threshold is mapped to the daily threshold range to obtain the target electricity consumption threshold.
7. The energy storage charging and discharging control method according to claim 3, characterized in that, The energy storage data includes the maximum discharge power of the energy storage; the electricity price data includes the time-of-use electricity price; the real-time data includes the current time, the current net load data, and the current energy storage state of charge. Based on the energy storage data, the electricity price data, the real-time data, and the target electricity consumption threshold, the charging and discharging control command is determined, including: Determine the off-peak electricity price period based on the time-of-use electricity price; When the current net load data is greater than the target power consumption threshold, the difference between the current net load data and the target power consumption threshold is taken as the theoretical discharge demand of energy storage, and the discharge power is determined based on the theoretical discharge demand of energy storage, the maximum discharge power of energy storage, and the remaining discharge energy. When the current net load is less than or equal to the target electricity consumption threshold, the current time is during the off-peak electricity price period, and the current energy storage state of charge is lower than the preset state of charge, the charging power is determined according to the preset charging safety constraints. The charge / discharge control command is determined based on the discharge power or the charging power.
8. An energy storage charging and discharging control system, employing the energy storage charging and discharging control method according to any one of claims 1-7, characterized in that, include: The data acquisition module is used to acquire net load data, energy storage data, electricity price data, and real-time data. The model building module constructs a charge-discharge control model with a hierarchical dynamic threshold control framework based on the net load data, the energy storage data, and the electricity price data. The hierarchical dynamic threshold control framework includes a monthly layer for determining the monthly target peak boundary, a day-ahead layer for determining the daily threshold range under the constraints of the monthly layer, and an intraday real-time layer for dynamically generating the target electricity consumption threshold within the daily threshold range. The instruction generation module is used to input the real-time data into the charge-discharge control model, and the charge-discharge control model outputs the charge-discharge control instructions of the energy storage system in the current control cycle.
9. A computer-readable storage medium, characterized in that, It is a computer-readable storage medium on which a computer program is stored, and when the computer program is executed, it implements an energy storage charging and discharging control method as described in any one of claims 1-7.
10. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing at least one instruction, at least one program, code set or instruction set, the at least one instruction, at least one program, code set or instruction set being loaded and executed by the processor to implement an energy storage charging and discharging control method as described in any one of claims 1 to 7.