Comprehensive energy system operation optimization method based on adaptive pruning and constraint distillation

By employing adaptive model pruning and constrained distillation, a lightweight model adapted to local scenarios is constructed, addressing the issues of data privacy and limited edge computing resources in integrated energy systems. This enables efficient deployment and physical feasibility of scheduling commands at edge terminals, ensuring long-term operational stability and data privacy protection.

CN122264475APending Publication Date: 2026-06-23ZHEJIANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHEJIANG UNIV
Filing Date
2026-05-25
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

Integrated energy systems suffer from issues such as data privacy and silo effects, limited edge computing resources, and lack of physical constraint guarantees. Existing federated learning methods are difficult to deploy at the edge and scheduling instructions are not feasible.

Method used

We employ adaptive model pruning and constraint distillation to construct a global teacher model-local lightweight student model architecture. We generate lightweight sub-models adapted to local scenarios through adaptive pruning, and incorporate energy constraint penalty terms into the physical constraint distillation initialization to ensure that the model output conforms to physical rules.

Benefits of technology

It enables efficient deployment on edge terminals, improves the physical feasibility and security of scheduling instructions, solves data privacy protection issues, and ensures the long-term stability and adaptability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122264475A_ABST
    Figure CN122264475A_ABST
Patent Text Reader

Abstract

The application discloses a comprehensive energy system operation optimization method based on adaptive pruning and constraint distillation, which solves the problems of insufficient fine-tuning and gradient error accumulation of traditional centralized optimization models by constructing a double-layer structure of global energy M and local sub-M, and issuing a localized sub-model after structured pruning, and improves the adaptability of the energy system to multi-agent heterogeneous scenarios. The method includes the construction and initialization of the global energy base model, the hierarchical compression of the local sub-model based on the energy scene saliency, the two-step distillation alignment combined with the energy constraints, the federal learning collaborative optimization process and the real-time operation optimization, etc. The application protects the data privacy of multi-agent such as industrial users and residential communities, improves the operation optimization accuracy and real-time performance of the comprehensive energy system, reduces the cross-agent communication cost, and is suitable for complex system scheduling scenarios containing multiple energy coupling such as electricity, heat, cold and gas.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the interdisciplinary field of integrated energy system scheduling and artificial intelligence. Specifically, it relates to an integrated energy system operation optimization method based on adaptive pruning and constrained distillation. It is applicable to complex energy systems that integrate multiple energy forms such as electricity, heat, cooling, and gas, involving multiple stakeholders including industrial users, residential communities, and commercial buildings. It can achieve global-local collaborative optimization under the premise of protecting the privacy of multiple stakeholders, thereby improving the operating efficiency and economy of the energy system. Background Technology

[0002] Integrated Energy Systems (IES) have become the core carrier for achieving efficient energy use. By synergistically optimizing the production, transmission, conversion, and consumption of various energy sources such as electricity, heat, cooling, and gas, IES can significantly improve energy efficiency and reduce carbon emissions. However, optimizing IES operation faces several key challenges, as follows:

[0003] Data privacy and the silo effect: Industrial and residential user data are sensitive, making traditional centralized optimization difficult to implement.

[0004] Edge computing resources are limited: Existing high-performance deep learning models have a huge number of parameters (such as Transformer), making it difficult to deploy them directly on edge terminals with weak computing power (such as smart meters and building controllers).

[0005] Lack of physical constraint protection: Purely data-driven AI models often ignore hard physical constraints such as power grid capacity and pipeline pressure, which may result in infeasible dispatch instructions or even safety accidents.

[0006] While existing federated learning (FL) methods address privacy concerns, they neglect model adaptability and security at the edge. Simple model compression leads to a sharp drop in accuracy, and general fine-tuning methods struggle to guarantee strict physical constraints. Therefore, a collaborative optimization method is urgently needed that can both reduce model complexity and inherit global physical constraint knowledge. Summary of the Invention

[0007] This invention provides a comprehensive energy system operation optimization method based on adaptive model pruning and constrained distillation, aiming to solve the problems in the prior art such as the difficulty in deploying global models at the edge, poor adaptability to heterogeneous scenarios, and low physical feasibility of scheduling instructions.

[0008] This method is implemented using the following technical solution:

[0009] To address the aforementioned problems, this invention provides a comprehensive energy system operation optimization method based on adaptive pruning and constrained distillation. Its core lies in constructing an architecture of "global teacher model - local lightweight student model," with the specific steps as follows:

[0010] S1. Construct a global energy foundation model (global energy M). Global energy M is a multi-task optimization model based on the Transformer architecture, trained using a public energy dataset. It is used to learn the regional multi-energy collaborative optimization rules and general constraints. Its specific structure includes a time-series feature extraction layer, a multi-energy collaborative layer, and an optimization objective layer.

[0011] The aforementioned regional-level multi-energy synergistic optimization law specifically refers to the spatiotemporal coupling characteristics and scheduling strategies that are prevalent among different energy subsystems, captured by the model from historical data through a self-attention mechanism. Specifically, it includes the following three dimensions of laws:

[0012] Multi-energy complementary coupling principle: This includes the efficiency characteristics and substitution relationships of different energy forms such as electricity, heat, cooling, and gas during the conversion process. For example, the economic strategy of prioritizing the use of electric boilers to replace gas boilers for heating during periods of low electricity prices, or using gas-fired combined cooling, heating, and power (CCHP) systems to generate electricity and provide heating during periods of high electricity prices.

[0013] Source-load timing matching patterns: This includes the timing correlation between renewable energy output and user load demand. For example, it identifies the overlap between "peak photovoltaic output at midday" and "peak commercial air conditioning cooling load" and automatically generates scheduling strategies to improve the local photovoltaic consumption rate.

[0014] Dynamic inertia and storage patterns: This includes the system's thermal inertia and energy storage arbitrage mechanisms. Specifically, the system's thermal inertia involves identifying the lag time in the temperature drop after heating is stopped, thus reducing heating power in advance without compromising comfort. Energy storage arbitrage mechanisms refer to mastering the low-charge, high-discharge peak-valley arbitrage mode of electric / thermal energy storage devices to reduce overall lifecycle operating costs.

[0015] The general constraints specifically refer to the physical limitations and safety boundaries that must be strictly observed during the operation of the integrated energy system. These general constraints are encoded in the model's training objective and loss function, and specifically include:

[0016] Energy and power balance constraints: These must comply with Kirchhoff's laws and the law of conservation of energy, meaning that at any given moment... The sum of the electrical and gas power input to the system and the output of renewable energy must equal the electricity, heat, and cooling load demand on the user side plus system conversion losses and energy storage charging power.

[0017] Network transmission security constraints: These restrict the physical state of energy transmission networks, specifically including: node voltage deviations and maximum transmission capacity of distribution networks; supply and return water temperature limits and maximum flow rates of heating networks; and node pressure safety ranges of natural gas networks.

[0018] Equipment operating characteristic constraints: covering the physical limits of key equipment, specifically including: ramp rate limits for energy conversion equipment; upper and lower limits of state of charge (SOC) for energy storage devices; and minimum start-up and shutdown time limits for units.

[0019] The temporal feature extraction layer employs a 6-layer Transformer encoder with a hidden layer dimension of 512 and 8 attention heads. The input consists of 15-minute time-series data with a dimension of 128, including energy, environmental, and economic data. Energy data comprises electricity, heat, cooling, and gas loads, covering the past 48 hours; environmental data includes temperature, light intensity, and wind speed, used to influence renewable energy output; and economic data includes time-of-use electricity prices and carbon prices, covering the past 7 days. By embedding temporal location encoding and utilizing a self-attention mechanism to capture short-term fluctuations and long-term cycles in the data, the output is a 256-dimensional temporal feature vector.

[0020] The multi-energy synergy layer comprises two fully connected sublayers with dimensions ranging from 512 to 256. This layer embeds multi-energy coupling relationships, including conversion constraints and transmission constraints. Conversion constraints include an electricity-to-heat efficiency of 0.9, a gas-to-electricity efficiency of 0.35, and a photovoltaic-to-energy storage conversion loss of 5%. Transmission constraints include a heat loss rate of 0.02% / km for thermal pipelines and a pressure limit of 0.4-0.6 MPa for natural gas pipelines.

[0021] By fusing the temporal feature vector output from the temporal feature extraction layer with the coupling constraints (including transformation constraints and transmission constraints) of the multi-energy collaborative layer through the gated activation unit, the multi-energy collaborative feature is output with a dimension of 256.

[0022] The optimization objective layer aims to minimize the overall cost, and the formula is defined as follows:

[0023]

[0024] Among them: energy consumption costs , They represent electricity, heat, cold, and gas, respectively. Let be the power (kW) of the i-th type of energy at time t. The unit price of energy type i at time t (yuan / kWh); carbon emission cost Carbon emissions at time t , The carbon emission factor for energy type i, such as the carbon emission factor for grid electricity. , Carbon price (yuan / t) Equipment depreciation costs , These represent energy storage, transformers, and multi-energy conversion equipment, respectively. Let be the unit loss coefficient (yuan / kWh·h) for the k-th type of equipment. The operating intensity (%) of the k-th type of equipment. Let be the running time (h) of the k-th type of equipment.

[0025] Simultaneously, the target layer integrates general constraints, including energy and power balance constraints, network transmission security constraints, and equipment operating characteristic constraints. The network transmission security constraints are: transformer capacity ≤ 1000kVA, line power flow ≤ 800kW; the equipment operating characteristic constraints are: energy storage SOC ∈ [20%, 90%], boiler temperature ≤ 300℃; the energy and power balance constraints are... That is, input = output + loss.

[0026] The global energy foundation model is pre-trained using public energy datasets, such as regional anonymized load data and publicly available carbon emission coefficients. The training rounds are 200, the learning rate is 0.001, and the optimizer is AdamW.

[0027] S2. Perform structured adaptive pruning on the global energy M to generate a local sub-model (sub-M).

[0028] Based on the energy scenario saliency corresponding to the client type (including industrial clients, residential clients, and commercial clients), the server performs structured adaptive pruning on the multi-energy collaboration layer of the global energy M to construct a lightweight sub-model (i.e., sub-M) adapted to the local scenario.

[0029] The structured adaptive pruning strategy is as follows: Keeping the parameters and structure of the temporal feature extraction layer and the optimization target layer unchanged, neurons with high energy scenario saliency scores in the multi-energy collaborative layer are selected and retained, thus achieving structured adaptive pruning only on the multi-energy collaborative layer. The local scenario is carried out on a client-side platform, and the client's hardware configuration, energy structure, and energy consumption behavior determine the specific characteristics of the local scenario. The specific characteristics of the local scenario (i.e., the client's hardware configuration, energy structure, and energy consumption behavior) are expressed through constraints to obtain local constraints. The contribution of each neuron to the model output under the local constraints is defined as the energy scenario saliency. The specific formula for calculating the energy scenario saliency score is as follows:

[0030]

[0031] in: For the first The energy scene significance score of each neuron; the higher the score, the more important the neuron is to the local scene. This refers to the size of the local dataset. Considering the differences in data accumulation across different scenarios, this is tailored to different client types. Assign values ​​separately; For sub-M pairs of samples The output (i.e., scheduling instructions); For the j-th neuron, For the j-th neuron The gradient contribution to the output (i.e., sensitivity); For the sample The corresponding local constraint weights are as follows: Specifically, for industrial clients, the weight of the waste heat recovery equipment constraint is set to 1.5, and the weight of the conventional constraint is 1.0; for residential clients, the weight of the photovoltaic consumption constraint is set to 1.3, and the weight of the conventional constraint is 1.0; for commercial clients, the weight of the flexible adjustment constraint of air conditioning load is set to 1.4, and the weight of the conventional constraint is 1.0.

[0032] During structured adaptive pruning, the compression ratio of sub-M is dynamically adjusted based on client computing resources (1 / 4-1 / 2):

[0033] Industrial Clients (High Computing Power): Retain the saliency score for energy scenarios. The first 60% of neurons generated have a sub-M parameter size that is approximately half the global energy M.

[0034] Commercial Clients (Medium Computing Power): Retain Energy Saliency Score The first 50% of neurons generated have a sub-M parameter size of approximately 1 / 2.5 of the global energy M;

[0035] Residential Client (Low Computing Power): Retain Energy Salience Score The top 40% of neurons generate sub-M parameters that are approximately 1 / 4 the size of the global energy M, to accommodate the limited resources of edge devices.

[0036] S3. Knowledge distillation initialization based on physical constraints

[0037] After the client downloads sub-M, it performs hierarchical distillation before fine-tuning, aiming to align the global optimization objective with general constraints and ensure that the initial output of sub-M conforms to basic physical rules. Specifically, using the global energy M as the teacher model and sub-M as the student model, sub-M is trained through a distillation loss function that includes an energy constraint penalty term, so that sub-M aligns with the optimization objective and general constraints of the global energy M.

[0038] The distillation target is the output features of each layer of the global energy M issued by the server (excluding the original model parameters), specifically including: output of the time series feature extraction layer: including peak and valley identification results and load trend prediction features; output of the multi-energy coordination layer: including energy coupling coefficient and multi-energy conversion efficiency features; output of the optimization target layer: including cost calculation coefficient and constraint boundary features.

[0039] The distillation loss function including an energy constraint penalty term is defined as the loss function component of the model output that violates physical constraints, which at least include grid interaction boundary constraints and equipment operation safety thresholds. Specifically, the distillation loss function including the energy constraint penalty term employs an improved knowledge distillation loss method, incorporating the energy constraint penalty term. The specific calculation formula is as follows:

[0040]

[0041] in:

[0042] Layer output loss ( ):

[0043]

[0044] in These are the output features of the corresponding layers (temporal feature extraction layer, multi-energy collaboration layer, and optimization target layer) for sub-M and global energy M, respectively;

[0045] Weight regularization ( Used to prevent model overfitting:

[0046]

[0047] Parameters of sub-M A set;

[0048] Energy constraint penalty item ( ):

[0049]

[0050] in, The total number of constrained physical quantities; The final output of sub-M The corresponding number The actual value of each physical quantity; For the first The upper limit of the safety threshold for each physical quantity; For the first The lower limit of the safety threshold for each physical quantity.

[0051] In the energy constraint penalty term, the physical constraints include:

[0052] Power grid interaction boundary constraints: mainly refers to the physical restrictions on the interaction points with the external main power grid, specifically including the upper limit of transformer capacity and the maximum transmission power limit of tie lines, to prevent transformer overload or line tripping due to excessive dispatching instructions;

[0053] Energy storage operating status constraints: covering the operating status restrictions of batteries and thermal / cold tanks, specifically including upper and lower limits of state of charge (SOC), maximum charge and discharge power limits, and cycle life protection constraints to prevent overcharging and over-discharging.

[0054] Key equipment operation safety threshold constraints: These refer to the red lines for the operation safety of energy conversion equipment, specifically including the upper limit of the outlet temperature of gas boilers / waste heat boilers, the pressure safety range of natural gas pipeline nodes, and the flow rate limit of heating network circulating water;

[0055] Multi-energy flow power balance constraint: follows the law of conservation of energy, that is, at any given moment... The total power supplied by each of the electricity, heat, cooling and gas subsystems (including self-produced and purchased power) minus conversion losses must be dynamically matched to the total load demand on the user side.

[0056] Equipment output ramp-up constraint: For rotating equipment such as gas turbines and diesel generators, limit the rate of change of power between adjacent time steps to prevent thermal stress damage to the equipment or system oscillation caused by excessively rapid power adjustment.

[0057] Taking the constraints of energy storage operation status as an example, let's assume... upper limit of constraints The lower limit is 20%. When the model outputs... or At that time, the loss increases significantly, and an additional 1.5x penalty coefficient is set to force the model to learn a safe boundary;

[0058] and , which is a weighting coefficient used to emphasize the importance of physical constraints during the initialization phase.

[0059] The distillation training process is executed entirely on the client-side, with the following parameters set: 20 training epochs and a learning rate of 0.0005.

[0060] S4.FL collaborative fine-tuning: The client fine-tunes sub-M based on local privacy data, and achieves global collaborative optimization through federated learning to obtain an updated global energy M.

[0061] During local fine-tuning, the client uses its own private data without uploading it to the server; the private data used by industrial clients includes production line load, waste heat recovery equipment parameters, and output of self-provided power plants; the private data used by residential clients includes user electricity consumption curves, distributed photovoltaic output, and real-time SOC of energy storage; the private data used by commercial clients includes shopping mall customer traffic, air conditioning load, and emergency power status.

[0062] The fine-tuning objective is to minimize the local optimization error. ,in The scheduling instructions output by sub-M, such as energy storage charging and discharging power; The historical optimal scheduling result is obtained in advance by the dynamic programming algorithm based on historical data.

[0063] During gradient uploading and aggregation, the client only uploads the gradient update amount of sub-M. Security is ensured through homomorphic encryption; the server uses a federated averaging algorithm to aggregate gradients, with the formula as follows:

[0064]

[0065] in, This represents the global energy gradient update amount M on the server side, and K is the number of clients participating in this round of updates. Let k be the local data volume of the kth client. To calculate the total data volume of all clients participating in this update, using As a weighting coefficient to balance the gradient contributions of clients with different amounts of data; For the first The amount of gradient update for sub-M uploaded by each client.

[0066] Subsequently, the server updates the global energy using the aggregated gradient. The updated formula is:

[0067]

[0068] in, and The first Wheel and First The global energy M parameter of the wheel, This is the learning rate.

[0069] S5. Repeat steps S2-S4; simultaneously, every t rounds, perform a correction process based on neuron-level alignment. Specifically, the client filters low-activation neurons based on the local scene activation rate and uses the corresponding layer features of the updated global energy M to perform knowledge transfer on the low-activation neurons to correct the gradient error accumulation caused by pruning. The local scene activation rate is defined as the proportion of samples in the local dataset whose neuron output values ​​exceed a preset activation threshold to the total number of samples.

[0070] The local scene activation rate is used to identify neurons that are strongly correlated with the local scene, and its calculation formula is as follows:

[0071]

[0072] in: is the local scene activation rate of neuron j, that is, the proportion of activation in local data; This is an indicator function; it returns 1 if the condition is met, and 0 otherwise. The threshold values ​​are dynamic: 0.6 for industrial, 0.4 for residential, and 0.5 for commercial.

[0073] The neuron renewal strategy is: highly activated neurons ( ) are considered to be strongly correlated with local scenarios, such as the "waste heat equipment neurons" of industrial clients, whose parameters are retained without updating to prevent catastrophic forgetting; low-activation neurons ( It is weakly correlated with the local scene. The parameters are overwritten using the global energy basic model features issued by the server to align with the global optimization direction.

[0074] Based on energy system load fluctuation rate Dynamic adjustment, the formula is:

[0075] in, Let t be the load volatility in round t, which is defined as:

[0076]

[0077] In the formula, Let t be the power load sequence for round t. , and These represent the maximum, minimum, and average load values ​​for cycle t, respectively.

[0078] S6. Real-time operation optimization to form a closed loop of local decision-making and global feedback. This step realizes the real-time scheduling and dynamic evolution of the integrated energy system through the corrected local sub-model (sub-M). The specific process is as follows:

[0079] (1) Real-time scheduling instruction generation: The client generates a real-time scheduling instruction every 15 minutes using the sub-M corrected in step S5. The instruction content includes the following for different types of client scenarios:

[0080] For industrial clients: This includes energy allocation for production lines, start-up and shutdown of waste heat recovery equipment, and output control of self-owned power plants. For residential clients: This includes the proportion of distributed photovoltaic power generation, charging and discharging power of energy storage devices, and peak-shaving control of household appliances. For commercial clients: This includes flexible adjustment of air conditioning load, emergency power backup strategies, and power adjustment of lighting systems.

[0081] (2) Optimization effect feedback: The client collects system operation data and sends the anonymized optimization effect indicators (excluding the original privacy data) back to the server. The optimization effect indicators cover the following dimensions:

[0082] Economic indicators: Energy cost reduction rate, peak-valley arbitrage profits. Technical indicators: Constraint compliance rate, specifically including the compliance rate of energy storage state of charge (SOC) and equipment operating efficiency. Environmental indicators: Carbon emission reduction.

[0083] (3) Model iterative update: The server dynamically adjusts the training strategy of the global energy M based on the optimization performance indicators fed back by the client. For example, for clients with low constraint satisfaction rates, the server increases their corresponding gradient weights in the next round of federated learning. The system completes a global update every 24 hours, thereby achieving continuous optimization of model performance.

[0084] This application also provides a comprehensive energy system operation optimization system based on adaptive model pruning and constrained distillation, the system comprising:

[0085] Server-side: Deploy a global energy source M and configure a model compression module. The model compression module is used to adaptively prune the multi-energy collaborative layer of the global energy source M according to the saliency of the client's energy scenario, and generate a sub-M adapted to the local scenario. The server-side is also used for model initialization, gradient aggregation update and feature distribution.

[0086] Multiple clients: Sub-M is deployed separately for local data fine-tuning, real-time optimization decision-making, and gradient uploading.

[0087] Communication module: Enables encrypted transmission of gradient and feature data between the server and the client, without transmitting raw privacy data.

[0088] Constraint verification module: Integrated into the client, used to verify whether the scheduling instructions output by sub-M meet the constraints of the local device.

[0089] This application also provides a computer-readable storage medium having computer instructions stored thereon for causing a computer to perform the steps of the above-described method.

[0090] The beneficial effects of this invention are as follows:

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

[0092] Strong edge deployment adaptability: For heterogeneous computing scenarios, through structured adaptive pruning, the huge number of Transformer model parameters is compressed to 1 / 4 to 1 / 2 of the original, so that complex optimization models can be directly deployed on low computing power edge terminals such as smart meters.

[0093] High security of dispatch instructions: To address the uncontrollable problem of AI "black box", knowledge distillation based on physical constraints is used to internalize physical laws such as grid capacity and equipment thresholds into model parameters, which significantly improves the physical feasibility of dispatch instructions and avoids the risk of equipment exceeding limits.

[0094] Good long-term stability: To address the gradient error accumulation problem in federated learning, a dynamic feature alignment mechanism is used to periodically correct the parameter drift of inactive neurons, effectively preventing performance degradation and catastrophic forgetting of the model during long-term fine-tuning.

[0095] Reliable data privacy protection: Relying on the encrypted gradient interaction mode, it realizes collaborative optimization among multiple entities without leaving the domain or sharing the original data, completely solving the privacy concerns of industrial and residential users and breaking down energy data silos. Attached Figure Description

[0096] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0097] Figure 1 Flowchart of Federated Learning Expert Model Training;

[0098] Figure 2 This is a schematic diagram of the federated learning collaborative fine-tuning of an integrated energy system. Detailed Implementation

[0099] To make the technical solution of the present invention clearer, the implementation process is described in detail below in conjunction with specific application scenarios.

[0100] like Figure 1 The diagram illustrates a comprehensive energy system operation optimization method based on adaptive pruning and constrained distillation, which specifically includes the following steps:

[0101] S1 constructs a global energy foundation model (Global Energy M), which is a multi-task optimization model based on the Transformer architecture. It is trained using a public energy dataset and is used to learn the regional multi-energy collaborative optimization rules and general constraints. Its specific structure includes a time-series feature extraction layer, a multi-energy collaborative layer, and an optimization objective layer.

[0102] The specific rules for regional-level multi-energy synergistic optimization include:

[0103] Multi-energy complementary coupling principle: This includes the efficiency characteristics and substitution relationships of different energy forms such as electricity, heat, cooling, and gas during the conversion process. For example, the economic strategy of prioritizing the use of electric boilers to replace gas boilers for heating during periods of low electricity prices, or using gas-fired combined cooling, heating, and power (CCHP) systems to generate electricity and provide heating during periods of high electricity prices.

[0104] Source-load timing matching patterns: This includes the timing correlation between renewable energy output and user load demand. For example, it identifies the overlap between "peak photovoltaic output at midday" and "peak commercial air conditioning cooling load" and automatically generates scheduling strategies to improve the local photovoltaic consumption rate.

[0105] Dynamic inertia and storage patterns: This includes the system's thermal inertia and energy storage arbitrage mechanisms. Specifically, the system's thermal inertia involves identifying the lag time in the temperature drop after heating is stopped, thus reducing heating power in advance without compromising comfort. Energy storage arbitrage mechanisms refer to mastering the low-charge, high-discharge peak-valley arbitrage mode of electric / thermal energy storage devices to reduce overall lifecycle operating costs.

[0106] The general constraints specifically include:

[0107] Energy and power balance constraints: These must comply with Kirchhoff's laws and the law of conservation of energy, meaning that at any given moment... The sum of the electrical and gas power input to the system and the output of renewable energy must equal the electricity, heat, and cooling load demand on the user side plus system conversion losses and energy storage charging power.

[0108] Network transmission security constraints: These restrict the physical state of energy transmission networks, specifically including: node voltage deviations and maximum transmission capacity of distribution networks; supply and return water temperature limits and maximum flow rates of heating networks; and node pressure safety ranges of natural gas networks.

[0109] Equipment operating characteristic constraints: covering the physical limits of key equipment, specifically including: ramp rate limits for energy conversion equipment; upper and lower limits of state of charge (SOC) for energy storage devices; and minimum start-up and shutdown time limits for units.

[0110] The temporal feature extraction layer employs a 6-layer Transformer encoder.

[0111] The hidden layer has a dimension of 512, and the number of attention heads is 8. The input is 15-minute time-series data with a dimension of 128, including energy, environmental, and economic data. Energy data consists of electricity, heat, cooling, and gas loads, covering the past 48 hours; environmental data includes temperature, light intensity, and wind speed, used to influence renewable energy output; and economic data includes time-of-use electricity prices and carbon prices, covering the past 7 days. By embedding temporal location encoding and utilizing a self-attention mechanism to capture short-term fluctuations and long-term cycles in the data, the output is a 256-dimensional temporal feature vector.

[0112] The multi-energy synergy layer comprises two fully connected sublayers with dimensions ranging from 512 to 256. This layer embeds multi-energy coupling relationships, including conversion constraints and transmission constraints. Conversion constraints include an electricity-to-heat efficiency of 0.9, a gas-to-electricity efficiency of 0.35, and a photovoltaic-to-energy storage conversion loss of 5%. Transmission constraints include a heat loss rate of 0.02% / km for thermal pipelines and a pressure limit of 0.4-0.6 MPa for natural gas pipelines.

[0113] By fusing the temporal feature vector output from the temporal feature extraction layer with the coupling constraints (including transformation constraints and transmission constraints) of the multi-energy collaborative layer through the gated activation unit, the multi-energy collaborative feature is output with a dimension of 256.

[0114] The optimization objective layer aims to minimize the overall cost, and the formula is defined as follows:

[0115]

[0116] Among them: energy consumption costs , They represent electricity, heat, cold, and gas, respectively. Let be the power (kW) of the i-th type of energy at time t. The unit price of energy type i at time t (yuan / kWh); carbon emission cost Carbon emissions at time t , The carbon emission factor for energy type i, such as the carbon emission factor for grid electricity. , Carbon price (yuan / t) Equipment depreciation costs , These represent energy storage, transformers, and multi-energy conversion equipment, respectively. Let be the unit loss coefficient (yuan / kWh·h) for the k-th type of equipment. The operating intensity (%) of the k-th type of equipment. Let be the running time (h) of the k-th type of equipment.

[0117] Simultaneously, the target layer integrates general constraints, including energy and power balance constraints, network transmission security constraints, and equipment operating characteristic constraints. The network transmission security constraints are: transformer capacity ≤ 1000kVA, line power flow ≤ 800kW; the equipment operating characteristic constraints are: energy storage SOC ∈ [20%, 90%], boiler temperature ≤ 300℃; the energy and power balance constraints are... That is, input = output + loss.

[0118] The global energy foundation model is pre-trained using public energy datasets, such as regional anonymized load data and publicly available carbon emission coefficients. The training rounds are 200, the learning rate is 0.001, and the optimizer is AdamW.

[0119] S2. Perform structured adaptive pruning on the global energy M to generate a local sub-model (sub-M).

[0120] Based on the client type (including industrial, residential, and commercial clients) and the salience of their corresponding energy scenarios, the server performs structured pruning on the multi-energy coordination layer of the global energy M to obtain a lightweight sub-model (i.e., sub-M) adapted to the local scenario. The local scenario is carried by the client, and the client's hardware configuration, energy structure, and energy consumption behavior determine the specific characteristics of the local scenario.

[0121] The structured adaptive pruning strategy is as follows: Keeping the parameters and structure of the temporal feature extraction layer and the optimization target layer unchanged, neurons with high energy scenario saliency scores in the multi-energy collaboration layer are selected and retained, thus achieving structured adaptive pruning only on the multi-energy collaboration layer. The specific features of the local scenario (i.e., the client's hardware configuration, energy structure, and energy consumption behavior) are expressed under constraints to obtain local constraints. The contribution of each neuron to the model output under local constraints is defined as the energy scenario saliency. The specific formula for calculating the energy scenario saliency score is as follows:

[0122]

[0123] in: For the first The saliency score of each neuron indicates that the neuron is more important to the local scene; This refers to the size of the local dataset. In this embodiment, considering the differences in data accumulation across different scenarios, the industrial client's... The value is 3000, from the resident client. The value is 1000, for commercial clients. The value is 500; For local sub-model samples The output (i.e., scheduling instructions); For the j-th neuron The gradient contribution to the output (i.e., sensitivity); For the sample Specifically, for industrial clients, the weight of the waste heat recovery equipment constraint is set to 1.5, and the weight of the conventional constraint is set to 1.0; for residential clients, the weight of the photovoltaic consumption constraint is set to 1.3, and the weight of the conventional constraint is set to 1.0; for commercial clients, the weight of the flexible adjustment constraint of the air conditioning load is set to 1.4, and the weight of the conventional constraint is set to 1.0.

[0124] During structured adaptive pruning, the compression ratio of sub-M is dynamically adjusted (1 / 4-1 / 2) based on client computing resources, implemented using a pruning controller.

[0125] Industrial Clients (High Computing Power): Retain the saliency score for energy scenarios. The first 60% of neurons generated have a sub-M parameter size that is approximately half the global energy M.

[0126] Commercial Clients (Medium Computing Power): Retain Energy Saliency Score The first 50% of neurons generated have a sub-M parameter size of approximately 1 / 2.5 of the global energy M;

[0127] Residential Client (Low Computing Power): Retain Energy Salience Score The top 40% of neurons generate sub-M parameters that are approximately 1 / 4 the size of the global energy M, to accommodate the limited resources of edge devices.

[0128] The pruning controller is a logical control unit residing on the server side, used to execute structured adaptive pruning algorithms. Its core function is to calculate the saliency score of the energy scenario based on feedback from the client. It calculates and distributes neuron masks, dynamically adjusts the multi-energy collaborative layer topology of global energy M, and thus generates sub-models with heterogeneous parameter scales for clients with different computing power.

[0129] S3. Knowledge distillation initialization based on physical constraints

[0130] After the client downloads the pruned local sub-model, it performs hierarchical distillation before fine-tuning to align the global optimization objective with general constraints, ensuring that the initial output of the local sub-model conforms to basic physical rules. Specifically, using the global energy M as the teacher model and the sub-M as the student model, the sub-M is trained using a distillation loss function that includes an energy constraint penalty term, so that the sub-M aligns with the optimization objective and general constraints of the global energy M.

[0131] The distillation target is the output features of each layer of the global energy M issued by the server (excluding the original model parameters), specifically including: output of the time series feature extraction layer: including peak and valley identification results and load trend prediction features; output of the multi-energy coordination layer: including energy coupling coefficient and multi-energy conversion efficiency features; output of the optimization target layer: including cost calculation coefficient and constraint boundary features.

[0132] The distillation loss function including an energy constraint penalty term is defined as the loss function component for model output that violates physical constraints. Specifically, the distillation loss function including an energy constraint penalty term employs an improved knowledge distillation loss method, incorporating the energy constraint penalty term. The specific calculation formula is as follows:

[0133]

[0134] in:

[0135] Layer output loss ( ):

[0136]

[0137] in These are the output features of the corresponding layers (temporal feature extraction layer, multi-energy collaboration layer, and optimization target layer) for sub-M and global energy M, respectively;

[0138] Weight regularization ( This is used to prevent model overfitting, specifically:

[0139]

[0140] Let M be the set of parameters;

[0141] Energy constraint penalty item ( ):

[0142]

[0143] in, The total number of constrained physical quantities; The final output of sub-M The corresponding number The actual value of each physical quantity; For the first The upper limit of the safety threshold for each physical quantity; For the first The lower limit of the safety threshold for each physical quantity.

[0144] In the energy constraint penalty term, the physical constraints include:

[0145] Power grid interaction boundary constraints: mainly refers to the physical restrictions on the interaction points with the external main power grid, specifically including the upper limit of transformer capacity and the maximum transmission power limit of tie lines, to prevent transformer overload or line tripping due to excessive dispatching instructions;

[0146] Energy storage operating status constraints: covering the operating status restrictions of batteries and thermal / cold tanks, specifically including upper and lower limits of state of charge (SOC), maximum charge and discharge power limits, and cycle life protection constraints to prevent overcharging and over-discharging.

[0147] Key equipment operation safety threshold constraints: These refer to the red lines for the operation safety of energy conversion equipment, specifically including the upper limit of the outlet temperature of gas boilers / waste heat boilers, the pressure safety range of natural gas pipeline nodes, and the flow rate limit of heating network circulating water;

[0148] Multi-energy flow power balance constraint: follows the law of conservation of energy, that is, at any given moment... The total power supplied by each of the electricity, heat, cooling and gas subsystems (including self-produced and purchased power) minus conversion losses must be dynamically matched to the total load demand on the user side.

[0149] Equipment output ramp-up constraint: For rotating equipment such as gas turbines and diesel generators, limit the rate of change of power between adjacent time steps to prevent thermal stress damage to the equipment or system oscillation caused by excessively rapid power adjustment.

[0150] Taking the constraints of energy storage operation status as an example, let's assume... upper limit of constraints The lower limit is 20%. When the model outputs... or At that time, the loss increases significantly, and an additional 1.5x penalty coefficient is set to force the model to learn a safe boundary;

[0151] and This is the weighting coefficient. In this embodiment, we take... , This is used to emphasize the importance of physical constraints in the initialization phase.

[0152] The distillation training process is executed entirely on the client-side, with the following parameters set: 20 training epochs and a learning rate of 0.0005.

[0153] S4.FL collaborative fine-tuning involves the client fine-tuning sub-M based on local privacy data, achieving global collaborative optimization through federated learning to obtain an updated global energy M, as detailed below. Figure 2 As shown.

[0154] During local fine-tuning, the client uses its own private data without uploading it to the server; the private data used by industrial clients includes production line load, waste heat recovery equipment parameters, and output of self-provided power plants; the private data used by residential clients includes user electricity consumption curves, distributed photovoltaic output, and real-time SOC of energy storage; the private data used by commercial clients includes shopping mall customer traffic, air conditioning load, and emergency power status.

[0155] The fine-tuning objective is to minimize the local optimization error. ,in The scheduling instructions output by sub-M, such as energy storage charging and discharging power; The historical optimal scheduling result is obtained in advance by the dynamic programming algorithm based on historical data.

[0156] During gradient uploading and aggregation, the client only uploads the gradient update amount of sub-M. Security is ensured through homomorphic encryption; the server uses a federated averaging algorithm to aggregate gradients (implemented based on a gradient aggregator), the formula is:

[0157]

[0158] in, This represents the global energy gradient update amount M on the server side, and K is the number of clients participating in this round of updates. Let k be the local data volume of the kth client. To calculate the total data volume of all clients participating in this update, using As a weighting coefficient to balance the gradient contributions of clients with different amounts of data; For the first The amount of gradient update for sub-M uploaded by each client.

[0159] A gradient aggregator is a server-side algorithmic component used to merge update information from multiple client sub-Ms. It receives encrypted gradient updates from each client's sub-M. And combined with the weight of the local data volume of each client. Calculate the global gradient update using federated averaging or other weighted aggregation strategies. This enables the parameter evolution of the global energy model.

[0160] Subsequently, the server updates the global energy using the aggregated gradient. The updated formula is:

[0161]

[0162] in, and The first Wheel and First The global energy M parameter of the wheel, The learning rate is set to 0.001 in this embodiment.

[0163] S5. Repeat steps S2-S4; at the same time, every t rounds, perform a correction process based on neuron-level alignment. The specific method is as follows: the client selects low-activation neurons based on the activation rate of the local scene, and uses the corresponding layer features of the updated global energy M to perform knowledge transfer on the low-activation neurons in order to correct the gradient error accumulation caused by pruning.

[0164] The local scene activation rate is defined as the proportion of samples in the local dataset whose neuron output values ​​exceed a preset activation threshold, relative to the total number of samples. The local scene activation rate is used to identify neurons strongly correlated with the local scene, and its calculation formula is:

[0165]

[0166] in: is the local scene activation rate of neuron j, that is, the proportion of activation in local data; This is an indicator function; it returns 1 if the condition is met, and 0 otherwise. The threshold values ​​are dynamic: 0.6 for industrial, 0.4 for residential, and 0.5 for commercial.

[0167] The neuron renewal strategy is: highly activated neurons ( ) are considered to be strongly correlated with local scenarios, such as the "waste heat equipment neurons" of industrial clients, whose parameters are retained without updating to prevent catastrophic forgetting; low-activation neurons ( It is weakly correlated with the local scene. The parameters are overwritten using the global energy basic model features issued by the server to align with the global optimization direction.

[0168] Based on energy system load fluctuation rate Dynamic adjustment, the formula is:

[0169] in, Let t be the load volatility in round t, which is defined as:

[0170]

[0171] In the formula, Let t be the power load sequence for round t. , and These represent the maximum, minimum, and average load values ​​for cycle t, respectively.

[0172] S6. Real-time optimization is performed to form a closed loop of local decision-making and global feedback. The client generates real-time scheduling instructions using the sub-M corrected in step S5; simultaneously, the client collects real-time optimization performance indicators and feeds them back to the server. The server adjusts the training strategy of the global energy M based on the optimization performance indicators and performs iterative updates with the client for the next cycle.

[0173] During the real-time scheduling instruction generation process, the client generates scheduling instructions every 15 minutes through the corrected sub-M.

[0174] The optimization performance feedback consists of anonymized optimization performance metrics reported by the client to the server, excluding the original data. These metrics include economic, technical, and environmental indicators. Economic indicators include energy cost reduction rate and peak-valley arbitrage revenue; technical indicators include constraint compliance rate, such as the compliance rate of energy storage SOC and equipment operating efficiency; and environmental indicators include the reduction in carbon emissions.

[0175] The model iterative update involves the server dynamically adjusting the training weights of the global energy base model based on feedback metrics. For example, gradient weights are added to clients with low constraint satisfaction rates. A global update is completed every 24 hours to continuously optimize model performance.

[0176] In step S6, the real-time scheduling instruction includes:

[0177] For industrial clients, this includes energy allocation for production lines, start-up and shutdown of waste heat recovery equipment, and power output from self-owned power plants;

[0178] For residential users, this includes photovoltaic consumption ratio, energy storage charging and discharging power, and peak-shaving control of household appliances;

[0179] For commercial clients, this includes air conditioning load regulation, emergency power backup strategies, and lighting system power.

[0180] Another embodiment of this application provides a comprehensive energy system operation optimization system based on adaptive model pruning and constrained distillation, the system comprising:

[0181] Server-side: Deploys a global energy source M and configures a model compression module. The model compression module is used to adaptively prune the multi-energy collaborative layer of the global energy source M according to the saliency of the client's energy scenario, generating a sub-M adapted to the local scenario. The server-side is also used for model initialization, gradient aggregation update, and feature distribution.

[0182] Multiple clients: each deployed as a sub-M for local data fine-tuning, real-time optimization decision-making, and gradient uploading;

[0183] Communication module: Enables encrypted transmission of gradient and feature data between the server and client, without transmitting raw privacy data;

[0184] Constraint verification module: Integrated into the client, used to verify whether the scheduling instructions output by sub-M meet the constraints of the local device.

[0185] Another embodiment of this application provides a computer-readable storage medium having computer instructions stored thereon for causing a computer to perform the above-described method.

Claims

1. A comprehensive energy system operation optimization method based on adaptive pruning and constrained distillation, characterized in that, Includes the following steps: S1. Construct a global energy basic model, denoted as global energy M; the global energy M includes a time-series feature extraction layer, a multi-energy collaboration layer, and an optimization target layer; S2. Construct a local sub-model, denoted as sub-M; The server performs structured adaptive pruning on the multi-energy collaborative layer of the global energy M, and selects and retains neurons with high energy scenario saliency scores in the multi-energy collaborative layer to obtain sub-M; S3. The client downloads sub-M and trains it using a distillation loss function that includes an energy constraint penalty term, so that sub-M aligns with the optimization objective of the global energy M and the general constraints; the energy constraint penalty term is defined as the loss function component of the model output that violates the physical constraints; S4. The client uses local privacy data to fine-tune the sub-M, and achieves global collaborative optimization through federated learning to obtain an updated global energy M; S5. Repeat steps S2-S4; every t-round interval, the client filters neurons with low activation rates in the local scene and uses the corresponding layer feature output of the updated global energy M to perform parameter correction on the low-activation neurons; the local scene activation rate is defined as the proportion of the number of samples in the local dataset whose neuron output values ​​exceed the preset activation threshold to the total number of samples. S6. The client generates real-time scheduling instructions using the sub-M corrected in step S5; at the same time, the client collects the optimization effect indicators of real-time operation and feeds them back to the server. The server adjusts the training strategy of global energy M based on the optimization effect indicators and performs the next cycle of iterative update with the client.

2. The method according to claim 1, characterized in that, The optimization objective layer of the global energy M in step S1 aims to "minimize the overall cost," which is specifically defined by the following formula: in: The cost of energy consumption. Let be the power of the i-th type of energy at time t. Let be the unit price of the i-th type of energy at time t; For carbon emission costs, Let be the carbon emissions at time t. For carbon price; This refers to equipment depreciation costs. Let be the unit loss coefficient for the k-th type of equipment. For the operating intensity of the k-th type of equipment, The running time of the k-th type of equipment; Furthermore, the general constraints include energy and power balance constraints, network transmission security constraints, and equipment operating characteristic constraints.

3. The method according to claim 1, characterized in that, The energy scenario saliency mentioned in step S2 is defined as the contribution of each neuron to the model output under local constraints. These local constraints are obtained by constraining the client's hardware configuration, energy structure, and energy consumption behavior. The formula for calculating the energy scenario saliency score is as follows: in: The energy scenario saliency score for the j-th neuron. For local dataset size, For sub-M pairs of samples The output, For the j-th neuron, For the sample The corresponding local constraint weights.

4. The method according to claim 1, characterized in that, The distillation loss function including the energy constraint penalty term mentioned in step S3 is defined as follows: in: This represents the distillation loss value. The layer output loss is used to characterize the Euclidean distance between the intermediate layer outputs of sub-M and the global energy M; For weight regularization terms; The energy constraint penalty term is used to penalize outputs that violate physical constraints. It is defined as the sum of the squares of all constraint violations, and the physical constraints include at least grid interaction boundary constraints and equipment operation safety threshold constraints. and These are the weight coefficients for the weight regularization term and the energy constraint penalty term, respectively.

5. The method according to claim 1, characterized in that, The formula for calculating the local scene activation rate of neurons in step S5 is as follows: in: Let be the local scene activation rate of the j-th neuron; This is an indicator function; it returns 1 if the condition is met, and 0 otherwise. For neuron j, pair of samples The output, The activation threshold; The value of the interval t is dynamically adjusted according to the load volatility of the energy system: when the volatility is greater than 20%, t = 5 rounds; when the volatility is less than 5%, t = 20 rounds.

6. The method according to claim 1, characterized in that, In step S4, during the process of achieving global collaborative optimization through federated learning, only the gradient update is uploaded to the server. The server uses a federated averaging algorithm to aggregate the gradients and update the global energy M. The formula for aggregating the gradients using the federated averaging algorithm is: in Let M be the gradient update amount of the global energy M on the server side. The number of clients participating in this update, The local data volume of the kth client The total data volume of all clients participating in this update. This represents the sub-M gradient update amount uploaded by the k-th client.

7. The method according to claim 1, characterized in that, The real-time scheduling instructions in step S6 include: For industrial clients, this includes energy allocation for production lines, start-up and shutdown of waste heat recovery equipment, and power output from self-owned power plants; For residential users, this includes photovoltaic consumption ratio, energy storage charging and discharging power, and peak-shaving control of household appliances; For commercial clients, this includes air conditioning load regulation, emergency power backup strategies, and lighting system power. The optimization effect feedback includes economic indicators, technical indicators, and environmental indicators; economic indicators are the energy cost reduction rate and peak-valley arbitrage revenue; technical indicators are the constraint compliance rate, including the compliance rate of energy storage SOC and equipment operating efficiency; and environmental indicators are the reduction in carbon emissions.

8. A comprehensive energy system operation optimization system based on adaptive model pruning and constrained distillation, characterized in that, include: Server-side: A global energy source M is deployed and configured with a model compression module. The model compression module is used to adaptively prune the multi-energy collaboration layer of the global energy source M according to the salience of the client's energy scenario, and generate a sub-M adapted to the local scenario. The server-side is also used for model initialization, gradient aggregation and updating, and feature distribution. Multiple clients: each deployed as a sub-M for local data fine-tuning, real-time optimization decision-making, and gradient uploading; Communication module: Enables encrypted transmission of gradient and feature data between the server and client, without transmitting raw privacy data; Constraint verification module: Integrated into the client, used to verify whether the scheduling instructions output by sub-M meet the constraints of the local device.

9. The system according to claim 8, characterized in that, The clients include industrial clients, commercial clients, and residential clients; a local sub-model with a first parameter scale is deployed for industrial clients, a local sub-model with a second parameter scale is deployed for commercial clients, and a local sub-model with a third parameter scale is deployed for residential clients; wherein, the first parameter scale is larger than the second parameter scale, and the second parameter scale is larger than the third parameter scale.

10. A computer-readable storage medium storing computer instructions thereon, characterized in that, The computer instructions are used to cause the computer to perform the steps of the method as described in any one of claims 1-7.