Microgrid Hybrid Energy Storage Two-Layer Energy Management System Considering Energy Storage Degradation Costs
By introducing a hybrid energy storage system of batteries and supercapacitors into a microgrid, and combining time-series attention and robust model predictive control, the problem of accelerated battery aging due to frequent power fluctuations was solved, thereby extending battery life and improving prediction accuracy.
Patent Information
- Application Number
- CN202611266358.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-20
- Publication Date
- 2026-11-10
AI Technical Summary
In existing microgrid energy management systems, single battery energy storage systems cannot simultaneously address energy time shifts and high-frequency fluctuation smoothing. Batteries age faster due to frequent responses to power fluctuations, and insufficient load forecasting accuracy affects dispatch performance.
A hybrid energy storage system consisting of batteries and supercapacitors is adopted, which combines a time-series attention mechanism and robust model predictive control. The batteries are charged and discharged in the upper layer according to hourly commands, while the supercapacitors compensate for power fluctuations in the lower layer according to minutes. A nonlinear battery degradation cost model based on the depth of discharge is introduced, and the prediction accuracy is improved through a multi-head self-attention mechanism.
It significantly extends battery life, reduces operating costs, improves forecasting accuracy, and achieves economic efficiency and stability in energy management.
Smart Images

Figure CN123073884A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of microgrid energy management technology, specifically relating to a two-layer energy management system for microgrid hybrid energy storage that takes into account the cost of energy storage degradation. Background Technology
[0002] Currently, microgrid energy management systems widely employ hierarchical optimization control architectures to coordinate power balance among renewable energy sources, energy storage systems, and the main grid. For example, existing invention patent CN114944661A discloses a three-stage optimization control method for microgrids based on rolling optimization of energy storage systems. This method proposes a three-stage architecture of day-ahead scheduling, intraday coordination, and real-time control. It optimizes electricity load through a price-based demand response model and calculates the power boundary value of the energy storage system based on rolling optimization to extend battery life and reduce operating costs. In the day-ahead scheduling stage, the scheduling plan aims to minimize operating costs. In the intraday stage, rolling optimization tracks the uncertainties of wind power, photovoltaics, and electric vehicles. In the real-time stage, the energy storage control mode is adjusted by monitoring the bus voltage.
[0003] However, the aforementioned existing technologies still have the following drawbacks: the scheme uses a single battery energy storage system, which makes it difficult to simultaneously meet the dual requirements of energy time shift and high-frequency fluctuation smoothing. The battery needs to frequently respond to transient power fluctuations, accelerating its aging process. Its energy storage aging cost model is based on the linearization of the cumulative throughput under the rated discharge depth, which cannot accurately characterize the nonlinear aging characteristics of the battery under different discharge depths. This results in the scheduling strategy lacking economic guidance for healthy operating modes such as shallow charging and shallow discharging. In addition, its day-ahead load forecast uses a simple time series method, which has limited ability to capture complex meteorological characteristics and time-series dependencies. Insufficient forecast accuracy directly affects the effect of intraday rolling optimization. Summary of the Invention
[0004] The purpose of this invention is to provide a two-layer energy management system for microgrid hybrid energy storage that takes into account the cost of energy storage degradation, so as to solve the problem of accelerated aging of battery energy storage in existing microgrid energy management systems due to frequent power fluctuations.
[0005] The present invention achieves the above objectives through the following technical solutions: Firstly, this invention proposes a two-layer energy management system for microgrid hybrid energy storage, applicable to a microgrid comprising a main grid, a renewable energy system, loads, and a hybrid energy storage system. The hybrid energy storage system includes batteries and supercapacitors, and the energy management system includes: The first control module is used to perform rolling optimization with the power trajectory predicted based on the time-series attention mechanism as input and the goal of minimizing the total operating cost, and generate power reference commands for the battery and the main grid; wherein, the total operating cost includes the main grid electricity purchase cost, energy storage degradation cost and carbon emission cost; The second control module is used to perform rolling quadratic programming optimization with a control step size smaller than that of the first control module and with the goal of minimizing the deviation between the actual power and the power reference command, to generate the real-time power compensation amount of the supercapacitor. The power reference command is used to constrain the optimization solution of the second control module. The second control module feeds back the real-time power compensation to the first control module to correct the power prediction value for the next optimization round.
[0006] Furthermore, the energy storage degradation cost includes battery degradation cost and supercapacitor degradation cost. The battery degradation cost is determined based on the battery's cycle life and depth of discharge, where the cycle life L... B With discharge depth d B The relationships between them include the following: ; in, The lifespan scale factor is the order of cycle life of a battery under specified test conditions. The depth-of-discharge sensitivity coefficient is the coefficient by which changes in the depth of discharge affect the rate of cycle life decay. It is a life correction factor for batteries under non-ideal operating conditions, used to correct the baseline offset in the cycle life model caused by differences in materials, processes, environment and operating conditions. Battery degradation cost per unit discharge event We obtain it from the following formula: ; in, For the battery replacement cost, Let be the discharge power at time t. The duration of discharge. Let be the actual battery capacity at time t. , These are the charging and discharging efficiencies, respectively. The degradation cost of the supercapacitor is determined linearly based on its calendar life, and the degradation cost of the supercapacitor per unit time is... We obtain it from the following formula: ; in, The replacement cost of a supercapacitor. Its rated calendar life.
[0007] Furthermore, the system also includes a prediction submodule employing an encoder-decoder architecture. The encoder adds temporal position information to the input sequence through position encoding and extracts temporal coupling features from the input sequence through a multi-head self-attention mechanism; the input sequence includes the microgrid's historical load power data, historical photovoltaic irradiance data, historical wind speed data, meteorological data, and time feature data; The decoder outputs the predicted power trajectory of points in the future rolling time domain based on the feature representation output by the encoder. ,in, For load power prediction trajectory, For photovoltaic power prediction trajectory, The predicted power trajectory is used as the input for rolling optimization in the first control module; The prediction submodule adopts a rolling prediction method. The prediction value of the first time period in each prediction time domain is sent to the first control module. The prediction result of the first time period includes the predicted value of load power, photovoltaic power and wind power. The prediction result of the first time period, together with the electricity price data and carbon emission rights price signal, are used as the input of the objective function of the first control module to generate an optimized scheduling plan.
[0008] Furthermore, the multi-head self-attention mechanism uses scaled dot product attention to achieve feature weighting. The prediction submodule also filters the input features through the Pearson correlation coefficient and performs validity verification in combination with attention weights to eliminate redundant features and avoid multicollinearity.
[0009] Furthermore, the objective function of the first control module Represented as: ; in, This is the time index for the first control step. This represents the total number of steps in the prediction time domain of the first control module. The interaction cost of the main power grid, For electricity price, To exchange power with the main power grid, For the first control step size, For the cost of battery degradation, For carbon emission costs, , As a signal for carbon emission rights prices; The decision variable of the first control module is the switching power of the main power grid. and the power of the battery ; The first control module solves the objective function Then, the main grid power reference command corresponding to the first time step in the prediction time domain will be used. and battery power reference instructions It is then sent to the second control module.
[0010] Furthermore, the objective function of the second control module Represented as: ; in, For the time index of the second control step, This represents the total number of steps in the prediction time domain of the second control module; , , These are the weighting coefficients for the battery power deviation term, the grid power deviation term, and the supercapacitor terminal energy state term, respectively. This is a penalty item for battery power deviation. This is the battery power reference command issued by the first control module. This refers to the actual battery power. The main grid power deviation penalty term. This is the main grid power reference command issued by the first control module. This represents the actual power exchanged by the main power grid. This is a penalty term for the terminal energy state of the supercapacitor. To predict the energy of the supercapacitor at the end of the time domain, Its rated energy.
[0011] Furthermore, the quadratic programming optimization is implemented using a robust model predictive control algorithm; the robust model predictive control algorithm introduces a set of uncertainty constraints. ,in Indicates the prediction error. As an upper bound on the error, the set of uncertainty constraints is used to limit the second control module to satisfy all the following conditions during the optimization solution: Constraints under the given conditions.
[0012] Furthermore, the first control step size is an hourly time interval, and the second control step size is a minute-level time interval.
[0013] Secondly, this invention proposes a two-layer energy management method for microgrids with hybrid energy storage, executed by the aforementioned energy management system, comprising the following steps: S1. Obtain the future rolling time domain renewable energy power prediction trajectory and load power prediction trajectory based on the time-series attention mechanism through the prediction submodule, and obtain the main grid electricity price data and carbon emission rights price signal; S2. Obtain the main grid power purchase cost, energy storage degradation cost, and carbon emission cost, and determine them as the total operating cost; S3. The first control module performs rolling optimization with the goal of minimizing total operating cost, and generates power reference commands for the battery and main grid; S4. The second control module performs rolling quadratic programming optimization with a control step size smaller than that of the first control module and with the goal of minimizing the deviation between the actual power and the power reference command, to generate the real-time power compensation amount of the supercapacitor. S5. Combining the power reference command and the real-time power compensation amount, generate the corrected main grid power command, battery power command and supercapacitor power command, and send them to the microgrid system for execution.
[0014] The beneficial effects of this invention are as follows: This invention employs a hybrid energy storage system consisting of batteries and supercapacitors. The batteries are charged and discharged at the upper level according to hourly commands, while the supercapacitors compensate for power fluctuations at the lower level, avoiding frequent responses from the batteries to high-frequency power surges. The battery degradation cost based on the nonlinearity of discharge depth is incorporated into the upper-level optimization objective, accurately quantifying the exponential loss of battery life due to deep discharge and guiding the scheduling strategy to prioritize shallow charge and discharge modes. A prediction submodule based on a time-series attention mechanism is introduced, improving prediction accuracy by extracting the time-series coupling characteristics of historical data through multi-head self-attention. Robust model predictive control is used at the lower level, quantifying the prediction error range through an uncertainty constraint set to ensure that system constraints are met in the worst-case scenario. This solution significantly extends battery life while reducing operating costs. Attached Figure Description
[0015] Figure 1 This is a system block diagram of a microgrid hybrid energy storage two-layer energy management system in an embodiment of the present invention; Figure 2 This is another system block diagram of the microgrid hybrid energy storage two-layer energy management system in this embodiment of the invention; Figure 3 This is a system structure diagram of an existing microgrid system proposed in a specific embodiment of the present invention; Figure 4 This is a flowchart of a microgrid hybrid energy storage two-layer energy management method in an embodiment of the present invention; Figure 5 The figure shows the simulation results of battery charging and discharging power and battery state of charge changes in an embodiment of the present invention. Figure 6 The above figures show the simulation results of the charging and discharging power of the supercapacitor and the change in the state of charge of the supercapacitor in the embodiments of the present invention. Figure 7This is a load absorption analysis diagram showing the relationship between wind power output, photovoltaic power output, grid power purchase and actual load in an embodiment of the present invention. Detailed Implementation
[0016] The present application will now be described in further detail with reference to the accompanying drawings. It should be noted that the following specific embodiments are only used to further illustrate the present application and should not be construed as limiting the scope of protection of the present application. Those skilled in the art can make some non-essential improvements and adjustments to the present application based on the above application content.
[0017] The microgrid system used in this embodiment includes a main grid (i.e., a public grid), a renewable energy system, loads, and a hybrid energy storage system. The renewable energy system includes photovoltaic power generation units and wind power generation units. The hybrid energy storage system consists of batteries (such as lithium batteries) and supercapacitors, where the batteries are responsible for energy time shifting and the supercapacitors are responsible for smoothing high-frequency power fluctuations.
[0018] Figure 3 This is a structural diagram of the microgrid system used in an embodiment of the present invention. Figure 3 As shown, in a microgrid system, photovoltaic power generation units, wind power generation units, batteries, supercapacitors, loads, and the main grid are connected via a common bus. At any time t, the microgrid system must satisfy a power balance constraint, the mathematical expression of which is: ; in, Total load power, Main power exchange capacity For battery power, For supercapacitor power, Photovoltaic power generation capacity, This refers to the power output of wind power generation.
[0019] The discrete equations for the energy state (state of charge) of lithium batteries and supercapacitors over time satisfy the following dynamic relationships: When lithium batteries discharge ( ): ; When lithium batteries are charging ( ): ; When a supercapacitor discharges ( ): ; When supercapacitors are charging : .
[0020] in, and Let be the energy states of the battery and the supercapacitor at time t, respectively. t is the first control step size. For the second control step size, and These are the battery's charging and discharging efficiencies, respectively. and These represent the charging and discharging efficiencies of the supercapacitor, respectively.
[0021] The operation of each unit in the system must meet the following physical constraints: upper and lower limits of the main grid's switching power, upper and lower limits of battery charging and discharging power, upper and lower limits of supercapacitor charging and discharging power, and upper and lower limits of the energy storage unit's state of charge. The upper and lower limits of the battery's state of charge are expressed as follows: ; in, and These are the minimum and maximum values of the battery's state of charge, respectively. Let t be the actual capacity of the battery at time t.
[0022] Figure 2 The system block diagram in this invention is as follows: The microgrid hybrid energy storage dual-layer energy management system proposed in this invention adopts a dual-layer control architecture, including an upper economic dispatch layer (corresponding to the first control module in the following embodiments) and a lower real-time balancing layer (corresponding to the second control module in the following embodiments).
[0023] The system first collects historical operating data of the microgrid, including historical load power data, historical photovoltaic irradiance data, historical wind speed data, meteorological data, and time characteristic data, while also acquiring electricity price data and carbon emission rights price signals.
[0024] In the upper-level economic dispatch layer, the upper-level optimization takes the power trajectory predicted based on the time-series attention mechanism as input, minimizes the total operating cost as the objective function, and performs rolling optimization with hourly control steps, outputting power reference commands for the battery and the main grid. After optimization, the first-step dispatch command is extracted, and only the power reference command corresponding to the first time step in the predicted time domain is sent to the lower-level real-time balancing layer as the power reference setpoint.
[0025] In the lower real-time balancing layer, rolling optimization is performed with a minute-level control step size smaller than the first control step size and with the objective function of minimizing the deviation between the actual power and the power reference setpoint. The real-time power compensation amount is dynamically generated by utilizing the fast response capability of the supercapacitor to eliminate the power imbalance caused by renewable energy prediction errors and load fluctuations.
[0026] The updated state variables include the deviation between the actual power detected by the second control module and the predicted power. This deviation is fed back to the upper economic scheduling layer to correct the prediction error in the next optimization round.
[0027] Example 1
[0028] Please see Figure 1 This embodiment proposes a two-layer energy management system for microgrids that considers the degradation costs of energy storage. It is applied to a microgrid that includes a main grid, a renewable energy system, loads, and a hybrid energy storage system. The hybrid energy storage system includes batteries and supercapacitors, where batteries handle energy time-shifting and supercapacitors handle high-frequency power fluctuation smoothing. The energy management system includes a first control module and a second control module.
[0029] The first control module is used to perform rolling optimization with the power trajectory predicted based on the time-series attention mechanism as input and the goal of minimizing the total operating cost, and to generate power reference commands for the battery and the main grid. The total operating cost includes the main grid electricity purchase cost, the battery degradation cost considering the nonlinearity of the depth of discharge, the supercapacitor degradation cost, and the carbon emission cost. This module transforms the long-term asset life cycle cost of energy storage equipment into short-term operating costs, enabling the scheduling strategy to actively avoid deep charge and discharge operations that severely damage battery life.
[0030] The second control module is used to perform rolling quadratic programming optimization with a control step size smaller than that of the first control module and with the objective function of minimizing the deviation between the actual power and the power reference command issued by the first control module. It utilizes the fast response capability of the supercapacitor to dynamically generate real-time power compensation to eliminate power imbalance caused by renewable energy prediction errors and load fluctuations.
[0031] The power reference command output by the first control module serves as the constraint boundary for the optimization solution of the second control module. The second control module feeds back the generated real-time power compensation to the first control module to correct the power prediction value for the next optimization round.
[0032] Understandably, the deviation between the actual power and the predicted power detected by the second control module during real-time operation—for example, the actual photovoltaic output being 2kW lower than the predicted value—essentially reflects a systematic error in the prediction model during the current period. After this deviation is fed back to the first control module, the first control module can utilize this information in the next optimization round in the following two ways: (1) The prediction error of the previous round is superimposed on the prediction trajectory of the next round, and the predicted values of load, photovoltaic and wind power are corrected online to make the new prediction results closer to the real situation. (2) Use the error information to adaptively update the parameters of the prediction model or to train the model for rolling learning, so as to gradually improve the accuracy of the prediction model.
[0033] The microgrid hybrid energy storage dual-layer energy management system proposed in this embodiment constructs a dual-layer control architecture with functional decoupling and time-scale separation. Specifically, the first control module constitutes the upper economic dispatch layer, which operates on a longer time scale, such as the hourly level, focusing on minimizing the long-term total operating cost of the microgrid, including electricity purchase cost, energy storage degradation cost, and carbon emission cost. The upper economic dispatch layer undertakes the tasks of energy time shifting and economic arbitrage by rolling optimization of the output power reference commands of the battery and the main grid. The second control module constitutes the lower real-time balancing layer, which operates on a shorter time scale, such as the minute level, focusing on eliminating instantaneous power imbalances caused by renewable energy prediction errors and load fluctuations. This layer undertakes the task of smoothing high-frequency fluctuations by rapidly dispatching supercapacitors to compensate for power deviations in real time. The lithium battery performs energy-type charging and discharging according to the upper-layer economic optimization commands, avoiding frequent responses to transient fluctuations and thus extending its lifespan; the supercapacitor performs power-type charging and discharging according to the lower-layer rapid compensation commands, giving full play to its advantages of high power density and long cycle life.
[0034] Specifically, energy storage degradation costs include battery degradation costs and supercapacitor degradation costs. By quantifying the long-term asset lifecycle cost of energy storage devices into short-term operating costs related to real-time operation, the upper-level economic dispatch can proactively identify and avoid deep charge-discharge operations that severely damage battery life, guiding the system to prioritize a healthy operation mode of shallow charge-discharge. This significantly extends the actual lifespan of batteries and reduces the total lifecycle replacement cost of energy storage without sacrificing the economic efficiency of the microgrid.
[0035] First, the cost of battery degradation is determined based on the battery's cycle life and depth of discharge. Specifically, cycle life L... B With discharge depth d B The relationships between them include the following: ; Where a, b, and c are the lifespan model parameters fitted based on the cycle life test data or publicly available product data sheets of the target battery. Specifically, a is the lifespan scaling coefficient, used to characterize the order of magnitude of the battery's cycle life under reference test conditions; b is the depth of discharge sensitivity coefficient, used to characterize the impact of changes in the depth of discharge on the rate of cycle life decay; and c is the lifespan correction coefficient, used to correct for baseline deviations caused by differences in battery material systems, manufacturing processes, test temperatures, charge / discharge rates, and lifespan termination conditions. These parameters can be determined from the DoD-cycle life data sheets published by battery manufacturers. For example, by selecting the corresponding cycle life LB,i at different depths of discharge dB,i, the least squares method or nonlinear curve fitting method can be used to identify the parameters of the cycle life model, thereby obtaining the values of a, b, and c suitable for the target battery model.
[0036] Battery degradation cost per unit discharge event We obtain it from the following formula: ; in, This refers to the battery replacement cost, i.e., the cost of replacing the battery. Let be the discharge power at time t, where a positive value indicates discharge, and a negative value or zero indicates charging or no action; This refers to the duration of the discharge. The actual capacity of the battery at time t gradually decreases as the battery ages. , These represent the charge and discharge efficiencies, respectively. A single discharge event corresponds to one continuous discharge cycle of the battery, and its duration is... The start and end time difference of this discharge is given, and the average discharge power is given. .
[0037] In this embodiment, the battery degradation cost transforms the long-term capital investment cost of the battery into short-term operating costs related to real-time charge and discharge operations, enabling optimized scheduling to proactively avoid deep charge and discharge operations that severely damage battery life.
[0038] Secondly, the degradation cost of supercapacitors is linearly determined based on their calendar life. Unlike batteries, the lifespan of supercapacitors is primarily affected by voltage and temperature, and is less related to the number of cycles and depth of discharge. Therefore, their degradation process can be approximated as a time-linear process. The degradation cost of supercapacitors per unit time... We obtain it from the following formula: ; in, The replacement cost of a supercapacitor. Its rated calendar life.
[0039] This invention considers the two degradation costs mentioned above in energy management, enabling the battery to undertake the task of energy time shifting and be protected by the depth of discharge constraint, while the supercapacitor undertakes the task of smoothing high-frequency fluctuations and leverages its long cycle life advantage. This minimizes the total life cycle cost of the energy storage system while ensuring the economical operation of the microgrid.
[0040] In a preferred embodiment, the system further includes a prediction submodule employing an encoder-decoder architecture, which provides a high-precision power prediction trajectory for the first control module.
[0041] The encoder adds temporal position information to the input sequence through position encoding. Since the Transformer architecture itself does not contain recurrent neural networks or convolutional neural networks, it cannot naturally perceive the order information of the input sequence. Therefore, a position encoding layer is needed to add encoding information to the position of each time step so that the model can utilize the sequential features of the sequence.
[0042] The encoder extracts temporal coupling features from the input sequence through a multi-head self-attention mechanism. This mechanism allows the model to focus on information from different locations in parallel across different representation subspaces, effectively capturing long-term dependencies in time-series data. The input sequence includes historical load power data, historical photovoltaic irradiance data, historical wind speed data, meteorological data (such as temperature and humidity), and temporal feature data (such as hourly, weekly, and monthly data).
[0043] To avoid redundancy and multicollinearity issues in the input features, the prediction submodule first performs correlation analysis on the candidate input features. Candidate input features include historical load power, historical photovoltaic irradiance, historical wind speed, temperature, humidity, time characteristics, and other meteorological features. The prediction submodule calculates the Pearson correlation coefficient between each candidate input feature and the prediction target (load power, photovoltaic power, wind power), and also calculates the Pearson correlation coefficient between different candidate input features. When the absolute value of the correlation coefficient between a candidate input feature and the prediction target is lower than a preset first threshold (e.g., 0.1), the candidate input feature is determined to have a weak correlation with the prediction target and is discarded. When the absolute value of the correlation coefficient between two candidate input features is higher than a preset second threshold (e.g., 0.8), they are determined to have strong collinearity, and the candidate input feature with a higher correlation to the prediction target is retained, while the other candidate input feature is discarded.
[0044] After completing the above correlation screening, the prediction submodule further utilizes the trained multi-head self-attention mechanism to verify the effectiveness of the screened input features. Specifically, the prediction submodule calculates the attention weights of each input feature at different attention heads and time steps, and determines the contribution of each input feature to the prediction result based on the average, maximum, or weighted cumulative value of the attention weights. When the attention weight of an input feature is lower than a preset third threshold in multiple consecutive training cycles or validation samples, it is determined that the input feature has a low contribution to the prediction task and is removed from the input feature set; when an input feature has a certain correlation with other features, but its attention weight remains high, it is determined that the input feature still contains time-series information useful for the prediction task and is retained. Through the above Pearson correlation coefficient screening and attention weight repetition kernel process, while reducing input feature redundancy and multicollinearity, effective features that actually contribute to the prediction of load power, photovoltaic power, and wind power are retained.
[0045] Based on the feature representation output by the encoder, the decoder outputs the predicted power trajectory of points in the future rolling time domain. ,in, For load power prediction trajectory, For photovoltaic power prediction trajectory, The predicted power trajectory is used as the input for rolling optimization in the first control module.
[0046] The prediction submodule employs a rolling prediction method. During inference, the model only takes the predicted value of the first time period within each prediction time domain and sends it to the first control module. For example, if the prediction time domain is 24 hours and the step size is 1 hour, then only the predicted value of the first hour in the future is taken. Instead of directly using all forecast values for the next 24 hours, the system participates in upper-level optimization, thus avoiding target leakage issues. The initial forecast results include load power forecasts, photovoltaic power forecasts, and wind power forecasts. These initial forecast results, along with electricity price data and carbon emission rights price signals, serve as inputs to the objective function of the first control module, generating an optimized scheduling plan. The training objective of the forecast submodule is to minimize the forecast error, using mean squared error (MSE) or mean absolute error (MAE) as the loss function.
[0047] In a preferred embodiment, the multi-head self-attention mechanism employs scaled dot product attention to achieve feature weighting, and its calculation expression is as follows: ; in, These are the query matrix, key matrix, and value matrix, respectively. Dimension of the key vector. Scaling factor. The purpose is to prevent the dot product result from becoming too large, which would cause the softmax function to enter the gradient saturation region, thereby maintaining the stability of training.
[0048] In this embodiment, the objective function of the first control module Represented as: ; in, This is the time index for the first control step. This represents the total number of steps in the prediction time domain for the first control module. For example, if the first control step size is 1 hour and the prediction time domain is 24 hours, then... =24.
[0049] The interaction cost of the main power grid, For electricity price, This represents the power exchanged with the main power grid; a positive value indicates electricity purchase, and a negative value indicates electricity sale. This is the first control step size. It should be noted that in a typical grid-connected microgrid, the main grid acts as a balancing node. When renewable energy generation is insufficient, the microgrid purchases electricity from the main grid; when renewable energy is in surplus, the microgrid can sell electricity back to the main grid to generate revenue.
[0050] This represents the battery degradation cost, which is calculated using the aforementioned battery degradation cost calculation formula.
[0051] For carbon emission costs, , As a carbon emission rights price signal, by introducing this cost item, the system will proactively choose to reduce the amount of electricity purchased from the main grid during periods when the carbon emission rights price is higher when formulating charging and discharging plans, and prioritize the use of local renewable energy or energy storage to meet load demand, thereby reducing carbon emissions while reducing electricity purchase costs.
[0052] The decision variable for the first control module is the switching power of the main power grid. and battery power ; The first control module solves the objective function. Then, the main grid power reference command corresponding to the first time step in the prediction time domain will be used. and battery power reference instructions The data is then sent to the second control module.
[0053] As a preferred option, the objective function of the second control module Represented as: ; in, For the time index of the second control step, This represents the total number of steps in the prediction time domain for the second control module. For example, if the second control step size is 5 minutes and the prediction time domain is 1 hour (i.e., 12 steps), then... =12; , , These are the weighting coefficients for the battery power deviation term, the grid power deviation term, and the supercapacitor terminal energy state term, respectively. The values of these coefficients can be adjusted according to the actual application scenario; for example, they can be appropriately increased when more stringent tracking of upper-level commands is required. , .
[0054] This is a penalty item for battery power deviation. This is the battery power reference command issued by the first control module. This represents the actual battery power; this secondary term penalizes the deviation between the actual power and the reference command, encouraging the system to operate according to the upper-level economic scheduling plan.
[0055] The main grid power deviation penalty term. This is the main grid power reference command issued by the first control module. This represents the actual power exchanged with the main power grid.
[0056] This is a penalty term for the terminal energy state of the supercapacitor. To predict the energy of the supercapacitor at the end of the time domain, The terminal penalty term is set to its rated energy. Its purpose is to maintain the supercapacitor's state of charge near its nominal value at the end of each optimization cycle, ensuring the supercapacitor has sufficient energy margin to cope with potential future power fluctuations.
[0057] It should be noted that the objective function mentioned above contains only quadratic terms, and the constraints are all linear constraints, such as power upper and lower limits and SOC upper and lower limits. Therefore, this optimization problem constitutes a standard quadratic programming (QP) problem, which can be solved quickly using efficient interior-point methods or effective set methods, meeting the computational speed requirements of lower-level real-time control.
[0058] As a preferred approach, the quadratic programming optimization is implemented using a robust model predictive control algorithm; the robust model predictive control algorithm introduces a set of uncertainty constraints. ,in This indicates the prediction error, which is the deviation between the actual power and the predicted power of photovoltaic and wind power. As the upper bound of the error, the set of uncertainty constraints is used to limit the second control module to satisfy all the conditions during the optimization solution. The constraints under the worst-case prediction error condition are ensured to maintain the system's power balance and energy storage SOC constraints. This design allows the system to proactively anticipate the risks posed by prediction errors, rather than passively waiting for voltage exceedances before compensating through droop control.
[0059] As a preferred approach, the first control step size is an hourly time interval, and the second control step size is a minute-level time interval. The typical ratio of the two step sizes is 12:1. This hierarchical design of time scales allows the upper layer to capture electricity price fluctuations and daytime trends of renewable energy sources with sufficient time span, while the lower layer can respond quickly to transient power fluctuations.
[0060] According to the above embodiments, this invention employs a hybrid energy storage system consisting of batteries and supercapacitors. The batteries are charged and discharged according to hourly optimized commands at the upper level, while the supercapacitors compensate for power fluctuations at the minute level at the lower level. The battery degradation cost based on the nonlinearity of discharge depth is incorporated into the upper-level optimization objective to guide shallow charging and discharging of the batteries. A time-series attention mechanism is used to predict renewable energy output and load. Robust model predictive control is used at the lower level to address prediction errors. This solution solves the problem of accelerated battery aging due to frequent responses to power fluctuations in existing technologies.
[0061] Example 2
[0062] This embodiment proposes a two-layer energy management method for microgrids with hybrid energy storage, executed by the energy management system in Embodiment 1, including the following steps: S1. Obtain the future rolling time domain renewable energy power prediction trajectory and load power prediction trajectory based on the time-series attention mechanism through the prediction submodule, and obtain the main grid electricity price data and carbon emission rights price signal.
[0063] Specifically, in this step, the prediction submodule first collects historical operating data of the microgrid, including the load power sequence, photovoltaic irradiance sequence, and wind speed sequence of the past 24 hours, as well as the corresponding meteorological data and time characteristic data. Then, it outputs the predicted load power trajectory, photovoltaic power trajectory, and wind power trajectory for the next 24 hours through a trained Transformer model.
[0064] S2. Obtain the main grid power purchase cost, energy storage degradation cost, and carbon emission cost, and determine them as the total operating cost.
[0065] Specifically, the main grid electricity purchase cost is calculated based on real-time electricity prices and predicted exchange power; the energy storage degradation cost includes battery degradation cost and supercapacitor degradation cost, calculated according to the formulas given in Example 1; the carbon emission cost is calculated based on carbon emission rights price signals and predicted exchange power. The total operating cost is the weighted sum of the three costs or their direct sum, with the specific weights set according to the actual application scenario.
[0066] S3. The first control module performs rolling optimization with the goal of minimizing total operating costs, generating power reference commands for the battery and the main grid.
[0067] Specifically, the first control module takes the power prediction trajectory output by the prediction submodule as input, and combines it with electricity price and carbon price signals to solve a nonlinear programming problem, obtaining the battery power plan and main grid switching power plan for each time period in the next 24 hours. After the solution is completed, only the power plan value corresponding to the next hour is sent to the second control module as a reference instruction.
[0068] S4. The second control module performs rolling quadratic programming optimization with a control step size smaller than that of the first control module and with the goal of minimizing the deviation between the actual power and the power reference command, to generate the real-time power compensation amount of the supercapacitor.
[0069] Specifically, the second control module uses a 5-minute control cycle to collect real-time data on the actual power generation of photovoltaic and wind power, as well as the actual power consumption of the load, and calculates the deviation between the actual power and the reference commands issued from the upper level. Then, it solves a quadratic programming problem to obtain the power compensation amount that the supercapacitor needs to generate or absorb, in order to make up for the power imbalance caused by renewable energy prediction errors and load fluctuations.
[0070] S5. Combining the power reference command and the real-time power compensation amount, generate the corrected main grid power command, battery power command and supercapacitor power command, and send them to the microgrid system for execution.
[0071] Specifically, the supercapacitor power compensation output by the second control module is added to the battery power reference command issued by the first control module to form the final execution command. For example, if the upper layer issues a 10kW battery charge, and the lower layer detects that the actual photovoltaic output is 2kW lower than the prediction, the supercapacitor discharges 2kW to compensate. The system ultimately executes a coordinated action of charging the battery at 10kW and discharging the supercapacitor at 2kW to maintain power balance.
[0072] Experimental verification To verify the operational effectiveness of the proposed dual-layer microgrid hybrid energy storage management system considering energy storage degradation costs, this embodiment constructs a grid-connected microgrid simulation model comprising a main grid, photovoltaic power generation units, wind power generation units, loads, batteries, and supercapacitors. The simulation time domain is set to 48 hours. The first control module performs rolling optimization on an hourly time scale, while the second control module performs real-time power compensation on a minute-level time scale. Simulation inputs include load power, photovoltaic output, wind power output, electricity price signals, and energy storage system state parameters. During system operation, constraints on main grid switching power, battery charging and discharging power, supercapacitor charging and discharging power, and upper and lower limits of energy storage state of charge must be met. The first control module generates battery and main grid power reference commands based on the predicted power trajectory and total operating cost, while the second control module generates real-time supercapacitor compensation power based on actual power deviations.
[0073] Figure 5 The results show the changes in battery charging and discharging power and battery state of charge. Figure 5 It can be seen that the battery mainly undertakes the energy scheduling task over a longer time scale, and its SOC is always kept within the set range without significant over-limit or drastic fluctuations. This indicates that the first control module can reasonably arrange the battery charging and discharging process and reduce the risk of the battery frequently responding to instantaneous power fluctuations.
[0074] Figure 6 The results show the changes in charging and discharging power and state of charge of the supercapacitor. Figure 6 It can be seen that the power of the supercapacitor changes frequently, and it can compensate for short-term power deviations caused by photovoltaic, wind power and load fluctuations; its SOC remains within the allowable range, indicating that the second control module can use the supercapacitor's fast response capability to achieve real-time power balance.
[0075] Figure 7 This illustrates the relationship between wind power output, photovoltaic power output, grid-purchased power, and actual load. Figure 7 It can be seen that when renewable energy output is sufficient, the load is preferentially supplied by local wind power and photovoltaic power; when renewable energy is insufficient, the system makes up for the power gap by purchasing electricity from the main grid and coordinating energy storage, thereby ensuring continuous and stable power supply to the load.
[0076] The simulation results show that the battery primarily handles hourly energy shifting tasks, maintaining a stable state of charge without drastic fluctuations; the supercapacitor handles minute-level power compensation tasks, rapidly responding to instantaneous power deviations caused by photovoltaic, wind power, and load; when renewable energy output is sufficient, the load is preferentially supplied by local clean energy, and when output is insufficient, it is supplemented by the main grid and energy storage. These results verify that the proposed dual-layer energy management system can achieve functional decoupling between the battery and the supercapacitor, extending battery life while ensuring stable microgrid operation.
[0077] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated.
[0078] The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access, or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).
[0079] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0080] In addition, the functional modules in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0081] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A two-layer energy management system for microgrids with hybrid energy storage considering energy storage degradation costs, applied to a microgrid comprising a main grid, renewable energy systems, loads, and a hybrid energy storage system, wherein the hybrid energy storage system includes batteries and supercapacitors, characterized in that, The energy management system includes: The first control module is used to perform rolling optimization with the power trajectory predicted based on the time-series attention mechanism as input and the goal of minimizing the total operating cost, and generate power reference commands for the battery and the main grid; wherein, the total operating cost includes the main grid electricity purchase cost, energy storage degradation cost and carbon emission cost; The second control module is used to perform rolling quadratic programming optimization with a control step size smaller than that of the first control module and with the goal of minimizing the deviation between the actual power and the power reference command, to generate the real-time power compensation amount of the supercapacitor. The power reference command is used to constrain the optimization solution of the second control module. The second control module feeds back the real-time power compensation to the first control module to correct the power prediction value of the next optimization round. The system also includes a prediction submodule employing an encoder-decoder architecture. The encoder adds temporal position information to the input sequence through position encoding and extracts temporal coupling features from the input sequence through a multi-head self-attention mechanism; the input sequence includes the microgrid's historical load power data, historical photovoltaic irradiance data, historical wind speed data, meteorological data, and time feature data; The decoder outputs the predicted power trajectory of points in the future rolling time domain based on the feature representation output by the encoder. ,in, For load power prediction trajectory, For photovoltaic power prediction trajectory, The predicted power trajectory is used as the input for rolling optimization in the first control module; The prediction submodule adopts a rolling prediction method. The prediction value of the first time period in each prediction time domain is sent to the first control module. The prediction result of the first time period includes the predicted value of load power, photovoltaic power and wind power. The prediction result of the first time period, together with the electricity price data and carbon emission rights price signal, are used as the input of the objective function of the first control module to generate an optimized scheduling plan.
2. The microgrid hybrid energy storage dual-layer energy management system according to claim 1, characterized in that, The energy storage degradation cost includes battery degradation cost and supercapacitor degradation cost. The battery degradation cost is determined based on the battery's cycle life and depth of discharge, where cycle life L... B With discharge depth d B The relationships between them include the following: ; in, The lifespan scale factor is the order of cycle life of a battery under specified test conditions. The depth-of-discharge sensitivity coefficient is the coefficient by which changes in the depth of discharge affect the rate of cycle life decay. It is a life correction factor for batteries under non-ideal operating conditions, used to correct the baseline offset in the cycle life model caused by differences in materials, processes, environment and operating conditions. Battery degradation cost per unit discharge event We obtain it from the following formula: ; in, For the battery replacement cost, Let be the discharge power at time t. The duration of discharge. Let be the actual battery capacity at time t. , These are the charging and discharging efficiencies, respectively. The degradation cost of the supercapacitor is determined linearly based on its calendar life, and the degradation cost of the supercapacitor per unit time is... We obtain it from the following formula: ; in, The replacement cost of a supercapacitor. Its rated calendar life.
3. The microgrid hybrid energy storage dual-layer energy management system according to claim 1, characterized in that, The multi-head self-attention mechanism uses scaled dot product attention to achieve feature weighting. The prediction submodule also filters input features using the Pearson correlation coefficient and performs validity verification in conjunction with attention weights to eliminate redundant features and avoid multicollinearity.
4. The microgrid hybrid energy storage dual-layer energy management system according to claim 2, characterized in that, The objective function of the first control module Represented as: ; in, This is the time index for the first control step. This represents the total number of steps in the prediction time domain of the first control module. The interaction cost of the main power grid, For electricity price, To exchange power with the main power grid, For the first control step size, For the cost of battery degradation, For carbon emission costs, , As a signal for carbon emission rights prices; The decision variable of the first control module is the switching power of the main power grid. and the power of the battery ; The first control module solves the objective function Then, the main grid power reference command corresponding to the first time step in the prediction time domain will be used. and battery power reference instructions It is then sent to the second control module.
5. The microgrid hybrid energy storage dual-layer energy management system according to claim 4, characterized in that, The objective function of the second control module Represented as: ; in, For the time index of the second control step, This represents the total number of steps in the prediction time domain of the second control module; , , These are the weighting coefficients for the battery power deviation term, the grid power deviation term, and the supercapacitor terminal energy state term, respectively. This is a penalty item for battery power deviation. This is the battery power reference command issued by the first control module. This refers to the actual battery power. The main grid power deviation penalty term. This is the main grid power reference command issued by the first control module. This represents the actual power exchanged by the main power grid. This is a penalty term for the terminal energy state of the supercapacitor. To predict the energy of the supercapacitor at the end of the time domain, Its rated energy.
6. The microgrid hybrid energy storage dual-layer energy management system according to claim 5, characterized in that, The quadratic programming optimization is implemented using a robust model predictive control algorithm; the robust model predictive control algorithm introduces a set of uncertainty constraints. ,in Indicates the prediction error. As an upper bound on the error, the set of uncertainty constraints is used to limit the second control module to satisfy all the following conditions during the optimization solution: Constraints under the given conditions.
7. The microgrid hybrid energy storage dual-layer energy management system according to claim 5, characterized in that, The first control step size is an hourly time interval, and the second control step size is a minute-level time interval.
8. A two-layer energy management method for microgrid hybrid energy storage considering energy storage degradation costs, executed by the energy management system according to any one of claims 1-7, characterized in that, Includes the following steps: S1. Obtain the future rolling time domain renewable energy power prediction trajectory and load power prediction trajectory based on the time-series attention mechanism through the prediction submodule, and obtain the main grid electricity price data and carbon emission rights price signal; S2. Obtain the main grid power purchase cost, energy storage degradation cost, and carbon emission cost, and determine them as the total operating cost; S3. The first control module performs rolling optimization with the goal of minimizing total operating cost, and generates power reference commands for the battery and main grid; S4. The second control module performs rolling quadratic programming optimization with a control step size smaller than that of the first control module and with the goal of minimizing the deviation between the actual power and the power reference command, to generate the real-time power compensation amount of the supercapacitor. S5. Combining the power reference command and the real-time power compensation amount, generate the corrected main grid power command, battery power command and supercapacitor power command, and send them to the microgrid system for execution.
Citation Information
Patent Citations
Micro-grid three-stage optimization control method based on rolling optimization of energy storage system
CN114944661A
