A two-layer optimization method and system based on an energy hub

By constructing a two-layer optimization model with a master-slave game architecture, and combining KKT conditions and Huber fuzzy sets, the problem of coordinating emerging resources and the interests of multiple stakeholders in the energy hub is solved. This achieves efficient and robust optimization of the energy hub and comprehensive benefits of the multi-energy system, and improves the scientific nature and adaptability of scheduling decisions.

CN122264329APending Publication Date: 2026-06-23CHANGSHA UNIVERSITY OF SCIENCE AND TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHANGSHA UNIVERSITY OF SCIENCE AND TECHNOLOGY
Filing Date
2026-01-26
Publication Date
2026-06-23

Smart Images

  • Figure CN122264329A_ABST
    Figure CN122264329A_ABST
Patent Text Reader

Abstract

The application relates to a double-layer optimization method and system based on an energy concentrator, which firstly constructs a double-layer optimization model of a master-slave game architecture, wherein an upper-layer model of the double-layer optimization model takes minimization of total operation cost as an optimization target and comprises first-stage day-ahead scheduling decision and second-stage real-time adjustment decision; the double-layer optimization model is reconstructed into a single-layer mixed integer linear programming model through KKT conditions and strong duality theory; experience distribution is generated based on historical data and Huber fuzzy set is constructed to depict RG uncertainty, so as to form a min-max-min distribution robust optimization model under the first-stage day-ahead scheduling decision-worst distribution selection-second-stage real-time adjustment decision architecture; and finally, a customized C&CG algorithm is adopted for iterative solution. The method balances economy and robustness, improves multi-subject coordination and source-load interaction efficiency, and provides a stable and efficient scheduling scheme for the energy concentrator.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of integrated energy system optimization and scheduling technology, and in particular to a two-layer optimization method and system based on energy hubs. Background Technology

[0002] With the large-scale grid connection of renewable energy and the rapid development of Integrated Energy Systems (IES), Energy Hubs (EHs), as the core carriers for coupling and conversion, have become a key form for improving the energy efficiency and flexibility of IESs. By coordinating the conversion, storage, and distribution of various energy carriers such as electricity, gas, heat, and cooling, EHs provide an effective way to build a clean, low-carbon, safe, and efficient modern energy system.

[0003] Existing research often focuses on conventional electrical heating and cooling multi-energy loads, failing to systematically incorporate emerging flexible resources such as electric vehicles, hydrogen energy, and data centers into energy hub modeling. While basic multi-energy optimization scheduling has been achieved in traditional IES scenarios, the unique operational characteristics and flexible adjustment potential of these emerging resources have been overlooked, hindering the full realization of their rational allocation and coordinated optimization value. This limits the improvement of EH operating efficiency and flexibility, and fails to adapt to the complex and diverse characteristics of multi-energy loads and the increasing penetration rate of emerging resources under the deepening of IES construction. Furthermore, these resources have not been considered as key elements for enhancing EH scheduling potential and economy, thus failing to fully unleash the comprehensive benefits of multi-energy systems. Uncertainty handling methods have failed to effectively balance conservatism, economy, and computational feasibility. SP relies excessively on precise distributions, and RO is overly conservative. The fuzzy set construction of traditional DRO has significant limitations. In addition, existing research generally ignores the multi-agent characteristics and interest game relationships of EH. Although it simplifies model construction in centralized scheduling scenarios, it does not consider the economic interests of participating entities such as multi-energy loads and electric vehicles that exist as aggregators. Centralized unified scheduling may damage their participation enthusiasm and weaken the sustainability of multi-energy transactions. Although some studies have attempted to combine DRO with master-slave game theory, they are limited by the technical difficulties of combining and reconstructing the two, and have not fully utilized the unique advantages of Huber-CVaR DRO. Related cross-disciplinary research is still in the exploratory stage. At the same time, many studies use the KKT-based Big-M method to linearize complementary relaxation constraints, ignoring its inherent defects such as NP-hard M value selection, poor numerical stability, and low solution efficiency. The advantage of SOS1 modeling technology, which does not require manual parameter setting, has not been fully utilized, and it is impossible to achieve efficient model solution to adapt to the scheduling needs in multi-agent environments. Summary of the Invention

[0004] This invention provides a two-layer optimization method and system based on energy hubs to solve the problems of neglecting diverse and heterogeneous flexible resources, imbalance in uncertainty handling, lack of multi-agent game theory, and defects of the Big-M method in the prior art. It realizes the economy, robustness, and multi-agent collaborative optimization of energy hub operation, and improves the system's ability to cope with uncertainty and the effectiveness of scheduling decisions.

[0005] To address the aforementioned problems, in a first aspect, embodiments of the present invention provide a two-layer optimization method based on an energy hub, comprising:

[0006] S1. Construct a two-layer optimization model with a master-slave game architecture, wherein the upper-layer model takes the energy hub operator (EH) as the core decision-making entity, and the lower-layer model takes the aggregator covering data centers, electrolyzers, electric vehicles, and multi-energy loads as the response entity; the upper-layer model of the two-layer optimization model takes minimizing total operating cost as the optimization objective, and the optimization objective includes a first-stage daytime scheduling decision with economic efficiency as the objective and a second-stage real-time adjustment decision with the objective of minimizing economic risk synergy. The constraints include the operating constraints of multi-energy conversion equipment and the operating constraints of the aggregator;

[0007] S2. By using the Caro-Kuhn-Tucker KKT conditions and strong duality theory, the optimization problem of the lower-level model is equivalently transformed into a set of linear constraints and embedded into the upper-level model. At the same time, the coupling terms in the optimization objective of the upper-level model are linearized, and the two-level optimization model is reconstructed into a single-level mixed integer linear programming model.

[0008] S3. Generate an empirical distribution based on historical error data, and construct a fuzzy set with Huber distance as the radius to describe the fluctuation range of the true probability distribution; embed the fuzzy set into the single-layer mixed integer linear programming model, so that the real-time adjustment decision in the second stage is made under the worst probability distribution, forming a min-max-min partial Huber bar optimization model under the architecture of the first stage day-ahead scheduling decision-worst distribution selection-second stage real-time adjustment decision;

[0009] S4. The column and constraint generation algorithm is used to solve the min-max-min sub-Bruker optimization model. The scheduling scheme and target lower bound are generated by iteratively solving the main problem, and the sub-problems are solved to find the worst probability distribution and calculate the target upper bound until the upper and lower bounds converge. The optimal scheduling scheme of the energy hub in the day-ahead stage is output.

[0010] Preferably, the construction of the upper-level model in step S1 includes:

[0011] S11. Construction of the first-stage objective function: The first-stage objective function aims to minimize the EH electricity purchase and sale cost, gas purchase cost, electrolyzer start-up and shutdown cost, and interaction cost with lower-level aggregators.

[0012] S12. Constraint System Construction: Construct EH internal equipment operation constraints and multi-heterogeneous flexible resource operation constraints. The internal equipment includes cogeneration (CHP), condensing boiler (CB), diesel generator (DG), and energy storage system (ES). The multi-heterogeneous flexible resource operation constraints include data center cache and server energy consumption constraints, hydrogen electrolyzer three-state switching and hydrogen production power constraints, multi-energy load transferability and abandonment constraints, and electric vehicle charging, discharging, and state of charge constraints.

[0013] S13. Second-stage real-time tracking model construction: With the goal of minimizing real-time operating costs and risk loss costs, a real-time adjustment model is established to cope with RG uncertainty. The operating costs and risk loss costs include standby adjustment costs and load abandonment compensation costs. Tail risk loss is quantified through CVaR.

[0014] Preferably, the two-layer optimization model reconstruction in step S2 includes:

[0015] S21. Lower-level model reconstruction: Utilizing the convexity of the lower-level aggregator optimization model and the Slater condition, it is transformed into a constraint set containing the original variables, dual variables, optimality conditions, and complementary relaxation constraints through KKT conditions.

[0016] S22. Linearization of complementary relaxation constraints: The complementary relaxation constraints are processed using special ordered set type SOS1 variables, wherein the SOS1 variables satisfy at most one non-zero constraint property.

[0017] S23. Bilinear term processing: Based on strong duality theory, the bilinear terms in the upper objective function that are related to the lower response variables are transformed into linear form, thus completing the linearization and reconstruction of the model.

[0018] Preferably, the construction of the min-max-min partial Blue bar optimization model in step S3 includes:

[0019] S31. Experience distribution generation: Based on the historical prediction error data of RG output, generate S error scenarios and corresponding experience distributions. The probability of each scenario in the experience distribution is the ratio of the number of times the scenario occurs to the total number of scenarios.

[0020] S32. Huber Fuzzy Set Construction: A fuzzy set with Huber distance as the radius, wherein the fuzzy set uses a segmented penalty mechanism to apply a quadratic penalty for small deviations and a linear penalty for large deviations;

[0021] S33. Three-layer model integration: Huber fuzzy set and CVaR risk measure are embedded into a two-layer optimization framework to form a min-max-min three-layer model.

[0022] Preferably, step S4 uses a column and constraint generation algorithm to solve the problem, including:

[0023] S41. Solving the main problem: Fix the worst uncertainty distribution obtained in each iteration, and solve the lower bound LB of the first-stage decision variables and objective function. The main problem includes the linearized constraint system and scenario constraints.

[0024] S42. Subproblem Solving: Based on the first-stage decision output of the main problem, find the worst uncertainty distribution and calculate the upper bound UB of the objective function. The subproblems are decoupled into parallel solutions and single-layer max models for step-by-step solutions, and piecewise linearization is applied to the nonlinear Huber fuzzy set.

[0025] Secondly, the present invention also provides a two-layer optimization system based on an energy hub, comprising:

[0026] The two-layer optimization model construction module constructs a master-slave game architecture for a two-layer optimization model. The upper-layer model takes the energy hub operator (EH) as the core decision-making entity, while the lower-layer model takes aggregators covering data centers, electrolyzers, electric vehicles, and multi-energy loads as the responding entities. The upper-layer model of the two-layer optimization model takes minimizing total operating costs as its optimization objective. The optimization objective includes a first-stage daytime scheduling decision aimed at economic efficiency and a second-stage real-time adjustment decision aimed at minimizing economic risk synergy. The constraints include the operating constraints of multi-energy conversion equipment and the operating constraints of the aggregators.

[0027] The two-level optimization model reconstruction module: by using the Caro-Kuhn-Tucker KKT conditions and strong duality theory, the optimization problem of the lower-level model is equivalently transformed into a set of linear constraints and embedded into the upper-level model. At the same time, the coupling terms in the optimization objective of the upper-level model are linearized, and the two-level optimization model is reconstructed into a single-level mixed integer linear programming model.

[0028] The min-max-min sub-Huber bar optimization model construction module generates an empirical distribution based on historical error data and constructs a fuzzy set with Huber distance as the radius to describe the fluctuation range of the true probability distribution; the fuzzy set is embedded into the single-layer mixed integer linear programming model, so that the real-time adjustment decision in the second stage is made under the worst probability distribution, forming a min-max-min sub-Huber bar optimization model under the architecture of first-stage day-ahead scheduling decision - worst-case distribution selection - second-stage real-time adjustment decision;

[0029] Algorithm solution module: The column and constraint generation algorithm is used to solve the min-max-min sub-Bruker optimization model. The scheduling scheme and target lower bound are generated by iteratively solving the main problem, and the sub-problems are solved to find the worst probability distribution and calculate the target upper bound until the upper and lower bounds converge. The optimal scheduling scheme of the energy hub in the day-ahead stage is output.

[0030] The two-layer optimization method and system based on energy hubs provided by this invention have the following advantages compared with the prior art:

[0031] This invention constructs a Huber bilayer optimization method and system that considers diverse heterogeneous flexible resources. By integrating the modeling of heterogeneous flexible resources such as data centers and electrolyzer hydrogen production, it overcomes the limitations of traditional methods that only focus on conventional loads. It integrates Huber fuzzy sets and CVaR risk measurement to balance the economy and robustness of uncertainty handling and avoid the imbalance problem of single optimization methods. It builds a bilayer master-slave game architecture to coordinate the interests of the main parties and improve the source-load coordination efficiency. It adopts SOS1 variable linearization and customized C&CG algorithm to avoid the defects of Big-M method, optimize the stability and efficiency of solution, and significantly improve the scientificity and adaptability of scheduling decisions. Attached Figure Description

[0032] Figure 1 A flowchart of a two-layer optimization method based on an energy hub provided by the present invention;

[0033] Figure 2 A collaborative optimization framework diagram for a two-layer optimization method based on energy hubs provided by this invention;

[0034] Figure 3 An EH scheduling result diagram for a two-layer optimization method based on energy hubs provided by this invention;

[0035] Figure 4a1 Electricity price diagram of the upper-layer EH and lower-layer multi-energy load game results of a two-layer optimization method based on energy hubs provided by the present invention;

[0036] Figure 4a2 The electrical load diagram of the upper-layer EH and lower-layer multi-energy load game results of a two-layer optimization method based on energy hubs provided by the present invention;

[0037] Figure 4b1 The heat price diagram of the upper-layer EH and lower-layer multi-energy load game results provided by the present invention is a two-layer optimization method based on energy hubs.

[0038] Figure 4b2 A heat load diagram showing the game result of the upper-level EH and lower-level multi-energy load in a two-layer optimization method based on energy hubs provided by the present invention;

[0039] Figure 4c1 Cooling price diagram of the upper-level EH and lower-level multi-energy load game results of a two-layer optimization method based on energy hubs provided by the present invention;

[0040] Figure 4c2 The cold load diagram of the upper-layer EH and lower-layer multi-energy load game results of a two-layer optimization method based on energy hubs provided by the present invention;

[0041] Figure 5a The charging and discharging state diagram of 20 specific EVs based on the EV game result of a two-layer optimization method based on energy hubs provided by the present invention.

[0042] Figure 5b The EV aggregated charge-discharge effect diagram is provided by the EV game result of the two-layer optimization method based on energy hub provided by the present invention.

[0043] Figure 6a A comparison diagram before and after considering latency tolerance in the data center optimization results of a two-layer optimization method based on energy hubs provided by the present invention;

[0044] Figure 6b The diagram shows the optimization results of data center utilization, cache size, and power using a two-layer optimization method based on energy hubs provided by this invention.

[0045] Figure 7a A comparison diagram of hydrogen load before and after hydrogen storage in an electrolytic cell optimization result based on a dual-layer optimization method for energy hubs provided by the present invention;

[0046] Figure 7b The figure shows the optimization results of hydrogen storage in an electrolytic cell for hydrogen production based on a two-layer optimization method using an energy hub, as provided by this invention.

[0047] Figure 8 A comparison diagram of three uncertainty methods for a two-layer optimization method based on an energy hub provided by this invention;

[0048] Figure 9 The influence diagram of Huber distance on worst-case scenario probability provided by the present invention is shown in the bi-layer optimization method based on energy hub.

[0049] Figure 10 A flowchart of a two-layer optimization system based on an energy hub provided by the present invention;

[0050] Figure 11 The present invention provides a model and framework diagram of an energy hub based on a two-layer optimization method for energy hubs. Detailed Implementation

[0051] Preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings, which form part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not intended to limit the scope of the present invention.

[0052] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0053] like Figure 1 The diagram shows a flowchart of a two-layer optimization method based on an energy hub provided by the present invention, including:

[0054] S1. Construct a two-layer optimization model with a master-slave game architecture, wherein the upper-layer model takes the energy hub operator (EH) as the core decision-making entity, and the lower-layer model takes the aggregator covering data centers, electrolyzers, electric vehicles, and multi-energy loads as the response entity; the upper-layer model of the two-layer optimization model takes minimizing total operating cost as the optimization objective, and the optimization objective includes a first-stage daytime scheduling decision with economic efficiency as the objective and a second-stage real-time adjustment decision with the objective of minimizing economic risk synergy. The constraints include the operating constraints of multi-energy conversion equipment and the operating constraints of the aggregator;

[0055] S2. By using the Caro-Kuhn-Tucker KKT conditions and strong duality theory, the optimization problem of the lower-level model is equivalently transformed into a set of linear constraints and embedded into the upper-level model. At the same time, the coupling terms in the optimization objective of the upper-level model are linearized, and the two-level optimization model is reconstructed into a single-level mixed integer linear programming model.

[0056] S3. Generate an empirical distribution based on historical error data, and construct a fuzzy set with Huber distance as the radius to describe the fluctuation range of the true probability distribution; embed the fuzzy set into the single-layer mixed integer linear programming model, so that the real-time adjustment decision in the second stage is made under the worst probability distribution, forming a min-max-min partial Huber bar optimization model under the architecture of the first stage day-ahead scheduling decision-worst distribution selection-second stage real-time adjustment decision;

[0057] S4. The column and constraint generation algorithm is used to solve the min-max-min sub-Bruker optimization model. The scheduling scheme and target lower bound are generated by iteratively solving the main problem, and the sub-problems are solved to find the worst probability distribution and calculate the target upper bound until the upper and lower bounds converge. The optimal scheduling scheme of the energy hub in the day-ahead stage is output.

[0058] Furthermore, the construction of the upper-level model in step S1 includes:

[0059] S11. Construction of the first-stage objective function: The objective function aims to minimize the EH electricity purchase and sale cost, gas purchase cost, electrolyzer start-up and shutdown cost, and interaction cost with lower-level aggregators, and establishes a day-ahead scheduling optimization objective.

[0060] The cost expression of the EH model in step S11 is as follows:

[0061] (1)

[0062] In the formula, This represents the cost of the first-stage optimization model. This indicates the electricity price that EH purchases from the upstream power grid; This indicates the electricity price that EH sells to the upstream power grid; This indicates the amount of electricity EH sells to the upstream power grid; This indicates the amount of electricity EH purchases from the upstream power grid; This indicates the cost of DG; Indicates the cost of purchasing gas; This indicates DG's contribution; Indicates EH's gas purchase volume; This indicates the start-up cost of an electrolytic hydrogen production cell; Indicates the stop binary variable for the electrolytic cell; This represents the price EH sells energy to multi-energy loads; This represents the compensation price from EH to multi-energy loads, where This indicates a multi-energy load, which includes electrical load (e), heating load (h), and cooling load (c). Indicates multi-energy load; Indicates the abandonment of load; Indicates the amount of charge in an EV; This indicates the discharge amount of the EV.

[0063] S12. Constraint System Construction: Construct EH internal equipment operation constraints and multi-heterogeneous flexible resource operation constraints. The internal equipment includes cogeneration (CHP), condensing boiler (CB), diesel generator (DG), and energy storage system (ES). The multi-heterogeneous flexible resource operation constraints include data center cache and server energy consumption constraints, hydrogen electrolyzer three-state switching and hydrogen production power constraints, multi-energy load transferability and abandonment constraints, and electric vehicle charging, discharging, and state of charge constraints.

[0064] In step S12, the operating constraints of the internal devices of EH are constructed, including:

[0065] The power balance equation of EH in the upper-level EH model is shown in equation (2a), and equations (2b)-(2d) represent the internal power relationship and thermal power balance equation of EH:

[0066] (2a)

[0067] (2b)

[0068] (2c)

[0069] (2d)

[0070] In the formula, This indicates the output of RG; Indicates the energy storage charging power; Indicates the energy storage discharge power; Indicates the thermal efficiency of CHP equipment; Indicates the power efficiency of CHP equipment; Indicates the input fuel power of the CHP device. Indicates electrical load; Indicates heat load; Indicates cooling load; Indicates the power consumption of the data center; Indicates the power consumption of the electrolytic cell; This indicates the input power of the gas furnace; This indicates the thermal power provided by the gas-fired furnace to meet the heat load; Indicates the efficiency of the gas furnace equipment; This indicates the efficiency of the condensing boiler equipment.

[0071] The relationship between the energy storage state of charge and charge / discharge and the corresponding limitations in formulas (2e)-(2h) of the upper-level model EH:

[0072] (2e)

[0073] (2f)

[0074] (2g)

[0075] (2h)

[0076] In the formula, Indicates the state of charge of the stored energy at time t; Indicates the charging efficiency of energy storage; Indicates the discharge efficiency of energy storage; Indicates the maximum state of charge of the energy storage; Indicates the minimum state of charge of energy storage; Indicates the maximum charging capacity; Indicates the minimum charging amount; Indicates the maximum discharge amount; This indicates the minimum discharge quantity.

[0077] Limitations on the range of EH electricity purchases, equipment output, and energy sales prices in the upper-level model:

[0078] (2i)

[0079] (2j)

[0080] (2k)

[0081] In the formula, Indicates the output of the EH conversion equipment; Indicates the maximum selling price; Minimum selling price; This indicates the electricity purchase price that EH pays to multi-energy loads.

[0082] In step S12, the data center cache and server energy consumption constraints include:

[0083] In the upper-layer data center model, the data center load consists of fixed latency-sensitive loads and latency-sensitive loads executed at the current moment:

[0084] (3a)

[0085] In the formula, Indicates the number of data center loads; This indicates latency-sensitive load in the data center; This indicates a latency-tolerant load in the data center.

[0086] In the upper-layer data center model, formulas (3b)-(3d) represent the number of latency-tolerant loads cached in the data center, the cache limit after the scheduling cycle ends, and the cache capacity limit, respectively:

[0087] (3b)

[0088] (3c)

[0089] (3d)

[0090] In the formula, This represents the data center cache tasks at time t; This indicates the maximum cache capacity of the data center.

[0091] In the upper-layer data center model, formula (3e) indicates that latency-tolerant loads must be subject to constraints during the corresponding time period:

[0092] (3e)

[0093] In the formula, Indicates task The earliest start time; Indicates task The deadline for completion, This represents the collection of all such flexible workloads within a data center (DC).

[0094] In the upper-layer data center model The total energy consumption of the servers is shown in formula (3f), where PUE is the data center energy efficiency; formula (3g) defines the utilization rate of the server CPU. Calculation method; Formula (3h) is a constraint parameter that determines the minimum number of servers required to meet the load:

[0095] (3f)

[0096] (3g)

[0097] (3h)

[0098] In the formula, This indicates the total number of servers. express Total energy consumption of the servers; This indicates the peak power of the data center server; Indicates the idle power of data center servers; This indicates the utilization rate of the server's CPU; PUE stands for Data Center Energy Efficiency. Indicates the number of data center loads; This indicates the rated processing capacity of a single server; This indicates the maximum allowed utilization of the server.

[0099] In step S12, the three-state switching of the hydrogen electrolyzer and the hydrogen production power constraint include:

[0100] Constraints related to start-up, shutdown, or standby states in the upper-level hydrogen electrolyzer model. Formula This indicates that the electrolytic cell can only be in one of three states at any given time: powered on, powered off, or in standby. (Formula) This represents the constraint for identifying the start-up state of the electrolytic cell. (Formula) This indicates that the shutdown and standby states are mutually exclusive, and also prevents the use of the standby state to circumvent startup costs:

[0101] (4a)

[0102] (4b)

[0103] (4c)

[0104] In the formula, This represents the binary variable indicating when the electrolytic cell starts up at time t. The binary variable representing the shutdown of the electrolytic cell at time t; This represents the standby binary variable of the electrolytic cell at time t; This is an action variable representing the startup action, used to capture the instant when the device changes from being powered off to being powered on. This indicates that the program was not started at time t=1; This represents the binary variable indicating when the electrolytic cell starts up at time t. This represents the standby binary variable of the electrolytic cell at time t.

[0105] In the upper-level hydrogen electrolyzer model, when the electrolyzer is in operation, the power should be between the minimum operating power and the rated power, as specified in the formula. As shown; Formula Medium hydrogen energy storage , and Relationship with energy storage - Similarly, I will not go into details here.

[0106] (4d)

[0107] (4e)

[0108] In the formula, Indicates the maximum power of the electrolytic cell; Indicates the minimum power of the electrolytic cell; Indicates the idle power of the electrolytic cell; This represents the actual hydrogen load after optimized scheduling at time t; This represents the original predicted hydrogen load after optimized scheduling at time t; Indicates hydrogen storage capacity; This indicates the amount of hydrogen released.

[0109] In the upper-level hydrogen electrolyzer model, the hydrogen production rate and electricity consumption during electrochemical hydrogen production are non-linearly related. Therefore, the following formula needs to be introduced. - Linearization methods are used to fit its power curve. Formula This indicates that the hydrogen load is obtained by weighted summation of load samples from each segment and their respective weighting coefficients. Simultaneously, the electrolyzer's power consumption and hydrogen load use the same interpolation weights. (Formula) This describes the relationship between the weights and the activation variable in the initial, final, and middle segments. (Formula) This means that the sum of the weight coefficients of all segments must be 1, thus ensuring that the piecewise combination is a convex combination. Formula (4i) indicates that only one main segment is allowed to be activated at each time step, thereby achieving piecewise linearization control:

[0110]

[0111]

[0112]

[0113]

[0114] In the formula, Indicates the index of the segment point; This represents the set of all segmented sampling points. Let be the weighting coefficient, representing the th What percentage does each sampling point contribute at the current moment? Indicates the first The fixed hydrogen production corresponding to each sampling point; Indicates the first The fixed power consumption corresponding to each sampling point; This represents the interval activation variable, where 1 indicates the first interval. A segmented interval is "activated" if the current working point falls within that interval, and 0 indicates that it is not within that interval.

[0115] In step S12, the multi-energy load transferability and abandonment constraints include:

[0116] The upper-level energy hub then adjusts its dispatching strategy and pricing accordingly until a game equilibrium is reached between the upper and lower levels regarding energy supply and demand and profit distribution. (Formula) This indicates that the goal of lower-level users is to maximize their utility function and benefits. (Formula) The marginal utility gained by a user from consuming energy is approximated using a piecewise linear approach. (Formula) This indicates that the user load consists of rigid loads, transferable loads, and resilient loads that can be actively reduced. (Formula) It defines the scheduling boundaries for flexible resources on the demand side. (Formula) It is mandatory to keep the total energy consumption of transferable load constant throughout the entire scheduling cycle:

[0117]

[0118]

[0119]

[0120]

[0121]

[0122] In the formula, This represents the objective function of the lower-level users, namely, the utility function and profit maximization. The utility function representing multi-energy load; Represents the fundamental coefficients of the linearized utility function; The marginal utility slope coefficient represents the linearized utility function; Denotes the dual variable of formula (5b), Denotes the dual variable of formula (5c). Formula dual variables, Formula dual variables, Formula dual variables, Formula dual variables, Represents the dual variable of formula (5e); Indicates multi-energy load; Indicates transferable load; Indicates the abandonment of load; Indicates a fixed multi-energy load; Indicates the initial transferable load; Indicates the maximum transferable load; This indicates the maximum load that can be discarded.

[0123] In step S12, the charging / discharging and state of charge constraints of the electric vehicle include:

[0124] The lower-level electric vehicles (EVs), also acting as followers in this game, will optimize their costs by adjusting access times and charging / discharging power based on the real-time electricity prices published by the upper-level energy hub, while meeting user travel needs and power constraints, ultimately reaching a game-theoretic equilibrium with the upper level. (Formula) This indicates an intention to maximize the total arbitrage profit of the EV aggregator throughout the entire scheduling cycle. (Formula) - The formula limits the charging and discharging power of a single EV during grid-connected and off-grid periods. - This indicates the process and limitations of battery state of charge change during the grid-connected period of an EV. (Formula) - This indicates the required state of charge (SOC) of the EV during the initial arrival and departure periods. (Formula) EVs are restricted from participating in charging and discharging during non-grid-connected periods:

[0125]

[0126]

[0127]

[0128]

[0129]

[0130]

[0131]

[0132]

[0133]

[0134] In the formula, This represents the total arbitrage profit of the EV aggregator throughout the entire scheduling cycle, with the goal of maximizing this profit. This indicates the EH electricity sales price; Indicates the maximum charging capacity; Indicates the maximum discharge amount; Formula The dual variable; Formula The dual variable; Formula The dual variable; Formula The dual variable; Formula The dual variable; Formula The dual variable; The per-unit value representing the state of charge of EV at time t+1; The per-unit value represents the state of charge of EV at time t; Indicates the charging efficiency of the EV; Indicates the discharge efficiency of the EV; Indicates EV battery capacity; Represents the dual variable of formula (6e); Indicates the moment when the EV begins charging; Indicates the moment when the EV stops charging; Indicates the maximum state of charge; Minimum state of charge; Formula The dual variable; Formula The dual variable; This indicates the state of charge of the EV at the moment of its arrival. This indicates the state of charge at the moment the EV leaves; Represents the dual variable of formula (6g); The dual variable of formula (6h) is represented; Let represent the dual variable of formula (6i).

[0135] S13. Second-stage real-time tracking model construction: With the goal of minimizing real-time operating costs and risk loss costs, a real-time adjustment model is established to cope with RG uncertainty. The costs include standby adjustment costs and load abandonment compensation costs. Tail risk loss is quantified through CVaR.

[0136] Furthermore, the objective function in the second stage of step S13 aims to minimize the expected operating cost. and CVaR risk measurement Weighted average cost . formula Defined in uncertain scenarios Under this circumstance, the total real-time dispatch cost of EH includes dispatch adjustments, power trading, and related penalty costs. (Formula) - CVaR-related constraints are defined. Formula - This ensures that the final actual output of the DG must strictly remain within its capacity range. (Formula) This represents the power balance of EH in the real-time phase. (Formula) The regulations specify the permissible scope for purchasing and selling electricity in real-time phases.

[0137]

[0138]

[0139]

[0140]

[0141]

[0142]

[0143]

[0144]

[0145] In the formula, Indicates the risk coefficient; Indicates confidence level; Indicates the probability of scenario s occurring; Indicates that it is ready for use upwards; Indicates that the item is ready for use at the bottom. This represents the basic cost coefficient for adjusting the unit power of DG; This indicates the penalty cost for adjusting DG power; This indicates the penalty cost for adjusting system backup deviations; This represents the amount of electricity that EH purchases from the upstream power grid under scenario s; This represents the amount of electricity sold by EH to the upstream power grid under scenario s; As an auxiliary variable, it represents the value at risk; Indicates in the scene Loss deviation exceeding the risk value; This indicates the maximum power of the DG. Indicates the minimum power of the DG; Indicates uncertainty error; Indicates the maximum amount of electricity that can be purchased; This indicates the maximum electricity sales volume.

[0146] Further, the two-layer optimization model reconstruction in step S2 includes:

[0147] S21. Lower-level model reconstruction: Utilizing the convexity of the lower-level aggregator optimization model and the Slater condition, it is transformed into a constraint set containing the original variables, dual variables, optimality conditions, and complementary relaxation constraints through KKT conditions.

[0148] In step S12, since the lower-level model satisfies convexity and the Slater condition, this invention uses KKT conditions to reconstruct the lower-level model into a set of equivalent constraints, thereby embedding it into the upper-level model. The matrix form of the lower-level model can be expressed as:

[0149]

[0150] In the formula, For decision variables in lower-level optimization problems; For a matrix, It is its transpose matrix; is the coefficient matrix of the inequality constraints; is the vector of constant terms for the inequality constraints; These are the Lagrange multipliers corresponding to the inequality constraints; This is the coefficient matrix of the equality constraints; This is the vector of constant terms for the equality constraints; These are the Lagrange multipliers corresponding to the equality constraints.

[0151] In addition to satisfying the feasibility constraints of the original and dual variables, the KKT conditions must also include the following optimality conditions and complementary relaxation constraints:

[0152]

[0153]

[0154] In the formula, the Lagrange function There are 3 independent variables ; Representing the Lagrange function For the original decision variables The gradient of the Lagrange function, i.e., the gradient of the Lagrange function. Take the derivative and set it to 0; The coefficient matrix of the inequality constraint Transpose matrix; The coefficient matrix of the inequality constraint The transpose of the matrix;

[0155] S22. Linearization of complementary relaxation constraints: The complementary relaxation constraints are processed using SOS1 variables, which satisfy at most one non-zero constraint property.

[0156] Furthermore, in step S22, to handle the nonlinear complementary relaxation constraints in the KKT conditions, the SOS1 method, a special instruction set supported by modern optimization solvers, is adopted. This set requires that at most one variable is non-zero. Compared to the traditional Big-M method, SOS1 linearization does not rely on a manually set large constant parameter, thus avoiding the numerical instability or even infeasibility problems caused by improper selection of the M value in the traditional Big-M method, and exhibiting higher numerical stability. For example, consider formula (9b):

[0157]

[0158] In the formula, This represents the slack variable vector. They are a pair variable; This represents a special type of ordered set, in which at most one variable can have a non-zero value.

[0159] S23. Bilinear term processing: Based on strong duality theory, the bilinear terms in the upper objective function that are related to the lower response variables are transformed into linear form, thus completing the linearization and reconstruction of the model.

[0160] Furthermore, in step S23, since the upper-level objective function still contains bilinear terms related to the lower-level response variables, and considering the objective function of the lower-level multi-energy load users... (As shown in formula (5a)) and its dual variable Since they are equal, strong duality theory is introduced to handle the upper-level bilinear terms.

[0161]

[0162] Similarly, the bilinear term for EVs can be handled in a similar way. The objective function for the lower-level electric vehicle... Its dual variable They are equal. Therefore, the objective function of the first stage of EH is equal. Ultimately, it can be equivalent to the following linear function:

[0163]

[0164] Further, the construction of the min-max-min partial Bruker optimization model in step S3 includes:

[0165] S31. Experience distribution generation: Based on the historical prediction error data of RG output, generate S error scenarios and corresponding experience distributions. The probability of each scenario in the experience distribution is the ratio of the number of times the scenario occurs to the total number of scenarios.

[0166] S32. Huber Fuzzy Set Construction: A fuzzy set with Huber distance as the radius, wherein the fuzzy set uses a segmented penalty mechanism to apply a quadratic penalty for small deviations and a linear penalty for large deviations;

[0167] Furthermore, step S32 uses a fuzzy set with Huber distance as the radius to characterize the true distribution. With experience distribution The tolerable offset range between them. Formula A fuzzy set based on Huber loss was constructed, which constrains the true probability distribution. With experience distribution The total divergence between them is within a preset robust radius DHuber. (Formula) The Huber fuzzy set is defined to apply piecewise penalties to probability bias. For "normal" biases that deviate from the reference value slightly, a quadratic form is used to penalize them, making full use of the data information. For "abnormal" biases that deviate significantly, a linear form is used to penalize them, aiming to reduce the model's sensitivity to individual outliers and thus make the decision more robust.

[0168]

[0169]

[0170] In the formula, It is a constructed fuzzy set based on empirical distribution. Centered on the Huber divergence metric, all possible true distributions are defined. A set; Represents the candidate probability distribution In the context The probability of it; express 3D real space; Representing empirical probability in a scenario The probability of; Represents the Huber loss function; This represents the radius of the Huber sphere; This represents the threshold parameter of the Huber function.

[0171] S33. Three-layer model integration: Huber fuzzy set and CVaR risk measure are embedded into a two-layer optimization framework to form a min-max-min three-layer model.

[0172] Furthermore, the model constructed in step S33 can be simplified into the following matrix form:

[0173]

[0174] Where x is the decision variable for the first stage; , , These are the decision variables for the second stage. A, B, C, D, g, and h are constant matrix coefficients; They are respectively The transpose of D; This represents the confidence level, as shown in formula (7c). The meanings are the same; this is a simplified form.

[0175] This model is a complex three-layer min-max-min model that embeds CVaR and Huber fuzzy sets.

[0176] Furthermore, step S4, which employs a column and constraint generation algorithm, includes:

[0177] S41. Solving the main problem: Fix the worst uncertainty distribution obtained in each iteration, and solve the lower bound LB of the first-stage decision variables and objective function. The main problem includes the linearized constraint system and scenario constraints.

[0178] In step S41, whenever a subproblem returns a new set of worst-case probability distributions, the main problem MP constructs a new set of variables and constraints.

[0179]

[0180] In the formula, These are the decision variables for the second stage of the scenario during the k-th iteration; These are the predicted variables for the second-stage subproblem in the k-th iteration; η is the risk deviation variable in the second stage during the k-th iteration; η is the estimated value of the subproblem SP. This represents the total number of iterations; k represents the current iteration. This represents the worst probability distribution found in each iteration.

[0181] S42. Subproblem Solving: Based on the first-stage decision output of the main problem, find the worst uncertainty distribution and calculate the upper bound UB of the objective function. The subproblems are decoupled into parallel solutions and single-layer max models for step-by-step solutions, and piecewise linearization is applied to the nonlinear Huber fuzzy set.

[0182] The goal of the subproblem in step S42 is to find the worst probability distribution given the first-stage decision x*.

[0183]

[0184] The subproblems also have a two-layer structure that cannot be directly solved. These subproblems exhibit a special separation structure because... In the lower-level subproblem min model, it is a fixed scalar, while The value of does not affect the feasible region of the lower-level model, so the subproblem can be further decoupled into two independent steps for solving:

[0185] Parallel solution of the following s models to obtain

[0186]

[0187] In the formula, As an auxiliary variable, it represents the scenario. The minimum expected operating cost.

[0188] Will Substituting into the original SP model, we get the following: Model

[0189]

[0190] In the formula, Inequality constraints The dual variable.

[0191] Regarding the above For the lower-level min model of the model, Since it is a fixed scalar, the inner min model can be transformed into a max model through strong duality conditions, and then merged with the outermost max model into the following single-layer model.

[0192]

[0193] For nonlinear Huber fuzzy sets, the same formula can be used. - The linearization method. Ultimately, it is achieved by solving... The model can be used to obtain the upper bound UB of the original model.

[0194] Secondly, such as Figure 10 As shown, a two-layer optimization system based on an energy hub provided by the present invention includes:

[0195] The two-layer optimization model construction module constructs a master-slave game architecture for a two-layer optimization model. The upper-layer model takes the energy hub operator (EH) as the core decision-making entity, while the lower-layer model takes aggregators covering data centers, electrolyzers, electric vehicles, and multi-energy loads as the responding entities. The upper-layer model of the two-layer optimization model takes minimizing total operating costs as its optimization objective. The optimization objective includes a first-stage daytime scheduling decision aimed at economic efficiency and a second-stage real-time adjustment decision aimed at minimizing economic risk synergy. The constraints include the operating constraints of multi-energy conversion equipment and the operating constraints of the aggregators.

[0196] The two-level optimization model reconstruction module: by using the Caro-Kuhn-Tucker KKT conditions and strong duality theory, the optimization problem of the lower-level model is equivalently transformed into a set of linear constraints and embedded into the upper-level model. At the same time, the coupling terms in the optimization objective of the upper-level model are linearized, and the two-level optimization model is reconstructed into a single-level mixed integer linear programming model.

[0197] The min-max-min sub-Huber bar optimization model construction module generates an empirical distribution based on historical error data and constructs a fuzzy set with Huber distance as the radius to describe the fluctuation range of the true probability distribution; the fuzzy set is embedded into the single-layer mixed integer linear programming model, so that the real-time adjustment decision in the second stage is made under the worst probability distribution, forming a min-max-min sub-Huber bar optimization model under the architecture of first-stage day-ahead scheduling decision - worst-case distribution selection - second-stage real-time adjustment decision;

[0198] Algorithm solution module: The column and constraint generation algorithm is used to solve the min-max-min sub-Bruker optimization model. The scheduling scheme and target lower bound are generated by iteratively solving the main problem, and the sub-problems are solved to find the worst probability distribution and calculate the target upper bound until the upper and lower bounds converge. The optimal scheduling scheme of the energy hub in the day-ahead stage is output.

[0199] Depend on Figure 2 The core logic of the vertical two-layer architecture combined with horizontal uncertainty management connects the hardware structure of the energy hub with the optimization algorithm process. In the vertical two-layer architecture, the upper layer is the scheduling layer led by the energy hub operator (EH), integrating conventional equipment such as cogeneration (CHP) and condensing boilers (CB), as well as flexible loads such as data centers and electric hydrogen electrolyzers. It is responsible for obtaining energy from upstream power and gas systems, formulating day-ahead scheduling plans, and publishing multi-energy prices. The lower layer is the aggregation layer of diverse heterogeneous flexible resources, where multi-energy load aggregators and electric vehicle aggregators act as game followers, optimizing their energy consumption and charging / discharging strategies based on the price signals from the upper layer, forming a Stackelberg master-slave game interaction. The horizontal dimension embeds a distributed robust optimization system based on Huber fuzzy sets and CVaR. Through a two-stage framework of day-ahead scheduling in the first stage and real-time tracking in the second stage, it characterizes the uncertainty of renewable energy (RG) output. The framework also integrates the entire process logic of model building, two-layer reconstruction, uncertainty modeling, and customized C&CG algorithm solution, achieving a balance between the robustness of upper-layer scheduling and the economy of lower-layer resource utilization, providing clear logical support for multi-entity collaborative optimization.

[0200] Depend on Figure 3The results demonstrate EH's comprehensive optimization capabilities in multi-energy complementarity, price signal response, and flexible energy storage adjustment, showcasing optimized dispatching results over a 24-hour period. This dispatching strategy utilizes natural gas gas and furnaces to provide base power, supplemented by dynamically purchasing grid power as needed. During off-peak electricity price periods, the system prioritizes meeting load demand through electricity purchases and energy storage charging; during periods of high electricity prices and peak renewable energy output, energy storage begins discharging to reduce electricity purchases, while simultaneously utilizing purchased gas to drive gas-fired equipment to meet some heat demand.

[0201] Figure 4 shows the operating results of the upper-layer EH and the lower-layer multi-energy load under the master-slave game mechanism. Figure 4a1 and Figure 4a2 During periods of high electricity prices and relatively high incentive prices, such as t10-t14 and t17-t21, the electricity load is significantly reduced under the DR mechanism and is partially replenished during periods of low electricity prices, indicating the sensitivity of user-side load to price signals. Figure 4b1 , Figure 4b2 , Figure 4c1 and Figure 4c2 The results show that both heat and cooling loads exhibit significant price-responsive behavior, displaying peak-shaving and valley-filling characteristics under the guidance of incentive prices. The game theory results validate the effectiveness of the proposed two-layer interaction framework. By issuing differentiated multi-energy price signals, the Energy Management Center (EH) successfully guided downstream users' energy consumption behavior and reduced operating costs. Users' rational responses not only lowered their own energy costs but also helped the upper-level EH optimize its overall operation.

[0202] Figure 5 shows the optimization results of the EV cluster participating in the EH game. Figure 5a The heatmap shows that although individual EV travel behaviors exhibit heterogeneity, they generally follow similar scheduling patterns. For example, charging is concentrated during off-peak electricity prices (t1–t10), while discharging occurs during peak electricity prices (t11–t13 and t18–t20). This pattern is evident in… Figure 5b Further aggregation was achieved. For example, at time t12, the EV cluster discharged, resulting in a peak discharge power of 831.11 kW. The above results demonstrate that the proposed model not only enables EVs to profit but also effectively supports the economical operation of EH.

[0203] Figure 6 shows the data center optimization results. Figure 6a The distribution of DC workload and power changes before and after considering delay-tolerant loads were compared. Without affecting service quality, the DC system shifts some delay-tolerant loads to later time periods, thus effectively responding to peak-valley pricing and reducing EH operating costs. Figure 6bThe combined results for DC power, utilization, and buffer size are presented. DC utilization fluctuated between 0.25 and 0.9 over time, meeting DC operational requirements. Meanwhile, DC buffer size peaked at 3800 tasks during time period t13. This optimization approach, which decouples power consumption from the successful arrival of real-time tasks, highlights the significant potential of DC as a flexible resource for energy management (EH).

[0204] Figure 7 shows the optimization results of the electrolytic hydrogen production cell. Figure 7a and Figure 7b This indicates that after the electrolyzer is equipped with hydrogen storage, the hydrogen storage can store hydrogen during periods of low EH electricity purchase cost, such as t1-t5 and t14-t17, and release hydrogen during periods of high cost, such as t18-t23. Therefore, the hydrogen load is no longer rigid, thus improving the flexibility of the electrolyzer.

[0205] Depend on Figure 8 A comparison of three uncertainty-based methods reveals that the total operating cost of EH is compared under three methods: stochastic programming (SP), classic robust optimization (RO), and Huber distance-based directive optimization (DRO). SP has the lowest cost at 18,158 yuan, demonstrating good economic efficiency. However, its assumption that uncertainty follows an exact distribution leads to overly optimistic results. Conversely, robust optimization, focusing on the worst-case scenario, has the highest cost at 18,590 yuan. As the Huber distance radius increases from 0.005 to 0.025, the DRO cost rises, ranging from 18,383 to 18,499 yuan, reflecting the increased conservatism brought about by the expansion of the fuzzy set. In conclusion, Huber distance-based DRO achieves a balance between cost control and robustness, providing a robust and economical scheduling strategy for EH operation in uncertain environments.

[0206] Depend on Figure 9 The changes in the probability distribution of the worst-case scenario under different Huber distances are observed. As the Huber distance gradually increases from 0.005 (blue) to 0.02 (red), the model systematically reconstructs the probability distribution to find the most robust solution. Specifically, the model identifies scenario s4 as the most risky adverse scenario in the system and significantly amplifies its probability weight: the probability of s4 climbs from 0.184 at the time of prediction to 0.483 when the Huber distance is 0.02. The results indicate that as decision-makers increase their risk aversion, the model shifts more probability weights to critical scenarios, thereby ensuring that decisions can effectively withstand the worst-case scenario within this range of uncertainty.

[0207] Depend on Figure 11 It is understood that the present invention provides a two-layer optimized structure based on an energy hub, including a vertical two-layer architecture and a horizontal uncertainty control mechanism.

[0208] Furthermore, the vertical two-tier architecture consists of an upper conversion side and a lower demand side:

[0209] The upper-level conversion side is a unified scheduling system by the energy hub (EH), integrating conventional energy conversion and storage equipment such as cogeneration (CHP), furnaces, condensing boilers (CB), diesel generators (DG), heat recovery devices (RG), and energy storage systems (ES), as well as flexible loads such as data centers and electric hydrogen electrolyzers. The lower-level demand side is a multi-dimensional, heterogeneous, and flexible resource integration system, integrating DC systems, hydrogen electrolyzers, electric vehicles, and multi-energy loads (electric / heat / cooling). Through multi-energy load aggregators and electric vehicle aggregators acting as game followers, they optimize their energy consumption plans and charging / discharging strategies based on the energy prices released by the upper level, forming a master-slave game interaction with the upper-level Stackelberg system.

[0210] Furthermore, the aforementioned horizontal uncertainty management mechanism is a sub-Bluerro optimization system based on Huber fuzzy sets and conditional value at risk (CVaR). Through a two-stage dynamic demand response framework consisting of day-ahead scheduling in the first stage and real-time tracking in the second stage, it characterizes the uncertainty of renewable energy (RG) output and achieves a balance between the robustness of upper-level scheduling and the economic efficiency of lower-level resource utilization.

[0211]

[0212] Table 1 Comparison of tail risk coefficients

[0213] As shown in Table 1, when the tail risk coefficient The gradual increase from 0 to 1 signifies a stronger commitment from policymakers to mitigating tail risks. Although the total cost of Energy Utilization (EH) shows an upward trend, policymakers are enhancing EH's ability to cope with uncertainty by continuously increasing the system's overall reserve capacity to address potential tail risk losses from uncertainty.

[0214]

[0215] Table 2 Comparison of the model solving performance of the Big-M method and the SOS1 method.

[0216] As shown in Table 2, when using the traditional Big-M method, if the parameters are too small or not large enough, it may become infeasible or the lower-level main body may find a local optimum, demonstrating the difficulty in selecting parameters for the Big-M method. While the SOS1 method adopted in this paper has a relatively longer solution time, it avoids the difficulty of manually selecting parameters. Furthermore, the solution results are consistent with the Big-M method when selecting appropriate parameters such as 10000 and 100000, proving the effectiveness and portability of the SOS1 method.

[0217] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the appended claims.

[0218] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A two-layer optimization method based on energy hubs, characterized in that, include: S1. Construct a two-layer optimization model with a master-slave game architecture, wherein the upper-layer model takes the energy hub operator (EH) as the core decision-making entity, and the lower-layer model takes the aggregator covering data centers, electrolyzers, electric vehicles, and multi-energy loads as the response entity; the upper-layer model of the two-layer optimization model takes minimizing total operating cost as the optimization objective, and the optimization objective includes a first-stage daytime scheduling decision with economic efficiency as the objective and a second-stage real-time adjustment decision with the objective of minimizing economic risk synergy. The constraints include the operating constraints of multi-energy conversion equipment and the operating constraints of the aggregator; S2. By using the Caro-Kuhn-Tucker KKT conditions and strong duality theory, the optimization problem of the lower-level model is equivalently transformed into a set of linear constraints and embedded into the upper-level model. At the same time, the coupling terms in the optimization objective of the upper-level model are linearized, and the two-level optimization model is reconstructed into a single-level mixed integer linear programming model. S3. Generate an empirical distribution based on historical error data, and construct a fuzzy set with Huber distance as the radius to describe the fluctuation range of the true probability distribution; embed the fuzzy set into the single-layer mixed integer linear programming model, so that the real-time adjustment decision in the second stage is made under the worst probability distribution, forming a min-max-min partial Huber bar optimization model under the architecture of the first stage day-ahead scheduling decision-worst distribution selection-second stage real-time adjustment decision; S4. The column and constraint generation algorithm is used to solve the min-max-min sub-Bruker optimization model. The scheduling scheme and target lower bound are generated by iteratively solving the main problem, and the sub-problems are solved to find the worst probability distribution and calculate the target upper bound until the upper and lower bounds converge. The optimal scheduling scheme of the energy hub in the day-ahead stage is output.

2. The method according to claim 1, characterized in that, The construction of the upper-level model in step S1 includes: S11. Construction of the first-stage objective function: The first-stage objective function aims to minimize the EH electricity purchase and sale cost, gas purchase cost, electrolyzer start-up and shutdown cost, and interaction cost with lower-level aggregators. S12. Constraint System Construction: Construct EH internal equipment operation constraints and multi-heterogeneous flexible resource operation constraints. The internal equipment includes cogeneration (CHP), condensing boiler (CB), diesel generator (DG), and energy storage system (ES). The multi-heterogeneous flexible resource operation constraints include data center cache and server energy consumption constraints, hydrogen electrolyzer three-state switching and hydrogen production power constraints, multi-energy load transferability and abandonment constraints, and electric vehicle charging, discharging, and state of charge constraints. S13. Second-stage real-time tracking model construction: With the goal of minimizing real-time operating costs and risk loss costs, a real-time adjustment model is established to cope with RG uncertainty. The operating costs and risk loss costs include standby adjustment costs and load abandonment compensation costs. Tail risk loss is quantified through CVaR.

3. The method according to claim 1, characterized in that, The two-layer optimization model reconstruction in step S2 includes: S21. Lower-level model reconstruction: Utilizing the convexity of the lower-level aggregator optimization model and the Slater condition, it is transformed into a constraint set containing the original variables, dual variables, optimality conditions, and complementary relaxation constraints through KKT conditions. S22. Linearization of complementary relaxation constraints: The complementary relaxation constraints are processed using special ordered set type SOS1 variables, wherein the SOS1 variables satisfy at most one non-zero constraint property. S23. Bilinear term processing: Based on strong duality theory, the bilinear terms in the upper objective function that are related to the lower response variables are transformed into linear form, thus completing the linearization and reconstruction of the model.

4. The method according to claim 1, characterized in that, The construction of the min-max-min sub-Bruker optimization model in step S3 includes: S31. Experience distribution generation: Based on the historical prediction error data of RG output, generate S error scenarios and corresponding experience distributions. The probability of each scenario in the experience distribution is the ratio of the number of times the scenario occurs to the total number of scenarios. S32. Huber Fuzzy Set Construction: A fuzzy set with Huber distance as the radius, wherein the fuzzy set uses a segmented penalty mechanism to apply a quadratic penalty for small deviations and a linear penalty for large deviations; S33. Three-layer model integration: Huber fuzzy set and CVaR risk measure are embedded into a two-layer optimization framework to form a min-max-min three-layer model.

5. The method according to claim 1, characterized in that, Step S4 uses a column and constraint generation algorithm to solve the problem, including: S41. Solving the main problem: Fix the worst uncertainty distribution obtained in each iteration, and solve the lower bound LB of the first-stage decision variables and objective function. The main problem includes the linearized constraint system and scenario constraints. S42. Subproblem Solving: Based on the first-stage decision output of the main problem, find the worst uncertainty distribution and calculate the upper bound UB of the objective function. The subproblems are decoupled into parallel solutions and single-layer max models for step-by-step solutions, and piecewise linearization is applied to the nonlinear Huber fuzzy set.

6. A two-layer optimization system based on an energy hub, characterized in that, include: The two-layer optimization model construction module constructs a master-slave game architecture for a two-layer optimization model. The upper-layer model takes the energy hub operator (EH) as the core decision-making entity, while the lower-layer model takes aggregators covering data centers, electrolyzers, electric vehicles, and multi-energy loads as the responding entities. The upper-layer model of the two-layer optimization model takes minimizing total operating costs as its optimization objective. The optimization objective includes a first-stage daytime scheduling decision aimed at economic efficiency and a second-stage real-time adjustment decision aimed at minimizing economic risk synergy. The constraints include the operating constraints of multi-energy conversion equipment and the operating constraints of the aggregators. The two-level optimization model reconstruction module: by using the Caro-Kuhn-Tucker KKT conditions and strong duality theory, the optimization problem of the lower-level model is equivalently transformed into a set of linear constraints and embedded into the upper-level model. At the same time, the coupling terms in the optimization objective of the upper-level model are linearized, and the two-level optimization model is reconstructed into a single-level mixed integer linear programming model. The min-max-min sub-Huber bar optimization model construction module generates an empirical distribution based on historical error data and constructs a fuzzy set with Huber distance as the radius to describe the fluctuation range of the true probability distribution; the fuzzy set is embedded into the single-layer mixed integer linear programming model, so that the real-time adjustment decision in the second stage is made under the worst probability distribution, forming a min-max-min sub-Huber bar optimization model under the architecture of first-stage day-ahead scheduling decision - worst-case distribution selection - second-stage real-time adjustment decision; Algorithm solution module: The column and constraint generation algorithm is used to solve the min-max-min sub-Bruker optimization model. The scheduling scheme and target lower bound are generated by iteratively solving the main problem, and the sub-problems are solved to find the worst probability distribution and calculate the target upper bound until the upper and lower bounds converge. The optimal scheduling scheme of the energy hub in the day-ahead stage is output.