Multi-energy micro-grid real-time regulation and control method fusing topology perception and meta-learning self-adaption

By using graph neural networks and meta-enhanced distillation technology, a topology-aware model of multi-energy microgrids is constructed, which solves the problems of high computational complexity and poor cross-scenario adaptability in multi-energy microgrids, and realizes efficient multi-energy flow coordinated regulation and low-carbon optimization.

CN121809593APending Publication Date: 2026-04-07CHONGQING NORMAL UNIVERSITY
View PDF 0 Cites 1 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-25
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively handle the uncertain output of renewable energy in multi-energy microgrids, neglect system physical topology and security constraints, suffer from high computational complexity, lack cross-scenario adaptive capabilities, and are difficult to achieve multi-objective optimization that balances economics and environmental protection.

Method used

A topology-aware teacher model is constructed using graph neural networks. Combined with meta-reinforcement distillation technology, a dedicated temporal feature extraction module is designed. Through a multi-teacher collaborative training framework, the lightweight student model can be quickly adapted to the new microgrid scenario, realizing multi-energy flow collaborative regulation.

Benefits of technology

It significantly improves the model's ability to understand the physical structure of the system, enhances the accuracy of multi-timescale collaborative prediction, reduces computational complexity, strengthens cross-scenario generalization ability, and achieves multi-objective collaborative optimization of economy and environmental protection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121809593A_ABST
    Figure CN121809593A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-energy micro-grid real-time regulation and control method fusing topology perception and meta-learning self-adaption, and the method comprises the steps: inputting electric-heat-gas multi-source heterogeneous data obtained in real time into a pre-trained lightweight student model, and generating a prediction multi-energy flow cooperative regulation and control strategy. When the model is trained, firstly, a corresponding multi-energy micro-grid graph structure is constructed based on the network topology of the multi-energy micro-grid, multi-source heterogeneous data used as training data is combined and input to a teacher model constructed based on a graph neural network, and a corresponding predictive multi-energy flow cooperative regulation strategy is output; calculating a loss function based on the strategy and a corresponding optimal multi-energy-flow cooperative control strategy, and optimizing network parameters of the teacher model; and finally, migrating the knowledge of the trained multi-teacher network to the lightweight student model through a method of combining knowledge distillation, meta learning and reinforcement learning to obtain a trained lightweight student model. According to the invention, the problems of multi-target optimization, real-time regulation and control and cross-scene adaptation of the multi-energy micro-grid are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent multi-energy microgrid control technology, specifically to a real-time control method for multi-energy microgrids that integrates topology sensing and meta-learning adaptive control. Background Technology

[0002] With the increasing severity of global climate change and environmental pollution, the low-carbon transformation and sustainable development of energy systems have become a global consensus. Integrated Energy Systems (IES), especially Multi-Energy Microgrids (MEMGs), as an innovative energy management model, provide a powerful framework for achieving energy efficiency and promoting the consumption of renewable energy by coordinating the production, transmission, distribution, and consumption of various energy forms such as electricity, heat, and gas. Early research focused on optimizing the economic operation of the system through methods such as linear programming or mixed integer programming, but often neglected the volatility of renewable energy output and environmental factors. As the penetration rate of renewable energy increases, effectively absorbing its uncertain output has become a key challenge. At the same time, environmental benefits are gradually being incorporated into optimization objectives, driving research to evolve from single economic optimization to multi-objective optimization.

[0003] However, existing research methods still have significant limitations when facing the inherent complexity of MEMGs. Traditional methods such as Model Predictive Control (MPC), while based on physical models and robust, have high computational complexity when dealing with large-scale, multi-timescale systems, making it difficult to meet real-time control requirements. Data-driven methods such as Deep Reinforcement Learning (DRL), while adaptable to dynamic environments, generally lack explicit consideration of the system's physical topology and security constraints, resulting in poor generalization ability of their decisions in new scenarios and potential risks of physical infeasibility. At the modeling level, energy flows such as electricity, heat, and gas in multi-energy microgrids have distinctly different temporal dynamic characteristics (e.g., high frequency, inertia, low frequency), but most existing studies use generalized time-series models, failing to accurately capture these heterogeneous features and limiting model accuracy.

[0004] Furthermore, although Graph Neural Networks (GNNs) have been successfully applied to sensing energy network topologies, and advanced sequence models such as Temporal Convolutional Networks (TCNs) and Mamba have demonstrated advantages in time-series data processing, these high-performance models are typically computationally intensive and unsuitable for resource-constrained edge deployment scenarios. While knowledge distillation (KD) technology can serve as an effective means of model compression, existing methods lack mechanisms to enable lightweight student networks to quickly adapt to new microgrid operating scenarios. Finally, most studies do not adequately focus on and integrate full life-cycle carbon footprint modeling and multi-pollutant synergistic control, making it difficult to achieve deep synergistic optimization of economic efficiency and environmental friendliness.

[0005] Therefore, existing technologies urgently need a comprehensive technical framework that can unify and integrate topology-aware modeling, dedicated temporal dynamic capture, lightweight real-time inference, rapid cross-scene adaptation, and economic-environmental multi-objective collaborative optimization to solve the above problems. Summary of the Invention

[0006] To address the shortcomings of the existing technologies, this invention provides a real-time control method for multi-energy microgrids that integrates topology sensing and meta-learning adaptive control. By constructing a multi-energy microgrid collaborative optimization framework based on graph neural networks and meta-reinforcement distillation, it solves the problems of multi-objective optimization, efficient real-time control, and rapid cross-scenario adaptation of multi-energy microgrids under complex and uncertain environments.

[0007] To solve the above-mentioned technical problems, the present invention adopts the following technical solution:

[0008] A real-time control method for multi-energy microgrids integrating topology sensing and meta-learning adaptive control includes the following steps:

[0009] S1. Real-time acquisition of multi-source heterogeneous data from multi-energy microgrids;

[0010] S2. Input multi-source heterogeneous data into a pre-trained lightweight student model to generate a predictive multi-energy flow coordinated control strategy, thereby realizing the coordinated control of electric-thermal-gas multi-energy flows in the multi-energy microgrid.

[0011] The steps involved in training a lightweight student model include:

[0012] S201. Construct the corresponding multi-energy microgrid graph structure based on the network topology of the multi-energy microgrid;

[0013] S202. Input the multi-source heterogeneous data and multi-energy micro-network graph structure used as training data into the teacher model built based on graph neural network, and output the corresponding predicted multi-energy flow collaborative regulation strategy.

[0014] S203. Calculate the loss function based on the predicted multi-energy flow coordinated regulation strategy and the corresponding optimal multi-energy flow coordinated regulation strategy, and optimize the network parameters of the teacher model;

[0015] S204. Repeat steps S202 to S203 to iteratively train the teacher model until the model converges or reaches the maximum number of iterations.

[0016] S205. The knowledge of the trained multi-teacher network is transferred to the lightweight student model by combining knowledge distillation, meta-learning and reinforcement learning to obtain the trained lightweight student model.

[0017] As a preferred embodiment, in step S201, the graph structure constructed based on the network topology of the multi-energy microgrid is as follows: , where V represents the set of nodes, E represents the set of edges, and A represents the weighted adjacency matrix.

[0018] As a preferred embodiment, step S202 includes the following processing steps for the teacher model:

[0019] S2021. Decompose the input multi-source heterogeneous data into power data, heat data, and gas data;

[0020] S2022. Input the power data into the power teacher network, extract the power features of the power data through the time encoder, and input the power features together with the multi-energy microgrid graph structure into the GNN for propagation to obtain the power output features.

[0021] S2023. Input thermal data into the power teacher network, extract thermal features of thermal data through a time encoder, and input thermal features together with the multi-energy microgrid graph structure into the GNN for propagation to obtain thermal output features.

[0022] S2024. Input the gas data into the power teacher network, extract the gas features of the gas data through the time encoder, and input the gas features together with the multi-energy micro-network graph structure into the GNN for propagation to obtain the gas output features.

[0023] S2025. The characteristics of power output, heat output and gas output are weighted and fused to generate a predictive multi-energy flow coordinated control strategy output by the teacher model.

[0024] As a preferred embodiment, in step S2022, the time encoder of the power teacher network uses a time convolutional network to perform dynamic time-series feature extraction on the power data, as shown below:

[0025] ;

[0026] In the formula, For the extracted power time series features; For temporal convolutional networks; The input power data tensor; These are the kernel weights; The kernel size; For causal convolution operations;

[0027] In step S2023, the time encoder of the thermal teacher network uses a bidirectional Mamba model to extract dynamic time-series features from the thermal data, as shown below:

[0028] ;

[0029] In the formula, For the extracted thermodynamic time series features; and These are the forward and backward Mamba models, respectively. For the input thermal data tensor; This involves concatenating positive and negative features.

[0030] In step S2023, the time-series encoder of the gas teacher network performs dynamic time-series feature extraction on the gas data using a Transformer encoder with a multi-head attention mechanism, as shown below:

[0031] ;

[0032] In the formula, These are query, key, and value matrices, generated from gas data through linear transformation. The dimension of the key vector; This is the normalization function.

[0033] As a preferred embodiment, in step S2025, the power output characteristics, heat output characteristics, and gas output characteristics are weighted and fused using a channel attention mechanism, as shown below:

[0034] ;

[0035] ;

[0036] In the formula, This represents the fused features. For energy Attention weights for output features; It is a 1×1 convolution; Energy extracted from the teacher network The output characteristics; Index for energy type; These are electricity, heat, and gas, respectively. and All are learnable weight matrices; To traverse the output characteristics of all energy sources.

[0037] As a preferred embodiment, in step S203, the formula for calculating the loss function is expressed as follows:

[0038] ;

[0039] In the formula, For the multi-task loss function of the teacher model; The main task loss function; The physical constraint loss function;

[0040] The loss of the main task is:

[0041] ;

[0042] In the formula, To predict multi-energy flow coordinated regulation strategies, The optimal multi-energy flow coordinated control strategy; L2 norm

[0043] The physical constraint loss is:

[0044] ;

[0045] ;

[0046] ;

[0047]

[0048] In the formula, These are the weighting coefficients for the losses of each constraint; For energy storage constraint losses; and These are the minimum and maximum values ​​of the energy storage state, respectively; For ReLU functions; This is due to power balance constraint losses; For nodes The power generation capacity; For nodes The load power; For transmission loss; Losses due to carbon emission constraints; This represents the total carbon emissions of the system. For carbon quota allocation.

[0049] As a preferred option, step S205, which involves transferring the knowledge of the trained multi-teacher network to the lightweight student model using a combination of knowledge distillation, meta-learning, and reinforcement learning, includes the following steps:

[0050] S2051, Knowledge Distillation Stage: Fix the trained teacher network parameters, iteratively optimize the network parameters of the lightweight student model through the knowledge distillation loss function, and execute S2052 when the lightweight student model converges or reaches the maximum number of iterations.

[0051] S2052, Meta-learning stage: Through the inner and outer loop optimization mechanism of the model-independent meta-learning algorithm, the student network is fine-tuned based on a small sample dataset from the new micro-network scenario, and the network parameters of the lightweight student model are iteratively optimized through the comprehensive loss function until the lightweight student model converges or reaches the maximum number of iterations, and the trained lightweight student model is obtained.

[0052] During each training iteration in the meta-learning phase, the trained reinforcement learning agent outputs an action based on the current training state, and performs the next training iteration based on that action. The action output by the reinforcement learning agent defines the optimal weight combination of each loss in the comprehensive loss function and the adjustment factor of the learning rate for the next training iteration.

[0053] As a preferred embodiment, in step S2051, the formula for the knowledge distillation loss function is expressed as follows:

[0054] ;

[0055] In the formula, Characteristic distillation loss; and The teacher and student models are respectively Features of the layer; For adapter functions; For hierarchical weights; It is the Frobenius norm.

[0056] As a preferred option, in step S2052, the inner and outer loop optimization mechanism of the model-independent meta-learning algorithm is specifically as follows: through a two-layer optimization framework of inner loop task fine-tuning and outer loop parameter optimization, combined with feature adaptive transformation, the lightweight student model can achieve scenario adaptation based on few-sample technology.

[0057] The specific processing procedure is as follows:

[0058] ;

[0059] ;

[0060] ;

[0061] ;

[0062] In the formula, For specific microgrid tasks The parameters after fine-tuning; These are the initial parameters for the student model; The learning rate for the inner loop; For specific losses related to the mission; For parameters The gradient; For parameters Student model; For microgrid tasks Support set; For task distribution; For microgrid tasks Query set; The features are the features after adaptive transformation; Features extracted for the teacher model; For transformation parameters; The weight matrix for the feature adaptive transformation; For global average pooling; It is a multilayer perceptron;

[0063] The formula for the comprehensive loss function is expressed as follows:

[0064] ;

[0065] In the formula, This is the overall loss function for the student model.

[0066] As a preferred embodiment, in step S2052, the reinforcement learning agent includes a state space consisting of the distillation training state and the system operating state, an action space for adjusting the loss weight and learning rate, and a reward function that includes the comprehensive operating cost, system risk, and carbon emission cost.

[0067] The state space of the reinforcement learning agent is as follows:

[0068] ;

[0069] In the formula, For state space; Forecast loss; This is the initial predicted loss; This is the ratio of the energy storage state to the critical value; This is the ratio of carbon emissions to allowances;

[0070] The action space of the reinforcement learning agent is:

[0071] ;

[0072] In the formula, For action space; The learning rate;

[0073] The reward function of the reinforcement learning agent is:

[0074] ;

[0075] In the formula, For the reward function; For systemic risk; These are the weighting coefficients for each cost item.

[0076] Compared with the prior art, the present invention has the following technical effects:

[0077] 1. This invention uses graph neural networks (GNNs) to construct a topology-aware teacher model, explicitly modeling the physical connections and energy interactions of multiple energy flows (electricity, heat, and gas) in the microgrid. It effectively captures the spatial dependencies and energy transmission constraints between nodes, enhancing the model's understanding of the system's physical structure. Combined with a multi-teacher collaborative training framework, this model can comprehensively learn and integrate the complex operational knowledge of multi-energy microgrids, providing a high-quality source for knowledge distillation of student networks and avoiding constraint violations or suboptimal scheduling problems caused by neglecting network structure in traditional black-box models.

[0078] 2. This invention addresses the heterogeneous characteristics of multiple energy flows across time scales by designing dedicated temporal feature extraction modules for electricity, heat, and gas data. It employs a Temporal Convolutional Network (TCN) to capture the high-frequency rapid fluctuations of electricity, a bidirectional Mamba model to model the mid-frequency inertial dynamics of heat, and a Transformer encoder to extract the low-frequency steady-state trends of gas. This differentiated temporal modeling strategy significantly improves the model's accuracy in representing the dynamic characteristics of each energy source, thereby achieving more precise multi-timescale collaborative prediction and control. Simultaneously, through multi-teacher collaborative training and an adaptive feature fusion mechanism, it integrates professional feature representations of different energy types and utilizes channel attention dynamic weighted fusion of multi-source information, enhancing the model's perceptual capabilities and achieving deep coupling and collaborative optimization of the electricity-heat-gas multi-energy flows at the feature level.

[0079] 3. This invention introduces a meta-reinforcement distillation mechanism to transfer knowledge from a complex teacher model to a lightweight student network, significantly reducing the model's computational complexity and inference time, thus meeting the requirements of edge devices and real-time control. Furthermore, integrating Model-Independent Meta-Learning (MAML) enables the student network to quickly adapt to new micro-network scenarios with only a small number of samples, significantly improving the model's cross-scenario generalization ability and overcoming the limitations of traditional data-driven methods that perform poorly in new environments. Simultaneously, by dynamically optimizing the loss weights and learning rate during the distillation process through a reinforcement learning agent, it achieves automatic balancing of prediction accuracy, physical constraint satisfaction, and multi-objective (economic, risk, environmental) optimization needs during training, avoiding the tediousness and subjectivity of manual parameter tuning, and enabling the model to adaptively approximate the comprehensive optimal control strategy.

[0080] 4. This invention also constructs a comprehensive life-cycle carbon footprint optimization model, which not only refines the calculation of direct and indirect emissions but also incorporates carbon trading mechanisms and carbon flow tracking, achieving precise quantification and optimization of the low-carbon and environmental protection goals of multi-energy microgrids. This enables the system to effectively assume its environmental responsibility while pursuing economic benefits. Attached Figure Description

[0081] To make the objectives, technical solutions, and advantages of the invention clearer, the invention will now be described in further detail with reference to the accompanying drawings, wherein:

[0082] Figure 1 This is a flowchart of the real-time control method for multi-energy microgrids that integrates topology sensing and meta-learning adaptive control disclosed in this invention.

[0083] Figure 2 This is a diagram of the layered distributed architecture of an embodiment of the present invention;

[0084] Figure 3 This is a diagram illustrating the multi-teacher collaborative training framework of an embodiment of the present invention.

[0085] Figure 4 This is a schematic diagram of the meta-enhanced distillation framework of an embodiment of the present invention;

[0086] Figure 5 This is a convergence curve of the teacher model training in an embodiment of the present invention;

[0087] Figure 6 This is a graph showing the variation in the similarity of distillation process features in an embodiment of the present invention.

[0088] Figure 7 This is a diagram illustrating the impact of weightlessness combinations on the performance of multi-energy microgrids according to an embodiment of the present invention.

[0089] Figure 8 This is a diagram showing the comprehensive analysis results of the impact of weightlessness on the performance of multi-energy microgrids according to an embodiment of the present invention;

[0090] Figure 9 This is a comparative evaluation chart of the carbon emission reduction effects of different methods in the embodiments of the present invention;

[0091] Figure 10 This is a time-by-time carbon emission reduction performance analysis diagram of the GNN-MetaRL model in an embodiment of the present invention;

[0092] Figure 11 This is a diagram illustrating the synergistic relationship between renewable energy utilization and carbon emissions in an embodiment of the present invention.

[0093] Figure 12 This diagram illustrates the dual advantages of GNN-MetaRL in terms of economic cost and decision-making efficiency in this embodiment of the invention. Detailed Implementation

[0094] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of 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, not all, of the embodiments of the present invention. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but only to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.

[0095] The present invention will now be described in further detail with reference to the accompanying drawings.

[0096] To address the core challenges of multi-energy microgrid (MEMG) collaborative optimization, including high-dimensional uncertainty, complex coupling of multiple energy flows, strong physical constraints, and the need for real-time control, existing methods generally suffer from high computational complexity, weak cross-scenario generalization ability, and difficulty in balancing economic and low-carbon goals. While traditional model predictive control (MPC) can handle constraints, its heavy computational burden makes it unsuitable for high-frequency real-time decision-making. Data-driven deep reinforcement learning (DRL) methods, although possessing dynamic decision-making capabilities, often neglect the system's physical topology and constraints, and exhibit instability in new scenarios. Furthermore, most studies focus only on a single energy source or a single objective, lacking systematic modeling of multi-energy flow coordination (electricity, heat, gas), life-cycle carbon footprint, and multi-pollutant control, resulting in optimization strategies that are often inefficient and lack adaptability in practical engineering.

[0097] To address the aforementioned problems, this invention proposes a real-time control method for multi-energy microgrids that integrates topology-awareness and meta-learning adaptive control. This method is based on a multi-energy microgrid collaborative control optimization framework (GNN-MetaRL) using graph neural networks and a meta-reinforcement distillation architecture. It integrates topology-aware modeling, heterogeneous temporal feature extraction, knowledge distillation, meta-learning, and reinforcement learning techniques to construct a two-layer "teacher-student" optimization architecture. First, the method uses graph neural networks to explicitly characterize the physical connections and energy flow relationships of the microgrid, and designs a dedicated temporal encoder for the dynamic characteristics of electrical, thermal, and gas data to construct a high-precision teacher model. Then, through a meta-reinforcement distillation mechanism, the teacher's knowledge is transferred to a lightweight student network, enabling it to maintain high computational efficiency while possessing rapid cross-scenario adaptive capabilities and multi-objective collaborative optimization performance.

[0098] Specifically, the present invention proposes a real-time control method for multi-energy microgrids that integrates topology sensing and meta-learning adaptive control, such as... Figure 1 As shown, it includes:

[0099] S1. Real-time acquisition of multi-source heterogeneous data from multi-energy microgrids;

[0100] S2. Input multi-source heterogeneous data into a pre-trained lightweight student model to generate a predictive multi-energy flow coordinated control strategy, thereby realizing the coordinated control of electric-thermal-gas multi-energy flows in the multi-energy microgrid.

[0101] The steps involved in training a lightweight student model include:

[0102] S201. Construct the corresponding multi-energy microgrid graph structure based on the network topology of the multi-energy microgrid;

[0103] S202. Input the multi-source heterogeneous data and multi-energy micro-network graph structure used as training data into the teacher model built based on graph neural network, and output the corresponding predicted multi-energy flow collaborative regulation strategy.

[0104] S203. Calculate the loss function based on the predicted multi-energy flow coordinated regulation strategy and the corresponding optimal multi-energy flow coordinated regulation strategy, and optimize the network parameters of the teacher model;

[0105] S204. Repeat steps S202 to S203 to iteratively train the teacher model until the model converges or reaches the maximum number of iterations.

[0106] S205. The knowledge of the trained multi-teacher network is transferred to the lightweight student model by combining knowledge distillation, meta-learning and reinforcement learning to obtain the trained lightweight student model.

[0107] Specifically, to effectively manage the complex coupling, multi-timescale dynamics, and uncertainties of multiple energy flows in multi-energy microgrids, this invention designs a hierarchical distributed control architecture, such as... Figure 2 As shown, this architecture, through modular design, decomposes complex control tasks into four collaborative core layers, ensuring the robustness and efficiency of the system in high-dimensional data processing and real-time decision-making.

[0108] ① Data Sensing Layer: As the sensing end of the system, this layer collects multi-source heterogeneous data such as electricity, heat, and gas in real time through smart meters, phasor measurement units (PMUs), and IoT sensors deployed throughout the microgrid. This data is then integrated into a single multi-source heterogeneous data set.

[0109] ;

[0110] In the formula, Indicates the number of time points. Indicates the number of microgrid nodes. Represents characteristic dimensions (such as voltage, current, temperature, flow rate, etc.). For multi-source heterogeneous data, For power data; For thermal data; This layer provides gas data. Through high-precision sensors and edge computing devices, it ensures the real-time nature, accuracy, and completeness of the data, providing high-quality input for subsequent analysis. The data perception layer also needs to address practical issues such as sensor noise and communication latency, improving data quality through data cleaning and preprocessing techniques.

[0111] ② Knowledge Extraction Layer: This layer is the central hub for transforming data into knowledge. Based on multi-source data collected from the perception layer, machine learning and statistical analysis methods are used to uncover the implicit physical and economic laws within the data, such as dynamic price elasticity and the correlation between load and renewable energy output. These laws are quantified and constructed into a knowledge set.

[0112] ;

[0113] In the formula, For knowledge set, For knowledge extraction functions, This layer extracts the model's parameter set, including feature extraction algorithms and statistical model parameters. Through machine learning and statistical analysis methods, it uncovers potential patterns and correlations in the data, such as price elasticity and load correlation, providing a theoretical basis for optimization decisions.

[0114] ③ Collaborative Optimization Layer: This layer is the "decision-making brain" of the system. Its core is to adopt a teacher network based on GNN and a meta-reinforcement distillation framework, combined with the topology of the micronetwork. and knowledge To achieve coordinated optimization of multiple energy flows:

[0115] ;

[0116] In the formula, For the teacher model, This is a graph neural network.

[0117] ④ Decision Execution Layer: This layer is responsible for translating the optimization strategy into executable physical instructions. Considering real-time requirements, this layer employs a lightweight "student" network that learns from the teacher network using knowledge distillation techniques. The optimal control instructions are generated through this lightweight student network. To minimize the system's comprehensive objective function :

[0118] ;

[0119] Under the guidance of the teacher network, the student network performs knowledge distillation, balancing computational efficiency and control precision, making it suitable for rapid decision-making in real-time scenarios. The decision execution layer also needs to consider the physical constraints and response time of the devices to ensure the executability of instructions.

[0120] The key implementation steps of the real-time control method for multi-energy microgrids that integrates topology sensing and meta-learning adaptation are explained in detail below.

[0121] 1. Knowledge extraction and objective function construction

[0122] 1.1 Dynamic Price Elasticity Matrix

[0123] Price elasticity modeling is a core component of multi-energy microgrid system optimization. By analyzing the impact of energy price changes on demand, it reveals the interaction patterns among multiple energy sources, providing a basis for demand-side management and economic optimization.

[0124] Price elasticity is key to connecting the energy market with user behavior. This embodiment constructs a dynamic elasticity matrix. To quantify the response of demand to price changes. Elasticity coefficient. Defined as:

[0125] ;

[0126] in, All are energy types (electricity, heat, gas); For energy Demand; For energy The price.

[0127] Self-elastic Cross-elasticity reflects the direct impact of a single energy source's price on its own demand; it is typically negative, indicating that a price increase leads to a decrease in demand. This reflects the interaction between different energy prices; for example, a rise in heat prices may lead to an increase in electricity demand (e.g., increased use of heat pumps). The elasticity matrix is ​​represented as:

[0128] .

[0129] 1.2 Improved Affine Uncertainty Model

[0130] Multi-energy microgrid systems face multiple uncertainties, including renewable energy output (such as wind power and solar power) and load demand. This embodiment quantifies the uncertainties in system operation by improving the affine model and uncertainty propagation analysis, providing support for robust optimization.

[0131] To capture the strong correlation between renewable energy output and load demand, an improved affine model is constructed, taking into account the strong correlation between wind and solar power output and load demand:

[0132] ;

[0133] in, and These are random variables representing wind and solar power output and load demand, respectively. and Its mean, The Cholesky decomposition matrix satisfies:

[0134] ;

[0135] in, and These are the variances of output and load, respectively. The correlation coefficient is used in this model. It effectively captures the dynamic relationship between wind and solar power output and load, such as the negative correlation between wind speed and electrical load, thus improving the accuracy of uncertainty modeling.

[0136] 1.3 Life Cycle Carbon Footprint Model

[0137] In response to the goal of low-carbon development, this embodiment constructs a carbon footprint optimization model, which combines carbon emission calculation and carbon trading mechanism to optimize the environmental benefits of microgrid systems while balancing economic efficiency and sustainability.

[0138] (1) Carbon emission calculation

[0139] ① Direct emissions. Energy production derived from fossil fuels, such as natural gas power generation and coal-fired power generation:

[0140] ;

[0141] In the formula, For direct emissions; For the first Output power of fossil fuel power generation equipment; For the first Carbon emission intensity of energy sources;

[0142] ② Indirect emissions. These originate from electricity purchased from the external power grid, and the time-varying carbon emission factor of the power grid must be considered.

[0143] ;

[0144] In the formula, Indirect emissions; Electricity purchased from an external power grid; The time-varying carbon emission factor of the power grid;

[0145] (2) Carbon trading mechanism

[0146] ① Carbon quota allocation. Carbon emission quotas are allocated based on maximum load to encourage efficient energy use:

[0147] ;

[0148] In the formula, Carbon quota allocation; This is the quota allocation coefficient, which is usually determined by policy or market mechanisms; For the first The load power of each node;

[0149] ② Carbon cost function. Calculate the cost of excess emissions to incentivize low-carbon operations:

[0150] ;

[0151] ;

[0152] In the formula, For carbon trading prices; This represents the total carbon emissions of the system.

[0153] (3) Carbon flow tracking

[0154] A proportional sharing model is used to track the carbon emission intensity of nodes and quantify the carbon emission responsibility of each node:

[0155] ;

[0156] In the formula, Let be the carbon emission intensity of node i; Let be the power flowing from upstream node j to node i;

[0157] This model allocates carbon emission responsibility according to the proportion of energy flow, is applicable to multi-energy flow coupling scenarios, and can accurately track carbon flow paths in complex networks.

[0158] Based on the above knowledge, a comprehensive objective function is constructed with the goal of synergistically minimizing operating costs and total life-cycle carbon costs:

[0159] ;

[0160] In the formula, The overall objective function; Operating costs; This is the carbon cost weighting coefficient.

[0161] Simultaneously, the physical constraints for system operation are defined, mainly including energy storage system operation constraints and power balance constraints:

[0162] The operating constraints of the energy storage system are defined based on the energy storage dynamic model and are expressed as follows:

[0163] ;

[0164] In the formula, The energy stored by the energy storage system at the next time point t+1; Let be the energy stored in the energy storage system at time t; and These are the charging and discharging efficiencies, respectively. and These are the charging and discharging efficiencies, respectively. For time step;

[0165] At the same time, strict physical constraints were imposed to ensure that the energy storage system operates within a safe range and to avoid simultaneous charging and discharging. These constraints include:

[0166] ;

[0167] In the formula, This represents the maximum charging efficiency. This represents the maximum discharge efficiency. and These represent the minimum and maximum values ​​of the energy storage state, respectively.

[0168] The power balance constraint is defined based on the energy hub model and is expressed as follows:

[0169] ;

[0170] In the formula, and These are the output electrical power and thermal power, respectively. The electrical conversion efficiency of combined heat and power (CHP); The heat recovery coefficient of cogeneration; To improve the efficiency of power grid purchasing; and These represent the input gas power and the power purchased from the grid, respectively.

[0171] The optimal control instructions for training the teacher model are obtained by solving the comprehensive objective function.

[0172] 2. Teacher Model Based on Graph Neural Networks

[0173] The complex topology of multi-energy microgrid systems presents a core challenge in their modeling. The physical connections between nodes (such as power lines, heating pipes, and gas pipelines) and the dynamic interactions of multiple energy flows require precise description using graph structures. This embodiment proposes a topology-aware graph neural network architecture that combines the physical topology and data characteristics of the microgrid to achieve efficient information propagation and feature aggregation.

[0174] 2.1 Topology-Aware Graph Neural Network Architecture

[0175] Constructing the physical topology of a multi-energy microgrid The definitions of each part are as follows:

[0176] ① Node : Represents an energy node, including power generation units (such as photovoltaics and wind power), energy storage devices (batteries, thermal storage tanks), and load centers (electrical loads, thermal loads, etc.). The feature vector of each node is:

[0177] ;

[0178] in, Indicates power generation capacity. Indicates the energy storage status. Indicates load demand. Represents a timestamp. This indicates the carbon emission intensity of a node.

[0179] ②side This indicates an energy transmission connection, including power lines, heat pipelines, and gas pipelines, reflecting the physical or energy interaction between nodes.

[0180] ③Adjacency matrix This includes topological weights, representing the connection strength between nodes. For nodes with physical connections... and The weights are calculated as follows:

[0181] ;

[0182] in, For distance attenuation factor, and These are the spatial coordinates or feature vectors of the nodes. This represents the Euclidean distance. The weighting design takes into account the impact of physical distance and energy transmission losses on connection strength.

[0183] 2.2 Extraction of Time-Series Features Dedicated to Multiple Energy Sources

[0184] In multi-energy microgrid systems, the temporal characteristics and dynamic behaviors of electricity, heat, and gas data differ significantly: electricity data exhibits high-frequency fluctuations, heat data displays mid-frequency inertia, and gas data exhibits low-frequency steady-state characteristics. Therefore, dedicated feature extraction modules need to be designed for different energy types to capture their respective dynamic patterns. This embodiment introduces feature extraction methods for electricity, heat, and gas data respectively, and fuses multi-energy features through a GNN to form a unified topology-aware representation.

[0185] 2.2.1 Power Time Series Feature Extraction

[0186] Power data (such as voltage, current, and active power) exhibits high-frequency dynamic characteristics, requiring the capture of rapid fluctuations and short-term trends. A Temporal Convolutional Network (TCN) is employed for feature extraction, with the core formula being:

[0187] ;

[0188] In the formula, For the extracted power time series features; For temporal convolutional networks; For power input data tensors, For time points, For the number of nodes, For characteristic dimensions (such as voltage, current, etc.); These are the kernel weights; The kernel size; This is a causal convolution operation, ensuring that the model uses only historical and current data, which meets the needs of real-time adjustment.

[0189] 2.2.2 Extraction of Thermodynamic Time Series Features

[0190] Thermal data (such as temperature and flow rate) exhibits mid-frequency inertia characteristics, changing relatively slowly but showing strong time-series dependence. This embodiment employs a bidirectional Mamba (Bi-Mamba) model for feature extraction to efficiently capture the bidirectional contextual information and long-term dependencies of thermal data. Through forward and backward Mamba processing, Bi-Mamba can comprehensively capture the bidirectional contextual information of thermal data, thereby more accurately modeling peak and seasonal variations in heat load and comprehensively capturing the contextual information of thermal data.

[0191] ;

[0192] In the formula, For the extracted thermodynamic time series features; and These are the forward and backward Mamba models, respectively. For thermal input data tensors; It is a combination of positive and negative features.

[0193] Bi-Mamba has linear computational complexity compared to traditional LSTM. This significantly reduces training and inference costs, while enhancing the ability to capture features such as peak heat load and seasonal variations through bidirectional modeling, making it suitable for dynamic control of thermal systems. Thermal systems exhibit large inertia and long-range dependency. Mamba's state-space model (SSM) characteristics make it far superior to TCN in capturing this 'long memory', while its linear computational complexity ( When processing long sequences, it is better than Transformer. More efficient.

[0194] 2.2.3 Extraction of Gas Timing Features

[0195] Gas data (such as pressure and flow rate) exhibits low-frequency steady-state characteristics, with gradual changes but long-term trends. A Transformer encoder is used for feature extraction, its core being a multi-head self-attention mechanism.

[0196] ;

[0197] In the formula, These are query, key, and value matrices, respectively, derived from gas data. Generated through linear transformation; The dimension of the key vector is used to scale the dot product attention and avoid numerical instability; This is the normalization function.

[0198] Transformer captures global dependencies in gas data through a multi-head attention mechanism, making it suitable for handling low-frequency trends, such as seasonal variations in industrial gas demand or stable characteristics of gas supply pressure. Table 1 provides a detailed comparison of the feature extraction network modules selected for different energy types, along with their key parameters and applicable scenarios. Through in-depth analysis of the unique temporal characteristics (high-frequency dynamics, mid-frequency inertia, and low-frequency steady-state) of electricity, heat, and gas data, this embodiment meticulously designs the most suitable network structure for each energy flow.

[0199] Table 1 Comparison of Multi-Energy Feature Extraction Modules

[0200] Feature type Network Structure Time characteristics Feature Dimension Number of parameters Applicable Scenarios Electricity characteristics TCN High frequency dynamic 128 28K Voltage / power fluctuations, grid disturbances Thermal characteristics Bi-Mamba Mid-frequency inertia 96 30K Temperature / flow rate changes, heat load forecasting Gas characteristics Transformer Low-frequency steady state 64 42K Pressure / flow trends, gas supply optimization Fusion features GCN Topological association 256 18K Multi-energy coordinated regulation

[0201] 2.2.4 Feature Adaptive Fusion

[0202] This embodiment employs a channel attention mechanism, enabling the model to dynamically learn the importance of different energy features based on the characteristics of the input data and perform weighted fusion.

[0203] ;

[0204] ;

[0205] In the formula, This represents the fused features. For energy Attention weights for output features; It is a 1×1 convolution; Energy extracted from the teacher network The output characteristics; Index for energy type; These are electricity, heat, and gas, respectively. and All are learnable weight matrices; To traverse the output characteristics of all energy sources.

[0206] 2.3 Multi-task loss function and training strategy

[0207] 2.3.1 Multi-task loss function

[0208] The heterogeneous nature of electrical, thermal, and gas data necessitates a balance between specialized processing and collaborative optimization in the model. This embodiment proposes a multi-teacher collaborative training framework, such as... Figure 3 As shown, the teacher model and adaptive feature fusion module are used to achieve comprehensive modeling and optimization of multi-energy data.

[0209] The loss function of the teacher model is:

[0210] ;

[0211] In the formula, For the multi-task loss function of the teacher model; The main task loss function; The physical constraint loss function; The knowledge distillation loss function;

[0212] The loss of the main task is:

[0213] ;

[0214] In the formula, For the control instructions predicted by the model, This is the optimal control instruction; L2 norm

[0215] The physical constraint loss is:

[0216] ;

[0217] ;

[0218] ;

[0219] In the formula, These are the weighting coefficients for the losses of each constraint; For energy storage constraint losses; and These are the minimum and maximum values ​​of the energy storage state, respectively; For ReLU functions; This is due to power balance constraint losses; For nodes The power generation capacity; For nodes The load power; For transmission loss; Losses due to carbon emission constraints;

[0220] To adapt to different training stages and system states, a learnable weight adjustment mechanism based on Bi-Mamba is introduced:

[0221] ;

[0222] in, For the softmax function, ensure , This is a hidden state of Bi-Mamba, capturing system operating status (such as load fluctuations and carbon quota changes). This mechanism dynamically adjusts... To balance the importance of task loss and physical constraints, the model's adaptability in complex scenarios is improved. Table 2 details the loss function weight allocation strategy used in this embodiment. This strategy distinguishes between fixed weights and dynamic weights. The task loss is assigned a fixed, relatively high weight (0.7) to ensure the model's stability and accuracy on the baseline performance. For the three types of physical constraint losses—energy storage constraints, power balance, and carbon emissions—a dynamic weight adjustment mechanism is used. These dynamic weights are determined by the hidden states generated based on the Bi-Mamba network, which can capture and reflect the key state information of the current system operation.

[0223] Table 2 Loss Function Weight Allocation Strategy

[0224]

[0225] 2.3.2 Training Strategy

[0226] (1) Pre-training phase:

[0227] Independent training network for each energy teacher ( ), optimize the feature extraction modules (TCN, Bi-Mamba, Transformer);

[0228] Freeze the underlying feature extractor, focus on GNN parameter optimization, and reduce instability in the early stages of training;

[0229] Learning rate It converges quickly to a local optimum.

[0230] (2) Joint fine-tuning stage:

[0231] Unfreeze the feature extractor and jointly optimize the teacher network and feature fusion module;

[0232] Learning rate Refine model parameters to improve multi-energy synergy performance;

[0233] L2 regularization is introduced to prevent overfitting.

[0234] (3) Knowledge distillation stage:

[0235] Train a lightweight student network with fixed teacher network parameters;

[0236] Learning rate This ensures that students can efficiently learn from teachers' knowledge using the network with low computing resources;

[0237] Optimize knowledge distillation loss This improves migration efficiency.

[0238] This embodiment also employs a cosine annealing strategy to dynamically adjust the learning rate, balancing convergence speed and model stability:

[0239] ;

[0240] in, ; For the current training round, This is the maximum number of training rounds. This strategy avoids getting stuck in local minima by periodically reducing the learning rate, and refines the parameters in the later stages of training to improve the model's generalization ability.

[0241] 3. Lightweight student model

[0242] Real-time control of multi-energy microgrid systems places high demands on computational efficiency and model adaptability. The high complexity of traditional teacher networks is insufficient to meet the needs of edge devices or real-time scenarios. Therefore, this embodiment proposes a lightweight student model based on meta-reinforcement distillation, such as... Figure 4 As shown, the aim is to efficiently transfer the complex knowledge of a multi-teacher model to a lightweight student model by combining knowledge distillation, meta-learning, and reinforcement learning, while ensuring rapid adaptability and meeting physical constraints in the new microgrid scenario.

[0243] The specific processing steps of this lightweight student model include:

[0244] Knowledge distillation phase: Fix the pre-trained teacher network parameters, iteratively optimize the network parameters of the lightweight student model through the knowledge distillation loss function, and execute the meta-learning phase when the lightweight student model converges or reaches the maximum number of iterations;

[0245] Meta-learning stage: Through the inner and outer loop optimization mechanism of the model-independent meta-learning algorithm, the student network is fine-tuned based on a small sample dataset from the new micro-network scenario, and the network parameters of the lightweight student model are iteratively optimized through the comprehensive loss function until the lightweight student model converges or reaches the maximum number of iterations, and the trained lightweight student model is obtained.

[0246] During each training iteration in the meta-learning phase, the trained reinforcement learning agent outputs an action based on the current training state, and performs the next training iteration based on that action. The action output by the reinforcement learning agent defines the optimal weight combination of each loss in the comprehensive loss function and the adjustment factor of the learning rate for the next training iteration.

[0247] 3.1 Knowledge Distillation Mechanism

[0248] The goal of knowledge distillation is to minimize the differences between the teacher network and the student network in terms of feature space and modulated output, while satisfying the physical constraints of the microgrid system. The formula for the knowledge distillation loss function is expressed as:

[0249] ;

[0250] In the formula, To ensure the characteristic distillation loss, we need to ensure the characteristic representation of the teacher network in student network learning; and The network for teachers and students is divided into two parts. Features of the layer; For adapter functions; For hierarchical weights; It is the Frobenius norm.

[0251] 3.2 Model-independent meta-learning

[0252] The Model-Independent Meta-Learning (MAML) algorithm fine-tunes the lightweight student model by using a two-layer optimization framework of inner loop task fine-tuning and outer loop parameter optimization, combined with feature adaptive transformation, to achieve scenario adaptation of the lightweight student model based on few-shot techniques.

[0253] The specific processing procedure is as follows:

[0254] ;

[0255] ;

[0256] ;

[0257] ;

[0258] In the formula, For specific microgrid tasks The parameters after fine-tuning; These are the initial parameters for the student model; The learning rate for the inner loop; For specific losses related to the mission; For parameters The gradient; For parameters Student model; For microgrid tasks Support set; For task distribution; For microgrid tasks Query set; The features are the features after adaptive transformation; Features extracted for the teacher model; For transformation parameters; The weight matrix for the feature adaptive transformation; For global average pooling; It is a multilayer perceptron.

[0259] The formula for the comprehensive loss function of the student model is as follows:

[0260] ;

[0261] In the formula, This is the overall loss function for the student model.

[0262] Table 8 Comparison of Adapter Performance

[0263] Microgrid type Conventional distillation (MSE) Meta-adaptive distillation (MSE) Adaptation time (min) Precision improvement Island Micro Network 0.152 0.087 8.2 42.8% City Microgrid 0.138 0.095 6.7 31.2% Industrial microgrids 0.201 0.112 9.5 44.3% Rural microgrid 0.167 0.103 7.3 38.3% Business Micronet 0.145 0.091 5.9 37.2%

[0264] As shown in Table 8, compared with the traditional distillation method, the distillation framework integrating the meta-adaptor demonstrates significant advantages in five different types of new microgrid scenarios. The mean squared error (MSE) is reduced by an average of 38.7%, and the adaptation time (time required to reach convergence) is shortened by an average of approximately 40%. This strongly demonstrates the superiority of the MAML algorithm in solving the problem of rapid adaptation with small samples.

[0265] 3.3 Distillation Optimization Based on Reinforcement Learning Agents

[0266] The reinforcement learning agent optimizes the distillation process as follows: observes the state space consisting of the distillation training state and the system operating state, outputs the action space for adjusting the loss weight and learning rate, and performs policy learning using the comprehensive operating cost, system risk and carbon emission cost as the reward function.

[0267] The state space of the reinforcement learning agent is as follows:

[0268] ;

[0269] In the formula, For state space; Forecast loss; This is the initial predicted loss; This is the ratio of the energy storage state to the critical value; This is the ratio of carbon emissions to allowances;

[0270] The action space of the reinforcement learning agent is

[0271] ;

[0272] In the formula, For action space; For learning rate, ;

[0273] The reward function of the reinforcement learning agent is:

[0274] ;

[0275] In the formula, For the reward function; For systemic risk; These are the weighting coefficients for each cost item, which will be used in specific implementation. .

[0276] To punish violations of physical constraints, a violation penalty item is introduced:

[0277]

[0278] in, To constrain the number of violations (such as exceeding energy storage limits or power imbalance), this reward function balances economic efficiency, stability, and environmental benefits through multi-objective optimization.

[0279] 3.4 Training Strategies

[0280] 3.4.1 Three-stage training mechanism

[0281] (1) Teacher guidance stage:

[0282] Objective: In this initial stage, the goal is to enable the student network to quickly mimic the basic feature representations of the teacher network. This embodiment fixes all parameters of the pre-trained teacher network and trains only the student network. The optimization objective is solely the feature distillation loss.

[0283] Program: Fix teacher network parameters and optimize This allows students to learn about teacher characteristics online.

[0284] Parameters: Use a higher learning rate This encourages students to quickly converge their network parameters to an approximate representation space of the teacher's knowledge.

[0285] (2) Meta-adaptation stage:

[0286] Objective: This stage aims to activate the model's ability to adapt across different scenarios.

[0287] The program activates the meta-knowledge adapter and employs an inner and outer loop optimization mechanism based on Model-Independent Meta-Learning (MAML). It uses a small sample dataset from a new microgrid scenario. Fine-tune the student network. At this point, the optimization objective is the comprehensive loss function that includes all loss terms. .

[0288] Parameters: Use a medium learning rate. This aims to balance the speed at which the model adapts to new tasks while maintaining the stability of knowledge learned from teachers.

[0289] (3) Enhancement and optimization stage:

[0290] Objective: After the student network has acquired basic knowledge and adaptability, the goal of this stage is to train a reinforcement learning (RL) agent that can act as a dynamic and intelligent "training coach" to find the optimal hyperparameter policy (i.e. loss weights and learning rate) for the distillation process itself.

[0291] Procedure: In this stage, the main parameters of the student network are frozen to create a relatively stable environment for the RL agent's learning. The RL agent interacts with the distillation process: At each training step t, the agent observes the current state St of the distillation process (including information such as predicted loss and the degree of violation of physical constraints). Based on this state, its internal policy network... Output an action This action defines the optimal weight combination of task loss, physical constraint loss, and distillation loss for the next training step. and the adjustment factor for the learning rate. After the student network uses this set of hyperparameters for a training update, the system will calculate a reward signal based on the overall performance (economic cost, risk, carbon emissions) of the resulting control strategy. And feed it back to the RL agent.

[0292] Parameters: The RL agent is trained using an independent, small learning rate. This is to ensure the stability of its strategy learning process.

[0293] 3.4.2 Course Learning Strategies

[0294] To enhance the model's robustness in complex scenarios, training scenarios with increasing difficulty are designed:

[0295]

[0296] in, For training scenarios; For ideal operating conditions (such as stable load and low fluctuations); This is a scenario with moderate fluctuations (such as seasonal load changes). This is designed for extreme scenarios (such as extreme weather or equipment failure). The course gradually increases the difficulty of training, enabling students' networks to adapt to complex operating environments and improving their generalization ability and robustness.

[0297] 4. Results

[0298] 4.1 Summary and Performance Analysis of the Teacher Framework

[0299] To fully verify the effectiveness of the proposed framework, Figure 5 The results show the comparison between the multi-teacher model and the single-teacher baseline model without a dedicated encoder in terms of training convergence and performance metrics.

[0300] Depend on Figure 5 (a) As can be seen, the loss value of the multi-teacher model (cyan curve) decreases rapidly in the early stages of training, exhibiting a faster convergence speed compared to the single-teacher model (red curve). By designing dedicated temporal encoders for different energy data, the model can more efficiently capture energy features and dynamic coupling relationships, thus significantly accelerating the learning process. The yellow highlighted portion in the figure shows that the multi-teacher model achieves a performance improvement of 17.3% in the mid-stage, and a performance improvement of up to 49.2% after final training convergence. This indicates that the framework has stronger learning and generalization capabilities in high-dimensional multi-energy data modeling and dynamic feature extraction. Figure 5 As shown in (b), the multi-teacher model exhibits lower loss values ​​and smoother convergence curves throughout the training process, validating its stability and efficiency in multi-source data fusion and feature interaction. This result further demonstrates that the proposed GNN-meta-enhancement distillation collaborative mechanism can effectively guide the model to achieve rapid convergence and stable optimization in complex energy flow environments. Figure 5 (c) The performance metrics comparison shows that the multi-teacher model is significantly better than the single-teacher model in all three core dimensions: the convergence speed is improved by 23 percentage points (from 65% to 88%), the final performance is improved by 17 percentage points (from 72% to 89%), and the training stability is improved by 17 percentage points (from 68% to 85%).

[0301] Comprehensive experimental results show that the hierarchical multi-teacher framework proposed in this embodiment improves the control accuracy by 17.3% and reduces the physical constraint violation rate by 62.5% compared to the baseline model. Furthermore, in thermal feature extraction, the Bi-Mamba structure achieves a reduction in computational complexity of approximately 15% and an improvement in feature representation capability of approximately 10%. Overall, this framework improves the adaptation speed in new microgrid scenarios by approximately 3.7 times, reduces control costs by 12.3%, and reduces the constraint violation rate by approximately 65%, fully validating its robustness and superiority in intelligent control of multi-energy microgrids.

[0302] The effectiveness of the knowledge distillation process Figure 5 The figure provides a detailed and multi-dimensional visualization analysis. It systematically demonstrates how the lightweight student network progressively learns and reproduces the feature representations of the high-precision teacher network at different depth levels during training.

[0303] Figure 6 (a) and 6(b) visually reveal the significant hierarchical nature of the knowledge transfer process. The first layer of the teacher network (red curve), representing the shallower layers and used to capture general, basic features, shows a rapid increase in feature similarity with the corresponding layer of the student network in the early stages of training, reaching a cosine similarity of nearly 0.9 by the 10th training epoch. In contrast, the third layer (light blue curve), representing deeper, more abstract, and task-specific knowledge, shows a much slower convergence in feature similarity, only reaching saturation after the 20th epoch. This phenomenon perfectly aligns with the feature learning pattern in deep learning: "from shallow to deep, from general to specific." The average feature similarity of the student network (black dashed line) shows a steady, monotonous increase, eventually reaching a very high level, indicating that the entire distillation process is stable and efficient. Figure 6 (c) A quantitative analysis of the learning difficulty of different levels of knowledge was conducted. The figure shows the number of training rounds required for the feature similarity of each layer to reach the 0.9 threshold. The results show that shallow knowledge (Layer 1) requires only 9.7 rounds to be absorbed, while the deepest complex knowledge (Layer 3) requires 30 rounds to be fully learned. This intuitively demonstrates the difference in learning difficulty among different levels of knowledge depth and verifies the rationality of the hierarchical feature matching loss design in this embodiment. Figure 6 The knowledge retention curve in (d) shows that as training progresses, the amount of teacher knowledge retained by the student network increases rapidly, then levels off after about 15 rounds, eventually stabilizing at over 98%. Combined with... Figure 6 The final similarity scores shown in (a) (Layer 1: 0.988, Layer 2: 0.988, Layer 3: 0.974) strongly demonstrate that the distillation framework of this embodiment can achieve near-lossless, high-fidelity transfer of teacher network knowledge. Finally, Figure 6 (e) This demonstrates the practical value of knowledge distillation—a significant improvement in computational efficiency. While successfully reproducing the teacher network's knowledge, the lightweight student network achieved extremely high inference speeds (measured in frames per second, FPS). This result proves that the framework of this embodiment is successful in achieving model lightweighting, and the generated student network fully meets the stringent computational requirements for real-time control on resource-constrained edge devices.

[0304] 4.2 Experimental Verification and Analysis

[0305] To comprehensively evaluate the performance of the graph neural network-meta-RL-based optimization framework in multi-energy microgrid regulation, the following experiments were designed in this embodiment.

[0306] 4.2.1 Experimental Setup

[0307] To ensure the scientific rigor and reproducibility of the experiments, this section details the design of the datasets, testing environment, comparison methods, and evaluation metrics. The experiments employed four multi-energy microgrid datasets covering different typical scenarios to comprehensively test the model's generalization ability and robustness. Specific characteristics are shown in Table 3. The experiments were conducted on a high-performance server equipped with an NVIDIA Tesla V100 GPU, an AMD EPYC 7742 CPU, and 1TB of memory. The software environment was based on Python 3.9, PyTorch 1.12, and TensorFlow 2.8. The experiments used four multi-energy microgrid datasets covering various scenarios, including standard testing, islands, industrial parks, and commercial parks, to verify the model's generalization ability. The statistical characteristics of the datasets are as follows:

[0308] Table 3 Statistical characteristics of the experimental dataset

[0309] Dataset Number of nodes Time span Sampling interval Energy type Data scale Scene characteristics MEMG22 22 6 months 15 minutes Electric / Heating / Gas 12.6 GB Standard test scenario, integrated energy flow Aachen 18 1 year 1 hour Electricity / Heat / Photovoltaics 9.8 GB Real-world industrial scenarios with high load fluctuations Island 8 3 months 30 minutes Electricity / Photovoltaics / Energy Storage 4.2 GB Island microgrids, dominated by renewable energy Campus 12 9 months 10 minutes Electric / Heating / Cold 7.5 GB Commercial parks, dynamic heating and cooling demand

[0310] 4.2.2 Comparison Method

[0311] To conduct a comprehensive performance comparison, this embodiment selects six advanced methods representing the mainstream technical paths in the current multi-energy microgrid optimization field to comprehensively evaluate the performance of GNN-MetaRL, as listed in Table 4.

[0312] Table 4. Explanation of Comparison Methods

[0313] Method Abbreviation Full name Core features MPC Model predictive control physics-based rolling optimization is robust but computationally complex. DRL Deep reinforcement learning No model optimization, adapts to dynamic environments but has high training costs. PINN Physically Guided Neural Networks Integrating physical constraints, balancing accuracy and constraint satisfaction LSTM-GNN Long Short-Term Memory Graph Neural Network The combination of temporal modeling and topology awareness is suitable for dynamic systems. TCN-RL Temporal convolutional reinforcement learning The combination of high-frequency timing processing and strategy optimization results in strong real-time performance. Transformer-DDQN Transformer and Deep Deterministic Policy Gradient Global temporal modeling and reinforcement learning to adapt to complex scenarios GNN-MetaRL This article's method Graph Neural Networks + Meta-Reinforcement Distillation: High Efficiency and Low Complexity

[0314] 4.3 Ablation Experiment Analysis

[0315] To verify the effectiveness of each component in the GNN-MetaRL framework, ablation experiments were conducted based on the MEMG22 dataset, and the roles of GNN, Meta, RL, and carbon optimization modules were analyzed one by one.

[0316] 4.3.1 Component Validation

[0317] Ablation experiments were conducted to evaluate the performance contribution of key components in the framework by removing them one by one. The experimental results are shown in Table 5.

[0318] Table 5. Component ablation experiment results (MEMG22 dataset)

[0319] Model variants Total cost (ten thousand yuan) <![CDATA[Carbon emissions (tCO2)]]> Decision time (ms) constraint violation rate (%) Basic Model 412.8 62.3 35.2 6.8 +GNN 398.5 (-3.5%) 59.8 (-4.0%) 32.7 (-7.1%) 4.2 (-38.2%) +GNN+Meta 391.2 (-5.2%) 58.5 (-6.1%) 28.4 (-19.3%) 3.5 (-48.5%) +GNN+MetaRL 389.2 (-5.7%) 57.6 (-7.5%) 25.1 (-28.7%) 2.8 (-58.8%) +GNN+ MetaRL +Carbon 376.5 (-8.8%) 53.1 (-14.8%) 23.7 (-32.7%) 2.1 (-69.1%)

[0320] As shown in Table 5, the introduction of the GNN module yielded significant results, reducing the constraint violation rate by 38.2% and the total cost by 3.5%. This finding empirically validates the effectiveness of GNN in capturing the physical topology and energy flow constraints of microgrids, thereby enhancing the model's operational reliability. Building upon topology awareness, the addition of the meta-learning module further improved performance across multiple dimensions. Most notably, it additionally reduced decision time by 19.3% and lowered the constraint violation rate to 3.5% (a cumulative improvement of 48.5% compared to the baseline model). This demonstrates the success of the MAML algorithm in enhancing the model's generalization and rapid adaptation capabilities, enabling it to make more efficient and reliable decisions in new scenarios. Subsequently, the integrated reinforcement learning optimizer brought greater robustness to the model. By dynamically adjusting loss weights to intelligently balance competing optimization objectives, this module further reduced the constraint violation rate to 2.8%, marking a cumulative improvement of 58.8% compared to the baseline model. This highlights the effectiveness of reinforcement learning agents in dealing with the complex trade-offs inherent in dynamic operating environments, resulting in more robust and consistent performance. Finally, by incorporating an explicit carbon optimization module into the reward function, the model achieved the most significant improvements in both environmental and economic performance. Compared to the baseline model, the complete GNN-MetaRL model achieved a 14.8% reduction in carbon emissions and an 8.8% reduction in total operating costs. Simultaneously, the final model also achieved the lowest constraint violation rate (2.1%) and the fastest decision time (23.7 milliseconds), demonstrating cumulative improvements of 69.1% and 32.7% respectively in these two metrics.

[0321] 4.3.2 Analysis of the impact of loss weights

[0322] To analyze the impact of dynamic weight adjustment on specific performance indicators of multi-energy microgrids, different combinations of loss weights (task losses) were tested: [0.8, 0.2], [0.7, 0.3], [0.6, 0.4], [0.5, 0.5], and [1.0, 0.0].

[0323] like Figure 7 (a) shows the impact on total operating cost. The total operating cost is lowest at RMB 3.765 million when the loss weight combination is [0.8, 0.2]. As the weight of physical constraint loss increases from 0.2 to 0.5, the total cost gradually rises to RMB 3.892 million. The highest cost, reaching RMB 4.128 million, is achieved when physical constraint loss is completely ignored (weight [1.0, 0.0]). This indicates that while the introduction of physical constraints is crucial for economic performance, an 80 / 20 weight allocation between task loss and physical loss achieves the most cost-effective result. Figure 7 (b) The impact on carbon emissions is similar to that on operating costs. The lowest carbon emissions, at 53.1 tons of CO2, are achieved with a weighting combination of [0.8, 0.2]. Emissions increase with the weighting of physical losses, reaching 57.6 tons at [0.5, 0.5]. The worst-case scenario is also a combination of [1.0, 0.0], resulting in the highest carbon emissions of 62.3 tons. This demonstrates that achieving the optimal cost balance also yields the best environmental benefits. Figure 7 (c) The constraint violation rate is used to measure the reliability of the system. The lowest violation rate (2.1%) was achieved with a weight combination of [0.8, 0.2]. Interestingly, the violation rate also increases slightly with increasing physics loss weights, reaching 3.2% with a combination of [0.5, 0.5]. However, when using weights of [1.0, 0.0] to completely ignore the physics constraints, the violation rate spikes dramatically to 6.8%. This highlights the crucial role of the physics loss term in ensuring the reliability and physical plausibility of the model output. Figure 7 (d) The impact of the weights on computational efficiency is plotted in milliseconds (ms), representing the model's computational speed. The fastest decision time is 23.7 ms, corresponding to a weight combination of [0.8, 0.2]. As the weights of the physics loss increase, the decision time gradually lengthens, reaching 27.3 ms at [0.5, 0.5]. The slowest performance (35.2 ms) occurs when the physics constraints ([1.0, 0.0]) are ignored.

[0324] Figure 8(a) reveals a convex function relationship between task loss weights and total operating costs. As the weight λ increases from 0.5, the total cost decreases, reaching a minimum at the optimal point λ=0.8, approximately 3.8 million yuan. Beyond this point, if the weight is further increased to 1.0, the total cost rebounds sharply. This indicates that while focusing on the core task (higher λ value) is crucial for improving economic efficiency, completely ignoring other constraints (excessively high λ value) or neglecting them (excessively low λ value) are not optimal strategies. Figure 8 The trend in carbon emissions in (b) is highly consistent with the change in total cost. Similarly, carbon emissions reach their lowest point, approximately 53 tons of CO2, when the task loss weight λ = 0.8. Deviations from this optimum in any direction lead to an increase in carbon emissions, with the highest emissions occurring at λ = 1.0. This demonstrates a strong synergy between system economics and environmental friendliness, meaning that the most cost-effective operating strategy is also the most environmentally friendly. Figure 8 (c) The constraint violation rate is used to assess the system's reliability. The constraint violation rate reaches its lowest point, approximately 2.1%, at λ=0.8, indicating the highest system reliability. As the task loss weight decreases or increases from this point, the violation rate rises, implying a decline in the model's ability to adhere to physical and operational constraints. This highlights that the optimal weight λ=0.8 provides the best balance for ensuring the system's safe and stable operation.

[0325] Figure 8 (d) The computational performance of the model was evaluated by measuring the decision time (in milliseconds). Similar to other metrics, the fastest decision time (approximately 23.5 milliseconds) was also achieved at the optimal task loss weight λ = 0.8. The decision time increases as the weights deviate from this optimal value, indicating that the model is most internally efficient when the loss components are balanced in a specific ratio. Figure 8 (e) The overall performance scores under different weight combinations were quantified. The combination [0.8, 0.2] received the highest score of 100 and was identified as the optimal configuration. The scores of other combinations decreased as they deviated from the optimal point, with the combination [1.0, 0.0], which completely ignored physical constraints, scoring 0 and performing the worst. Figure 8 (f) A direct comparison of the performance of the optimal combination ([0.8, 0.2], blue area) and the worst combination ([1.0, 0.0], red origin) is presented. The optimal combination exhibits near-perfect balanced performance across all four dimensions: carbon reduction, cost-effectiveness, computational efficiency, and constraint satisfaction, forming a large performance envelope. In contrast, the worst combination scores close to zero across all dimensions.

[0326] Comprehensive analysis consistently points to a task loss weight λ = 0.8 (i.e., a task and physical constraint weight combination of [0.8, 0.2]) as the optimal value for the model, simultaneously achieving optimal performance across the four dimensions of cost, carbon emissions, reliability, and efficiency. Under this setting, the system achieves optimal performance across all evaluation dimensions. Therefore, all subsequent experiments will use this optimal fixed weight combination of [0.8, 0.2].

[0327] 4.3 Comparison of experimental results

[0328] To verify the overall performance of GNN-MetaRL, it is compared with MPC, DRL, PINN, LSTM-GNN, TCN-RL and Transformer-DDQN methods on the Aachen and Campus datasets to evaluate its economy, environmental friendliness and reliability.

[0329] 4.3.1 Comparison of Economic Benefits

[0330] Table 6. Economic Comparison of Different Methods (Aachen Dataset)

[0331] method Total cost (ten thousand yuan) Operating costs Risk Cost carbon cost MPC 285.4 210.3 42.7 32.4 DRL 273.6 205.8 38.5 29.3 PINN 268.7 201.2 36.8 30.7 LSTM-GNN 265.3 198.7 37.2 29.4 TCN-RL 262.1 196.5 35.9 29.7 Transformer-DDQN 259.8 194.3 35.1 30.4 GNN-MetaRL 248.9 188.5 32.1 28.3

[0332] As shown in Table 6, GNN-MetaRL achieved the lowest total operating cost (RMB 2.489 million), a significant reduction of 12.8% compared to the traditional MPC benchmark. This advantage is reflected in the comprehensive improvement of various cost components: direct operating costs decreased by 10.4%, risk costs by 24.8%, and carbon costs by 12.6%. Compared with other advanced methods, its total cost is still the lowest, 4.2% lower than the second-best Transformer-DDQN, with particularly outstanding advantages in risk and carbon costs.

[0333] Further analysis shows that the penalty cost ratio of GNN-MetaRL is only 15.3%, the lowest among all methods, indicating its stronger compliance capability; while the energy procurement cost ratio is the highest (55.4%), indicating that it prefers to use low-cost energy rather than rely on high-cost adjustments or violations. This optimized balance between energy procurement and compliance, combined with effective risk mitigation strategies, jointly supports the overall economic advantage of GNN-MetaRL.

[0334] 4.3.2 Comparison of Environmental Performance

[0335] Figure 9The study compares the carbon emission intensity of different methods across four time periods throughout the day and under average conditions. GNN-MetaRL maintains the lowest emission intensity across all time periods, averaging 0.58 kgCO2 / kWh, significantly better than the MPC baseline of 0.69 kgCO2 / kWh. The midday period (0.55 kgCO2 / kWh) benefits from efficient solar energy utilization, while the evening period (0.59 kgCO2 / kWh) maintains its low-carbon performance through optimized energy storage management and scheduling. Figure 9 In the study, GNN-MetaRL achieved an emission reduction rate of 15.9% compared to MPC, which is higher than other methods (4.3%–11.6%), highlighting the effectiveness of its carbon optimization module and its comprehensive ability to maximize clean energy utilization and reduce high carbon dependence under topology perception and adaptive control.

[0336] Figure 10 The changes in carbon emission intensity and the emission reduction effect of GNN-MetaRL were analyzed. Figure 10 The data shows that GNN-MetaRL maintains the lowest carbon emission intensity throughout the day, especially during the midday peak solar PV period and the evening peak period, demonstrating its advantages in utilizing renewable energy and optimizing energy storage and multi-energy synergy during peak hours. Figure 10 The hourly emission reduction rate relative to MPC was further quantified, with an average reduction rate of 15.1%, a peak of 19.3% during the evening peak hours, and an emission reduction effect of over 10% even during the low-load period in the early morning. This demonstrates that GNN-MetaRL can achieve maximum emission reduction during critical periods, balancing system supply and demand with environmental benefits.

[0337] In summary, GNN-MetaLR achieves stable, efficient, and low-carbon operation through advanced modeling and intelligent scheduling, providing an effective technical path for the greening of multi-energy microgrids.

[0338] Figure 11 The performance of GNN-MetaRL in terms of renewable energy utilization and carbon emissions was analyzed. Figure 11 The results show that its photovoltaic absorption rate reaches 95.7% and its wind curtailment rate is only 2.1%, both of which are better than MPC (82.3%, 8.2%) and other advanced methods, demonstrating excellent intermittent energy integration capabilities. Figure 11 Further evidence shows a strong correlation between photovoltaic utilization rate and system carbon emission intensity (R²=0.944). GNN-MetaRL is in the optimal position in the lower right corner, corresponding to the highest photovoltaic utilization rate and the lowest carbon emission intensity (0.58 kgCO2 / kWh), while MPC is in the opposite position.

[0339] In summary, GNN-MetaRL effectively replaces fossil fuels by maximizing local photovoltaic consumption and significantly reducing system carbon emissions, highlighting its technological advantages in promoting the clean and low-carbon transformation of multi-energy microgrids.

[0340] 4.3.3 Reliability Comparison

[0341] The evaluation results using the Campus dataset are shown in Table 7. GNN-MetaRL significantly outperforms other methods in terms of reliability. Its constraint violation rate is only 2.1%, a 59.6% reduction compared to the MPC benchmark and a 36.4% improvement compared to the second-best method, Transformer-DDQN, demonstrating the effectiveness of physical constraint embedding and topology-aware modeling. Meanwhile, GNN-MetaRL achieves the lowest SAIDI metric of 0.38 hours / user, significantly lower than MPC (0.85 hours) and Transformer-DDQN (0.50 hours), indicating stronger fault response and rapid recovery capabilities.

[0342] Although advanced methods such as LSTM-GNN offer improvements over MPC, they still lag behind GNN-MetaRL in constraint compliance and interruption recovery, highlighting the role of meta-reinforcing distillation in enhancing policy robustness. In conclusion, GNN-MetaRL significantly improves the operational safety and resilience of multi-energy microgrids while optimizing economic and environmental objectives.

[0343] Table 7 Comparison of Reliability Metrics (Campus Dataset)

[0344] method constraint violation rate (%) SAIDI(h / user) MPC 5.2 0.85 DRL 4.1 0.62 PINN 3.7 0.55 LSTM-GNN 3.9 0.58 TCN-RL 3.5 0.53 Transformer-DDQN 3.3 0.50 GNN-MetaRL 2.1 0.38

[0345] 4.4 Scalability Verification

[0346] To evaluate the performance of GNN-MetaRL under different microgrid sizes and temporal resolutions, experiments were conducted on node scalability and temporal adaptability.

[0347] 4.4.1 Node Scalability

[0348] Table 8 Performance Comparison of Different Node Sizes

[0349] Number of nodes method Decision time (ms) Memory usage (GB) Total cost (ten thousand yuan) 10 MPC 120.5 2.1 185.3 GNN-MetaRL 28.3 0.8 168.7 30 MPC 352.8 6.7 532.6 GNN-MetaRL 41.5 1.5 489.2 50 MPC 896.4 18.3 1,203.5 GNN-MetaRL 67.2 2.8 1,085.3

[0350] To evaluate the applicability of GNN-MetaRL in micronetworks of different sizes, this embodiment tested its computational performance (decision time, memory usage) and cost-effectiveness as the number of nodes increased, and compared it with MPC. The results are shown in Table 8: As the network size increased from 10 nodes to 50 nodes, the MPC decision time surged from 120.5 milliseconds to 896.4 milliseconds (an increase of approximately 7.4 times), while GNN-MetaRL only increased from 28.3 milliseconds to 67.2 milliseconds (an increase of approximately 2.4 times), representing only 7.5% of MPC at 50 nodes. In terms of memory, MPC used 18.3 GB at 50 nodes, while GNN-MetaRL only required 2.8 GB, a reduction of 84.7%, making it more suitable for edge deployment. In terms of cost-effectiveness, GNN-MetaRL maintained a cost lead at all sizes, and its cost growth rate was lower than MPC, with its advantage becoming more significant as the scale increases. Compared with methods such as LSTM-GNN, its lightweight student network also performed better in terms of computational efficiency.

[0351] In summary, GNN-MetaRL demonstrates good scalability in terms of computational performance, memory efficiency, and cost-effectiveness, making it suitable for real-time optimization problems in large-scale multi-energy microgrids.

[0352] 4.4.2 Time Scale Adaptability

[0353] To evaluate the performance of GNN-MetaRL at different time resolutions, this embodiment compares it with MPC over a period of 1 to 60 minutes. Figure 12 As shown in the figure, the results indicate that GNN-MetaRL maintains lower operating costs across all resolutions, with a reduction of 7.8%-8.1%, demonstrating its stable economic advantages at both fine-grained scheduling and macro-level considerations. Furthermore, GNN-MetaRL's decision-making efficiency is significantly superior to MPC, with a decision time of only 38% of MPC at a 1-minute resolution (a speedup of over 60%), and still 18% faster at a 60-minute resolution. This proves that its lightweight student network can balance economic optimization and real-time computation, effectively solving the traditional trade-off between high accuracy and high efficiency, and is suitable for real-time intelligent control of multi-energy microgrids.

[0354] 4.5 Adaptability to new scenarios

[0355] To verify the rapid adaptability of GNN-MetaRL in new microgrid scenarios, a small-sample adaptation experiment was conducted based on the Island dataset, and its performance in extreme scenarios was tested.

[0356] 4.5.1 Small Sample Adaptation Experiment

[0357] Table 9. Small sample adaptation performance (Island dataset)

[0358] Training samples method MSE Adaptation time (min) Total cost (ten thousand yuan) 100 Transfer learning 0.152 15.2 78.5 GNN-MetaRL 0.087 8.2 72.3 50 Transfer learning 0.187 12.6 81.7 GNN-MetaRL 0.112 6.7 75.8 20 Transfer learning 0.243 10.3 85.2 GNN-MetaRL 0.153 5.1 79.6

[0359] To verify the rapid adaptability of GNN-MetaRL in data-scarce scenarios, this embodiment conducted a small-sample experiment on the Island dataset and compared it with traditional transfer learning. The results are shown in Table 9. Under the extreme condition of only 20 training samples, the mean squared error (MSE) of GNN-MetaRL was 0.153, a 37.0% reduction compared to transfer learning (0.243); the adaptation time was only 5.1 minutes, a 50.5% reduction. Simultaneously, its total operating cost (796,000 RMB) was lower than that of transfer learning (852,000 RMB), a reduction of approximately 6.5%. This indicates that GNN-MetaRL can not only adapt faster and more accurately in new environments but also maintain its economic performance advantage. The experimental results verify the efficiency and robustness of its meta-learning component in data-scarce scenarios, making it suitable for the need for rapid response to environmental changes in practical deployments.

[0360] 4.5.2 Extreme Scenario Testing

[0361] To evaluate the robustness and resilience of the GNN-MetaRL framework under severe operating conditions, this embodiment simulates three typical extreme scenarios: typhoon weather (leading to a surge in wind speed and a sharp drop in photovoltaic output), critical equipment failure (main transformer N-1), and sudden change in load demand (instantaneous increase of 30%). This embodiment compares the system recovery time, necessary load shedding, and resulting additional cost increases of different methods under these scenarios, and the results are shown in Table 10.

[0362] Table 10. Extreme Scenario Recovery Capability

[0363] method Recovery time (min) Load shedding (MWh) Cost increase rate MPC 45.2 8.7 38.5% DRL 32.7 6.2 31.8% PINN 28.3 5.1 27.6% LSTM-GNN 29.5 5.4 28.2% TCN-RL 27.8 5.0 26.9% Transformer-DDQN 26.4 4.8 25.7% GNN-MetaRL 18.6 3.2 19.7%

[0364] Experimental results demonstrate that GNN-MetaRL exhibits significant recovery capabilities and robustness under extreme scenarios. Compared to MPC, its average system recovery time is reduced by 58.8% (18.6 minutes vs. 45.2 minutes), load shedding is reduced by 63.2% (3.2 MWh vs. 8.7 MWh), and additional cost increase is reduced by 48.8% (19.7% vs. 38.5%), showing a faster, more accurate, and more economical response capability under sudden disturbances. GNN-MetaRL's recovery time is also superior to the suboptimal method Transformer-DDQN, decreasing by 29.5% (18.6 minutes vs. 26.4 minutes), highlighting the role of meta-reinforcement distillation in improving adaptive adjustment and rapid recovery. Compared to methods such as LSTM-GNN, its performance remains leading, further validating the key contribution of meta-learning to the generalization ability under extreme conditions. Extreme scenario tests confirm that GNN-MetaRL possesses superior resilience and reliability in ensuring the safe, stable, and economical operation of multi-energy microgrids.

[0365] 5. Overview

[0366] In summary, this embodiment proposes a multi-energy micronet collaborative optimization framework (GNN-MetaRL) based on graph neural networks and meta-reinforcement distillation. It aims to solve the core challenges of multi-energy micronets in complex and uncertain environments, such as multi-objective optimization, efficient real-time control, and rapid adaptation across scenarios, by integrating advanced deep learning technologies.

[0367] Compared with the prior art, the present invention has the following technical effects:

[0368] First, this embodiment constructs a hierarchical distributed collaborative control architecture. Through four layers—data perception, knowledge extraction, collaborative optimization, and decision execution—it achieves efficient processing of complex coupling relationships, multi-timescale data, and uncertainty challenges in multi-energy microgrids. This ensures the system's robustness and efficiency in complex high-dimensional data processing and real-time control, providing a structured solution for the intelligent management of multi-energy microgrids.

[0369] Secondly, this framework achieves knowledge extraction and time scale alignment of multi-source heterogeneous data through dynamic elasticity matrices, correlation-aware uncertainty models, and the DTW algorithm. More importantly, this embodiment utilizes deep learning models such as TCN, Bi-Mamba, and Transformer to adaptively capture the unique temporal characteristics and inherent patterns of electricity, heat, and gas data, laying a data foundation for subsequent accurate prediction and optimization.

[0370] Furthermore, this embodiment designs a topology-aware graph neural network teacher model, which effectively models the physical connections and energy flow relationships of the microgrid through a GNN architecture. By embedding hard and soft constraint mechanisms, the teacher model can ensure the physical rationality of the optimization results. Combined with a multi-teacher collaborative training framework, this model can comprehensively learn and integrate the complex operational knowledge of multi-energy microgrids, providing a high-quality source for knowledge distillation of student networks.

[0371] Furthermore, this embodiment innovatively proposes a lightweight student network design based on meta-reinforcement distillation. By combining Model-Independent Meta-Learning (MAML), the student network achieves rapid adaptability in different micronet scenarios, greatly enhancing the model's generalization ability. Simultaneously, reinforcement learning dynamically optimizes the distillation parameters, enabling the student network to maintain high computational efficiency while balancing economy, reliability, and environmental benefits, meeting the stringent requirements of real-time control.

[0372] Finally, this embodiment constructs a comprehensive life-cycle carbon footprint optimization model, which not only refines the calculation of direct and indirect emissions but also incorporates carbon trading mechanisms and carbon flow tracking, achieving precise quantification and optimization of the low-carbon and environmentally friendly goals of multi-energy microgrids. This enables the system to effectively fulfill its environmental responsibilities while pursuing economic benefits.

[0373] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described with reference to preferred embodiments, those skilled in the art should understand that various changes in form and detail can be made without departing from the spirit and scope of the invention as defined in the appended claims.

Claims

1. A real-time control method for multi-energy microgrids integrating topology sensing and meta-learning adaptive control, characterized in that, Includes the following steps: S1. Real-time acquisition of multi-source heterogeneous data from multi-energy microgrids; S2. Input multi-source heterogeneous data into a pre-trained lightweight student model to generate a predictive multi-energy flow coordinated control strategy, thereby realizing the coordinated control of electric-thermal-gas multi-energy flows in the multi-energy microgrid. The steps involved in training a lightweight student model include: S201. Construct the corresponding multi-energy microgrid graph structure based on the network topology of the multi-energy microgrid; S202. Input the multi-source heterogeneous data and multi-energy micro-network graph structure used as training data into the teacher model built based on graph neural network, and output the corresponding predicted multi-energy flow collaborative regulation strategy. S203. Calculate the loss function based on the predicted multi-energy flow coordinated regulation strategy and the corresponding optimal multi-energy flow coordinated regulation strategy, and optimize the network parameters of the teacher model; S204. Repeat steps S202 to S203 to iteratively train the teacher model until the model converges or reaches the maximum number of iterations. S205. The knowledge of the trained multi-teacher network is transferred to the lightweight student model by combining knowledge distillation, meta-learning and reinforcement learning to obtain the trained lightweight student model.

2. The real-time control method for multi-energy microgrids integrating topology sensing and meta-learning adaptive control according to claim 1, characterized in that, In step S201, the graph structure constructed based on the network topology of the multi-energy microgrid is as follows: , where V represents the set of nodes, E represents the set of edges, and A represents the weighted adjacency matrix.

3. The real-time control method for multi-energy microgrids integrating topology sensing and meta-learning adaptive control according to claim 1, characterized in that, In step S202, the processing steps for the teacher model include: S2021. Decompose the input multi-source heterogeneous data into power data, heat data, and gas data; S2022. Input the power data into the power teacher network, extract the power features of the power data through the time encoder, and input the power features together with the multi-energy microgrid graph structure into the GNN for propagation to obtain the power output features. S2023. Input thermal data into the power teacher network, extract thermal features of thermal data through a time encoder, and input thermal features together with the multi-energy microgrid graph structure into the GNN for propagation to obtain thermal output features. S2024. Input the gas data into the power teacher network, extract the gas features of the gas data through the time encoder, and input the gas features together with the multi-energy micro-network graph structure into the GNN for propagation to obtain the gas output features. S2025. The characteristics of power output, heat output and gas output are weighted and fused to generate a predictive multi-energy flow coordinated control strategy output by the teacher model.

4. The real-time control method for multi-energy microgrids integrating topology sensing and meta-learning adaptive control according to claim 1, characterized in that, In step S2022, the time encoder of the power teacher network uses a time convolutional network to extract dynamic time-series features from the power data, as shown below: ; In the formula, For the extracted power time series features; For temporal convolutional networks; The input power data tensor; These are the kernel weights; The kernel size; For causal convolution operations; In step S2023, the time encoder of the thermal teacher network uses a bidirectional Mamba model to extract dynamic time-series features from the thermal data, as shown below: ; In the formula, For the extracted thermodynamic time series features; and These are the forward and backward Mamba models, respectively. For the input thermal data tensor; This involves concatenating positive and negative features. In step S2023, the time-series encoder of the gas teacher network performs dynamic time-series feature extraction on the gas data using a Transformer encoder with a multi-head attention mechanism, as shown below: ; In the formula, These are query, key, and value matrices, generated from gas data through linear transformation. The dimension of the key vector; This is the normalization function.

5. The real-time control method for multi-energy microgrids integrating topology sensing and meta-learning adaptive control according to claim 1, characterized in that, In step S2025, the power output characteristics, heat output characteristics, and gas output characteristics are weighted and fused using a channel attention mechanism, as shown below: ; ; In the formula, This represents the fused features. For energy Attention weights for output features; It is a 1×1 convolution; Energy extracted from the teacher network The output characteristics; Index for energy type; These are electricity, heat, and gas, respectively. and All are learnable weight matrices; To traverse the output characteristics of all energy sources.

6. The real-time control method for multi-energy microgrids integrating topology sensing and meta-learning adaptive control according to claim 1, characterized in that, In step S203, the formula for calculating the loss function is expressed as follows: ; In the formula, For the multi-task loss function of the teacher model; The main task loss function; The physical constraint loss function; The loss of the main task is: ; In the formula, To predict multi-energy flow coordinated regulation strategies, The optimal multi-energy flow coordinated control strategy; L2 norm The physical constraint loss is: ; ; ; ; In the formula, These are the weighting coefficients for the losses of each constraint; For energy storage constraint losses; and These are the minimum and maximum values ​​of the energy storage state, respectively; For ReLU functions; This is due to power balance constraint losses; For nodes The power generation capacity; For nodes The load power; For transmission loss; Losses due to carbon emission constraints; This represents the total carbon emissions of the system. For carbon quota allocation.

7. The real-time control method for multi-energy microgrids integrating topology sensing and meta-learning adaptive control according to claim 1, characterized in that, In step S205, the process of transferring the knowledge of the trained multi-teacher network to the lightweight student model through a combination of knowledge distillation, meta-learning, and reinforcement learning includes: S2051, Knowledge Distillation Stage: Fix the trained teacher network parameters, iteratively optimize the network parameters of the lightweight student model through the knowledge distillation loss function, and execute S2052 when the lightweight student model converges or reaches the maximum number of iterations. S2052, Meta-learning stage: Through the inner and outer loop optimization mechanism of the model-independent meta-learning algorithm, the student network is fine-tuned based on a small sample dataset from the new micro-network scenario, and the network parameters of the lightweight student model are iteratively optimized through the comprehensive loss function until the lightweight student model converges or reaches the maximum number of iterations, and the trained lightweight student model is obtained. During each training iteration in the meta-learning phase, the trained reinforcement learning agent outputs an action based on the current training state, and performs the next training iteration based on that action. The action output by the reinforcement learning agent defines the optimal weight combination of each loss in the comprehensive loss function and the adjustment factor of the learning rate for the next training iteration.

8. The real-time control method for multi-energy microgrids integrating topology sensing and meta-learning adaptive control according to claim 7, characterized in that, In step S2051, the formula for the knowledge distillation loss function is expressed as follows: ; In the formula, Characteristic distillation loss; and The teacher and student models are respectively Characteristics of the layer; For adapter functions; For hierarchical weights; It is the Frobenius norm.

9. The real-time control method for multi-energy microgrids integrating topology sensing and meta-learning adaptive control according to claim 7, characterized in that, In step S2052, the inner and outer loop optimization mechanism of the model-independent meta-learning algorithm is specifically as follows: through a two-layer optimization framework of inner loop task fine-tuning and outer loop parameter optimization, combined with feature adaptive transformation, the lightweight student model can achieve scenario adaptation based on few-sample technology. The specific processing procedure is as follows: ; ; ; ; In the formula, For specific microgrid tasks The parameters after fine-tuning; These are the initial parameters for the student model; The learning rate for the inner loop; For specific losses related to the mission; For parameters The gradient; For parameters Student model; For microgrid tasks Support set; For task distribution; For microgrid tasks Query set; The features are the features after adaptive transformation; Features extracted for the teacher model; For transformation parameters; The weight matrix for the feature adaptive transformation; For global average pooling; It is a multilayer perceptron; The formula for the comprehensive loss function is expressed as follows: ; In the formula, This is the overall loss function for the student model; The main task loss function; This is the physical constraint loss function.

10. The real-time control method for multi-energy microgrids integrating topology sensing and meta-learning adaptive control according to claim 1, characterized in that, In step S2052, the reinforcement learning agent includes a state space consisting of the distillation training state and the system operating state, an action space for adjusting the loss weight and learning rate, and a reward function that includes the comprehensive operating cost, system risk and carbon emission cost. The state space of the reinforcement learning agent is as follows: ; In the formula, For state space; Forecast loss; This is the initial predicted loss; This is the ratio of the energy storage state to the critical value; This is the ratio of carbon emissions to allowances; The action space of the reinforcement learning agent is: ; In the formula, For action space; The learning rate; The reward function of the reinforcement learning agent is: ; In the formula, For the reward function; For systemic risk; Operating costs; Cost of carbon emissions; These are the weighting coefficients for each cost item.

Citation Information

Cited By

  • A collaborative intelligent control method for multiple smoke exhaust systems in tunnel fires based on MPC

    CN122308119A