A short-term prediction uncertainty hydrogen energy micro-grid optimization scheduling method and system

By combining LSTM and KDE methods, the prediction error distribution of microgrids is quantified, and the chance constraints are transformed into deterministic constraints. This solves the problems of prediction accuracy and equipment loss in microgrids under the uncertainty of renewable energy, and realizes economical and efficient optimized scheduling.

CN121983969BActive Publication Date: 2026-06-12TONGJI UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TONGJI UNIV
Filing Date
2026-04-03
Publication Date
2026-06-12

AI Technical Summary

Technical Problem

Existing microgrid optimization scheduling methods suffer from insufficient prediction accuracy and lack of consideration for equipment losses when facing the uncertainties of renewable energy sources such as wind power and photovoltaics, making it difficult for scheduling schemes to balance long-term operational reliability and economy.

Method used

A nonparametric probability density model is constructed by combining Long Short-Term Memory (LSTM) networks with kernel density estimation (KDE) to quantify the prediction error distribution. Opportunity constraints are transformed into deterministic linear constraints through a risk adaptive mechanism, and a stochastic optimization model that includes equipment degradation costs and power balance is constructed for rolling optimization scheduling.

Benefits of technology

It improves the accuracy of uncertainty quantification, reduces the complexity of stochastic optimization calculation, ensures the economical operation of the system, significantly reduces equipment wear and tear, and enhances the robustness of scheduling and equipment lifespan.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121983969B_ABST
    Figure CN121983969B_ABST
Patent Text Reader

Abstract

The present application relates to a kind of short-term prediction uncertainty hydrogen energy micro-grid optimization scheduling method and system, method includes the following steps: S1: real-time acquisition micro-grid field time series weather data and each unit power state;The data collected are cleaned, denoised and normalized preprocessing;S2: based on the long short-term memory network LSTM model trained in future prediction time domain obtains power point prediction sequence;Collect historical residual sample, utilize kernel density estimation KDE method to establish nonparametric probability density model;S3: optimization decision stage: S31: construct with system total operation cost minimum as target, contain equipment recession cost and power balance opportunity constraint random optimization model;S32: the power balance opportunity constraint is converted into deterministic linear inequality constraint;S4: execution and feedback stage.Compared with prior art, the present application improves the accuracy of uncertainty quantification, ensures the system economy operation, significantly reduces the calculation complexity of random optimization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of microgrid operation control and energy management technology, and in particular to a method and system for optimizing the scheduling of hydrogen microgrids with short-term predictive uncertainty. Background Technology

[0002] With the continuous increase in the penetration rate of renewable energy sources such as wind power and photovoltaics, their inherent intermittency and randomness pose a severe challenge to the frequency stability and peak-shaving capacity of the main power grid. Integrating distributed power sources, energy storage systems, and local loads and connecting them to the main grid in the form of "microgrids" has become an important direction for improving energy absorption capacity.

[0003] CN202510928944.3 discloses a multi-energy complementary optimization scheduling method for extreme high-temperature scenarios that considers uncertainty. The method mainly includes: 1. Integrating bidirectional temporal convolution, bidirectional long short-term memory networks, attention mechanisms, and quantile regression forests to achieve high-precision prediction and uncertainty modeling of wind speed, solar irradiance, and load, and constructing a typical daily scenario set; 2. Constructing a two-stage scheduling model that integrates ε-constrained multi-objective optimization and chance-constrained mixed integer programming, optimizing the adjustment margin before the day and rolling the scheduling path within the day; 3. Proposing three types of physical correction mechanisms for extreme high-temperature disturbances: wind power air density correction, photovoltaic temperature response, and hydropower evaporation-water level coupling; 4. Integrating and constructing a prediction-optimization-feedback-correction closed-loop process to improve the system's stability and response resilience under extreme climate conditions. However, the prediction accuracy is limited, the physical response model is lacking, the scheduling coordination is poor, and the optimization method's ability to handle complex uncertainties is insufficient.

[0004] In microgrid energy management systems (EMS), dispatch strategies need to be formulated by comprehensively considering grid electricity prices, load demand, renewable energy output, and energy storage costs. However, existing technologies have the following shortcomings:

[0005] 1. Inaccurate uncertainty modeling: Existing scheduling methods rely too much on point prediction results, making it difficult to accurately characterize the prediction error of non-Gaussian distributions.

[0006] 2. Lack of consideration for equipment losses: The cost of refined operation of key hydrogen energy components such as electrolyzers and fuel cells under frequent start-ups and power fluctuations is ignored, making it difficult for the scheduling scheme to balance long-term operational reliability and economy. Summary of the Invention

[0007] The purpose of this invention is to overcome the shortcomings of the existing technology by providing a method and system for optimizing the scheduling of hydrogen microgrids with short-term predictive uncertainty, improving the accuracy of uncertainty quantification, ensuring the economical operation of the system, and significantly reducing the computational complexity of stochastic optimization.

[0008] The objective of this invention can be achieved through the following technical solutions:

[0009] This invention provides a method for optimizing the scheduling of hydrogen microgrids with short-term forecast uncertainty, comprising the following steps:

[0010] S1: Data Acquisition and Preprocessing Stage: Real-time acquisition of time-series meteorological data and power status of each unit in the microgrid; cleaning, denoising and normalization preprocessing of the acquired data;

[0011] S2: Prediction and Uncertainty Quantification Stage: Obtain the power point prediction sequence in the future prediction time domain based on the trained Long Short-Term Memory (LSTM) network model; collect historical residual samples and use the kernel density estimation (KDE) method to establish a nonparametric probability density model to obtain the error probability distribution of power point prediction;

[0012] S3: Optimization Decision-Making Phase

[0013] S31: Construct a stochastic optimization model with the objective of minimizing the total system operating cost, incorporating constraints such as equipment degradation costs and power balancing opportunities; wherein, when constructing the stochastic optimization model, establish the overall objective function. The overall modeling includes the start-up and shutdown of electrolyzers and fuel cells, as well as the degradation costs caused by power fluctuations. and electricity costs Electricity purchase and sale costs and security costs ;

[0014] S32: Opportunity Constraint Transformation: Through a risk adaptive mechanism and quantile mapping, the power balance opportunity constraint is transformed into a deterministic linear inequality constraint; wherein, the calculation varies with the prediction step size. t Dynamically increasing allowed violation probability By utilizing the mapping relationship of the inverse cumulative probability distribution function of KDE, the power balance probability constraint is transformed into a deterministic linear inequality constraint limited by quantiles.

[0015] S4: Execution and Feedback Phase: The transformed deterministic optimization model is solved in a rolling manner, and the first optimal control command obtained from the solution is sent to the controllers of each unit of the hydrogen microgrid for execution. At the same time, based on the real-time operating status feedback of the system, the process returns to step S2 for closed-loop rolling optimization.

[0016] Furthermore, in S1, the preprocessing includes: removing outliers using a threshold determination method, completing missing data using a linear interpolation method, and eliminating magnitude differences between data of different dimensions using a normalization algorithm.

[0017] Furthermore, in S1, the time-series meteorological data includes irradiance and ambient temperature; the unit power status includes solar panel output power, load power, DC bus voltage, battery energy storage, and hydrogen energy system power.

[0018] Furthermore, in S2, a nonparametric probability density model is established using the kernel density estimation (KDE) method. Specifically, the probability density function of the prediction error is calculated using the following formula:

[0019] The point prediction sequence for the future prediction step size is obtained based on the trained Long Short-Term Memory (LSTM) network. Simultaneously, historical residual samples were collected, and a nonparametric probability density model was established using the kernel density estimation (KDE) method.

[0020]

[0021] in, Indicates prediction error The probability density estimation function; The total number of samples representing historical prediction errors; This represents bandwidth, a parameter used to control the smoothness of the probability density curve; Represented as a Gaussian kernel function; Indicates the first One historical prediction error observation sample value;

[0022] By segmenting and statistically analyzing the 24-hour error samples, we can obtain the non-stationary probability distribution characteristics that reflect the differences in prediction error fluctuations at different time periods.

[0023] Furthermore, in S31, the overall objective function is modeled holistically. The expression is as follows:

[0024] ;

[0025] The decline cost For electrolyzers and fuel cells, voltage losses caused by operating time, start-stop switching frequency, and power fluctuations are modeled holistically; for batteries and hydrogen storage systems, losses are quantified based on charge-discharge cycles and the number of hydrogen charge-discharge cycles; the electricity cost is also considered. The cost of renewable energy generation consumed in all pathways to meet load demand, including direct supply, battery storage, and hydrogen storage conversion; the electricity purchase and sale cost. This refers to calculating the direct economic losses or gains arising from the purchase and sale of electricity between the microgrid and the main grid based on time-of-use pricing; security costs. This refers to the safety cost of violating system state constraints.

[0026] Furthermore, in S32, the risk adaptive mechanism dynamically adjusts the allowed violation probability by the standard deviation of the prediction error distribution. The formula is as follows:

[0027] ;

[0028] in, α min and α max The minimum and maximum violation probabilities are preset. σ max The maximum value of the standard deviation. It is the standard deviation of the prediction error distribution, which is calculated from the prediction error distribution obtained by KDE.

[0029] Furthermore, S32 further includes the use of variables. Assign confidence levels to the probability intervals corresponding to the high and low quantiles. q L , q U The calculation formula is:

[0030] ;

[0031] in, The value of depends on the skewness of the prediction error distribution.

[0032] Furthermore, in S32, the probability constraint of power balance is transformed into a mapping relationship based on the inverse cumulative probability distribution function of KDE, thereby utilizing the high and low quantiles. and By imposing deterministic linear inequality constraints, chance constraints are transformed into deterministic constraints.

[0033] Furthermore, in S32, the specific operation of transforming chance constraints into deterministic constraints is as follows: using the inverse cumulative probability distribution function of the KDE probability density model. The probabilistic constraint of power balance is transformed into a deterministic linear inequality constraint:

[0034] .

[0035] This invention also provides a system for implementing an optimized scheduling method for hydrogen microgrids with short-term forecast uncertainty, comprising:

[0036] The data acquisition and preprocessing module is used to perform data cleaning, completion, and normalization.

[0037] The prediction and uncertainty quantification analysis module is used to generate power point prediction sequences using LSTM models and to construct a prediction error probability density model based on the KDE method.

[0038] The constraint reconstruction and transformation module is used to dynamically determine the allowed violation probability based on the prediction step size, and to transform the power balance opportunity constraint into a deterministic equivalent constraint using the quantile of the probability density model.

[0039] The integrated objective scheduling solution module is used to construct and solve the overall objective function that includes decay cost, electricity consumption cost, electricity purchase and sale cost and safety cost, and output the optimal control command sequence.

[0040] The instruction execution and feedback module is used to perform rolling optimized scheduling and receive system status feedback.

[0041] Compared with the prior art, the present invention has the following advantages:

[0042] (1) Improved accuracy of uncertainty quantification: By adopting a method that combines long short-term memory network (LSTM) with nonparametric kernel density estimation (KDE), the traditional method is freed from the assumption that the prediction error follows a normal distribution. This method can more accurately characterize the "non-Gaussian nature" of the prediction error, thereby improving the scheduling robustness of microgrids in uncertain environments (such as wind and solar power output fluctuations).

[0043] (2) Ensured the economical operation of the system: By innovatively introducing a refined component degradation model that takes into account the number of start-stop cycles and the power fluctuation amplitude into the objective function, the operational losses of core hydrogen energy components such as electrolyzers and fuel cells are effectively quantified and reduced, thereby achieving economical optimized scheduling that takes into account both the long-term lifespan of the equipment and the short-term operating costs.

[0044] (3) Significantly reduces the computational complexity of stochastic optimization: Compared with traditional stochastic optimization methods that require generating a large number of scene samples, this invention utilizes quantile mapping technology based on the KDE probability model to directly transform "chance constraints" containing random variables (prediction errors) into deterministic linear inequality constraints. This method achieves effective coverage of prediction uncertainty without significantly increasing the computational burden of model solving, making the proposed method more suitable for online rolling optimization applications. Attached Figure Description

[0045] Figure 1 This is a schematic diagram of the physical topology of a hydrogen microgrid system.

[0046] Figure 2 Flowchart of an optimized scheduling method that incorporates short-term forecasting uncertainty;

[0047] Figure 3 This is a comparison chart of the prediction error probability density based on kernel density estimation and Gaussian distribution fitting in Example 3;

[0048] Figure 4This is a schematic diagram showing the comparison of the electrolytic cell operating power under the two scheduling methods in Example 3;

[0049] Figure 5 This is a schematic diagram showing the comparison of fuel cell operating power under the two scheduling methods in Example 3.

[0050] Reference numerals: 101-Solar panel; 102-First DC / DC converter; 103-Load; 104-DC / AC converter; 105-Main power grid; 106-Bidirectional DC / AC converter; 107-Energy storage battery; 108-Bidirectional DC / DC converter; 109-Electrolyzer; 110-Second DC / DC converter; 111-Hydrogen storage tank; 112-Fuel cell; 113-Third DC / DC converter; 114-DC bus. Detailed Implementation

[0051] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. Component models, material names, connection structures, control methods, algorithms, and other features not explicitly described in this technical solution are considered common technical features disclosed in the prior art.

[0052] Example 1

[0053] This embodiment provides a method for optimizing the scheduling of hydrogen microgrids with short-term forecast uncertainty, such as... Figure 1 , 2 As shown, it includes the following steps:

[0054] S1: Data Acquisition and Preprocessing Stage: Real-time acquisition of time-series meteorological data and power status of each unit in the microgrid; cleaning, denoising and normalization preprocessing of the acquired data;

[0055] S2: Prediction and Uncertainty Quantification Stage: Obtain the power point prediction sequence in the future prediction time domain based on the trained Long Short-Term Memory (LSTM) network model; collect historical residual samples, and establish a non-parametric probability density model using the kernel density estimation (KDE) method to obtain the error probability distribution of the power point prediction;

[0056] S3: Optimization Decision-Making Phase

[0057] S31: Construct a stochastic optimization model with the objective of minimizing the total system operating cost, incorporating constraints such as equipment degradation costs and power balancing opportunities; wherein, when constructing the stochastic optimization model, establish the overall objective function. The overall modeling includes the start-up and shutdown of electrolyzers and fuel cells, as well as the degradation costs caused by power fluctuations. and electricity costs Electricity purchase and sale costs and security costs ;

[0058] S32: Opportunity Constraint Transformation: Through a risk adaptive mechanism and quantile mapping, the power balance opportunity constraint is transformed into a deterministic linear inequality constraint; wherein, the calculation varies with the prediction step size. t Dynamically increasing allowed violation probability By utilizing the mapping relationship of the inverse cumulative probability distribution function of KDE, the power balance probability constraint is transformed into a deterministic linear inequality constraint limited by quantiles.

[0059] S4: Execution and Feedback Phase: The transformed deterministic optimization model is solved in a rolling manner, and the first optimal control command obtained from the solution is sent to the controllers of each unit of the hydrogen microgrid for execution. At the same time, based on the real-time operating status feedback of the system, the process returns to step S2 for closed-loop rolling optimization.

[0060] Example 2

[0061] This embodiment provides a method for optimizing the scheduling of hydrogen microgrids with short-term forecast uncertainty, such as... Figure 1 , 2 As shown, it includes the following steps:

[0062] S1: Data Acquisition and Preprocessing Stage: Real-time acquisition of time-series meteorological data and power status of each unit in the microgrid; cleaning, denoising and normalization preprocessing of the acquired data;

[0063] In a specific implementation, the time-series meteorological data includes irradiance and ambient temperature; the unit power status includes solar panel output power, load power, DC bus voltage, battery energy storage, and hydrogen energy system power. Using sensors for light intensity, temperature, current, and voltage deployed at the microgrid site, irradiance, ambient temperature, solar panel output power, and load power data are collected in real time every 15 minutes.

[0064] The preprocessing includes: removing outliers using a threshold method, completing missing data using linear interpolation, and eliminating magnitude differences between data of different dimensions using a normalization algorithm.

[0065] S2: Prediction and Uncertainty Quantification Stage: Obtain the power point prediction sequence in the future prediction time domain based on the trained Long Short-Term Memory (LSTM) network model; collect historical residual samples, and establish a non-parametric probability density model using the kernel density estimation (KDE) method to obtain the error probability distribution of the power point prediction;

[0066] In a specific implementation, a nonparametric probability density model is established using the kernel density estimation (KDE) method, and the probability density function of the prediction error is calculated using the following formula:

[0067] The point prediction sequence for the future prediction step size is obtained based on the trained Long Short-Term Memory (LSTM) network. Simultaneously, historical residual samples were collected, and a nonparametric probability density model was established using the kernel density estimation (KDE) method.

[0068]

[0069] in, Indicates prediction error The probability density estimation function; The total number of samples representing historical prediction errors; This represents bandwidth, a parameter used to control the smoothness of the probability density curve; Represented as a Gaussian kernel function; Indicates the first One historical prediction error observation sample value;

[0070] By segmenting and statistically analyzing the 24-hour error samples, we can obtain the non-stationary probability distribution characteristics that reflect the differences in prediction error fluctuations at different time periods.

[0071] S3: Optimization Decision-Making Phase

[0072] S31: Construct a stochastic optimization model with the objective of minimizing the total system operating cost, incorporating constraints such as equipment degradation costs and power balancing opportunities; wherein, when constructing the stochastic optimization model, establish the overall objective function. The overall modeling includes the start-up and shutdown of electrolyzers and fuel cells, as well as the degradation costs caused by power fluctuations. and electricity costs Electricity purchase and sale costs and security costs ;

[0073] In a specific implementation, the overall objective function is modeled holistically. The expression is as follows:

[0074] ;

[0075] The decline cost For electrolyzers and fuel cells, voltage losses caused by operating time, start-stop switching frequency, and power fluctuations are modeled holistically; for batteries and hydrogen storage systems, losses are quantified based on charge-discharge cycles and the number of hydrogen charge-discharge cycles; the electricity cost is also considered. The cost of renewable energy generation consumed in all pathways to meet load demand, including direct supply, battery storage, and hydrogen storage conversion; the electricity purchase and sale cost. This refers to calculating the direct economic losses or gains arising from the purchase and sale of electricity between the microgrid and the main grid based on time-of-use pricing; security costs. This refers to the safety cost of violating system state constraints.

[0076] S32: Opportunity Constraint Transformation: Through a risk adaptive mechanism and quantile mapping, the power balance opportunity constraint is transformed into a deterministic linear inequality constraint; wherein, the calculation varies with the prediction step size. t Dynamically increasing allowed violation probability By utilizing the mapping relationship of the inverse cumulative probability distribution function of KDE, the power balance probability constraint is transformed into a deterministic linear inequality constraint limited by quantiles.

[0077] In a specific implementation, the risk adaptive mechanism dynamically adjusts the allowed violation probability by the standard deviation of the prediction error distribution. The formula is as follows:

[0078] ;

[0079] in, α min and α max The minimum and maximum violation probabilities are preset. σ max The maximum value of the standard deviation. It is the standard deviation of the prediction error distribution, which is calculated from the prediction error distribution obtained by KDE.

[0080] Further includes utilizing variables Assign confidence levels to the probability intervals corresponding to the high and low quantiles. q L , q U The calculation formula is:

[0081] ;

[0082] in, The value of depends on the skewness of the prediction error distribution.

[0083] By utilizing the inverse cumulative probability distribution function mapping relationship of KDE, the probabilistic constraint of power balance is transformed into a relationship based on high and low quantiles. and By imposing deterministic linear inequality constraints, chance constraints are transformed into deterministic constraints.

[0084] The specific operation to transform opportunity constraints into deterministic constraints is as follows: using the inverse cumulative probability distribution function of the KDE probability density model. The probabilistic constraint of power balance is transformed into a deterministic linear inequality constraint:

[0085] .

[0086] S4: Execution and Feedback Phase: The transformed deterministic optimization model is solved in a rolling manner, and the first optimal control command obtained from the solution is sent to the controllers of each unit of the hydrogen microgrid for execution. At the same time, based on the real-time operating status feedback of the system, the process returns to step S2 for closed-loop rolling optimization.

[0087] Example 3

[0088] This embodiment provides a system for implementing an optimized scheduling method for hydrogen microgrids with short-term predictive uncertainty, such as... Figure 1 , 2 As shown, it includes:

[0089] The data acquisition and preprocessing module is used to perform data cleaning, completion, and normalization.

[0090] The prediction and uncertainty quantification analysis module is used to generate power point prediction sequences using LSTM models and to construct a prediction error probability density model based on the KDE method.

[0091] The constraint reconstruction and transformation module is used to dynamically determine the allowed violation probability based on the prediction step size, and to transform the power balance opportunity constraint into a deterministic equivalent constraint using the quantile of the probability density model.

[0092] The integrated objective scheduling solution module is used to construct and solve the overall objective function that includes decay cost, electricity consumption cost, electricity purchase and sale cost and safety cost, and output the optimal control command sequence.

[0093] The instruction execution and feedback module is used to perform rolling optimized scheduling and receive system status feedback.

[0094] The system is integrated into the energy management system (EMS) of the hydrogen microgrid, which includes a solar panel 101, an energy storage battery 107, an electrolyzer 109, a hydrogen storage tank 111, a fuel cell 112, a load 103, and a converter connected to the main grid 105. Each unit is connected via a DC bus or an AC bus.

[0095] The electrical energy generated by the solar panel 101 is connected to the DC bus 114 via the first DC / DC converter 102. The electrical energy on the DC bus 114 is converted by the DC / AC converter 104 to provide power to the load 103. The main power grid 105 achieves bidirectional electrical energy exchange with the DC bus 114 through the bidirectional DC / AC converter 106. The energy storage battery 107 achieves charging and discharging operation through the bidirectional DC / DC converter 108. The hydrogen energy storage system includes an electrolyzer 109, a hydrogen storage tank 111, and a fuel cell 112, wherein the electrolyzer 109 and the fuel cell 112 are connected to the DC bus 114 through the second DC / DC converter 110 and the third DC / DC converter 113, respectively. Under the influence of power fluctuations in the output power of solar panel 101 and power disturbances in load 103, the Energy Management System (EMS) adjusts the operating power of the bidirectional DC / DC converter 108, the second DC / DC converter 110 on the electrolyzer side, and the third DC / DC converter 113 on the fuel cell side to achieve power balance of the DC bus 114 and optimize the overall economic efficiency of the system while meeting system operating constraints. Under continuous extreme weather conditions or high load conditions, when the local energy storage system alone cannot maintain system power balance, the EMS controls the bidirectional DC / AC converter 106 to achieve power interaction between the main grid 105 and the DC bus 114 to ensure the safe and stable operation of the hydrogen microgrid system.

[0096] This embodiment also provides a method for optimizing the scheduling of hydrogen microgrids with short-term prediction uncertainties:

[0097] S1: Data Acquisition and Preprocessing

[0098] In this embodiment, the system first utilizes a light intensity sensor, an ambient temperature sensor, a current measurement unit on the solar panel 101 and load 103 side, and a DC bus voltage sensor deployed at the hydrogen microgrid site to... To acquire multi-dimensional time-series data such as irradiance, temperature, output power, and load power in real time during the sampling period, a data preprocessing stage is then implemented. Threshold judgment is used to monitor the raw data and remove fault points exceeding physical safety limits or exhibiting abnormal rates of change. For missing data, linear interpolation is used to reconstruct the time series to ensure its integrity. Finally, [the process is described in the original text]. The standardization algorithm will standardize the input features of different dimensions. Mapped to The interval is calculated using the following formula: By eliminating the magnitude difference between data such as irradiance and voltage, the training convergence speed of the subsequent LSTM prediction model is accelerated and the gradient anomaly problem is avoided, providing standardized feature input for the prediction module.

[0099] Detailed Step S2: Power Prediction and Prediction Error Probability Distribution Modeling Based on LSTM

[0100] In this embodiment, the system uses a trained LSTM neural network to achieve rolling prediction of solar power generation and load power, and quantifies the prediction uncertainty.

[0101] S21: Training the LSTM model and obtaining the prediction error probability distribution parameters

[0102] LSTM model training: A sample set was constructed using historical monitoring data spanning two years (including irradiance, temperature, historical power, and load data). A sliding window technique was used to extract features, based on past data... Using data from a specific moment as input, predict the future. The power at each time step was calculated. After normalization, the dataset was divided into training, validation, and test sets in a 7:1:2 ratio. A sliding window technique was used to divide the input and output sets, and the LSTM neural network was iteratively trained with appropriate hyperparameters such as hidden layer depth, number of neurons, and learning rate, until the model's mean absolute percentage error on the validation set converged to a preset threshold, thus obtaining a trained LSTM prediction model.

[0103] Nonparametric modeling of prediction error: By comparing actual measurements in the system's historical database. Simultaneous predictions with LSTM model The historical residual sample set was calculated. To avoid the fitting bias caused by the traditional normal distribution assumption, the nonparametric kernel density estimation KDE algorithm is used for the sample set. A fitting is performed. The probability density function estimate is as follows:

[0104]

[0105] in, Indicates bandwidth, take , This represents the standard deviation of the prediction error. Represented as a Gaussian kernel function, taking Through the above calculations, a kernel density benchmark function that can accurately characterize prediction uncertainty is obtained.

[0106] Depend on Figure 3 As can be seen from the comparison, compared with the traditional Gaussian distribution fitting method, the probability density description method based on kernel density estimation (KDE) in this embodiment can more accurately capture the asymmetry and extreme fluctuation characteristics in the prediction error distribution. Through observation... Figure 3As can be seen from the curve trend, the probability density curve generated by the KDE method can closely fit the actual error sample, significantly improving the ability to describe the "skewness" and "fat tail" characteristics in the error distribution, effectively avoiding the fitting bias of traditional methods when dealing with non-normally distributed data, thus providing a more realistic fluctuation range for subsequent scheduling decisions.

[0107] S22: Online Real-Time Prediction and Error Description - Real-Time Power Prediction

[0108] The trained LSTM model is used to generate a sequence of power point predictions in the future prediction time domain. Simultaneously, the offline-built KDE probabilistic model is invoked to obtain the real-time probability density description of the error at each prediction time. This provides quantitative statistical support for the chance constraint transformation of the stochastic model predictive control (SMPC) in step S3, realizing the mapping from "probability distribution" to "power boundary constraint".

[0109] S3: Construct and solve the chance-constrained stochastic model predictive control problem.

[0110] S31: Optimization Objective Establishment: The economic operating cost mainly consists of four parts: energy storage component degradation cost, electricity consumption cost, electricity purchase and sale cost, and safety penalty cost, as expressed below:

[0111]

[0112] (1) The cost of recession

[0113] Recession Cost The cost consists of four parts: an electrolyzer 109 (ELZ), a fuel cell 112 (FC), a metal powder hydrogen storage tank 111 (MH), and an energy storage battery 107 (BAT).

[0114]

[0115] For electrolyzer 109 and fuel cell 112, the modeling focuses on operating time, start-stop frequency, and equivalent economic losses caused by power fluctuations:

[0116]

[0117] in, Every recession 1 The resulting recession cost, This indicates voltage degradation caused by operating time. This indicates the voltage drop caused by the number of start-stop cycles. This indicates voltage degradation caused by power fluctuations.

[0118] For the energy storage battery 107 and the hydrogen storage tank 111, the loss is quantified based on the number of charge-discharge cycles and converted into the cost per unit of energy exchange:

[0119]

[0120] in, This indicates the lifespan degradation of metal powder caused by charging and discharging 1 kWh of energy. It represents the energy that is charged or released within a certain period of time.

[0121] (2) Cost of electricity

[0122] In the operation of the hydrogen microgrid, the electricity generated by solar panel 101 mainly meets the load demand through three paths: direct supply, battery energy storage, and hydrogen energy storage conversion. To accurately assess the economics of system operation, the comprehensive electricity cost of load 103 can be defined as the cost of solar power generation under these three paths, as shown below:

[0123]

[0124] in That's the cost of 101 units of electricity generated by a solar panel. The electricity generated by the solar panel 101 is directly supplied to the load 103. Energy is supplied to the load through the energy storage battery 107. Energy is supplied to load 103 through hydrogen energy storage.

[0125] (3) Main grid power purchase and sale price

[0126] In the event of persistent extreme weather conditions or extreme loads, the hydrogen microgrid system may be unable to maintain operation on its own. It can purchase or sell electricity from the main grid 105 to maintain the safe operation of the system. The costs of purchasing or selling electricity from the main grid 105 are as follows:

[0127]

[0128] in This represents the cost of purchasing electricity from the main power grid (105). This represents the revenue obtained from selling electricity to the main grid 105. and These represent the prices for purchasing one kilowatt-hour of electricity from the main grid or selling one kilowatt-hour of electricity to the main grid, respectively.

[0129] (4) Security costs

[0130] To ensure the safety and feasibility of system operation, this embodiment introduces slack variables and penalty terms for SOC and LOH state constraints into the scheduling model. It aims to compensate for potential risks of exceeding limits during operation and to ensure the continuity of scheduling instructions and the safety of system operation under complex working conditions.

[0131]

[0132] in This represents the penalty for exceeding the system's State of Charge (SOC) constraints. This represents the penalty cost for exceeding the system's energy storage state (LOH).

[0133] S32 Opportunity Constraint Transformation: Construct a power balance opportunity constraint with random variables and introduce a risk adaptive mechanism to calculate the probability of loss as the prediction step size increases. Dynamically increasing allowed violation probability .

[0134]

[0135] This opportunity constraint means The probability is greater than Since the uncertainty of the prediction error increases with the increase of the prediction step size, the violation probability can be set as follows:

[0136]

[0137] in This is the standard deviation of the prediction error distribution, which can be obtained from the KDE distribution function. Using variables... Assign confidence levels to the probability intervals corresponding to the high and low quantiles. q L , q U ].

[0138]

[0139] in The skewness of the prediction error distribution depends on the KDE, which can be obtained using the inverse cumulative probability distribution function of the KDE. The mapping relationship transforms the probabilistic constraint of power balance into a relationship based on high and low quantiles. and By imposing deterministic linear inequality constraints, chance constraints are transformed into deterministic constraints.

[0140]

[0141] The final chance constraint can be transformed into the following deterministic constraint

[0142]

[0143] Combination Figure 4 and Figure 5A comparison of the scheduling results shows that the stochastic optimization scheduling method considering prediction uncertainty proposed in this embodiment has significant technical advantages compared with the deterministic scheduling method that does not consider uncertainty: First, in terms of equipment operating characteristics, the start-up and shutdown frequencies of the electrolyzer 109 and fuel cell 112 are significantly reduced, and the power fluctuation trend is smoother, effectively avoiding equipment losses caused by frequent adjustments. Second, in terms of economy, since the stochastic optimization method pre-incorporates the probability distribution characteristics of power fluctuations, the scheduling instructions are more robust to actual fluctuations, thereby significantly reducing the overall operating cost of the system.

[0144] Components not described in detail in this embodiment are all existing components that can be purchased through public channels.

[0145] The above description of the embodiments is provided to enable those skilled in the art to understand and use the invention. It will be apparent to those skilled in the art that various modifications can be made to these embodiments, and the general principles described herein can be applied to other embodiments without inventive effort. Therefore, the present invention is not limited to the above embodiments, and any improvements and modifications made by those skilled in the art based on the disclosure of the present invention without departing from the scope of the invention should be within the protection scope of the present invention.

Claims

1. A method for optimal scheduling of hydrogen microgrids with short-term forecast uncertainty, characterized in that, Includes the following steps: S1: Data acquisition and preprocessing stage: Real-time acquisition of time-series meteorological data and power status of each unit in the microgrid site; The collected data is preprocessed by cleaning, denoising, and normalization. S2: Prediction and Uncertainty Quantification Stage: Obtain the power point prediction sequence in the future prediction time domain based on the trained Long Short-Term Memory (LSTM) network model; collect historical residual samples and use the kernel density estimation (KDE) method to establish a nonparametric probability density model to obtain the error probability distribution of power point prediction; S3: Optimization Decision-Making Phase S31: Construct a stochastic optimization model with the objective of minimizing the total system operating cost, incorporating constraints such as equipment degradation costs and power balancing opportunities; wherein, when constructing the stochastic optimization model, establish the overall objective function. The overall modeling includes the start-up and shutdown of electrolyzers and fuel cells, as well as the degradation costs caused by power fluctuations. and electricity costs Electricity purchase and sale costs and security costs ; S32: Opportunity Constraint Transformation: Through a risk adaptive mechanism and quantile mapping, the power balance opportunity constraint is transformed into a deterministic linear inequality constraint; wherein, the calculation varies with the prediction step size. t Dynamically increasing allowed violation probability By utilizing the mapping relationship of the inverse cumulative probability distribution function of KDE, the power balance probability constraint is transformed into a deterministic linear inequality constraint limited by quantiles. S4: Execution and Feedback Phase: The transformed deterministic optimization model is solved in a rolling manner, and the first optimal control command obtained from the solution is sent to the controllers of each unit of the hydrogen microgrid for execution. At the same time, based on the real-time operating status feedback of the system, the process returns to step S2 for closed-loop rolling optimization.

2. The method for optimizing the scheduling of hydrogen microgrids with short-term prediction uncertainty according to claim 1, characterized in that, In S1, the preprocessing includes: removing outliers by threshold determination, completing missing data by linear interpolation, and eliminating magnitude differences between data of different dimensions using a normalization algorithm.

3. The method for optimizing the scheduling of hydrogen microgrids with short-term prediction uncertainty according to claim 1, characterized in that, In S1, the time-series meteorological data includes irradiance and ambient temperature; the unit power status includes solar panel output power, load power, DC bus voltage, battery energy storage and hydrogen energy system power.

4. The method for optimizing the scheduling of hydrogen microgrids with short-term predictive uncertainty according to claim 1, characterized in that, In S2, a nonparametric probability density model is established using the kernel density estimation (KDE) method. Specifically, the probability density function of the prediction error is calculated using the following formula: The point prediction sequence for the future prediction step size is obtained based on the trained Long Short-Term Memory (LSTM) network. Simultaneously, historical residual samples were collected, and a nonparametric probability density model was established using the kernel density estimation (KDE) method. in, Indicates prediction error The probability density estimation function; The total number of samples representing historical prediction errors; This represents bandwidth, a parameter used to control the smoothness of the probability density curve; Represented as a Gaussian kernel function; Indicates the first One historical prediction error observation sample value; By segmenting and statistically analyzing the 24-hour error samples, we can obtain the non-stationary probability distribution characteristics that reflect the differences in prediction error fluctuations at different time periods.

5. The method for optimal scheduling of hydrogen microgrids with short-term prediction uncertainty according to claim 1, characterized in that, In S31, the overall objective function is modeled holistically. The expression is as follows: ; The decline cost For electrolyzers and fuel cells, voltage losses caused by operating time, start-stop switching frequency, and power fluctuations are modeled holistically; for batteries and hydrogen storage systems, losses are quantified based on charge-discharge cycles and the number of hydrogen charge-discharge cycles; the electricity cost is also considered. The cost of renewable energy generation consumed in all pathways to meet load demand, including direct supply, battery storage, and hydrogen storage conversion; the electricity purchase and sale cost. This refers to calculating the direct economic losses or gains arising from the purchase and sale of electricity between the microgrid and the main grid based on time-of-use pricing; security costs. This refers to the safety cost of violating system state constraints.

6. The method for optimal scheduling of hydrogen microgrids with short-term prediction uncertainty according to claim 1, characterized in that, In S32, the risk adaptive mechanism dynamically adjusts the probability of violation by the standard deviation of the prediction error distribution. The formula is as follows: ; in, α min and α max The minimum and maximum violation probabilities are preset. σ max The maximum value of the standard deviation. It is the standard deviation of the prediction error distribution, which is calculated from the prediction error distribution obtained by KDE.

7. The method for optimal scheduling of hydrogen microgrids with short-term prediction uncertainty according to claim 6, characterized in that, S32 further includes the use of variables Assign confidence levels to the probability intervals corresponding to the high and low quantiles. q L , q U ]; The calculation formula is: ; in, The value of depends on the skewness of the prediction error distribution.

8. The method for optimal scheduling of hydrogen microgrids with short-term predictive uncertainty according to claim 7, characterized in that, In S32, the probability constraint of power balance is transformed into a mapping relationship based on the inverse cumulative probability distribution function of KDE. and By imposing deterministic linear inequality constraints, chance constraints are transformed into deterministic constraints.

9. A method for optimizing the scheduling of hydrogen microgrids with short-term predictive uncertainty according to claim 8, characterized in that, In S32, the specific operation to transform chance constraints into deterministic constraints is as follows: using the inverse cumulative probability distribution function of the KDE probability density model. The probabilistic constraint of power balance is transformed into a deterministic linear inequality constraint: 。 10. A system for implementing the optimized scheduling method for hydrogen microgrids with short-term prediction uncertainty as described in any one of claims 1-9, characterized in that, include: The data acquisition and preprocessing module is used to perform data cleaning, completion, and normalization. The prediction and uncertainty quantification analysis module is used to generate power point prediction sequences using LSTM models and to construct a prediction error probability density model based on the KDE method. The constraint reconstruction and transformation module is used to dynamically determine the allowed violation probability based on the prediction step size, and to transform the power balance opportunity constraint into a deterministic equivalent constraint using the quantile of the probability density model. The integrated objective scheduling solution module is used to construct and solve the overall objective function that includes decay cost, electricity consumption cost, electricity purchase and sale cost and safety cost, and output the optimal control command sequence. The instruction execution and feedback module is used to perform rolling optimized scheduling and receive system status feedback.