Carbon flow probabilistic forecasting and uncertainty quantification method for wind-solar-hydrogen storage microgrid

By employing a carbon flow quantile regression neural network and adversarial training in a wind-solar-hydrogen-storage microgrid, the problem of insufficient robustness of existing carbon flow prediction methods under extreme conditions is solved, carbon flow probability prediction and uncertainty quantification are realized, and the low-carbon scheduling capability of the microgrid energy management system is improved.

CN122154998APending Publication Date: 2026-06-05JIANGSU ANENGJIA ENERGY TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
JIANGSU ANENGJIA ENERGY TECHNOLOGY CO LTD
Filing Date
2026-02-03
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing carbon flow prediction methods cannot effectively quantify the uncertainty risks brought about by the fluctuation of multi-source data in wind, solar, hydrogen, and storage microgrids. Furthermore, the models lack robustness under extreme operating conditions, resulting in a lack of clear confidence intervals for carbon flow results, which makes it difficult to meet the needs of low-carbon dispatch.

Method used

A carbon flow quantile regression neural network model combined with an adversarial perturbation training mechanism is adopted. By constructing an input feature vector, introducing a quantile loss function and adversarial perturbation, the conditional distribution of the carbon flow target variable under different probability levels is fitted, and the carbon flow probability prediction interval is output.

Benefits of technology

It enables the quantification of point prediction values ​​and probability intervals for carbon flow, improves the robustness of the model under wind and solar resource fluctuations and extreme operating conditions, provides clear risk perception basis, and supports microgrid energy management systems for optimized scheduling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122154998A_ABST
    Figure CN122154998A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of energy internet and intelligent microgrid, and discloses a carbon flow probability prediction and uncertainty quantification method for wind-solar-hydrogen storage microgrid, which first acquires microgrid multi-source operation data and constructs an input feature vector; a carbon flow quantile regression neural network model is established, and a quantile loss function is used to fit the conditional distribution of carbon flow; an adversarial perturbation mechanism is introduced in the training stage, and adversarial samples are generated along the gradient rising direction of the loss function to construct a mixed total loss function to update the parameters and promote the model to learn the response boundary of the input data under the adversarial perturbation; finally, the trained model is used to output high and low quantile point prediction values, a carbon flow probability prediction interval is constructed, and the interval is transmitted to the microgrid energy management system. Through the combination of quantile regression and adversarial training, the present application realizes the explicit quantification of carbon flow uncertainty, improves the robustness of the prediction model under extreme working conditions, and provides a reliable basis for low-carbon risk decision-making of the microgrid.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of energy internet and smart microgrid technology, specifically to a method for carbon flow probability prediction and uncertainty quantification for wind-solar-hydrogen-storage microgrids. Background Technology

[0002] Currently, the global dual-carbon strategy is being implemented at an accelerated pace, and wind-solar-hydrogen-storage microgrids have become a key vehicle for achieving high-proportion renewable energy consumption and deep decarbonization. The operational optimization of such microgrid systems is highly dependent on the accuracy and timeliness of carbon emission information. The reliability of carbon flow data directly determines whether the microgrid can effectively achieve its established low-carbon management goals while maintaining real-time power balance.

[0003] To address these needs, existing carbon flow prediction applications are mostly based on deterministic modeling approaches. The typical approach involves collecting historical operational data and constructing a regression model using conventional machine learning algorithms. The model uses source-side power generation, load-side demand response, and external grid conditions as input features, and after training, establishes a mapping relationship between input and output. In practical applications, the system directly outputs a single numerical prediction of carbon flow for a specific scheduling time, or calculates real-time carbon flow based on a fixed carbon emission factor.

[0004] However, the aforementioned deterministic point prediction methods have limitations when facing complex and ever-changing microgrid environments. Providing only a single predicted value fails to reflect potential biases caused by random fluctuations in wind and solar resources and sudden load changes, resulting in a lack of clear confidence intervals for carbon flow results. Existing models generally do not undergo adversarial training for minor perturbations or extreme changes in input data, making it difficult to learn the system's response boundaries under adverse operating conditions. When tail-risk events such as sudden drops in wind and solar output or jumps in grid carbon intensity occur, the model's robustness is poor, and prediction accuracy often declines. Furthermore, due to the lack of quantitative assessment of the uncertainty of prediction results, upper-level energy management systems cannot accurately perceive carbon cost risks, making it difficult to meet the practical needs of traceable carbon footprints throughout the entire lifecycle of green hydrogen and high-confidence low-carbon dispatch.

[0005] Therefore, this invention provides a method for predicting carbon flow probability and quantifying uncertainty for wind-solar-hydrogen-storage microgrids to address the shortcomings of existing technologies. Summary of the Invention

[0006] To address the shortcomings of existing technologies, this invention provides a method for carbon flow probability prediction and uncertainty quantification for wind, solar, hydrogen, and energy storage microgrids. This method solves the problems of existing microgrid carbon flow prediction methods, which can only provide deterministic point values, cannot quantify the uncertainty risks caused by fluctuations in multi-source data, and have insufficient model robustness under extreme operating conditions.

[0007] To achieve the above objectives, the present invention provides a method for carbon flow probability prediction and uncertainty quantification for wind-solar-hydrogen-storage microgrids, comprising the following steps:

[0008] The system acquires multi-source operation data of the wind-solar-hydrogen-storage microgrid system at various time periods within the scheduling cycle, performs time series alignment and normalization processing on the multi-source operation data, and establishes an input feature vector characterizing the real-time operation status and external boundary conditions of the microgrid.

[0009] A carbon flow quantile regression neural network model is constructed. The carbon flow quantile regression neural network model is configured to receive the input feature vector, apply an asymmetric penalty weight to the prediction residual using the quantile loss function, fit the conditional distribution of the carbon flow target variable under different probability levels, and output the predicted value of the carbon flow target variable under a preset quantile set.

[0010] An adversarial perturbation mechanism is introduced during the training phase of the carbon flow quantile regression neural network model. The gradient information of the total loss function of quantile regression with respect to the input feature vector is determined. An adversarial perturbation vector is constructed based on the gradient information and superimposed on the input feature vector to generate adversarial examples. A hybrid total loss function containing the original sample loss and the adversarial sample loss is constructed. The model parameters are updated based on the principle of minimizing the hybrid total loss function, so that the model learns the response boundary of the input data under adversarial perturbation.

[0011] The trained carbon flow quantile regression neural network model is used to perform forward inference on the input feature vector for the period to be predicted, to obtain the predicted values ​​of low quantiles and high quantiles. The carbon flow probability prediction interval is defined based on the predicted values ​​of low quantiles and high quantiles. The carbon flow probability prediction interval is used to quantify the fluctuation range of carbon flow at a given confidence level, and the carbon flow probability prediction interval is transmitted to the microgrid energy management system.

[0012] By adopting the above technical solution, since the conditional probability distribution of carbon flow is directly fitted by a quantile regression neural network and targeted perturbations are introduced on the input side by combining an adversarial training mechanism, this invention can not only provide point prediction values ​​of carbon flow, but also quantify the randomness of wind and solar resources and the uncertainty brought about by load fluctuations through probability intervals. The introduction of an adversarial perturbation mechanism can simulate the worst input data fluctuation situation, forcing the model to explore the response boundary of input features during training, thereby improving the robustness of the model in the face of data noise or sudden disturbances in actual operation, and solving the problem that traditional deterministic prediction methods cannot effectively assess the risk of carbon flow fluctuations.

[0013] Preferably, the multi-source operation data covers four dimensions: source, load, grid, and storage. Specifically, it includes the predicted wind power and photovoltaic power on the source side, the predicted load power on the load side, the real-time carbon intensity of the grid on the grid side, and the electrochemical energy storage state of charge and the hydrogen mass in the hydrogen storage tank on the energy storage side.

[0014] By adopting the above technical solutions, it is ensured that the model input features can fully cover the key physical quantities that affect carbon flow in microgrids, providing a data foundation for high-precision carbon flow prediction.

[0015] Preferably, the preset quantile set includes low quantiles representing the lower boundary, median quantiles representing the trend, and high quantiles representing the upper boundary; the quantile loss function constrains the model output to approximate the conditional quantiles of the target variable through an asymmetric penalty mechanism. The specific processing logic is as follows: First, the prediction residual is determined based on the difference between the actual carbon flow value and the predicted value of the microgrid; then, the value of the indicator function is determined according to the positive or negative sign attribute of the prediction residual, which takes a specific value when the residual is negative and another specific value when the residual is positive; next, the weight coefficient of the current sample is determined by combining the preset quantile parameters and the value of the indicator function; finally, the loss value is determined based on the weighted relationship between the prediction residual and the weight coefficient.

[0016] By adopting the above technical solution and utilizing the asymmetric characteristics of the quantile loss function, the model can distinguish the different effects of overestimating and underestimating the predicted values, thereby accurately learning the distribution characteristics of carbon flow at different probability levels and achieving effective coverage of the carbon flow fluctuation range.

[0017] Preferably, the process of constructing the adversarial perturbation vector includes: determining the gradient vector of the quantile regression total loss function relative to the input feature vector, which indicates the direction in which the prediction error increases the most; identifying the input change direction that increases the prediction error, and generating the adversarial perturbation vector along the gradient ascent direction. Further, the generation of the adversarial perturbation vector employs L2 norm-based normalization, and the normalized vector is scaled using a preset perturbation radius; the perturbation radius is set based on the statistical characteristics of historical wind and solar power prediction errors or historical load prediction errors, and is set to a value related to the standard deviation of historical prediction errors.

[0018] By adopting the above technical solution, the adversarial examples generated using the gradient ascent direction represent the input situation that is most likely to cause prediction failure under the current model parameters, i.e., the worst case. At the same time, by using the statistical characteristics of historical prediction errors to constrain the perturbation radius, it is ensured that the generated adversarial examples are physically reasonable, avoiding excessive perturbation that makes it difficult for the model to converge. Thus, the trained model not only has mathematical robustness, but also has the ability to adapt to the fluctuations of the actual operating environment of the microgrid.

[0019] Preferably, the hybrid total loss function is constructed as follows: obtain the standard quantile regression loss based on the original input feature vector, obtain the adversarial quantile regression loss based on adversarial examples, and perform a weighted combination of the standard quantile regression loss and the adversarial quantile regression loss to form the hybrid total loss function.

[0020] By adopting the above technical solution, the optimization objective balances the fitting accuracy of the original data and the robustness against adversarial data. By balancing the two losses, the model is prevented from excessively sacrificing prediction accuracy while pursuing robustness, thus achieving a balance between generalization ability and anti-interference ability.

[0021] Preferably, the method for defining the carbon flow probability prediction interval is as follows: 5% of the preset quantiles are selected as low quantiles, and 95% of the quantiles are selected as high quantiles. The predicted values ​​corresponding to the low quantiles output by the model are determined as the lower bound, and the predicted values ​​corresponding to the high quantiles are determined as the upper bound, thereby forming the carbon flow probability prediction interval. The microgrid energy management system uses the carbon flow probability prediction interval to perform risk perception decision-making. The risk perception decision-making includes determining the conditional risk value index, or using the carbon flow probability prediction interval to set a dynamic tolerance band for carbon flow tracking in model predictive control.

[0022] By adopting the above technical solution, the constructed probability interval provides a quantitative risk assessment basis for the microgrid energy management system. The energy management system can set a dynamic tolerance zone based on this interval. When the monitored actual carbon flow fluctuation falls within this tolerance zone, the system determines that the current state is within a controllable range of uncertainty, thereby maintaining the current operating strategy and avoiding mechanical losses and control oscillations caused by frequent adjustments to equipment output. This achieves optimized scheduling that balances low carbon emissions and stability.

[0023] This invention provides a method for carbon flow probability prediction and uncertainty quantification for wind-solar-hydrogen-storage microgrids. It has the following beneficial effects:

[0024] 1. This invention determines the gradient information of the total loss function of quantile regression with respect to the input feature vector during the model training phase and generates an adversarial perturbation vector along the gradient ascent direction, forcing the model to learn the carbon flow response boundary of the input data under the most unfavorable perturbation. This mechanism enables the prediction model to not only adapt to normal wind and solar fluctuations, but also maintain stable prediction performance in tail risk events such as sudden drops in wind and solar power or abrupt changes in grid carbon intensity, effectively solving the problem of traditional prediction models failing under extreme conditions.

[0025] 2. This invention applies an asymmetric penalty weight to the prediction residuals using a quantile loss function, directly fitting the conditional distribution of the carbon flow target variable at different probability levels, and outputting a probability prediction interval including low and high quantiles. This interval can quantify the fluctuation range of carbon flow at a given confidence level, providing a clear basis for risk perception for microgrid energy management systems, and overcoming the technical limitations of existing methods that can only provide a single deterministic value and cannot assess the risk of carbon flow fluctuations.

[0026] 3. This invention decouples the prediction method from specific carbon accounting rules by treating carbon flow as an observable target variable and combining it with multi-source operational data for modeling, thus achieving broad compatibility. This method only requires historical operational data from multiple sources such as sources, loads, grids, and storage as input features, without being bound to a specific carbon accounting mathematical model. Therefore, it can seamlessly integrate with various compliant carbon accounting systems, such as dynamic carbon potential and fixed carbon factors. This versatility allows the invention to be flexibly applied to the carbon management needs of different microgrid scenarios such as industrial parks and data centers, reducing system deployment costs and migration difficulties. Attached Figure Description

[0027] Figure 1 This is a flowchart illustrating the carbon flow probability prediction and uncertainty quantification method for wind-solar-hydrogen-storage microgrids according to an embodiment of the present invention.

[0028] Figure 2 This is a schematic diagram of the carbon flow probability prediction and uncertainty quantification system for wind-solar-hydrogen-storage microgrids according to an embodiment of the present invention. Detailed Implementation

[0029] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0030] See attached document Figure 1 This invention provides a method for carbon flow probability prediction and uncertainty quantification for wind-solar-hydrogen-storage microgrids. This method constructs a prediction framework that integrates a quantile regression neural network and an adversarial perturbation training mechanism, explicitly modeling the propagation path from input uncertainty to carbon flow output. Specifically, it includes the following steps:

[0031] First, a multi-dimensional input feature vector for the microgrid is constructed. For the wind-solar-hydrogen-storage microgrid system, multi-source operational data for each time period within the scheduling cycle are acquired. This data includes predicted wind and solar power on the source side, predicted load power on the load side, real-time carbon intensity of the grid on the grid side, and electrochemical energy storage state of charge and hydrogen mass in the hydrogen storage tank on the energy storage side. These physical quantities are aligned and normalized according to time series to construct an input feature vector characterizing the real-time operating state and external boundary conditions of the microgrid, which serves as the input basis for subsequent prediction models.

[0032] Secondly, a carbon flow quantile regression neural network model is constructed. A deep neural network model is built to receive the input feature vector and output the predicted value of the carbon flow target variable at a preset quantile set. This model uses a quantile loss function as the optimization objective. By applying asymmetric penalty weights to the prediction residuals, the model can fit the conditional distribution of carbon flow at different probability levels, thereby obtaining statistical information about the uncertainty of the prediction results, rather than simply outputting a single conditional mean point estimate.

[0033] Furthermore, an adversarial perturbation mechanism is introduced for model training. During the model training phase, to address the insufficient generalization ability of conventional training in extreme scenarios, a gradient-based adversarial perturbation strategy is implemented. The gradient of the quantile loss function with respect to the input feature vector is calculated, and an adversarial perturbation vector maximizing the model loss is generated along the gradient's ascending direction. This perturbation vector is then superimposed onto the original input feature vector to construct adversarial examples. A hybrid total loss function, comprising the original sample loss and the adversarial sample loss, is constructed. By minimizing this hybrid total loss function, the model parameters are updated, forcing the model to learn the carbon flow response boundary when the input data suffers worst-case perturbations, thereby improving the model's robustness to low-probability, high-risk events such as sudden drops in wind and solar power or sudden changes in grid carbon potential.

[0034] Finally, a carbon flow prediction interval is output to support risk-aware decision-making. Using a trained carbon flow quantile regression neural network, forward inference is performed on the input feature vector for the period to be predicted, directly outputting the predicted values ​​of carbon flow at low and high quantiles. A carbon flow probability prediction interval is constructed based on these low and high quantile prediction values, quantifying the range of carbon flow fluctuations at a given confidence level. This carbon flow probability prediction interval is then transmitted as risk-aware data input to the microgrid energy management system for calculating conditional value of risk or setting dynamic tolerance bands in model predictive control, supporting optimal scheduling of the microgrid that takes into account carbon emission uncertainties.

[0035] This invention first defines the specific physical scenario of a wind-solar-hydrogen-storage microgrid. This microgrid system includes wind turbine generators, photovoltaic arrays, user-side loads, electrochemical energy storage devices, a hydrogen storage system, and a common connection point interface for power exchange with the external main grid. In this scenario, carbon flow is defined as the microgrid's carbon emission responsibility value per unit time period. This value, as an observable scalar target variable, is directly derived from the historical operating database or carbon accounting module of the microgrid energy management system. This invention utilizes historical data to model and predict this target variable.

[0036] Setting the microgrid scheduling cycle includes There are several time periods, among which A positive integer, for example, 24, represents a complete daily scheduling cycle with hourly resolution. Definition This is a time-period index, with values ​​ranging from 1 to... To quantify the impact of microgrid operating status and external boundary conditions on carbon flow in the future, a multidimensional input feature vector needs to be constructed. This input feature vector aggregates key physical quantity data from the source side, load side, grid side, and energy storage side, all of which are derived from the historical records or short-term forecast databases of the microgrid energy management system.

[0037] For each time period Define the input feature vector As shown below:

[0038] ;

[0039] in, Indicates the first Forecast wind power output for the specified time period, in kilowatts; Indicates the first Forecasted photovoltaic power for the specified time period, in kilowatts; Indicates the first Forecasted load power for the time period, in kilowatts; Indicates the first The real-time carbon potential of the power grid during a given period, which is the amount of carbon dioxide emitted per unit of electricity, expressed in grams of carbon dioxide per kilowatt-hour. Indicates the first The state of charge of the time-phase electrochemical energy storage device. This value is dimensionless and ranges from 0 to 1. Indicates the first The mass of hydrogen stored inside the hydrogen storage tank during the specified time period is expressed in kilograms. These six physical quantities together constitute a complete feature set describing the source-load-storage state of the microgrid and the intensity of external carbon emissions during that time period, serving as the input basis for the subsequent carbon flow quantile regression neural network model.

[0040] After constructing the multidimensional input feature vector of the microgrid, this embodiment of the invention establishes a quantile regression neural network model. This model aims to establish a nonlinear mapping relationship between the input features and the carbon flow probability distribution. The quantile regression neural network model receives the input feature vector at the k-th time period and outputs the predicted value of the carbon flow target variable under a preset quantile set, thereby achieving a quantitative estimate of the carbon flow fluctuation range. The preset quantile set is set as follows: For example, take , which correspond to the lower boundary, median, and upper boundary of the carbon flow distribution, respectively.

[0041] For the preset quantile set Each quantile The predicted output expression of the quantile regression neural network model is shown below:

[0042] ;

[0043] in, Indicates the first Temporal carbon flow at quantiles The predicted value is in grams of carbon dioxide per hour. The parameter is quantile regression neural network mapping function; For the first Input feature vector for a given time period; This is a quantile parameter, with values ​​ranging from 0 to 1.

[0044] To enable the neural network to learn the conditional quantiles of carbon flow, the model training uses a quantile loss function as the optimization objective. The quantile loss function applies specific penalty weights to the prediction residuals, causing the model output to approximate a specific quantile of the target variable. Over a complete scheduling cycle, the total loss function for quantile regression is... The definition is as follows:

[0045] ;

[0046] in, This represents the total loss function of quantile regression, which is a dimensionless quantity. This represents the total number of time periods within the scheduling period, and is a positive integer. For a period of time; These are quantile parameters, belonging to the set. ; Indicates the first The actual carbon flow value of the microgrid during the time period, in grams of carbon dioxide per hour, is obtained from the carbon accounting system recorded in the historical operating data. This represents the quantile loss function.

[0047] Quantile loss function The specific calculation logic of its internal indicator function is as follows:

[0048] ;

[0049] in, The prediction residual represents the difference between the actual value and the predicted value, and is calculated using the following formula: The unit is grams of carbon dioxide per hour; For an indicator function, its values ​​must satisfy the following conditions:

[0050] ;

[0051] By minimizing the total loss function described above, the parameters of the quantile regression neural network are... This allows the model to be updated, enabling it to output the corresponding carbon flux quantile prediction for a given input feature vector.

[0052] This invention introduces an adversarial perturbation training mechanism during the training phase of a carbon flow quantile regression neural network, aiming to improve the robustness of the prediction model in extreme scenarios such as sudden drops in wind and solar power, load abrupt changes, or drastic fluctuations in grid carbon intensity. Traditional training methods only fit historical observation data, often ignoring the inherent uncertainty distribution of the input data, leading to a decline in the model's generalization ability when encountering unseen extreme perturbations. This step actively applies gradient-based adversarial perturbations to the input feature vector during training, forcing the neural network model to learn the carbon flow response boundary under the most unfavorable input conditions, thereby enhancing the model's adaptability to tail-risk events.

[0053] Specifically, for each time period Given the input feature vector, the system calculates the gradient of the quantile regression total loss function with respect to this input based on the current model parameters. This gradient direction represents the direction of input change that causes the fastest increase in prediction error. Based on this gradient direction, an adversarial perturbation vector is generated. The calculation formula is as follows:

[0054] ;

[0055] in, This represents the generated adversarial perturbation vector, whose dimension is the same as the input feature vector. Consistent; Represents the total loss function of quantile regression For the input feature vector The gradient vector; This represents the L2 norm of the gradient vector, used to normalize the gradient direction. This represents the perturbation radius and is a positive real number. Perturbation radius The setting is based on the statistical characteristics of historical wind and solar power or load forecasting errors, specifically set as the standard deviation of historical forecasting errors. Multiples of, for example, taking This is to cover the vast majority of extreme deviation scenarios.

[0056] After generating the adversarial perturbation vector, it is superimposed on the original input feature vector to construct the input feature vector after applying the adversarial perturbation. The calculation formula is as follows:

[0057] ;

[0058] in, This is the input feature vector used to simulate extreme operating conditions. This sample is fed into a quantile regression neural network for forward propagation, and its corresponding prediction loss is calculated.

[0059] To balance prediction accuracy under normal conditions with robustness under extreme conditions, this invention constructs a total training loss function comprising a primary loss term and an adversarial loss term. The model updates its network parameters by minimizing this total training loss function. Total Training Loss Function The expression is as follows:

[0060] ;

[0061] in, denoted as the total training loss function, which is a dimensionless quantity; Indicates based on the original input feature vector The calculated standard quantile regression loss; Indicates based on perturbation input feature vector The calculated adversarial quantile regression loss; The adversarial training weight is a dimensionless coefficient ranging from 0 to 1, for example, 0.5. By adjusting this weight, the model's ability to learn from the original data distribution and its ability to defend against adversarial perturbations can be balanced. Through this optimization process of the hybrid objective function, the finally trained model can not only accurately fit historical normal data, but also maintain the reliability of prediction results when the input data undergoes severe shifts.

[0062] After completing the training and parameter optimization of the carbon flow quantile regression neural network model, this embodiment of the invention enters the prediction inference and application stage. The system receives data from the microgrid energy management system regarding a future scheduling cycle. This is equivalent to a sequence of input feature vectors spanning 24 time periods. This input sequence includes forecasts for wind power, solar power, load, grid carbon intensity, energy storage state of charge, and hydrogen storage for each future time period. The trained quantile regression neural network model performs forward propagation calculations on this input sequence without applying adversarial perturbations, directly outputting the predicted values ​​of the carbon flow target variable at preset quantiles.

[0063] Based on the quantile predictions from the model output, the system constructs the carbon flow prediction interval for each time period. Specifically, the predicted output values ​​at the low quantile (0.05) and high quantile (0.95) are selected and combined to form the predicted interval for each time period. The mathematical expression for the carbon flow prediction interval for a given period is shown below:

[0064] ;

[0065] in, This represents the 5 percentile predicted value of the carbon flow in the 1st time period. Its statistical meaning is that there is a 95 percent probability that the actual carbon flow value will not be lower than this value. The value represents the 95th percentile predicted value of the carbon flow in the given time period. Statistically, this means there is a 95% probability that the actual carbon flow value will not exceed this value. These two boundary values ​​together constitute the 90% confidence prediction band for the carbon flow, used to explicitly quantify the range of uncertainty in the prediction results.

[0066] The generated carbon flow prediction range is used as a risk-aware input parameter and transmitted to the economic and low-carbon collaborative scheduling module in the microgrid energy management system. This scheduling module utilizes the boundary information provided by the prediction range for optimization decisions, specifically in two application methods. The first method replaces the deterministic carbon cost term in the traditional optimization model with a conditional value-at-risk index based on the prediction range, thereby formulating a scheduling scheme that can avoid high carbon emission risks and ensure that carbon emission costs are controllable in extreme scenarios. The second method uses the prediction range to set a tolerance band for carbon flow tracking within the model predictive control framework. That is, when the actual monitored or short-term predicted carbon flow fluctuations fall within this prediction range, the controller maintains the current operating strategy, avoiding frequent triggering of equipment adjustment actions due to a single point prediction deviation, thereby reducing equipment mechanical wear and lowering the system's energy curtailment rate. Through the above steps, this invention realizes a complete technical process from data feature extraction and probabilistic model prediction to risk decision support.

[0067] See attached document Figure 2This invention provides a carbon flow probability prediction and uncertainty quantification system for wind, solar, hydrogen, and energy storage microgrids. The system operates on a computer or cloud server and includes an input data module, an anti-disturbance generation module, a carbon flow quantile regression neural network prediction module, and a carbon flow prediction interval output module. These modules are connected via a data bus or internal memory interface to achieve data transmission and interaction.

[0068] The input data module establishes communication connections with the historical and short-term forecast databases of the microgrid energy management system. This module is responsible for collecting multi-dimensional feature data for each time period within the future scheduling cycle before the start of each cycle. Specifically, the collected data includes wind power forecasts, photovoltaic power forecasts, load forecasts, real-time grid carbon potential, electrochemical energy storage state of charge, and hydrogen mass in hydrogen storage tanks. The input data module also includes a data preprocessing unit, which cleans the collected raw data to remove outliers and performs normalization, ultimately combining these physical quantities to construct an input feature vector sequence corresponding to each time period.

[0069] The adversarial perturbation generation module is only active during the system's model training phase and is used to generate adversarial examples simulating extreme scenarios. This module receives the raw input feature vector from the input data module. For each input feature vector, the module uses the backpropagation algorithm to calculate the gradient vector of the quantile regression loss function relative to that input feature vector. Subsequently, the module generates an adversarial perturbation vector along the calculated gradient direction. The magnitude of this perturbation vector is controlled by a preset perturbation radius parameter, which is set based on the standard deviation of historical wind or load prediction errors. The module superimposes the generated adversarial perturbation vector onto the raw input feature vector to synthesize a perturbed input feature vector, and then transmits this perturbed input feature vector to the carbon flow quantile regression neural network prediction module to force the model to learn the carbon flow response when the input data undergoes severe shifts.

[0070] The carbon flow quantile regression neural network prediction module is the core computational unit of the system, internally deploying a pre-built quantile regression neural network model. During the training phase, this module simultaneously receives the original input feature vector and the perturbation input feature vector output by the adversarial perturbation generation module, updating the network weight parameters by minimizing a hybrid objective function that includes both the original and adversarial loss terms. In the online prediction phase, this module receives input feature vectors for future time periods, performs forward propagation calculations of the neural network, and directly outputs the predicted values ​​of the carbon flow target variable at multiple preset quantiles. These preset quantiles typically include low quantiles, median quantiles, and high quantiles.

[0071] The carbon flow prediction interval output module is connected to the output of the carbon flow quantile regression neural network prediction module. This module is responsible for post-processing the multi-quantile predicted values ​​output by the model. Specifically, it selects the low quantile predicted value as the lower bound and the high quantile predicted value as the upper bound to construct a carbon flow prediction interval covering a certain confidence level. This module encapsulates the generated carbon flow prediction interval into a standard data format and transmits it to the economic and low-carbon collaborative scheduling module of the microgrid energy management system. This prediction interval serves as a risk-aware input, allowing the scheduling system to calculate the conditional value of risk index or set the tolerance band for model predictive control, thereby achieving microgrid operation optimization that considers uncertainty.

Claims

1. A method for carbon flow probability prediction and uncertainty quantification in wind-solar-hydrogen-storage microgrids, characterized in that, Includes the following steps: S1. Obtain multi-source operation data of the wind-solar-hydrogen-storage microgrid system at various time periods within the scheduling cycle, and perform time series alignment and normalization processing on the multi-source operation data to establish an input feature vector characterizing the real-time operation status and external boundary conditions of the microgrid. S2. Construct a carbon flow quantile regression neural network model, configure the carbon flow quantile regression neural network model to receive the input feature vector, apply an asymmetric penalty weight to the prediction residual using the quantile loss function, fit the conditional distribution of the carbon flow target variable under different probability levels, and output the predicted value of the carbon flow target variable under the preset quantile set. S3. In the training phase of the carbon flow quantile regression neural network model, an adversarial perturbation mechanism is introduced to determine the gradient information of the total loss function of quantile regression with respect to the input feature vector. Based on the gradient information, an adversarial perturbation vector is constructed and superimposed on the input feature vector to generate adversarial examples. A hybrid total loss function containing the original sample loss and the adversarial sample loss is constructed. The model parameters are updated based on the principle of minimizing the hybrid total loss function, so that the model learns the response boundary of the input data under adversarial perturbation. S4. Using the trained carbon flow quantile regression neural network model, perform forward inference on the input feature vector for the period to be predicted to obtain the predicted values ​​of low quantiles and high quantiles. Define the carbon flow probability prediction interval based on the predicted values ​​of low quantiles and high quantiles. Quantify the fluctuation range of carbon flow at a given confidence level using the carbon flow probability prediction interval. Transmit the carbon flow probability prediction interval to the microgrid energy management system.

2. The carbon flow probability prediction and uncertainty quantification method for wind-solar-hydrogen-storage microgrids according to claim 1, characterized in that, In step S1, the multi-source operation data includes the predicted wind power and photovoltaic power on the source side, the predicted load power on the load side, the real-time carbon intensity of the power grid on the grid side, and the electrochemical energy storage state of charge and the hydrogen mass in the hydrogen storage tank on the energy storage side.

3. The carbon flow probability prediction and uncertainty quantification method for wind-solar-hydrogen-storage microgrids according to claim 1, characterized in that, In step S2, the preset quantile set includes low quantiles, median quantiles, and high quantiles, and the quantile loss function is used to constrain the output of the carbon flow quantile regression neural network model to approximate the conditional quantiles of the carbon flow target variable.

4. The carbon flow probability prediction and uncertainty quantification method for wind-solar-hydrogen-storage microgrids according to claim 3, characterized in that, The processing logic of the quantile loss function includes: The prediction residual is determined based on the difference between the actual carbon flow value and the predicted value of the microgrid. The value of the indicator function is determined according to the positive or negative sign attribute of the prediction residual. The weighting coefficient is determined by combining the quantile parameter and the value of the indicator function. The loss value is determined based on the weighted relationship between the prediction residual and the weighting coefficient.

5. The carbon flow probability prediction and uncertainty quantification method for wind-solar-hydrogen-storage microgrids according to claim 1, characterized in that, In step S3, the process of constructing the anti-perturbation vector includes: Determine the gradient vector of the total loss function of the quantile regression relative to the input feature vector, identify the direction of input change that increases the prediction error, and generate the adversarial perturbation vector along the gradient ascent direction.

6. The carbon flow probability prediction and uncertainty quantification method for wind-solar-hydrogen-storage microgrids according to claim 5, characterized in that, The method for generating the adversarial perturbation vector is as follows: the gradient vector is normalized based on the L2 norm, and the normalized vector is scaled using a preset perturbation radius.

7. The carbon flow probability prediction and uncertainty quantification method for wind-solar-hydrogen-storage microgrids according to claim 6, characterized in that, The disturbance radius is set based on the statistical characteristics of historical wind and solar power prediction errors or historical load prediction errors, and is set as a value related to the standard deviation of historical prediction errors.

8. The carbon flow probability prediction and uncertainty quantification method for wind-solar-hydrogen-storage microgrids according to claim 1, characterized in that, In step S3, the hybrid total loss function is constructed as follows: Obtain the standard quantile regression loss based on the original input feature vector, obtain the adversarial quantile regression loss based on the adversarial examples, and weight the standard quantile regression loss and the adversarial quantile regression loss to form the mixed total loss function.

9. The carbon flow probability prediction and uncertainty quantification method for wind-solar-hydrogen-storage microgrids according to claim 1, characterized in that, In step S4, the method for defining the carbon flow probability prediction interval is as follows: Five percent of the preset quantiles are selected as low quantiles, and ninety-five percent of the quantiles are selected as high quantiles. The predicted values ​​corresponding to the low quantiles output by the carbon flow quantile regression neural network model are determined as the lower bound, and the predicted values ​​corresponding to the high quantiles are determined as the upper bound, thereby forming the carbon flow probability prediction interval.

10. The carbon flow probability prediction and uncertainty quantification method for wind-solar-hydrogen-storage microgrids according to claim 1, characterized in that, In step S4, the microgrid energy management system uses the carbon flow probability prediction interval to perform risk perception decision-making. The risk perception decision-making includes determining the conditional value of risk index, or using the carbon flow probability prediction interval in model predictive control to set a dynamic tolerance band for carbon flow tracking, so as to maintain the current operating strategy when the monitored carbon flow fluctuation is within the dynamic tolerance band.