Double-layer adaptive real-time energy management method and system based on micro-grid

By introducing dual -layer self -adaptive real -time energy management methods in the microcontrol grid, the predicted data is used to build an optimization model and execute the lower layer optimization process, solving the problem of uncertainty of meteorological parameters in the operation scheduling of the microdation grid, and achieved a stable and optimized operating effect. Essence

CN119382072APending Publication Date: 2025-01-28JIANGXI POWER EXCHANGE CENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411317128.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

Microgrid operation scheduling is affected by the intermittent and uncertainty of renewable energy generation, resulting in the challenging of stable and accurate operation scheduling, especially because the uncertainty of input meteorological parameters has a negative impact on microgrid operation.

Method used

Put forward a two -layer self -adaptation real -time energy management method based on micro -power grid. By obtaining medium -term and short -term prediction data, the upper -layer optimization model is constructed to maximize the profit of the micro grid, and the actual energy state of the battery energy storage system is optimized through the lower layer. Realize double -layer adaptive energy management.

Benefits of technology

Through the double -layer adaptive energy management method, it can effectively reduce the impact of the uncertainty of meteorological parameters, realize the stability and optimization operation scheduling of the micro -power grid, minimize the correction measures of scheduling components, improve the operating strategy of micro -power grid operators Selective.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119382072A_ABST
    Figure CN119382072A_ABST
Patent Text Reader

Abstract

The invention discloses a double-layer self-adaptive real-time energy management method and system based on a micro-grid, and the method comprises the steps: constructing an upper-layer optimization model of an energy management system according to the initial energy state of a battery energy storage system, and obtaining a state variable of a control decision in a time step length of an upper layer through solving the upper-layer optimization model; then, based on a state variable of an upper-layer time step control decision, executing a lower-layer optimization process, optimizing and updating an actual energy state of the battery energy storage system of a next time step in an upper-layer scheduling range, and performing iteration by taking the actual energy state as an input of an upper layer; and the optimal control decision of all time steps in the scheduling range of the energy management system is obtained. According to the method, the energy state of the battery energy storage system is used as a link, online operation scheduling is executed on the upper layer to maximize the profit of the micro-grid, near-real-time scheduling is executed on the lower layer, corrective measures of schedulable elements are reduced to the maximum extent, micro-grid operators can adopt different operation strategies, and the operation efficiency of the micro-grid is improved. And a compromise is achieved between obtaining higher profits and prolonging the service life of the equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of microgrids, and in particular relates to a double-layer adaptive real-time energy management method and system based on a microgrid. Background Art

[0002] As the energy crisis intensifies and environmental pollution becomes increasingly serious, microgrids, as a new type of energy network supply and management technology, have received increasing attention. Smart grids rely on microgrids as basic components to achieve their main goals. Microgrids are usually composed of a main bus called a backbone network, distributed energy resources DER, energy storage, loads, and connections to the upper grid. Since the operation of microgrids based on renewable energy is highly affected by the intermittent and uncertain nature of renewable energy generation, it is a challenging task to stably and accurately achieve the operation and scheduling of microgrids.

[0003] The operation and scheduling of microgrids is achieved through the energy management level. The uncertainty of input meteorological parameters will have a great negative impact on the operation of microgrids, causing them to deviate from the optimal state. Therefore, solving the uncertainty of input meteorological parameters to ensure the optimal operation of microgrids for a longer period of time is crucial for the optimized operation and scheduling of microgrids. Summary of the invention

[0004] The purpose of the present invention is to provide a double-layer adaptive real-time energy management method and system based on a microgrid in view of the above-mentioned problems existing in the prior art.

[0005] To achieve the above objectives, the technical solution of the present invention is as follows:

[0006] In a first aspect, the present invention proposes a two-layer adaptive real-time energy management method based on a microgrid, comprising:

[0007] S1. Obtain medium-term and short-term forecast data within the scope of energy management system scheduling;

[0008] S2. Based on the medium-term forecast data within the dispatch range of the energy management system, the initial energy state of the battery energy storage system is input, and the upper-level optimization model of the energy management system is constructed with the goal of maximizing the profit of the microgrid;

[0009] S3, solving the upper optimization model of the energy management system to obtain the state variables of a time step control decision within the upper scheduling range;

[0010] S4, based on the state variables of the control decision of a time step within the upper scheduling range and the short-term prediction data within the scheduling range of the energy management system, execute the lower optimization process of the energy management system to optimize and update the actual energy state of the battery energy storage system in the next time step within the upper scheduling range;

[0011] S5. Use the actual energy state of the battery energy storage system at the next time step within the updated upper-level scheduling range as the input of the upper layer, and return to step S2 for iteration until the optimal control decision for all time steps within the scheduling range of the energy management system is obtained.

[0012] In S2, the objective function of the upper optimization model of the energy management system is:

[0013]

[0014] In the above formula, t is the time step of the upper layer, are the electricity import cost and export cost in a single time step t, c grid_peak is the peak power cost, Ω t is the upper time step set, g is the dispatchable motor number, is the operating cost of the dispatchable motor in a single time step t, Ω g is the set of dispatchable motors, b is the battery energy storage system number, is the aging cost of the battery energy storage system in a single time step t, is the energy storage value cost of the battery energy storage system, Ω b is the battery energy storage system set, s is the static controllable load number, is the reduction cost of static controllable load in a single time step, Ω s is the static controllable load set, d is the dynamically controllable load number, is the cost of reducing the dynamically controllable load in a single time step, Ω d is a collection of dynamically controllable loads;

[0015] The power balance constraints that the upper optimization model of the energy management system needs to meet are:

[0016]

[0017] In the above formula, P t grid_in , P t grid_out are the purchased power and sold power from the grid by the grid coupling in a single time step t, are the charging power and discharging power of the battery energy storage system in a single time step t, p is the number of the photovoltaic, is the AC output power of the photovoltaic system in a single time step t, Ω p For photovoltaic collection, is the power generation of the dispatchable motor in a single time step t, P t crit is the critical load consumption in a single time step t, is the power loss of the static controllable load in a single time step t, is the power loss of the dynamically controllable load in a single time step t, l is the number of the time-shifted controllable load, is the power loss of the time-shifted controllable load within a single time step t, Ω l is a set of time-shifted controllable loads;

[0018] The state variables of a time step control decision input into the lower optimization process within the upper scheduling range include the purchased power and sold power from the grid by the grid coupling within a single time step t, the charging power and discharging power of each battery energy storage system, and the generated power of each dispatchable motor.

[0019] In the upper optimization model of the energy management system, each cost-related parameter is calculated using the following formula:

[0020]

[0021]

[0022] c grid_peak =c peak_price ΔP grid_peak ;

[0023]

[0024]

[0025]

[0026]

[0027]

[0028] In the above formula, is the price of electricity sold from the grid for a single time step, is the price of electricity purchased from the grid by the grid coupling within a single time step t, P t grid_in , P t grid_out are the purchased power and sold power from the grid by the grid coupling in a single time step t, Δt is the duration of the optimization time step, c peak_price is the peak power price, ΔP grid_peak is the maximum imported power during the billing period, is the startup cost of the dispatchable motor in a single time step t, is the fuel cost of the dispatchable motor in a single time step t, is the calendar aging cost of the battery energy storage system in a single time step t, is the cycle aging cost of the battery energy storage system in a single time step t, SOE T,b is the energy state of the battery energy storage system at the end of the current dispatch cycle, H b The time required for the battery energy storage system to be fully discharged at the rated power of the bidirectional power control unit. The price of electricity purchased from the grid for grid coupling, To reduce the total cost of static controllable loads, is the reduction level variable of the static controllable load in a single time step t, To reduce the total cost of dynamically controllable loads, is the reduction level variable of the dynamically controllable load within a single time step t.

[0029] The S4 includes:

[0030] S41, dividing a single time step of the upper layer into a plurality of units of time step k of the lower layer, and the scheduling of the lower layer model within a single time step k can be approximated as real-time scheduling;

[0031] S42. Construct the following lower layer optimization model with a time step of k:

[0032]

[0033] In the above formula, k is the time step of the lower layer, is the proportion of grid-coupled power generation in a single time step t of the upper layer, is the proportion of grid-coupled generation in a single time step k at the lower level, Ω k is the lower layer time step set, b is the battery energy storage number, is the power generation share of the battery energy storage system in a single time step t in the upper layer, is the power generation share of the battery energy storage system in a single time step k in the lower layer, Ω b is the battery energy storage system set, g is the dispatchable motor number, is the proportion of dispatchable motor power generation in a single time step t of the upper layer, is the proportion of dispatchable motor power generation share in a single time step k of the lower layer, Ωg is the set of dispatchable motors;

[0034] S43, solving the lower optimization model with a time step of k, and obtaining the state variables of the energy management system at time t+k;

[0035] S44, using the state variables of the energy management system at time t+k, as well as the actual solar irradiance, real-time temperature, and actual load as input quantities of the power system simulation tool to perform power flow simulation, and obtaining the actual value of the power flow calculation of the energy management system at time t+k;

[0036] S45. Use the actual value of the power flow calculation of the energy management system at time t+k as the input of the lower optimization model at time t+2k, return to step S42 for iteration, until the actual energy state of the battery energy storage system at the next time step within the upper scheduling range is obtained, and the loop ends.

[0037] In S42, the parameters related to each power generation share ratio are calculated using the following formula:

[0038]

[0039]

[0040]

[0041]

[0042]

[0043]

[0044]

[0045]

[0046]

[0047]

[0048]

[0049]

[0050]

[0051]

[0052] In the above formula, are the normalization coefficients of grid coupling power of the upper single time step t and the lower single time step k, respectively. are the power normalization coefficients of the bth battery energy storage system at the upper single time step t and the lower single time step k, respectively. are the power normalization coefficients of the g-th dispatchable motor in the upper layer single time step t and the lower layer single time step k respectively; P tgrid_net , are the net discharge power variables of the grid coupling at the upper single time step t and the lower single time step k, respectively, P t grid_out_max , are the maximum power purchased from the grid and the maximum power sold from the grid by the grid coupling in a single time step t of the upper layer, are the maximum power purchased from the grid and the maximum power sold from the grid by the grid coupling within a single time step k of the lower layer, are the net discharge power variables of the bth battery energy storage system at the upper single time step t and the lower single time step k, respectively. is the rated power of the bidirectional power control unit of the bth battery energy storage system, are the actual power generation of the g-th dispatchable motor in the upper single time step t and the lower single time step k, respectively. are the minimum power generation and maximum power generation of the g-th dispatchable motor in a single time step t of the upper layer, are the minimum power generation and maximum power generation of the g-th dispatchable motor in a single time step k of the lower layer, respectively; are the purchased power and sold power of the power grid coupling from the power grid in a single time step t of the upper layer, are respectively the charging power and discharging power of the battery energy storage system in a single time step t in the upper layer.

[0053] In a second aspect, the present invention proposes a two-layer adaptive real-time energy management system based on a microgrid, comprising a data acquisition module, an upper-layer optimization model construction module, an upper-layer optimization model solving module, a lower-layer optimization process execution module, and an iteration module;

[0054] The data acquisition module is used to obtain medium-term and short-term forecast data within the scheduling scope of the energy management system;

[0055] The upper optimization model building module is used to construct an upper optimization model of the energy management system based on the medium-term forecast data within the dispatch range of the energy management system, input the initial energy state of the battery energy storage system, and maximize the profit of the microgrid;

[0056] The upper optimization model solving module is used to solve the upper optimization model of the energy management system to obtain the state variable of a time step control decision within the upper scheduling range;

[0057] The lower-level optimization process execution module is used to execute the lower-level optimization process of the energy management system based on the state variables of a time step control decision within the upper-level scheduling range and the short-term prediction data within the energy management system scheduling range, and optimize and update the actual energy state of the battery energy storage system at the next time step within the upper-level scheduling range;

[0058] The iteration module is used to take the actual energy state of the battery energy storage system at the next time step within the updated upper-level scheduling range as the input of the upper layer, and return to the upper-level optimization model construction module for iteration until the optimal control decision for all time steps within the scheduling range of the energy management system is obtained.

[0059] The upper optimization model construction module includes an objective function construction unit and a constraint condition construction unit;

[0060] The objective function construction unit is used to construct the objective function of the upper optimization model of the following energy management system:

[0061]

[0062] In the above formula, t is the time step of the upper layer, are the electricity import cost and export cost in a single time step t, c grid_peak is the peak power cost, Ω t is the upper time step set, g is the dispatchable motor number, is the operating cost of the dispatchable motor in a single time step t, Ω g is the set of dispatchable motors, b is the battery energy storage system number, is the aging cost of the battery energy storage system in a single time step t, is the energy storage value cost of the battery energy storage system, Ω b is the battery energy storage system set, s is the static controllable load number, is the reduction cost of static controllable load in a single time step, Ω S is the static controllable load set, d is the dynamically controllable load number, is the cost of reducing the dynamically controllable load in a single time step t, Ω d is a collection of dynamically controllable loads;

[0063] The constraint condition construction unit is used to construct the following power balance constraint conditions that the upper optimization model of the energy management system needs to satisfy:

[0064]

[0065] In the above formula, P t grid_in , P t grid_outare the purchased power and sold power from the grid by the grid coupling in a single time step t, are the charging power and discharging power of the battery energy storage system in a single time step t, p is the number of the photovoltaic, is the AC output power of the photovoltaic system in a single time step t, Ωp is the photovoltaic collection, is the power generation of the dispatchable motor in a single time step t, P t crit is the critical load consumption in a single time step t, is the power loss of the static controllable load in a single time step, is the power loss of the dynamically controllable load in a single time step t, l is the number of the time-shifted controllable load, is the power loss of the controllable load within a single time step, Ω l is a set of time-shifted controllable loads;

[0066] The state variables of a time step control decision input into the lower optimization process within the upper scheduling range include the purchased power and sold power from the grid by the grid coupling within a single time step t, the charging power and discharging power of each battery energy storage system, and the generated power of each dispatchable motor.

[0067] In the upper optimization model of the energy management system, each cost-related parameter is calculated using the following formula:

[0068]

[0069]

[0070] c grid_peak =c peak_price ΔP grid_peak ;

[0071]

[0072]

[0073]

[0074]

[0075]

[0076] In the above formula, is the price of electricity sold from the grid by the grid coupling in a single time step t, is the price of electricity purchased from the grid by the grid coupling within a single time step t, P t grid_in , Pt grid_out are the purchased power and sold power from the grid by the grid coupling in a single time step t, Δt is the duration of the optimization time step, c peak_price is the peak power price, ΔP grid_peak is the maximum imported power during the billing period, is the startup cost of the dispatchable motor in a single time step t, is the fuel cost of the dispatchable motor in a single time step t, is the calendar aging cost of the battery energy storage system in a single time step t, is the cycle aging cost of the battery energy storage system in a single time step t, SOE T,b is the energy state of the battery energy storage system at the end of the current dispatch cycle, H b The time required for the battery energy storage system to be fully discharged at the rated power of the bidirectional power control unit. The price of electricity purchased from the grid for grid coupling, To reduce the total cost of static controllable loads, is the reduction level variable of the static controllable load in a single time step, To reduce the total cost of dynamically controllable loads, is the reduction level variable of the dynamically controllable load within a single time step t.

[0077] The lower-level optimization process execution module includes a time step division unit, a lower-level optimization model construction unit, a lower-level optimization model solution unit, a power flow simulation unit, and a loop iteration unit;

[0078] The time step division unit is used to divide a single time step of the upper layer into a plurality of units of the lower layer with a time step of k, and the scheduling of the lower layer model within a single time step k can be approximated as real-time scheduling;

[0079] The lower layer optimization model construction unit is used to construct the following lower layer optimization model with a time step of k:

[0080]

[0081] In the above formula, k is the time step of the lower layer, is the upper single time step, the proportion of coupled power generation in the internal grid, is the proportion of grid-coupled generation in a single time step k at the lower level, Ω k is the lower layer time step set, b is the battery energy storage number, is the power generation share of the internal battery energy storage system in a single time step of the upper layer, is the power generation share of the battery energy storage system in a single time step k in the lower layer, Ω bis the battery energy storage system set, g is the dispatchable motor number, is the proportion of dispatchable motor power generation in a single time step t of the upper layer, is the proportion of dispatchable motor power generation in a single time step k in the lower layer, Ω g is the set of dispatchable motors;

[0082] The lower-level optimization model solving unit is used to solve the lower-level optimization model with a time step of k to obtain the state variables of the energy management system at time t+k;

[0083] The power flow simulation unit is used to use the state variables of the energy management system at time t+k, as well as the actual solar irradiance, real-time temperature, and actual load as input quantities of the power system simulation tool to perform power flow simulation, and obtain the actual value of the power flow calculation of the energy management system at time t+k;

[0084] The loop iteration unit uses the actual value of the power flow calculation of the energy management system at time t+k as the input of the lower optimization model at time t+2k, and returns to the lower optimization model construction unit for iteration until the actual energy state of the battery energy storage system at the next time step within the upper scheduling range is obtained, and the loop ends.

[0085] In the lower optimization model construction unit, the parameters related to each power generation share ratio are calculated using the following formula:

[0086]

[0087]

[0088]

[0089]

[0090]

[0091]

[0092]

[0093]

[0094]

[0095]

[0096]

[0097]

[0098]

[0099]

[0100] In the above formula, are the normalization coefficients of grid coupling power of the upper single time step t and the lower single time step k, respectively. are the power normalization coefficients of the bth battery energy storage system at the upper single time step t and the lower single time step k, respectively. are the power normalization coefficients of the g-th dispatchable motor in the upper layer single time step t and the lower layer single time step k respectively; are the net discharge power variables of the grid coupling at the upper single time step t and the lower single time step k, respectively, P t grid_out_max , P g grid_in_max are the maximum power purchased from the grid and the maximum power sold from the grid by the grid coupling in a single time step t of the upper layer, are the maximum power purchased from the grid and the maximum power sold from the grid by the grid coupling within a single time step k of the lower layer, are the net discharge power variables of the bth battery energy storage system at the upper single time step t and the lower single time step k, respectively. is the rated power of the bidirectional power control unit of the bth battery energy storage system, are the actual power generation of the g-th dispatchable motor in the upper single time step t and the lower single time step k, respectively. are the minimum power generation and maximum power generation of the g-th dispatchable motor in a single time step t of the upper layer, are the minimum power generation and maximum power generation of the g-th dispatchable motor in a single time step k of the lower layer; P t grid_in , P t grid_out are the purchased power and sold power of the power grid coupling from the power grid in a single time step t of the upper layer, are respectively the charging power and discharging power of the battery energy storage system in a single time step t in the upper layer.

[0101] Compared with the prior art, the present invention has the following beneficial effects:

[0102] 1. The present invention proposes a two-layer adaptive real-time energy management method and system based on a microgrid. The method first obtains medium-term and short-term forecast data within the scheduling range of the energy management system, and based on the medium-term forecast data within the scheduling range of the energy management system, inputs the initial energy state of the battery energy storage system, and takes maximizing the profit of the microgrid as the goal, constructs an upper-level optimization model of the energy management system, and obtains the state variables of a time step control decision within the upper-level scheduling range by solving the upper-level optimization model of the energy management system. Then, based on the state variables of a time step control decision within the upper-level scheduling range and the short-term forecast data within the scheduling range of the energy management system, the lower-level optimization process of the energy management system is executed to optimize and update the actual energy state of the battery energy storage system at the next time step within the upper-level scheduling range. Finally, the actual energy state of the battery energy storage system at the next time step within the updated upper-level scheduling range is used as the input of the upper layer, and the upper-level optimization model is returned to iterate until the optimal control decision for all time steps within the scheduling range of the energy management system is obtained. This method proposes a two-layer microgrid energy management system optimization scheduling framework based on a rolling time domain strategy. Taking the energy state of the battery energy storage system as the link, online operation scheduling is performed at the upper layer to maximize the profit of the microgrid, and near real-time scheduling is performed at the lower layer to minimize the corrective action problems of dispatchable components and reduce the uncertainty of parameters related to renewable energy generation and power consumption, so that microgrid operators can adopt different operating strategies to achieve a compromise between obtaining greater profits and extending the service life of equipment.

[0103] 2. The present invention proposes a two-layer adaptive real-time energy management method and system based on microgrid. In the lower optimization process of the energy management system, a single time step of the upper layer is divided into several units of k time steps of the lower layer, and a ratio is introduced to construct a lower optimization model with a time step of k, and the optimization method and the power system simulation tool are interconnected through an interface to realize the step-by-step optimization of the lower layer. On the one hand, the method introduces the concept of ratio in the lower optimization model, which can eliminate the influence of the difference in installed capacity of dispatchable components and the negative value of power reference value, and determines the adjustment of power generation / power consumption plan according to the proportion of power grid coupling, battery energy storage system, and dispatchable motor in the total. The adjustment of high proportion is smaller, and the adjustment of small proportion is larger, so as to minimize the final actual and planned deviation; on the other hand, the method interconnects the optimization method and the power system simulation tool, regards the optimization problem as a black box, and can distribute energy between dispatchable components according to the participation of dispatchable components in the total power generation and consumption ratio, and maintains the economic operation monitored by the upper layer when the energy is insufficient or excessive. BRIEF DESCRIPTION OF THE DRAWINGS

[0104] Figure 1 The figure is an overall flow chart of the method of the present invention.

[0105] Figure 2 This is a time step relationship diagram for the upper layer and lower layer optimization described in Example 1.

[0106] Figure 3 This is a collaborative simulation diagram of the lower-level optimization process described in Example 1.

[0107] Figure 4 The structure diagram of the system of the present invention is shown in FIG. DETAILED DESCRIPTION

[0108] The present invention is further described in detail below in conjunction with specific implementations and drawings.

[0109] The present invention proposes a two-layer adaptive real-time energy management method and system based on microgrid, which obtains the solar irradiance and ambient temperature curves of the photovoltaic system, as well as the medium-term and short-term prediction data of the critical load curve of the microgrid, and considers the decision of the microgrid operator and the energy state of the battery energy storage system at the same time, and constructs a two-layer microgrid energy management system optimization scheduling framework, taking into account the minimization of operating costs / maximization of profits and the problem of minimizing corrective measures for dispatchable elements.

[0110] Embodiment 1:

[0111] This embodiment takes the microgrid that only considers the active power single bus electrical model as the research object, and adopts a two-layer adaptive real-time energy management method to achieve the optimal control management of the energy management system. In the mathematical model of the microgrid, five aspects are modeled, including the grid-microgrid coupling point PCC, the battery energy storage system BESS, the photovoltaic system PV, the dispatchable generator DG and the load.

[0112] like Figure 1 As shown, a two-layer adaptive real-time energy management method based on a microgrid is performed in the following steps:

[0113] 1. Obtain medium-term and short-term forecast data within the scope of energy management system scheduling;

[0114] The medium-term forecast data within the dispatch scope of the energy management system include medium-term forecast data of solar irradiance and ambient temperature of photovoltaic systems obtained by using the public service global forecast system GFS of numerical weather forecast model, and medium-term forecast data of key loads of microgrids obtained by using long short-term memory LSTM artificial neural network ANN prediction; the public service global forecast system GFS model runs four times a day with a horizontal resolution of 0.25°, and can provide forecasts for up to seven days with a time resolution of three hours. The Campbell-Norman model can be used to convert the retrieved cloud data into global horizontal irradiance;

[0115] The short-term prediction data within the dispatching range of the energy management system includes the solar irradiance and ambient temperature curves of the photovoltaic system obtained by using the long short-term memory artificial neural network prediction, and the short-term prediction data of the critical load curve of the microgrid.

[0116] 2. Based on the medium-term forecast data within the dispatch range of the energy management system, the microgrid operator’s decision and the initial energy state SOE of the battery energy storage system are input, and the upper-level optimization model of the energy management system is constructed with the goal of maximizing the profit of the microgrid;

[0117] The upper optimization problem is an online economic dispatch optimization problem. Under the condition of satisfying the operation constraints, the reactive power dispatch based on the rolling horizon strategy integrates the Mixed Integer Linear Programming problem (MILP) into the rolling time domain framework to perform online operation dispatch for multiple steps in the future. The goal is to obtain the initial dispatch of controllable units based on the medium-term forecast data within the forecast range and maximize the profit of the microgrid in the next dispatch cycle.

[0118] The upper optimization model of the energy management system includes:

[0119]

[0120] In the above formula, t is the time step of the upper layer, are the electricity import cost and export cost in a single time step t, c grid_peak is the peak power cost, Ω t is the upper time step set, g is the dispatchable motor number, is the operating cost of the dispatchable motor in a single time step t, Ω g is the set of dispatchable motors, b is the battery energy storage system number, is the aging cost of the battery energy storage system in a single time step t, is the energy storage value cost of the battery energy storage system, Ω b is the battery energy storage system set, s is the static controllable load number, is the reduction cost of static controllable load in a single time step t, Ω S is the static controllable load set, d is the dynamically controllable load number, is the cost of reducing the dynamically controllable load in a single time step t, Ω d is a collection of dynamically controllable loads;

[0121] In the upper optimization model of the energy management system, the calculation of various cost-related parameters is as follows:

[0122]

[0123]

[0124] In the above formula, is the price of electricity sold from the grid for a single time step, is the price of electricity purchased from the grid by the grid coupling within a single time step t, P t grid_in , P t grid_out are the purchased power and sold power from the grid by the grid coupling in a single time step t, respectively, and Δt is the duration of the optimization time step;

[0125] Peak power costs are added to the calculation of the upper-level grid optimization model to implement peak load shaving and valley filling. Peak power costs are calculated regularly during the billing period, usually at the end of each month, using the following formula:

[0126] c grid_peak =c peak_price ΔP grid_peak ;

[0127] Since the peak power cost has a long operating time, directly incorporating it into the optimization model will generate a very large cost value, which will affect the operation and scheduling of the microgrid. However, if this cost is ignored and there is no restriction on the imported power except the contracted power, a large peak power cost value will appear at the end of the billing period. Therefore, the maximum imported power in the billing period is introduced to reduce the peak power cost. Instead of using the peak power within the current scheduling range in each operation and scheduling iteration, if the microgrid operation is scheduled on any day other than the first day of a month, the peak power of the current billing period already exists, which means that two specific situations may occur, namely, the peak power of the current scheduling period is higher than the peak power of the current billing period, which will generate peak power costs, otherwise, no additional peak power costs will be generated, and it will not affect the operation and scheduling of the microgrid. If the microgrid operation is scheduled on the first day of a month and the historical value of the peak power is unknown, the historical peak power of the same billing period as m last year is used as a reference value.

[0128] The maximum imported power during the billing period is calculated using the following formula:

[0129]

[0130] Two specific cases are shown below:

[0131]

[0132]

[0133] In the above formula, c peak_price is the peak power price, ΔPgrid_peak is the maximum imported power during the billing period, i.e., peak power, P grid_peak_SH is the peak power within the current scheduling range, m is the billing period, is the peak power of the current billing period;

[0134] The operating cost of the dispatchable motor is calculated using the following formula, which includes the startup cost and fuel cost. The secondary fuel cost function can be linearized by piecewise linear approximation:

[0135]

[0136]

[0137] c DG_fuel (P) = a·P 2 + b·P;

[0138] In the above formula, is the startup cost of the dispatchable motor in a single time step t, is the fuel cost of the dispatchable motor in a single time step t, is the total startup cost of the dispatchable motor, is the binary start and shut down indicator of the dispatchable generator in a single time step t, and P is the possible shifting scheme of the original consumption of the time-shifted controllable load;

[0139] The aging cost of the battery energy storage system is calculated using the following formula, which is divided into calendar aging cost and cycle aging cost, both of which are included in the optimization model as virtual costs:

[0140]

[0141] The calendar aging cost uses a normalized, linearized calendar stress coefficient function that depends on the current energy state. Regardless of whether the battery energy storage system is in operation, the calendar aging cost always has a coefficient and is calculated using the following formula:

[0142]

[0143]

[0144] For the cycle aging cost, the cycle attenuation of the battery energy storage system is calculated based on the approximate value of the rain flow algorithm, which is usually used to count the cumulative impact of cycle counts on material fatigue. The nonlinear cycle depth aging function is linearized, and the J-segment piecewise linear approximation method is used to penalize the discharge cycle with a high discharge depth. The following formula is used for calculation:

[0145]

[0146]

[0147] Φ(δ)=(5.24·10 -4 )·δ 2.03 ;

[0148] In the above formula, is the calendar aging cost of the battery energy storage system in a single time step t, is the cycle aging cost of the battery energy storage system within a single time step t, is the replacement cost or investment cost, is the service life of the battery energy storage system, is the static calendar stress coefficient, k cal is the charge and discharge calendar stress coefficient, k cal =1.7, SOE t,b is the current energy state of the battery energy storage system in a single time step t, c price_kWh is the energy cost of the battery energy storage system, c price_kW is the power cost of the bidirectional power control unit, is the battery charge and discharge time, is the battery energy capacity, J is the total number of segments, cb,j is the degradation cost of each segment j, is a single time step, the battery discharge power of each segment j in the internal battery energy storage system, φ is the marginal cost, Φ(δ) is the cycle depth aging stress function, and δ is the cycle depth;

[0149] The energy state at the end of the dispatch period is managed by a mechanism that calculates the value of the energy stored in the battery energy storage system. The value of the stored energy represents the virtual revenue that the microgrid operator / owner would receive if the battery energy storage system were fully discharged. This virtual revenue depends on the energy state of the battery energy storage system at the end of the current dispatch period and the average import electricity price over multiple future time steps. It is calculated using the following formula:

[0150]

[0151] In the above formula, SOE T,b is the energy state of the battery energy storage system at the end of the current dispatch cycle, H b The time required for the battery energy storage system to be fully discharged at the rated power of the bidirectional power control unit. The price of electricity purchased from the grid for grid coupling;

[0152] In order to prevent frequent load reduction from affecting user comfort, the reduction cost of static controllable load and dynamically controllable load is calculated using the following formula:

[0153]

[0154]

[0155] In the above formula, To reduce the total cost of static controllable loads, is the reduction level variable of the static controllable load in a single time step t, To reduce the total cost of dynamically controllable loads, is the reduction level variable of the dynamically controllable load within a single time step t.

[0156] 3. Construct the constraints of the upper optimization model of the energy management system;

[0157] The power balance conditions that the upper optimization model of the energy management system needs to meet are:

[0158]

[0159] In the above formula, P t grid_in , P t grid_out are the purchased power and sold power from the grid by the grid coupling in a single time step t, are the charging power and discharging power of the battery energy storage system in a single time step t, p is the number of the photovoltaic, is the AC output power of the photovoltaic system in a single time step t, Ωp is the photovoltaic collection, is the power generation of the dispatchable motor in a single time step t, P t crit is the critical load consumption in a single time step t, is the power loss of the static controllable load in a single time step t, is the power loss of the dynamically controllable load in a single time step t, l is the number of the time-shift controllable load, is the power loss of the time-shifted controllable load within a single time step t, Ω l is a set of time-shifted controllable loads;

[0160] The microgrid is connected to the power system and can import and export power. There are power exchange constraints and peak power constraints for the grid-microgrid link coupling point PCC;

[0161] The power exchange constraints are:

[0162]

[0163]

[0164] The peak power constraint is:

[0165]

[0166] In the above formula, P grid_in_max , P grid_out_max are the maximum purchased input power and the maximum sold output power from the grid for grid coupling, is a binary variable of the power grid state within a single time step t. When it takes the value of 1, it purchases electricity from the power grid, and when it takes the value of 0, it sells electricity to the power grid. In the case where the import electricity price is higher than the export electricity price, the binary variable can be excluded from the mathematical model. is the peak power during the current billing period;

[0167] Like the power grid, the battery energy storage system BESS is also a bidirectional energy flow element in the microgrid. Its mathematical model consists of the battery and the bidirectional power control unit PCU model, including the bidirectional power control unit charge and discharge power constraints, the battery charge and discharge power constraints in the battery energy storage system, and the energy state constraints.

[0168] The charging and discharging power constraints of the bidirectional power control unit are:

[0169]

[0170]

[0171] When the battery energy storage system is in charging and discharging mode, that is, rectification or inversion, the DC charging power and AC discharging power depend on the efficiency of the bidirectional power control unit. In order to maintain the linearity of the model, the piecewise linear approximation method is used to linearize the nonlinear efficiency characteristics of the bidirectional power control unit:

[0172]

[0173]

[0174] In the above formula, Limit the charging and discharging power of the bidirectional power control unit of the battery energy storage system; are the charging power and discharging power of the battery in the battery energy storage system within a single time step t, They are the charging and discharging efficiency of the bidirectional power control unit of the battery energy storage system;

[0175] The lithium-ion battery model of the battery energy storage system adopts an energy charging model, which takes into account the battery's ability to absorb energy ΔSOE, which is a function of the current energy state SOE, and expresses the energy state as a percentage of the battery's rated energy capacity; the nonlinear ΔSOE-SOE characteristic is approximated by linear segmentation to incorporate linear optimization problems. If all segments of the linearized ΔSOE-SOE function are not monotonically decreasing, binary variables are required to approximate this feature; since the efficiency of lithium-ion batteries cannot be extracted separately during the charging and discharging process, the energy charging model takes into account the losses during the full cycle of charging and discharging, that is, the round-trip efficiency;

[0176] In summary, the charging and discharging power constraints of the battery in the battery energy storage system are:

[0177]

[0178]

[0179] Considering energy efficiency, the energy state of the battery energy storage system at time step t depends on the energy state of the previous step and the charge and discharge energy of this time step, and is calculated using the following formula:

[0180]

[0181] In the above formula, ΔSOE t,b is the energy absorbed by the battery in the battery energy storage system within a single time step t, To charge the energy use energy efficiency, is the maximum discharge power of the battery in the battery energy storage system, Δt is the duration of the optimization time step used to convert electrical energy into energy, SOE t,b is the current energy state of the battery energy storage system within a single time step t;

[0182] The energy state constraints of the battery energy storage system include the initial energy state and the energy state during operation scheduling, which are calculated using the following formula:

[0183]

[0184]

[0185] In the above formula, SOE 0,b is the initial energy state of the battery energy storage system, is the initial energy state value of the battery energy storage system at this time step, which is input by the lower model to the upper model at the end of the previous time step. They are the minimum and maximum energy states allowed by the battery energy storage system respectively;

[0186] The photovoltaic system PV model in the microgrid consists of a photovoltaic array model and a photovoltaic inverter model. The photovoltaic array model uses meteorological parameters as input, including the following output power constraints:

[0187]

[0188]

[0189]

[0190]

[0191] In the above formula, is the DC output power of the photovoltaic system in a single time step t, is the rated power of the photovoltaic array under standard test conditions STC, G t is the real-time solar irradiance, G STC The solar irradiance under standard test conditions is 1000W / m 2 , γ p is the power temperature coefficient of the photovoltaic module, is the current and temperature of the photovoltaic module in a single time step t, θ STC The temperature under the standard test conditions STC for photovoltaic modules is 25°C. is the current ambient temperature within a single time step t, NOCT p is the rated operating cell temperature of the PV module, is the AC output power of the photovoltaic system in a single time step t, is the photovoltaic inverter efficiency, is the rated power of the photovoltaic inverter;

[0192] The mathematical model of the dispatchable generator DG adopts the economic dispatch model, including output power constraints, output power change constraints between two time steps, and minimum switching time constraints;

[0193] The output power constraint is:

[0194]

[0195] The output power variation constraint between the two time steps is:

[0196]

[0197]

[0198] The minimum switching time constraint is:

[0199]

[0200]

[0201]

[0202] In the above formula, are the minimum and maximum output power of the dispatchable generator, is the binary state variable of the dispatchable generator within a single time step t. When the variable value is 1, it means that the dispatchable generator has been put into use, otherwise it is 0. is the power generation of the dispatchable motor in a single time step t, are the ramp constraints of dispatchable generators, are the shortest dispatchable generator start-up and shutdown times, is the binary start and shut down indicator of the dispatchable generator within a single time step t;

[0203] There are a variety of different load models in the energy management system of the microgrid, which can provide different degrees of load reduction for the microgrid operator, including static controllable load model constraints, dynamic controllable load model constraints and time-shifted controllable load model constraints;

[0204] The static controllable load model constraint is used to simulate the consumption of multi-unit loads such as large catering, air conditioning HVAC systems, ventilation and heaters. It can model loads with multiple units that can be shut down separately. The consumption of the load can be reduced in n discrete steps, where each step represents a unit and is calculated using the following formula:

[0205]

[0206] The dynamic controllable load model constraint takes into account the consumption of the electronic interface load. It can model the electronic countermeasure load with sustainable control consumption, such as dimmable lighting and variable frequency air conditioning system. The consumption of the dynamic controllable load is calculated by the following formula:

[0207]

[0208] The time-shifted controllable load model constraint can model loads that can be deferred, such as smart appliances, heat pumps, heaters, and electric vehicle charging. In this model constraint, the microgrid operator defines the time to connect to the microgrid and the time when the consumption cycle ends. The end time of the consumption cycle of the original consumption curve can be determined based on the start time. The maximum delay time is calculated using the following formula:

[0209]

[0210] The load consumption of each possible shifting scheme P of the time-shifted controllable load based on the original consumption is calculated using the following formula:

[0211]

[0212]

[0213] Assuming that the load consumption curve of the time-shifted controllable load model cannot be modified, and once the load cycle starts, it cannot be stopped, ensuring that each load is supplied within the end time of its cycle, the final consumption of the time-shifted controllable load is calculated using the following formula:

[0214]

[0215] In the above formula, is the consumption of static controllable load in a single time step t, is the reduction level variable of the static controllable load in a single time step t, is the benchmark / predicted load of the static controllable load in a single time step t, is the consumption of dynamically controllable load in a single time step t, is the reduction level variable of the dynamically controllable load within a single time step t, is the benchmark / predicted load of the dynamically controllable load within a single time step t, is the maximum delay time, is the end time of the consumption cycle, is the end time of the time-shifted controllable load of the original consumption curve, is the load consumption of each possible shifting scheme of the original consumption of the time-shifted controllable load within a single time step t, is the original consumption of the time-shift controllable load, A binary variable for each time transition scheme ensures that only one optimal time transition scheme can be selected.

[0216] 4. Solve the upper-level optimization model of the energy management system under the constraints, and obtain the state variables of a time step control decision within the upper-level scheduling range, including the purchased power and sold power of the grid coupling from the grid within a single time step t, the charging power and discharging power of each battery energy storage system, the generated power of each dispatchable motor, and the loss power of static controllable loads, dynamic controllable loads, and time-shifted controllable loads.

[0217] 5. Construct the lower-level optimization model of the energy management system;

[0218] The state variables of the control decision within a time step t in the upper-level dispatch range are used as the input of the lower-level optimization problem. The single time step t of the upper layer is divided into several units of time steps k in the lower layer. The dispatch range, prediction range, and control range of the lower layer are only one time step of the upper layer. The lower-level model uses the particle swarm optimization method based on the latest short-term prediction of uncertain input parameters to gradually run the power flow optimization under network constraints and perform near real-time dispatch within a single time step k shorter than the upper layer. The relationship between the upper and lower time steps is as follows: Figure 2 As shown;

[0219] The goal of the lower layer optimization is to maintain the power generation / power consumption share ratio of each dispatchable component in the microgrid defined by the upper layer as much as possible. It is assumed that only the power grid, battery energy storage system, and dispatchable motor in the microgrid can be used as dispatchable components to participate in regulating the energy shortage or surplus caused by the difference in power generation / consumption of each microgrid component in the two energy management system layers. In addition, since the scheduling period of the lower layer is shorter than that of the upper layer, it is assumed that the lower layer cannot change the consumption of the load, that is, if the upper layer is not invested, the lower layer cannot dispatch the motor;

[0220] The total consumption of the microgrid in the energy management system is calculated using the following formula:

[0221]

[0222] In the above formula, is the total consumption of the microgrid in a single time step t of the upper layer, P t crit is the critical load consumption in a single time step t of the upper layer, is the consumption of static controllable load in a single time step t of the upper layer, is the consumption of the dynamically controllable load in a single time step t of the upper layer, is the load consumption of the original consumption of the time-shifted controllable load within a single time step t of the upper layer;

[0223] In order to formulate the lower optimization model, the grid and battery energy storage system are converted into net variables P t grid_net and That is, it can be both positive and negative variables:

[0224]

[0225]

[0226] In the above formula, P t grid_net is the net variable of the discharge power coupled to the power grid in a single time step t of the upper layer, P t grid_in , Pt grid_out are the purchased power and sold power of the power grid coupling from the power grid in a single time step t of the upper layer, is the net variable of the discharge power of the bth battery energy storage system in a single time step t of the upper layer, are the charging power and discharging power of the battery energy storage system in a single time step t of the upper layer respectively;

[0227] In order to eliminate the impact of differences in installed capacity of dispatchable components and negative power reference values, all values ​​of the grid, battery energy storage system, and dispatchable motor are normalized to values ​​between 0 and 1. The normalization coefficients of the upper and lower layers are calculated using the following formula:

[0228]

[0229]

[0230]

[0231]

[0232]

[0233]

[0234] In the above formula, are the normalization coefficients of grid coupling power of the upper single time step t and the lower single time step k, respectively. are the power normalization coefficients of the bth battery energy storage system at the upper single time step t and the lower single time step k, respectively. are the power normalization coefficients of the g-th dispatchable motor in the upper layer single time step t and the lower layer single time step k respectively; P t grid_net , are the net discharge power variables of the grid coupling at the upper single time step t and the lower single time step k, respectively. are the maximum power purchased from the grid and the maximum power sold from the grid by the grid coupling in a single time step t of the upper layer, are the maximum power purchased from the grid and the maximum power sold from the grid by the grid coupling within a single time step k of the lower layer, are the net discharge power variables of the bth battery energy storage system at the upper single time step t and the lower single time step k, respectively. is the rated power of the bidirectional power control unit of the bth battery energy storage system, are the actual power generation of the g-th dispatchable motor in the upper single time step t and the lower single time step k, respectively. are the minimum power generation and maximum power generation of the g-th dispatchable motor in a single time step t of the upper layer, are the minimum power generation and maximum power generation of the g-th dispatchable motor in a single time step k of the lower layer, respectively;

[0235] The goal of the lower layer is to minimize the difference in the power generation / consumption share ratio of each dispatchable element in the two-layer microgrid, and the following lower-layer optimization model with a time step of k is constructed:

[0236]

[0237] Taking the upper grid coupling ratio as an example, this ratio calculates the ratio of the total net power consumption of the upper grid coupling to the total net power consumption of all components in the upper layer, and subtracts this ratio from the lower grid coupling ratio. The closer the difference is to 0, the closer the actual power generation / power consumption share of the lower layer is to the planned value of the upper layer. Therefore, the lower layer objective function is to minimize the difference between the upper and lower layer ratios of grid coupling, battery energy storage system, and dispatchable motor. In the above formula, k is the lower layer time step, is the proportion of grid-coupled power generation in a single time step t of the upper layer, is the proportion of grid-coupled generation in a single time step k at the lower level, Ω k is the lower layer time step set, b is the battery energy storage number, is the power generation share of the internal battery energy storage system in a single time step of the upper layer, is the power generation share of the battery energy storage system in a single time step k in the lower layer, Ω b is the battery energy storage system set, g is the dispatchable motor number, is the proportion of dispatchable motor power generation in a single time step t of the upper layer, is the proportion of dispatchable motor power generation in a single time step k in the lower layer, Ω g is the set of dispatchable motors;

[0238] The parameters related to each power generation share ratio are calculated using the following formula:

[0239]

[0240]

[0241]

[0242]

[0243]

[0244]

[0245] In the real-time energy management system, both optimization layers satisfy the PCC constraints of the grid-microgrid link coupling point, the BESS constraints of the battery energy storage system, the PV constraints of the photovoltaic system, the DG constraints of the dispatchable generator, and the load constraints. In addition, the lower optimization problem also includes the bus voltage constraints, the maximum current constraints of the microgrid branch, the power constraints of the power conversion elements, and the power factor constraints of the microgrid and the grid.

[0246] The bus voltage constraint is:

[0247]

[0248] The maximum current constraint of the microgrid branch is:

[0249]

[0250] The power constraints of the power conversion elements are:

[0251]

[0252] The power factor constraint for the microgrid to exchange power with the grid is:

[0253]

[0254]

[0255] In the above formula, V k,o is the bus voltage, are the rated minimum and maximum voltages of the busbar, I k,c is the maximum current of the microgrid branch, is the rated branch current, S k,e is the power conversion element power, P k,e , Q k,e are the active power and reactive power of the power conversion element, is the power factor of the power exchanged between the microgrid and the grid, They are leading and lagging power factor limits respectively.

[0256] 6. Based on the state variables of a time step control decision within the upper scheduling range and the short-term prediction data within the energy management system scheduling range, the lower optimization process of the energy management system is executed to optimize the state variables of the next time step control decision within the upper scheduling range;

[0257] The lower-level optimization problem performs near-real-time scheduling under network constraints, minimizing the deviation from the plan determined by the upper level for the next control horizon, i.e., time step, using a new collaborative simulation approach, e.g. Figure 3As shown, the optimization method and the power system simulation tool are connected to each other through an interface, and the optimization problem is regarded as a black box, that is, the optimization method is not familiar with the relationship between input and output, but only familiar with the objective function value. Therefore, a shorter dispatching scope and optimization time step are designed, and a step-by-step optimization method is used to ensure a shorter solution time.

[0258] In the new collaborative simulation method, the power system simulation tool is used to simulate the microgrid, which contains the state variables and constraints described in the upper optimization model. Since the power system simulation tool contains the power flow equation, it allows us to add network constraints to the optimization problem without coding, thereby reducing approximations and building a more realistic microgrid model. Although the nonlinear power flow equation is only indirectly included in the optimization problem, it defines the nature of the optimization problem as nonlinear;

[0259] Solve the lower optimization model with a time step of k to obtain the state variables of the energy management system at time t+k, including the purchased power and sold power from the grid coupling within a single time step k, the charging power and discharging power of each battery energy storage system, and the power generation power of each dispatchable motor. Since the lower scheduling cycle is short, it is determined that the three controllable loads are unchanged.

[0260] The state variables of the energy management system at time t+k, as well as the actual solar irradiance, real-time temperature, and actual load are used as inputs of the power system simulation tool to perform power flow simulation, and the actual value of the power flow calculation of the energy management system at time t+k is obtained, including the actual power purchased or sold from the power grid by the grid coupling, the actual charging power and discharging power of each battery energy storage system, the actual power generation power of each dispatchable motor, and the actual energy state SOE of the battery energy storage system;

[0261] The actual value of the power flow calculation of the energy management system at time t+k is used as the input of the lower optimization model at time t+2k, and the lower optimization model with a time step of k is returned to iterate until the actual energy state of the battery energy storage system in the next time step within the upper scheduling range is obtained, and the cycle ends.

[0262] 7. The actual energy state of the battery energy storage system at the next time step within the upper-level scheduling range is used as the input of the upper layer, and the operation of step 2 is returned to iterate. In the next iteration, the upper layer uses the updated actual energy state parameters, the medium-term forecast of the uncertain parameters, and the operator's decision to optimize and continue the operation at the next time step until the optimal control decision for all time steps within the scheduling range of the energy management system is obtained.

[0263] Embodiment 2:

[0264] like Figure 4As shown, a two-layer adaptive real-time energy management system based on a microgrid includes a data acquisition module, an upper-layer optimization model construction module, an upper-layer optimization model solution module, a lower-layer optimization process execution module, and an iteration module;

[0265] The data acquisition module is used to obtain medium-term and short-term forecast data within the scheduling scope of the energy management system;

[0266] The upper optimization model building module is used to construct an upper optimization model of the energy management system based on the medium-term forecast data within the dispatch range of the energy management system, input the initial energy state of the battery energy storage system, and maximize the profit of the microgrid;

[0267] The upper optimization model solving module is used to solve the upper optimization model of the energy management system to obtain the state variables of a time step control decision within the upper scheduling range, wherein the state variables include the purchased power or sold power of the power grid coupling from the power grid within the time step t, the charging and discharging power of each battery energy storage system, the generated power of each dispatchable motor, and the power size of the static controllable load, the dynamic controllable load, and the time-shifted controllable load;

[0268] The lower-level optimization process execution module is used to execute the lower-level optimization process of the energy management system based on the state variables of a time step control decision within the upper-level scheduling range and the short-term prediction data within the energy management system scheduling range, and optimize and update the actual energy state of the battery energy storage system at the next time step within the upper-level scheduling range;

[0269] The iteration module is used to take the actual energy state of the battery energy storage system at the next time step within the updated upper-level scheduling range as the input of the upper layer, and return to the upper-level optimization model construction module for iteration until the optimal control decision for all time steps within the scheduling range of the energy management system is obtained.

[0270] The upper optimization model construction module includes an objective function construction unit and a constraint condition construction unit;

[0271] The objective function construction unit is used to construct the objective function of the upper optimization model of the following energy management system:

[0272]

[0273] In the above formula, t is the time step of the upper layer, are the electricity import cost and export cost in a single time step t, c grid_peak is the peak power cost, Ω t is the upper time step set, g is the dispatchable motor number, is the operating cost of the dispatchable motor in a single time step t, Ω gis the set of dispatchable motors, b is the battery energy storage system number, is the aging cost of the battery energy storage system for a single time step, is the energy storage value cost of the battery energy storage system, Ω b is the battery energy storage system set, s is the static controllable load number, is the reduction cost of static controllable load in a single time step t, Ω S is the static controllable load set, d is the dynamically controllable load number, is the cost of reducing the dynamically controllable load in a single time step t, Ω d is a collection of dynamically controllable loads;

[0274] The constraint condition construction unit is used to construct the following power balance constraint conditions that the upper optimization model of the energy management system needs to satisfy:

[0275]

[0276] In the above formula, are the purchased power and sold power from the grid by the grid coupling in a single time step t, are the charging power and discharging power of the battery energy storage system in a single time step t, p is the number of the photovoltaic, is the AC output power of the photovoltaic system in a single time step t, Ω p For photovoltaic collection, is the power generation of the dispatchable motor in a single time step t, P t crit is the critical load consumption in a single time step t, is the power loss of the static controllable load in a single time step t, is the power loss of the dynamically controllable load in a single time step t, l is the number of the time-shift controllable load, is the power loss of the time-shifted controllable load within a single time step t, Ω l is a set of time-shifted controllable loads;

[0277] The state variables of a time step control decision input into the lower optimization process within the upper scheduling range include the purchased power and sold power from the grid by the grid coupling within a single time step t, the charging power and discharging power of each battery energy storage system, and the generated power of each dispatchable motor.

[0278] In the upper optimization model of the energy management system, each cost-related parameter is calculated using the following formula:

[0279]

[0280]

[0281]

[0282]

[0283]

[0284]

[0285]

[0286]

[0287] In the above formula, is the price of electricity sold from the grid for a single time step, is the price of electricity purchased from the grid by the grid coupling within a single time step t, P t grid_in , P t grid_out are the purchased power and sold power from the grid by the grid coupling in a single time step t, Δt is the duration of the optimization time step, c peak_price is the peak power price, ΔP grid_peak is the maximum imported power during the billing period, is the startup cost of the dispatchable motor in a single time step t, is the fuel cost of the dispatchable motors in a single time step, is the calendar aging cost of the battery energy storage system in a single time step t, is the cycle aging cost of the battery energy storage system in a single time step t, SOE T,b is the energy state of the battery energy storage system at the end of the current dispatch cycle, H b The time required for the battery energy storage system to be fully discharged at the rated power of the bidirectional power control unit. The price of electricity purchased from the grid for grid coupling, To reduce the total cost of static controllable loads, is the reduction level variable of the static controllable load in a single time step t, To reduce the total cost of dynamically controllable loads, is the reduction level variable of the dynamically controllable load within a single time step t.

[0288] The lower-level optimization process execution module includes a time step division unit, a lower-level optimization model construction unit, a lower-level optimization model solution unit, a power flow simulation unit, and a loop iteration unit;

[0289] The time step division unit is used to divide a single time step of the upper layer into a plurality of units of the lower layer with a time step of k, and the scheduling of the lower layer model within a single time step k can be approximated as real-time scheduling;

[0290] The lower layer optimization model construction unit is used to construct the following lower layer optimization model with a time step of k:

[0291]

[0292] In the above formula, k is the time step of the lower layer, is the proportion of grid-coupled power generation in a single time step t of the upper layer, is the proportion of grid-coupled generation in a single time step k at the lower level, Ω k is the lower layer time step set, b is the battery energy storage number, is the power generation share of the battery energy storage system in a single time step t in the upper layer, is the power generation share of the battery energy storage system in a single time step k in the lower layer, Ω b is the battery energy storage system set, g is the dispatchable motor number, is the proportion of dispatchable motor power generation in a single time step t of the upper layer, is the proportion of dispatchable motor power generation in a single time step k in the lower layer, Ω g is the set of dispatchable motors;

[0293] In the lower optimization model construction unit, the parameters related to each power generation share ratio are calculated using the following formula:

[0294]

[0295]

[0296]

[0297]

[0298]

[0299]

[0300]

[0301]

[0302]

[0303]

[0304]

[0305]

[0306]

[0307]

[0308] In the above formula, are the normalization coefficients of grid coupling power of the upper single time step t and the lower single time step k, respectively. are the power normalization coefficients of the bth battery energy storage system at the upper single time step t and the lower single time step k, respectively. are the power normalization coefficients of the g-th dispatchable motor in the upper layer single time step t and the lower layer single time step k respectively; P g grid_net , are the net discharge power variables of the grid coupling at the upper single time step t and the lower single time step k, respectively, P g grid_out_max , P g grid_in_max are the maximum power purchased from the grid and the maximum power sold from the grid by the grid coupling in a single time step t of the upper layer, are the maximum power purchased from the grid and the maximum power sold from the grid by the grid coupling within a single time step k of the lower layer, are the net discharge power variables of the bth battery energy storage system at the upper single time step t and the lower single time step k, respectively. is the rated power of the bidirectional power control unit of the bth battery energy storage system, are the actual power generation of the g-th dispatchable motor in the upper single time step t and the lower single time step k, respectively. are the minimum power generation and maximum power generation of the g-th dispatchable motor in a single time step t of the upper layer, are the minimum power generation and maximum power generation of the g-th dispatchable motor in a single time step k of the lower layer; P t grid_in , P t grid_out are the purchased power and sold power of the power grid coupling from the power grid in a single time step t of the upper layer, are the charging power and discharging power of the battery energy storage system in a single time step t of the upper layer respectively;

[0309] The lower-level optimization model solving unit is used to solve the lower-level optimization model with a time step of k to obtain the state variables of the energy management system at time t+k;

[0310] The power flow simulation unit is used to use the state variables of the energy management system at time t+k, as well as the actual solar irradiance, real-time temperature, and actual load as input quantities of the power system simulation tool to perform power flow simulation, and obtain the actual value of the power flow calculation of the energy management system at time t+k;

[0311] The loop iteration unit uses the actual value of the power flow calculation of the energy management system at time t+k as the input of the lower optimization model at time t+2k, and returns to the lower optimization model construction unit for iteration until the actual energy state of the battery energy storage system at the next time step within the upper scheduling range is obtained, and the loop ends.

Claims

1. A two-layer adaptive real-time energy management method based on microgrid, characterized in that: The method comprises: S1. Obtain medium-term and short-term forecast data within the scope of energy management system scheduling; S2. Based on the medium-term forecast data within the dispatch range of the energy management system, the initial energy state of the battery energy storage system is input, and the upper-level optimization model of the energy management system is constructed with the goal of maximizing the profit of the microgrid; S3, solving the upper optimization model of the energy management system to obtain the state variables of a time step control decision within the upper scheduling range; S4, based on the state variables of the control decision of a time step within the upper scheduling range and the short-term prediction data within the scheduling range of the energy management system, execute the lower optimization process of the energy management system to optimize and update the actual energy state of the battery energy storage system in the next time step within the upper scheduling range; S5. Use the actual energy state of the battery energy storage system at the next time step within the updated upper-level scheduling range as the input of the upper layer, and return to step S2 for iteration until the optimal control decision for all time steps within the scheduling range of the energy management system is obtained.

2. A two-layer adaptive real-time energy management method based on microgrid according to claim 1, characterized in that: In S2, the objective function of the upper optimization model of the energy management system is: In the above formula, t is the time step of the upper layer, are the import and export costs of domestic electricity for a single time step, c grid_peak is the peak power cost, Ω t is the upper time step set, g is the dispatchable motor number, is the operating cost of the dispatchable motor in a single time step t, Ω g is the set of dispatchable motors, b is the battery energy storage system number, is the aging cost of the battery energy storage system for a single time step, is the energy storage value cost of the battery energy storage system, Ω b is the battery energy storage system set, s is the static controllable load number, is the reduction cost of static controllable load in a single time step, Ω s is the static controllable load set, d is the dynamically controllable load number, is the cost of reducing the dynamically controllable load in a single time step t, Ω d is a collection of dynamically controllable loads; The power balance constraints that the upper optimization model of the energy management system needs to meet are: In the above formula, are the purchased power and sold power from the grid by the grid coupling in a single time step t, are the charging power and discharging power of the battery energy storage system in a single time step t, p is the number of the photovoltaic, is the AC output power of the photovoltaic system in a single time step t, Ω p For photovoltaic collection, is the power generation of the dispatchable motor in a single time step t, P t crit is the critical load consumption in a single time step t, is the power loss of the static controllable load in a single time step, is the power loss of the dynamically controllable load in a single time step, l is the number of the time-shift controllable load, is the power loss of the controllable load within a single time step, Ω l is a set of time-shifted controllable loads; The state variables of a time step control decision input into the lower optimization process within the upper scheduling range include a single time step, the purchased power and sold power from the grid by the inner grid coupling, the charging power and discharging power of each battery energy storage system, and the generated power of each dispatchable motor.

3. A two-layer adaptive real-time energy management method based on microgrid according to claim 2, characterized in that: In the upper optimization model of the energy management system, each cost-related parameter is calculated using the following formula: c grid_peak =c peak_price ·ΔP grid_peak ; In the above formula, is the price of electricity sold from the grid for a single time step, is the price of electricity purchased from the grid by the grid coupling within a single time step t, P t grid_in , P t grid_out are the purchased power and sold power from the grid by the grid coupling in a single time step t, Δt is the duration of the optimization time step, c peak_price is the peak power price, ΔP grid_peak is the maximum imported power during the billing period, is the startup cost of the dispatchable motor in a single time step, is the fuel cost of the dispatchable motor in a single time step t, is the calendar aging cost of the battery energy storage system in a single time step t, is the cycle aging cost of the battery energy storage system in a single time step t, SOE T,b is the energy state of the battery energy storage system at the end of the current dispatch cycle, H b The time required for the battery energy storage system to be fully discharged at the rated power of the bidirectional power control unit. The price of electricity purchased from the grid for grid coupling, To reduce the total cost of static controllable loads, is the reduction level variable of the static controllable load in a single time step, To reduce the total cost of dynamically controllable loads, is the reduction level variable of the dynamically controllable load within a single time step t.

4. A two-layer adaptive real-time energy management method based on microgrid according to claim 1, characterized in that: The S4 includes: S41, dividing a single time step of the upper layer into a plurality of units of time step k of the lower layer, and the scheduling of the lower layer model within a single time step k can be approximated as real-time scheduling; S42. Construct the following lower layer optimization model with a time step of k: In the above formula, k is the time step of the lower layer, is the proportion of grid-coupled power generation in a single time step t of the upper layer, is the proportion of grid-coupled generation in a single time step k at the lower level, Ω k is the lower layer time step set, b is the battery energy storage number, is the power generation share of the internal battery energy storage system in a single time step of the upper layer, is the power generation share of the battery energy storage system in a single time step k in the lower layer, Ω b is the battery energy storage system set, g is the dispatchable motor number, is the proportion of dispatchable motor power generation in a single time step t of the upper layer, is the proportion of dispatchable motor power generation in a single time step k in the lower layer, Ω g is the set of dispatchable motors; S43, solving the lower optimization model with a single time step of k, and obtaining the state variables of the energy management system at time t+k; S44, using the state variables of the energy management system at time t+k, as well as the actual solar irradiance, real-time temperature, and actual load as input quantities of the power system simulation tool to perform power flow simulation, and obtaining the actual value of the power flow calculation of the energy management system at time t+k; S45. Use the actual value of the power flow calculation of the energy management system at time t+k as the input of the lower optimization model at time t+2k, return to step S42 for iteration, until the actual energy state of the battery energy storage system at the next time step within the upper scheduling range is obtained, and the loop ends.

5. A two-layer adaptive real-time energy management method based on microgrid according to claim 4, characterized in that: In S42, the parameters related to each power generation share ratio are calculated using the following formula: In the above formula, are the normalization coefficients of grid coupling power of the upper single time step t and the lower single time step k, respectively. are the power normalization coefficients of the bth battery energy storage system at the upper single time step t and the lower single time step k, respectively. are the power normalization coefficients of the g-th dispatchable motor in the upper layer single time step t and the lower layer single time step k respectively; P t grid_net , are the net discharge power variables of the grid coupling at the upper single time step t and the lower single time step k, respectively, P t grid_out_max , P t grid_in_max are the maximum power purchased from the grid and the maximum power sold from the grid by the grid coupling in a single time step t of the upper layer, are the maximum power purchased from the grid and the maximum power sold from the grid by the grid coupling within a single time step k of the lower layer, are the net discharge power variables of the bth battery energy storage system at the upper single time step t and the lower single time step k, respectively. is the rated power of the bidirectional power control unit of the bth battery energy storage system, are the actual power generation of the g-th dispatchable motor in the upper single time step t and the lower single time step k, respectively. are the minimum power generation and maximum power generation of the g-th dispatchable motor in a single time step t of the upper layer, are the minimum power generation and maximum power generation of the g-th dispatchable motor in a single time step k of the lower layer; P t grid_in , P t grid_out are the purchased power and sold power of the power grid coupling from the power grid in a single time step t of the upper layer, They are respectively the charging power and discharging power of the internal battery energy storage system in a single time step of the upper layer.

6. A two-layer adaptive real-time energy management system based on microgrid, characterized in that: The system includes a data acquisition module, an upper-level optimization model construction module, an upper-level optimization model solution module, a lower-level optimization process execution module, and an iteration module; The data acquisition module is used to obtain medium-term and short-term forecast data within the scheduling scope of the energy management system; The upper optimization model building module is used to construct an upper optimization model of the energy management system based on the medium-term forecast data within the dispatch range of the energy management system, input the initial energy state of the battery energy storage system, and maximize the profit of the microgrid; The upper optimization model solving module is used to solve the upper optimization model of the energy management system to obtain the state variable of a time step control decision within the upper scheduling range; The lower-level optimization process execution module is used to execute the lower-level optimization process of the energy management system based on the state variables of a time step control decision within the upper-level scheduling range and the short-term prediction data within the energy management system scheduling range, and optimize and update the actual energy state of the battery energy storage system at the next time step within the upper-level scheduling range; The iteration module is used to take the actual energy state of the battery energy storage system at the next time step within the updated upper-level scheduling range as the input of the upper layer, and return to the upper-level optimization model construction module for iteration until the optimal control decision for all time steps within the scheduling range of the energy management system is obtained.

7. A two-layer adaptive real-time energy management system based on microgrid according to claim 6, characterized in that: The upper optimization model construction module includes an objective function construction unit and a constraint condition construction unit; The objective function construction unit is used to construct the objective function of the upper optimization model of the following energy management system: In the above formula, t is the time step of the upper layer, are the electricity import cost and export cost in a single time step t, c grid_peak is the peak power cost, Ω t is the upper time step set, g is the dispatchable motor number, is the operating cost of the dispatchable motor in a single time step t, Ω g is the set of dispatchable motors, b is the battery energy storage system number, is the aging cost of the battery energy storage system in a single time step t, is the energy storage value cost of the battery energy storage system, Ω b is the battery energy storage system set, s is the static controllable load number, is the reduction cost of static controllable load in a single time step t, Ω s is the static controllable load set, d is the dynamically controllable load number, is the cost of reducing the dynamically controllable load in a single time step t, Ω d is a collection of dynamically controllable loads; The constraint condition construction unit is used to construct the following power balance constraint conditions that the upper optimization model of the energy management system needs to satisfy: In the above formula, P t grid_in , P t grid_out are the purchased power and sold power from the grid by the grid coupling in a single time step t, are the charging power and discharging power of the battery energy storage system in a single time step t, p is the number of the photovoltaic, is the AC output power of the photovoltaic system in a single time step, Ω p For photovoltaic collection, is the power generation of the dispatchable motor in a single time step t, P t crit is the critical load consumption in a single time step t, is the power loss of the static controllable load in a single time step t, is the power loss of the dynamically controllable load in a single time step t, l is the number of the time-shifted controllable load, is the power loss of the time-shifted controllable load within a single time step t, Ω l is a set of time-shifted controllable loads; The state variables of a time step control decision input into the lower optimization process within the upper scheduling range include the purchased power and sold power from the grid by the grid coupling within a single time step t, the charging power and discharging power of each battery energy storage system, and the generated power of each dispatchable motor.

8. A two-layer adaptive real-time energy management system based on microgrid according to claim 7, characterized in that: In the upper optimization model of the energy management system, each cost-related parameter is calculated using the following formula: c grid_peak =c peak_price ·ΔP grid_peak ; In the above formula, is the price of electricity sold from the grid by the grid coupling in a single time step t, is the price of electricity purchased from the grid by the grid coupling within a single time step t, P t grid_in , P t grid_out are the purchased power and sold power from the grid by the grid coupling in a single time step t, Δt is the duration of the optimization time step, c peak_price is the peak power price, ΔP grid_peak is the maximum imported power during the billing period, is the startup cost of the dispatchable motor in a single time step t, is the fuel cost of the dispatchable motor in a single time step t, is a single time step, with the calendar aging cost of the battery energy storage system, is a single time step, with the cycle aging cost of the battery energy storage system, SOE T,b is the energy state of the battery energy storage system at the end of the current dispatch cycle, H b The time required for the battery energy storage system to be fully discharged at the rated power of the bidirectional power control unit. The price of electricity purchased from the grid for grid coupling, To reduce the total cost of static controllable loads, is the reduction level variable of the static controllable load in a single time step, To reduce the total cost of dynamically controllable loads, is the reduction level variable of the dynamically controllable load within a single time step t.

9. A two-layer adaptive real-time energy management system based on microgrid according to claim 6, characterized in that: The lower-level optimization process execution module includes a time step division unit, a lower-level optimization model construction unit, a lower-level optimization model solution unit, a power flow simulation unit, and a loop iteration unit; The time step division unit is used to divide a single time step of the upper layer into a plurality of units of k time steps of the lower layer, and the scheduling of the lower layer model within a single time step k can be approximated as real-time scheduling; The lower layer optimization model construction unit is used to construct the following lower layer optimization model with a time step of k: In the above formula, k is the time step of the lower layer, is the proportion of grid-coupled power generation in a single time step t of the upper layer, is the proportion of grid-coupled generation in a single time step k at the lower level, Ω k is the lower layer time step set, b is the battery energy storage number, is the power generation share of the internal battery energy storage system in a single time step of the upper layer, is the power generation share of the battery energy storage system in a single time step k in the lower layer, Ω b is the battery energy storage system set, g is the dispatchable motor number, is the proportion of dispatchable motor power generation in a single time step t of the upper layer, is the proportion of dispatchable motor power generation in a single time step k in the lower layer, Ω g is the set of dispatchable motors; The lower-level optimization model solving unit is used to solve the lower-level optimization model with a time step of k to obtain the state variables of the energy management system at time t+k; The power flow simulation unit is used to use the state variables of the energy management system at time t+k, as well as the actual solar irradiance, real-time temperature, and actual load as input quantities of the power system simulation tool to perform power flow simulation, and obtain the actual value of the power flow calculation of the energy management system at time t+k; The loop iteration unit uses the actual value of the power flow calculation of the energy management system at time t+k as the input of the lower optimization model at time t+2k, and returns to the lower optimization model construction unit for iteration until the actual energy state of the battery energy storage system at the next time step within the upper scheduling range is obtained, and the loop ends.

10. A two-layer adaptive real-time energy management system based on microgrid according to claim 9, characterized in that: In the lower optimization model construction unit, the parameters related to each power generation share ratio are calculated using the following formula: In the above formula, are the normalization coefficients of grid coupling power of the upper single time step t and the lower single time step k, respectively. are the power normalization coefficients of the bth battery energy storage system at the upper single time step t and the lower single time step k, respectively. are the power normalization coefficients of the g-th dispatchable motor in the upper layer single time step t and the lower layer single time step k respectively; P t grid_net , are the net discharge power variables of the grid coupling at the upper single time step t and the lower single time step k, respectively, P t grid_out_max , P t grid_in_max are the maximum power purchased from the grid and the maximum power sold from the grid by the grid coupling in a single time step t of the upper layer, are the maximum power purchased from the grid and the maximum power sold from the grid by the grid coupling within a single time step k of the lower layer, are the net discharge power variables of the bth battery energy storage system at the upper single time step t and the lower single time step k, respectively. is the rated power of the bidirectional power control unit of the bth battery energy storage system, are the actual power generation of the g-th dispatchable motor in the upper single time step t and the lower single time step k, respectively. are the minimum power generation and maximum power generation of the g-th dispatchable motor in a single time step t of the upper layer, are the minimum power generation and maximum power generation of the g-th dispatchable motor in a single time step k of the lower layer; P t grid_in , P t grid_out are the purchased power and sold power of the power grid coupling from the power grid in a single time step t of the upper layer, They are respectively the charging power and discharging power of the internal battery energy storage system in a single time step of the upper layer.