Energy storage system charging and discharging method and device based on stochastic programming
By optimizing the charging and discharging strategy of the energy storage system using stochastic programming, the problems of unstable returns, insufficient risk management, and battery aging in existing technologies are solved, resulting in higher decision robustness and extended battery life, thus improving the economics of the energy storage system.
Patent Information
- Application Number
- CN202511842154.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-09
- Publication Date
- 2026-01-23
AI Technical Summary
Existing energy storage system charging and discharging strategies rely on deterministic predictions, resulting in unstable returns, poor robustness, lack of risk management mechanisms, and neglect of battery aging costs, leading to impaired equipment lifespan.
A stochastic programming-based approach is adopted. An electricity price probability distribution is generated through an electricity price prediction model. A set of electricity price scenarios is generated using Monte Carlo simulation. A stochastic programming model that includes risk measurement, battery aging cost, and expected total revenue is constructed and solved to optimize the charging and discharging strategy.
It has improved the decision-making robustness and risk control capabilities of energy storage systems in uncertain market environments, extended battery life, improved long-term economics, and reduced the risk of loss under extreme market conditions.
Smart Images

Figure CN121395461A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of energy storage technology, and more specifically, to a charging and discharging method and apparatus for an energy storage system based on stochastic programming. Background Technology
[0002] Energy storage systems generate revenue by charging during periods of low electricity prices and discharging during periods of high electricity prices. However, existing energy storage system charging and discharging strategies have the following drawbacks: (1) Reliance on deterministic predictions: Current strategies are based on a single, deterministic prediction of future electricity prices (i.e., point predictions). Since electricity prices are affected by a variety of random factors and have high uncertainty, prediction deviations can cause the original plan to become suboptimal, or even result in losses. (2) Lack of risk management mechanisms: Traditional optimization models usually take maximizing revenue as the single objective and cannot quantify potential financial risks. (3) Ignoring equipment lifespan costs: The battery charge-discharge cycle life of energy storage systems is limited, and frequent or deep charging and discharging will accelerate its capacity decay, constituting a significant hidden cost.
[0003] In summary, how to provide a charging and discharging method for energy storage systems to synergistically optimize the benefits, risks, and costs of energy storage systems is a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0004] The purpose of this application is to provide a charging and discharging method and apparatus for an energy storage system based on stochastic programming, so as to synergistically optimize the benefits, risks and costs of the energy storage system.
[0005] To achieve the above objectives, the technical solution adopted in this application is as follows: On the one hand, this application provides a charging and discharging method for an energy storage system based on stochastic programming, the method comprising: Acquire electricity market data and energy storage system status data; Based on the electricity market data, a price prediction model is trained, and the trained model is used to generate the probability distribution of electricity prices at each time point within the planning period starting from the current time point. The Monte Carlo simulation method is used to randomly sample the probability distribution of electricity prices at each time point within the planning period to generate a set of electricity price scenarios containing multiple electricity price scenario paths; Based on the set of electricity price scenarios and the state data of the energy storage system, a stochastic programming model containing an objective function and constraints is constructed; the objective function includes a risk metric, a battery aging cost, and an expected total revenue under all electricity price scenario paths. Solving the stochastic programming model yields the charging and discharging strategy of the energy storage system at the current time point.
[0006] Furthermore, the planning period includes X time points, and the time interval between any two adjacent time points is equal to the preset time step, where X = total duration of the planning period / preset time step; The steps for generating an electricity price scenario set containing multiple electricity price scenario paths by randomly sampling the electricity price probability distribution at each time point within the planning period using the Monte Carlo simulation method include: The total number of original electricity price scenario paths to be generated is determined to be N; For each time point within the planning period, N random samples are taken according to the corresponding electricity price probability distribution to obtain N electricity prices for each time point. For the same random sampling, the electricity values corresponding to X time points are connected sequentially in chronological order to obtain an original electricity price scenario path, and the probability of occurrence of each original electricity price scenario path is 1 / N. Using the K-means clustering method, the N original electricity price scenario paths are reduced to M electricity price scenario paths, and the probability of the s-th electricity price scenario path occurring is given by... Where M < N, s = 1, 2, ..., M, , Let be the number of original electricity price scenario paths included in the s-th electricity price scenario path, and ; The M electricity price scenario paths and their corresponding occurrence probabilities together constitute the electricity price scenario set.
[0007] Furthermore, the probability distribution of electricity prices at each time point within the planning period is a normal distribution. The steps for obtaining N electricity values corresponding to each time point within the planning period, based on the corresponding electricity price probability distribution, include: For the t-th time point, during the r-th random sampling, generate a random number that follows a standard normal distribution. Where r = 1, 2, ..., N, t = 1, 2, ..., X; The electricity value at time t in the r-th random sampling Satisfy the following formula: ; in, and Let be the mean and standard deviation of the electricity price probability distribution at time point t, respectively.
[0008] Furthermore, the objective function of the stochastic programming model is: ; in, The expected total revenue under all electricity price scenarios. For battery aging costs, For risk measurement; Let be the probability of the occurrence of the s-th electricity price scenario path. Let X be the electricity value of the s-th electricity price scenario path at time t, where t = 1, 2, ..., X; The preset time step represents the execution duration of the charging and discharging strategy; and Let be the discharge power and charging power of the s-th electricity price scenario path at time t, respectively.
[0009] Furthermore, the battery aging cost Satisfy the following formula: ; in, The aging cost coefficient per unit energy throughput of the battery; The charge-discharge cycle depth factor at time point t is equal to... The difference between the battery's maximum and minimum state of charge over a given time period; The risk measurement Satisfy the following formula: ; in, Risk aversion coefficient; Let be the conditional risk value of the profit distribution under all electricity price scenarios, representing the risk at a confidence level. Below, the expected value of tail loss.
[0010] Furthermore, the constraints of the stochastic programming model include: energy storage state transition constraints, operating boundary constraints, unexpectedness constraints, and operating logic constraints; The energy storage state transition constraint is: ; in, and These refer to the charging efficiency and discharging efficiency of the energy storage system, respectively. The rated capacity of the energy storage system, Let the state of charge of the s-th electricity price scenario path be the state of charge at time t. The operational boundary constraints are: ; ; ; in, and These are the upper and lower limits of the state of charge, respectively. and These are the upper limits for charging power and discharging power of the energy storage system, respectively. The unexpected constraint is: ; ; in, , and i ≠ j; i and j represent any two different electricity price scenario paths; The operational logic constraint is that the energy storage system cannot charge and discharge simultaneously at the same time.
[0011] Furthermore, the steps for obtaining electricity price market data and energy storage system status data include: Collect raw electricity price market data and raw energy storage system status data; By employing downsampling and linear interpolation methods, the time granularity of all collected data is unified to a preset time step, resulting in the processed electricity market data and the energy storage system status data.
[0012] Furthermore, the electricity price prediction model integrates multiple time series prediction models of different types; the steps of training the electricity price prediction model based on the electricity market data, and using the trained electricity price prediction model to generate the probability distribution of electricity prices at each time point within the planning period starting from the current time point, include: A dataset is constructed based on the aforementioned electricity price market data; Each of the time series prediction models is trained using the dataset. Using all the trained time series prediction models, generate the probability distribution of electricity prices at each time point within the planning period starting from the current time point.
[0013] Furthermore, the planning period includes multiple time points, and the time interval between any two adjacent time points is equal to a preset time step. After solving the stochastic programming model to obtain the charging and discharging strategy of the energy storage system at the current time point, the method further includes: After each preset time step, the electricity price probability distribution and the electricity price scenario set are corrected based on the latest electricity price market data and energy storage system status data, and the stochastic programming model is resolved to update the charging and discharging strategy.
[0014] On the other hand, this application also provides a stochastic programming-based energy storage system charging and discharging device for performing the stochastic programming-based energy storage system charging and discharging method as described in any of the foregoing embodiments, the device comprising: The acquisition module is used to acquire electricity price market data and energy storage system status data; The first processing module is used to train an electricity price prediction model based on the electricity price market data, and use the trained electricity price prediction model to generate the electricity price probability distribution corresponding to each time point within the planning period starting from the current time point. The second processing module is used to randomly sample the electricity price probability distribution corresponding to each time point within the planning period using the Monte Carlo simulation method, and generate an electricity price scenario set containing multiple electricity price scenario paths. The construction module is used to construct a stochastic programming model containing an objective function and constraints based on the set of electricity price scenarios and the state data of the energy storage system; the objective function includes a risk metric, a battery aging cost, and an expected total revenue under all electricity price scenario paths. The output module is used to solve the stochastic programming model to obtain the charging and discharging strategy of the energy storage system at the current time point.
[0015] Compared with the prior art, this application has the following advantages: This application provides a method and apparatus for charging and discharging an energy storage system based on stochastic programming. The method includes: acquiring electricity price market data and energy storage system state data; training an electricity price prediction model based on the electricity price market data, and using the trained model to generate the probability distribution of electricity prices at each time point within a planning period starting from the current time point; randomly sampling the probability distribution of electricity prices at each time point within the planning period using Monte Carlo simulation to generate a set of electricity price scenarios containing multiple electricity price scenario paths; constructing a stochastic programming model containing an objective function and constraints based on the electricity price scenario set and the energy storage system state data; the objective function includes a risk metric, a battery aging cost, and the expected total revenue under all electricity price scenario paths; and solving the stochastic programming model to obtain the charging and discharging strategy of the energy storage system at the current time point. This application, by introducing a stochastic programming framework, systematically integrates electricity price uncertainty modeling, dynamic risk quantification, and battery aging cost, achieving multi-objective collaborative optimization of the energy storage system's charging and discharging strategy. This method synergistically optimizes the revenue, risk, and cost of energy storage systems, effectively overcomes the reliance of traditional strategies on deterministic predictions, and significantly improves the decision-making robustness, risk control capabilities, and long-term economic viability of energy storage systems in uncertain market environments. Attached Figure Description
[0016] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0017] Figure 1 One of the flowcharts for a charging and discharging method for an energy storage system based on stochastic programming provided in this application embodiment; Figure 2 A second schematic flowchart illustrating a charging and discharging method for an energy storage system based on stochastic programming, provided for an embodiment of this application; Figure 3 This is a flowchart illustrating the sub-steps of step S100 in an embodiment of this application. Figure 4 This is a flowchart illustrating the sub-steps of step S200 in an embodiment of this application; Figure 5 This is a flowchart illustrating the sub-steps of step S300 in an embodiment of this application. Figure 6 This is a structural block diagram of a stochastic programming-based energy storage system charging and discharging device provided in an embodiment of this application.
[0018] Icons: 10- Energy storage system charging and discharging device based on stochastic programming; 11- Acquisition module; 12- First processing module; 13- Second processing module; 14- Construction module; 15- Output module. Detailed Implementation
[0019] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can be arranged and designed in various different configurations.
[0020] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0021] It should be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0022] As described in the background section, existing energy storage system charging and discharging strategies have the following drawbacks: (1) Unstable returns and poor robustness due to reliance on deterministic electricity price forecasts. The current strategy is based on a single, deterministic forecast of future electricity prices (i.e., point forecasts). Since electricity prices are affected by a variety of random factors and have high uncertainty, forecast deviations can turn the original plan into a suboptimal one, or even result in losses.
[0023] (2) Lack of quantitative assessment and proactive risk control mechanisms for potential losses under extreme market conditions. Traditional optimization models usually take maximizing returns as the single objective and cannot quantify potential financial risks.
[0024] (3) Ignoring the aging costs of battery charging and discharging in pursuit of short-term gains leads to damage to the life cycle value of energy storage assets. The battery charge-discharge cycle life of energy storage systems is limited, and frequent or deep charging and discharging will accelerate its capacity decay, constituting a significant hidden cost.
[0025] Therefore, how to provide a charging and discharging method for energy storage systems to synergistically optimize benefits, risks, and costs is a technical problem that urgently needs to be solved by those skilled in the art.
[0026] To address the aforementioned technical problems, this application provides a method for charging and discharging energy storage systems based on stochastic programming. This method constructs a comprehensive optimization framework to synergistically optimize revenue, risk, and equipment lifespan cost. It involves the application of power system optimization scheduling and artificial intelligence algorithms, and is particularly suitable for the charging and discharging decisions of energy storage systems in the electricity market.
[0027] Specifically, please refer to Figure 1 The energy storage system charging and discharging method based on stochastic programming provided in this application includes the following steps: Step S100: Obtain electricity price market data and energy storage system status data.
[0028] Step S200: Train an electricity price prediction model based on electricity market data, and use the trained electricity price prediction model to generate the probability distribution of electricity prices at each time point within the planning period starting from the current time point.
[0029] It should be noted that the planning period refers to the future time frame considered for formulating the optimal charging and discharging strategy for the energy storage system. For example, the next 24 hours starting from the current time constitute a planning period. A planning period contains multiple time points, and the probability distribution of electricity prices at each time point within the planning period can be obtained through a trained electricity price prediction model. Furthermore, since future electricity prices cannot be accurately predicted, the decision-making time window of the planning period will be updated dynamically during the optimization process to adapt to market changes.
[0030] Step S300: The Monte Carlo simulation method is used to randomly sample the probability distribution of electricity prices at each time point within the planning period to generate a set of electricity price scenarios containing multiple electricity price scenario paths.
[0031] Step S400: Based on the electricity price scenario set and energy storage system state data, construct a stochastic programming model that includes an objective function and constraints. The objective function includes a risk metric, a battery aging cost term, and the expected total revenue term under all electricity price scenario paths.
[0032] Step S500: Solve the stochastic programming model to obtain the charging and discharging strategy of the energy storage system at the current time point.
[0033] Specifically, specialized optimization solvers such as Gurobi and CPLEX, or algorithms specifically designed for stochastic programming, can be used to efficiently solve the stochastic programming model, thereby obtaining the optimal charging and discharging strategy for the current time point. After the solution is completed, the strategy is sent to the power conversion system (PCS) of the energy storage system for execution.
[0034] Therefore, this application, by introducing a stochastic programming framework, systematically integrates electricity price uncertainty modeling, dynamic risk quantification, and battery aging costs to achieve multi-objective collaborative optimization of the charging and discharging strategy for energy storage systems. This method effectively overcomes the dependence of traditional strategies on deterministic predictions and significantly improves the decision-making robustness, risk control capability, and long-term economic viability of energy storage systems in uncertain market environments.
[0035] In one alternative implementation, the planning period includes multiple time points, and the time interval between any two adjacent time points is equal to a preset time step.
[0036] like Figure 2As shown, after step S500, which involves solving the stochastic programming model to obtain the charging and discharging strategy of the energy storage system at the current time point, the energy storage system charging and discharging method based on stochastic programming provided in this application further includes: In step S600, after each preset time step, the electricity price probability distribution and electricity price scenario set are corrected based on the latest electricity price market data and energy storage system status data, and the stochastic programming model is resolved to update the charging and discharging strategy. The execution time of each charging and discharging strategy is equal to the preset time step.
[0037] For example, assume the planning period is the next 24 hours starting from the current time, with a preset time step of 15 minutes. Under this configuration, each charge / discharge strategy executes for 15 minutes, and the entire planning period includes 96 time points. Each time a 15-minute execution period ends (i.e., a charge / discharge strategy is completed), the next decision time point begins. At this point, based on the latest electricity market data and the actual state of the energy storage system, the electricity price probability distribution and electricity price scenario set are corrected, and the stochastic programming model is resolved to generate the latest charge / discharge strategy for the next time period.
[0038] This rolling optimization mechanism enables decisions to continuously and dynamically adapt to new information, thereby achieving online correction and adaptation of charging and discharging strategies.
[0039] As can be seen, the energy storage system charging and discharging method based on stochastic programming provided in this application mainly includes: data acquisition and processing (step S100), electricity price prediction (step S200), generating electricity price scenarios (step S300), constructing a stochastic programming model (step S400), model solving (step S500), rolling optimization and closed-loop control (step S600).
[0040] To better understand the technical solution of this application, the steps of data acquisition and processing, electricity price prediction, generation of electricity price scenarios, and construction of stochastic programming models will be explained in detail below.
[0041] In one alternative implementation, please refer to Figure 3 The step S100, which involves obtaining electricity market data and energy storage system status data, includes sub-steps S110 and S120.
[0042] Step S110: Collect raw electricity price market data and raw energy storage system status data.
[0043] Specifically, raw electricity price market data (i.e., electricity price-related data) is collected from the electricity market information platform, including but not limited to: real-time electricity prices, historical electricity prices, market transaction volume, electricity price forecast data, and environmental data.
[0044] Collect raw energy storage system status data (i.e., the operating status and performance data of the energy storage system) from the energy storage system battery management platform, including but not limited to: battery state of charge (SOC), state of health (SOH), charge and discharge power, charge and discharge efficiency, charge and discharge cycle count, battery temperature, etc.
[0045] Step S120: Using downsampling and linear interpolation methods, the time granularity of all collected data is unified to a preset time step to obtain processed electricity market data and energy storage system status data.
[0046] Since data collected by different devices and platforms differ in temporal granularity, in order to unify data standards to support subsequent analysis, this application adopts a method of downsampling combined with linear interpolation for data preprocessing, unifying multi-source data to the same temporal resolution.
[0047] For example, assuming a preset time step of 15 minutes and the original granularity of charging and discharging power acquisition is once every 5 seconds, then all power samples within each 15-minute period are averaged and downsampled to obtain a charging and discharging power sequence at 15-minute intervals. Similarly, if the original granularity of electricity price-related data acquisition is once every 5 minutes, then averaged downsampling is achieved by calculating the average of the previous three 5-minute electricity price-related data within each 15-minute period. Furthermore, if there is missing data, linear interpolation is performed using valid data from adjacent time points to complete the data, thereby preprocessing all data to a granularity of 15 minutes.
[0048] By using the above methods, we can ensure that all data are aligned in the time dimension, providing a consistent and complete data foundation for subsequent modeling and analysis.
[0049] After data preprocessing, the electricity price prediction model can be trained to generate the probability distribution of electricity prices at each time point within the planning period. To better simulate the uncertainty of electricity price scenarios, in this embodiment, the electricity price prediction model integrates multiple time series prediction models of different types. Optionally, the electricity price prediction model includes, but is not limited to, time series prediction models such as Long Short-Term Memory (LSTM), Gated Recurrent Unit (GRU), and One-Dimensional Convolutional Neural Network (1D-CNN).
[0050] Different time series forecasting models are suitable for electricity price markets with different characteristics. For example, LSTM excels at capturing long-term trends and cyclical patterns in electricity prices, making it suitable for markets with relatively stable price fluctuations and clear cyclical patterns. GRU performs well in handling short-term price abrupt changes and rapid fluctuations, making it suitable for markets with large price fluctuations and frequent peaks. 1D-CNN excels at capturing local patterns (such as the fixed fluctuation patterns of intraday electricity prices), performs well on highly cyclical electricity price data, and its prediction results are more accurate on intraday patterns, making it suitable for markets with obvious intraday peak-valley patterns.
[0051] By integrating multiple time series prediction models such as LSTM, GRU, and 1D-CNN, it is possible to generate electricity price probability distribution scenarios covering different statistical characteristics (such as mean, variance, or quantiles), thereby providing more comprehensive and diverse electricity price inputs for subsequent stochastic programming models and improving the market adaptability and revenue stability of charging and discharging strategies.
[0052] like Figure 4 As shown, step S200, which trains an electricity price prediction model based on electricity price market data and uses the trained model to generate the probability distribution of electricity prices at each time point within the planning period starting from the current time point, includes sub-steps S210, S220, and S230.
[0053] Step S210: Construct a dataset based on electricity price market data.
[0054] Step S220: Train each time series prediction model using the dataset.
[0055] Specifically, a dataset is constructed based on historical electricity price data and auxiliary features (such as thermal power, new energy power generation, temperature, humidity, irradiance, historical transaction volume, time features, etc.) in the electricity price market data, and each time series prediction model is trained using this dataset.
[0056] For example, assume that the historical electricity price data consists of electricity price data every 15 minutes over the past 3 months. First, the electricity price data is normalized to conform to a standard normal distribution. Then, multiple sliding windows are constructed: using data from 672 time points over the past 7 days as input, the probability distribution of electricity prices for 96 time points in the next day is predicted. Optionally, the sliding window step size is 15 minutes.
[0057] That is, the input of the time series forecasting model is the electricity price data of 672 time points in the past 7 days, and the output is the probability distribution of electricity prices at 96 time points in the next day.
[0058] Understandably, electricity market prices typically exhibit significant short-term cyclicality and correlation (e.g., daily peak-valley patterns and weekly regularities). Using a 7-day window effectively captures recent dynamic patterns while avoiding noise and seasonal biases (e.g., monthly variations) that may arise from older historical data. Data from the past three months is used holistically for training and validation of each time series forecasting model. Multiple sliding windows are extracted from the past three months' data to construct the training set, ensuring the model's generalization ability. During the forecasting phase, the sliding window focuses on the most recent 7-day data to improve the accuracy and real-time response capability of short-term forecasts.
[0059] Step S230: Using all trained time series prediction models, generate the electricity price probability distribution for each time point within the planning period starting from the current time point.
[0060] For example, assuming the electricity price forecasting model integrates three different types of time series forecasting models, these three time series forecasting models are trained separately based on the dataset. After training, the latest data from the past 7 days is simultaneously input into these three time series forecasting models, thereby obtaining three different probability distributions of electricity prices for 96 time points within the next 24 hours (i.e., one planning period).
[0061] Subsequently, Monte Carlo simulation was used to randomly sample the three types of electricity price probability distributions to obtain a set of electricity price scenarios containing multiple electricity price scenario paths. Each electricity price scenario path represents a possible future electricity price trend and is associated with a probability of occurrence, thus providing diverse input scenarios for subsequent stochastic programming models.
[0062] It should be noted that this application does not impose a specific limit on the number of time series forecasting models. That is, the electricity price forecasting model can integrate a single time series forecasting model or integrate multiple time series forecasting models to participate in the forecasting.
[0063] To better understand this, the generation process of the electricity price scenario set will be explained in detail below.
[0064] In one alternative implementation, the planning period comprises X time points, and the time interval between any two adjacent time points is equal to a preset time step, where X = total duration of the planning period / preset time step. For example, if the planning period is for the next 24 hours and the preset time step is 15 minutes, then X = 96.
[0065] like Figure 5 As shown, step S300, which uses the Monte Carlo simulation method to randomly sample the probability distribution of electricity prices at each time point within the planning period and generate a set of electricity price scenarios containing multiple electricity price scenario paths, includes sub-steps S310, S320, S330, S340, and S350.
[0066] Step S310: Determine the total number of original electricity price scenario paths to be generated as N.
[0067] To strike a balance between computational complexity and scenario diversity, N is typically set to between 1,000 and 10,000. For example, in this embodiment, N=5,000 can be selected as the total number of original electricity price scenario paths to be generated.
[0068] Step S320: For each time point within the planning period, perform N random samplings based on the corresponding electricity price probability distribution to obtain N electricity values corresponding to each time point.
[0069] The probability distribution of electricity prices at each point in time within the planning period is a normal distribution. That is, the value of electricity at each time point follows a normal distribution.
[0070] The specific method for obtaining N electricity values for each time point within the planning period by performing N random samplings based on the corresponding electricity price probability distribution is as follows: For the t-th time point, during the r-th random sampling, a standard normal distribution random number generator is used to generate a random number that follows a standard normal distribution. Where r = 1, 2, ..., N, t = 1, 2, ..., X.
[0071] Through linear transformation, we can determine the electrical value at time point t of the r-th random sample. Satisfy the following formula: ; in, and Let be the mean and standard deviation of the electricity price probability distribution at time point t, respectively.
[0072] Repeat the above sampling method to obtain N electricity values corresponding to each time point (a total of X time points) within the planning period. (r=1,2,...,N, t=1,2,...,X).
[0073] Step S330: For the same random sampling, connect the electricity values corresponding to X time points in chronological order to obtain an original electricity price scenario path, and the probability of occurrence of each original electricity price scenario path is 1 / N.
[0074] Understandably, for the same random sampling (i.e., the same r), connecting the electricity values corresponding to X time points in chronological order yields a complete original electricity price scenario path, denoted as . Repeat this process N times to obtain N independent original electricity price scenario paths (r=1,2,...,N). Furthermore, based on the uniform sampling characteristics of Monte Carlo simulation, the probability of each original electricity price scenario path occurring can be set to 1 / N.
[0075] Step S340: Using the K-means clustering method, the N original electricity price scenario paths are reduced to M electricity price scenario paths, and the probability of the s-th electricity price scenario path occurring is... .
[0076] Where M < N, s = 1, 2, ..., M, , Let be the number of original electricity price scenario paths included in the s-th electricity price scenario path, and .
[0077] Understandably, since the number N of the original electricity price scenario paths is large, directly using them for subsequent optimization calculations would result in high model dimensionality and difficulty in solving the problem. To reduce computational complexity, this application employs scenario reduction techniques (e.g., K-means clustering) to condense the N original electricity price scenario paths into M representative electricity price scenario paths (M < N) while preserving the probability distribution characteristics of the original electricity price scenarios.
[0078] The probability of the occurrence of the s-th electricity price scenario path (s=1,2,...,M) is: ,satisfy .in, This represents the number of original electricity price scenario paths belonging to the s-th cluster (i.e., the s-th electricity price scenario path) after clustering. Original electricity price scenario paths within the same cluster exhibit high similarity in form and can be considered as different samples of the same market scenario. Furthermore, the sum of the probabilities of occurrence of all electricity price scenario paths equals 1. .
[0079] In step S350, the M electricity price scenario paths and their corresponding occurrence probabilities together form the electricity price scenario set.
[0080] Understandably, each electricity price scenario path is as follows: The corresponding probability of occurrence is Where s = 1, 2, ..., M. The M electricity price scenario paths and their corresponding probabilities together form an electricity price scenario set.
[0081] After obtaining the electricity price scenario set through steps S310 to S350 above, this application constructs a multi-stage stochastic programming model based on the electricity price scenario set and energy storage system state data. The core of this stochastic programming model lies in the construction of the objective function and constraints, and allows users to configure key parameters such as energy storage parameters and risk aversion coefficient according to actual needs.
[0082] To better understand this, we will first explain the construction of the objective function for the stochastic programming model.
[0083] In this embodiment, the objective function aims to maximize a comprehensive utility function. This function not only considers the expected total revenue under all electricity price scenarios but also introduces a risk measurement penalty term and a battery aging cost term to achieve synergistic optimization among revenue, risk, and equipment depreciation costs. Its mathematical expression is as follows: f = max(expected total revenue - battery aging cost - risk measure); Specifically, the objective function of the stochastic programming model is: ; in, This represents the expected total revenue under all electricity price scenarios, which is the probability-weighted sum of the predicted net revenue (electricity sales cost minus electricity purchase cost) under all electricity price scenarios.
[0084] This represents the cost of battery aging, used to value the lifespan loss of a battery during charging and discharging.
[0085] It represents a risk metric used to penalize volatility in returns or potential losses.
[0086] Let be the probability of the occurrence of the s-th electricity price scenario path. Let be the electricity value of the s-th electricity price scenario path at time t, where t=1,2,...,X and s=1,2,...,M.
[0087] The preset time step indicates the execution duration of the charging and discharging strategy.
[0088] and Let be the discharge power and charging power of the s-th electricity price scenario path at time t, respectively. These two are decision variables to be solved in the stochastic programming model.
[0089] Furthermore, battery aging costs It can be modeled as a function related to charge / discharge power and cycle depth, with the specific expression as follows: ; in, This is the aging cost factor per unit energy throughput of the battery. The charge-discharge cycle depth factor at time point t is equal to... The difference between the battery's maximum and minimum state of charge over a given time period.
[0090] Furthermore, this application adopts conditional value at risk as a risk measurement method, which... Satisfy the following formula: ; in, Let be the conditional risk value of the profit distribution under all electricity price scenarios, representing the risk at a confidence level. Below, the expected value of the tail loss. This term is achieved by introducing auxiliary variables and linear constraints into the model.
[0091] Risk aversion coefficient, set by the user: when When the strategy is risk-neutral, the only goal is to maximize expected return; when When a user is risk-averse, it means they are willing to sacrifice some expected returns in exchange for lower tail risk.
[0092] In another alternative implementation, the constraints of the stochastic programming model include: energy storage state transition constraints, operational boundary constraints, unexpectedness constraints, and operational logic constraints. Each constraint will be explained in turn below.
[0093] (1) The energy storage state transition constraint is: ; in, and These refer to the charging efficiency and discharging efficiency of the energy storage system, respectively. The rated capacity of the energy storage system, Let be the state of charge of the s-th electricity price scenario path at time t.
[0094] (2) The operational boundary constraints are: ; ; ; in, and These are the upper and lower limits of the state of charge, respectively. and These are the upper limits for charging power and discharging power of the energy storage system, respectively.
[0095] (3) Unexpected constraints are: ; ; in, And i≠j. i and j represent any two different electricity price scenario paths.
[0096] It should be noted that the unexpectedness constraint is a core constraint in stochastic programming. Its role is to ensure that, before future uncertainties are revealed, for all scenarios with the same historical information at the same time, the decision at time t is... , They must all be identical (i.e.) , ).
[0097] In other words, after the energy storage system completes the charging and discharging strategy for the previous 15 minutes (i.e., the preset time step), when it begins to solve for the charging and discharging strategy for the next time point, it must ensure that the strategy is the same for all electricity price scenarios at the current first time point; in subsequent time points, each scenario is allowed to make differentiated decisions based on its own path. This mechanism ensures that only a "unique and deterministic" charging and discharging strategy is output at each actual execution time, which meets the requirement of "unique current decision" in actual operation.
[0098] (4) The operating logic constraint is: the energy storage system cannot charge and discharge at the same time.
[0099] After constructing the stochastic programming module based on the above objective function and constraints, the model solution in step S500 and the rolling optimization and closed-loop control in step S600 are executed sequentially to complete the entire process.
[0100] Based on the above methodological concept, in another alternative implementation, please refer to... Figure 6 This application also provides a stochastic programming-based energy storage system charging and discharging device 10 for performing the stochastic programming-based energy storage system charging and discharging method as described in any of the foregoing embodiments. The device includes: The acquisition module 11 is used to acquire electricity price market data and energy storage system status data.
[0101] The first processing module 12 is used to train an electricity price prediction model based on electricity price market data, and use the trained electricity price prediction model to generate the probability distribution of electricity prices at each time point within the planning period starting from the current time point.
[0102] The second processing module 13 is used to randomly sample the probability distribution of electricity prices at each time point within the planning period using the Monte Carlo simulation method, and generate an electricity price scenario set containing multiple electricity price scenario paths.
[0103] Module 14 is used to construct a stochastic programming model containing an objective function and constraints based on the set of electricity price scenarios and the state data of the energy storage system. The objective function includes a risk metric, a battery aging cost, and an expected total revenue under all electricity price scenarios.
[0104] Output module 15 is used to solve the stochastic programming model to obtain the charging and discharging strategy of the energy storage system at the current time point.
[0105] Specific limitations regarding the stochastic programming-based energy storage system charging and discharging device 10 can be found in the above-described limitations of the stochastic programming-based energy storage system charging and discharging method, and will not be repeated here. Each module in the stochastic programming-based energy storage system charging and discharging device 10 can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in the electronic device, or stored in the memory of the electronic device in software form, so that the processor can call and execute the operations corresponding to each module.
[0106] In summary, this application provides a method and apparatus for charging and discharging an energy storage system based on stochastic programming. By introducing a stochastic programming framework, it systematically integrates electricity price uncertainty modeling, dynamic risk quantification, and battery aging costs, achieving multi-objective collaborative optimization of the energy storage system's charging and discharging strategy. This method effectively overcomes the dependence of traditional strategies on deterministic predictions, significantly improving the decision-making robustness, risk control capability, and long-term economic viability of the energy storage system in uncertain market environments.
[0107] By introducing stochastic programming, the stochastic programming model can dynamically optimize the charging and discharging strategy of energy storage systems based on real-time electricity price fluctuations, electricity price forecasts, and market uncertainties. Compared with traditional charging and discharging strategies based on fixed schedules, this stochastic programming model can more accurately capture the peak-valley difference in electricity prices, maximizing the benefits of charging during low electricity prices and discharging during high electricity prices.
[0108] The electricity market is subject to unpredictable extreme market conditions, such as sudden surges and crashes in electricity prices. Traditional strategies, lacking modeling for market uncertainty, are prone to losses under extreme conditions. However, stochastic programming-based models, by incorporating probability distributions and scenario analysis, can effectively assess market risk and formulate corresponding strategies. When electricity prices are abnormally high, the model can prioritize discharging to lock in high returns, while when prices are abnormally low, it can choose to charge. This flexibility can reduce the risk of losses under extreme conditions by approximately 30%, further ensuring project stability.
[0109] Battery lifespan is a key factor affecting the long-term economic benefits of energy storage systems. Traditional strategies often ignore the impact of charge / discharge depth and cycle count on battery lifespan, leading to premature battery aging. This random programming model, however, optimizes charge / discharge scheduling to minimize deep charge / discharge cycles, thereby reducing the battery's cycle aging rate. Calculations show that this strategy can extend battery lifespan by 15%-25%, thus delaying battery replacement costs (worth millions of dollars) by 2-3 years, significantly improving the project's long-term economic viability.
[0110] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. 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.
[0111] It will be apparent to those skilled in the art that this application is not limited to the details of the exemplary embodiments described above, and that this application can be implemented in other specific forms without departing from the spirit or essential characteristics of this application. Therefore, the embodiments should be considered illustrative and non-limiting in all respects, and the scope of this application is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within this application. No reference numerals in the claims should be construed as limiting the scope of the claims.
Claims
1. A charging and discharging method for an energy storage system based on stochastic programming, characterized in that, The method includes: Acquire electricity market data and energy storage system status data; Based on the electricity market data, a price prediction model is trained, and the trained model is used to generate the probability distribution of electricity prices at each time point within the planning period starting from the current time point. The Monte Carlo simulation method is used to randomly sample the probability distribution of electricity prices at each time point within the planning period to generate a set of electricity price scenarios containing multiple electricity price scenario paths; Based on the set of electricity price scenarios and the state data of the energy storage system, a stochastic programming model containing an objective function and constraints is constructed; the objective function includes a risk metric, a battery aging cost, and an expected total revenue under all electricity price scenario paths. Solving the stochastic programming model yields the charging and discharging strategy of the energy storage system at the current time point.
2. The charging and discharging method for an energy storage system based on stochastic programming according to claim 1, characterized in that, The planning period includes X time points, and the time interval between any two adjacent time points is equal to the preset time step. X = total duration of the planning period / preset time step. The steps for generating an electricity price scenario set containing multiple electricity price scenario paths by randomly sampling the electricity price probability distribution at each time point within the planning period using the Monte Carlo simulation method include: The total number of original electricity price scenario paths to be generated is determined to be N; For each time point within the planning period, N random samples are taken according to the corresponding electricity price probability distribution to obtain N electricity prices for each time point. For the same random sampling, the electricity values corresponding to X time points are connected sequentially in chronological order to obtain an original electricity price scenario path, and the probability of occurrence of each original electricity price scenario path is 1 / N. Using the K-means clustering method, the N original electricity price scenario paths are reduced to M electricity price scenario paths, and the probability of the s-th electricity price scenario path occurring is given by... Where M < N, s = 1, 2, ..., M, , Let be the number of original electricity price scenario paths included in the s-th electricity price scenario path, and ; The M electricity price scenario paths and their corresponding occurrence probabilities together constitute the electricity price scenario set.
3. The charging and discharging method for an energy storage system based on stochastic programming according to claim 2, characterized in that, The probability distribution of electricity prices at each point in time within the planning period is normal. The steps for obtaining N electricity values corresponding to each time point within the planning period, based on the corresponding electricity price probability distribution, include: For the t-th time point, during the r-th random sampling, generate a random number that follows a standard normal distribution. Where r = 1, 2, ..., N, t = 1, 2, ..., X; The electricity value at time t in the r-th random sampling Satisfy the following formula: ; in, and Let be the mean and standard deviation of the electricity price probability distribution at time point t, respectively.
4. The charging and discharging method for an energy storage system based on stochastic programming according to claim 2, characterized in that, The objective function of the stochastic programming model is: ; in, The expected total revenue under all electricity price scenarios. For battery aging costs, For risk measurement; Let be the probability of the occurrence of the s-th electricity price scenario path. Let X be the electricity value of the s-th electricity price scenario path at time t, where t = 1, 2, ..., X; The preset time step represents the execution duration of the charging and discharging strategy; and Let be the discharge power and charging power of the s-th electricity price scenario path at time t, respectively.
5. The charging and discharging method for an energy storage system based on stochastic programming according to claim 4, characterized in that, Battery aging cost Satisfy the following formula: ; in, The aging cost coefficient per unit energy throughput of the battery; The charge-discharge cycle depth factor at time point t is equal to... The difference between the battery's maximum and minimum state of charge over a given time period; The risk measurement Satisfy the following formula: ; in, Risk aversion coefficient; Let be the conditional risk value of the profit distribution under all electricity price scenarios, representing the risk at a confidence level. Below, the expected value of tail loss.
6. The charging and discharging method for an energy storage system based on stochastic programming according to claim 4, characterized in that, The constraints of the stochastic programming model include: energy storage state transition constraints, operating boundary constraints, unexpectedness constraints, and operating logic constraints; The energy storage state transition constraint is: ; in, and These refer to the charging efficiency and discharging efficiency of the energy storage system, respectively. The rated capacity of the energy storage system, Let the state of charge of the s-th electricity price scenario path be the state of charge at time t. The operational boundary constraints are: ; ; ; in, and These are the upper and lower limits of the state of charge, respectively. and These are the upper limits for charging power and discharging power of the energy storage system, respectively. The unexpected constraint is: ; ; in, , and i ≠ j; i and j represent any two different electricity price scenario paths; The operational logic constraint is that the energy storage system cannot charge and discharge simultaneously at the same time.
7. The charging and discharging method for an energy storage system based on stochastic programming according to claim 1, characterized in that, The steps for obtaining electricity market data and energy storage system status data include: Collect raw electricity price market data and raw energy storage system status data; By employing downsampling and linear interpolation methods, the time granularity of all collected data is unified to a preset time step, resulting in the processed electricity market data and the energy storage system status data.
8. The charging and discharging method for an energy storage system based on stochastic programming according to claim 1, characterized in that, The electricity price prediction model integrates multiple time series prediction models of different types; the steps of training the electricity price prediction model based on the electricity price market data, and using the trained electricity price prediction model to generate the probability distribution of electricity prices at each time point within the planning period starting from the current time point, include: A dataset is constructed based on the aforementioned electricity price market data; Each of the time series prediction models is trained using the dataset. Using all the trained time series prediction models, generate the probability distribution of electricity prices at each time point within the planning period starting from the current time point.
9. The charging and discharging method for an energy storage system based on stochastic programming according to claim 1, characterized in that, The planning period includes multiple time points, and the time interval between any two adjacent time points is equal to the preset time step. After solving the stochastic programming model to obtain the charging and discharging strategy of the energy storage system at the current time point, the method further includes: After each preset time step, the electricity price probability distribution and the electricity price scenario set are corrected based on the latest electricity price market data and energy storage system status data, and the stochastic programming model is resolved to update the charging and discharging strategy.
10. A charging and discharging device for an energy storage system based on stochastic programming, characterized in that, The apparatus for performing the energy storage system charging and discharging method based on stochastic programming as described in any one of claims 1-9, the apparatus comprising: The acquisition module is used to acquire electricity price market data and energy storage system status data; The first processing module is used to train an electricity price prediction model based on the electricity price market data, and use the trained electricity price prediction model to generate the electricity price probability distribution corresponding to each time point within the planning period starting from the current time point. The second processing module is used to randomly sample the electricity price probability distribution corresponding to each time point within the planning period using the Monte Carlo simulation method, and generate an electricity price scenario set containing multiple electricity price scenario paths. The construction module is used to construct a stochastic programming model containing an objective function and constraints based on the set of electricity price scenarios and the state data of the energy storage system; the objective function includes a risk metric, a battery aging cost, and an expected total revenue under all electricity price scenario paths. The output module is used to solve the stochastic programming model to obtain the charging and discharging strategy of the energy storage system at the current time point.
Citation Information
Patent Citations
Energy storage system capacity planning method considering wind power delivery and investment risk
CN114004390A
Energy storage system multi-scene optimization scheduling method, device, equipment, medium and product
CN120278449A
Optical storage power station energy storage capacity optimization method based on dynamic electricity price and related device
CN120978813A
Cited By
Charging and discharging optimization scheduling method and device
CN122118849A