Hybrid drive-based two-stage electro-thermal coupling system energy flow calculation method and system

By constructing a heterogeneous graph structure and combining graph neural network prediction with physical correction, the problems of high Jacobian matrix dimension and insufficient computational accuracy in traditional methods are solved, realizing efficient and accurate energy flow analysis and optimization of integrated energy systems.

CN121743632BActive Publication Date: 2026-04-28SHANDONG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANDONG UNIV
Filing Date
2026-02-28
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Traditional multi-energy flow analysis methods face problems such as high Jacobian matrix dimensionality and susceptibility to singularities or ill-conditioned phenomena when dealing with integrated energy systems, resulting in insufficient computational accuracy and efficiency. Furthermore, data-driven methods are not accurate enough when dealing with non-Euclidean topologies.

Method used

A two-stage electrothermal coupling system energy flow calculation method based on hybrid drive is adopted. By constructing a heterogeneous graph structure, a graph neural network is used for prediction. The method is then combined with physical equations and attention regularization loss function optimization to output a high-precision initial power flow solution. Subsequently, rapid correction is achieved through Jacobian matrix sparsification and block correction.

Benefits of technology

It achieves high-precision, physically consistent system state prediction, improves computational efficiency, adapts to multiple topology scenarios, and provides an efficient integrated energy system analysis and optimization solution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121743632B_ABST
    Figure CN121743632B_ABST
Patent Text Reader

Abstract

The application provides a two-stage electric-thermal coupling system energy flow calculation method and system based on hybrid driving, belongs to the technical field of energy flow calculation of comprehensive energy systems, and comprises the following steps: constructing a heterogeneous graph structure for the electric-thermal coupling comprehensive energy system, and building heterogeneous graph data based on the characteristics of the heterogeneous graph structure; inputting the heterogeneous graph data into a graph neural network model based on a relationship-aware grouping graph attention mechanism; taking the prediction result output by the graph neural network model based on the relationship-aware grouping graph attention mechanism as an initial value, and quickly correcting the initial value; and outputting complete system multi-energy flow analysis results based on the correction result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of energy flow calculation technology for integrated energy systems, and particularly relates to a method and system for energy flow calculation of a two-stage electrothermal coupling system based on hybrid drive. Background Technology

[0002] The statements in this section are merely background information related to the present invention and do not necessarily constitute prior art.

[0003] An integrated energy system refers to a new type of energy system that couples the production, transmission, storage, conversion and consumption of various energy forms such as electricity, gas, heat, cooling, hydrogen and energy storage within a region into an organic whole through overall planning, coordinated operation and intelligent interaction, thereby achieving a high-efficiency, clean, economical, safe and reliable energy supply.

[0004] Integrated energy systems, as an important means of effectively absorbing high proportions of renewable energy, improving the flexibility and economy of system operation, and ensuring a reliable supply of multiple energy sources, are increasingly becoming a key infrastructure supporting energy transition and sustainable development in a profound transformation characterized by the decarbonization of the energy system, the electrification of end-use energy, and the digitalization of system regulation.

[0005] This system, through the coupling and synergy of multiple energy forms such as electricity and heat, breaks through the limitations of traditional single energy systems in terms of spatiotemporal regulation and energy efficiency improvement, providing a physical basis and operational flexibility for the access and consumption of large-scale fluctuating renewable energy.

[0006] Multi-energy flow analysis, as a fundamental tool for the analysis and optimization of integrated energy system operations, needs to accurately characterize the energy distribution of heterogeneous networks under the influence of coupled devices, while also meeting the demands for increasingly larger scenario scales and generalization capabilities. It has received growing attention in areas such as state estimation, economic dispatch, and reliability assessment. However, with the increasing coupling and nonlinearity of energy systems, traditional multi-energy flow analysis methods based on the Newton-Laurent method face significant challenges. Although this method possesses a solid mathematical foundation and good convergence, both unified and decompositional solution strategies struggle to avoid problems such as high Jacobian matrix dimensionality and susceptibility to singularities or ill-conditioned conditions. This results in a dual bottleneck of accuracy and efficiency for traditional methods in complex network topologies and load fluctuation scenarios.

[0007] Data-driven approaches offer new insights into traditional mechanistic models, and their advantages in nonlinear modeling have garnered widespread attention. Some studies treat power flow calculation as a black-box mapping from operating conditions to system states, employing models such as multilayer perceptrons and convolutional neural networks to directly fit the input-output relationship. While this effectively improves computational efficiency to some extent, when dealing with integrated energy systems with non-Euclidean topologies, the convolutional kernels of traditional convolutional neural networks (CNNs) exhibit a fundamental mismatch when applied to systems like power grids and heating networks. This mismatch stems from the conflict between their underlying design assumptions and the physical characteristics of the energy network. These shortcomings lead to inaccurate computational results, impacting the comprehensive analysis and optimization of the system. Summary of the Invention

[0008] To overcome the shortcomings of the prior art, this invention provides a method and system for calculating energy flow in a two-stage electrothermal coupling system based on hybrid drive. This approach improves the system's computational efficiency while ensuring accuracy, providing efficient and reliable technical support for online operation analysis, planning evaluation, and intelligent scheduling of integrated energy systems.

[0009] To achieve the above objectives, one or more embodiments of the present invention provide the following technical solutions:

[0010] Firstly, a method for calculating energy flow in a two-stage electrothermal coupling system based on hybrid drive is disclosed, including:

[0011] Heterogeneous graph structures are constructed for integrated energy systems with electrothermal coupling, and heterogeneous graph data is built based on the characteristics of the heterogeneous graph structures.

[0012] Heterogeneous graph data is input into a graph neural network model based on a relation-aware grouped graph attention mechanism;

[0013] During training, the model fuses node feature predictions with edge features, and then optimizes them using a multi-task loss function that includes data fitting loss, physical equation soft constraint loss, and attention regularization loss. This allows the network to accurately learn data mapping relationships while its internal message passing patterns and attention weight distribution are guided by physical laws and causal priors, outputting a high-precision, physically consistent initial solution of the power flow as the prediction result.

[0014] The prediction results output by the graph neural network model based on the relation-aware grouped graph attention mechanism are used as the initial value, and the initial value is quickly corrected.

[0015] Based on the correction results, a complete system multi-energy flow analysis is output.

[0016] As a further technical solution, when the initial value is quickly corrected, the initial solution predicted by the graph neural network model is received, and the strong and weak regions are identified by the attention weights obtained during network training. Based on this, the complete Jacobian matrix is ​​intelligently sparsified and divided into blocks to construct an efficient hybrid Jacobian matrix. Lightweight Gauss-Newton projection is then performed to quickly correct the residuals and obtain a physically feasible accurate solution.

[0017] As a further technical solution, when constructing a heterogeneous graphical structure for an electrothermal coupled integrated energy system, the specific steps include:

[0018] Build power and heat system models for power flow calculations, and realize the internal coupling of the energy system through corresponding energy conversion equipment;

[0019] Power flow iterative calculations are performed on power and heat system models to generate standardized datasets;

[0020] The multimodal characteristics and complex interactions of an electrothermal coupled integrated energy system are abstracted into a heterogeneous graph structure.

[0021] As a further technical solution, the generation of the normalized dataset includes:

[0022] Complete system status information, including node voltage amplitude, phase angle, and supply and return water temperature, is obtained. Then, by applying random disturbances to the load power of each node in the system and the output of conventional generator sets, different operating conditions and fluctuation scenarios are simulated to generate a large-scale historical dataset covering a wide range of operating boundaries. After processing the historical dataset, a normalized dataset is generated.

[0023] As a further technical solution, the heterogeneous graph structure is ,in It is the set of all nodes in the system; It is a set of edges, which not only includes the physical connections of transmission lines and pipelines, but also models the energy conversion relationships of coupled devices as a kind of virtual edge; It is an adjacency matrix with dimension 1. ,in The number of nodes is denoted by 1. When nodes are connected to each other, the matrix elements are filled with 1, while 0 indicates that there is no connection between nodes.

[0024] As a further technical solution, heterogeneous graph data is input into a graph neural network model based on a relation-aware grouped graph attention mechanism, including:

[0025] System nodes are classified into two main categories based on their energy type: power nodes and thermal nodes.

[0026] The neighbor set is divided into several subsets according to the edge type. Then, the attention coefficient is calculated independently within each subset to maintain the independence of different energy flow process characteristics. Finally, the aggregation results under each relation are weighted and fused through learnable type fusion weights.

[0027] Then, the node features and edge embeddings are fed into a relationship-specific attention projection vector to obtain the information contribution of neighbors to the node, and the attention weights are obtained by normalization within the subset.

[0028] Finally, the nodes are obtained by weighted aggregation across all relationships. In the The embedding vectors of the layers are used to perform learnable weighting of different types of energy transfer paths through relational fusion.

[0029] As a further technical solution, the input characteristics of the power node include its active power, reactive power and type code, and the output characteristics are the node voltage amplitude and phase angle to be determined; the input characteristics of the thermal node include thermal power and type code, and the output characteristics are the node supply water temperature and return water temperature to be determined.

[0030] In edge modeling, the connection relationships are divided into three categories: power lines, thermal pipes, and coupling devices. Power lines use resistance and reactance as input features and output the active and reactive power transmitted by the line. Thermal pipes use pipe length, diameter, heat transfer coefficient per unit length, and roughness as input features and output the mass flow rate of the pipe segment. Coupling devices use energy conversion coefficient as input features and output their electro-thermal power conversion relationship.

[0031] As a further technical solution, it also includes: using known physical experience to guide and constrain the distribution of attention weights to ensure that the interaction relationship learned by the model is consistent with the actual energy flow law of the electrothermal coupling system. Specifically, it includes: selecting line admittance as a priori value in power lines, selecting thermal conductivity, cross-sectional area and pipe length as priori values ​​in thermal pipe networks, using conversion efficiency and rated power as priori values ​​as offline parameters for coupling equipment, and using KL divergence constraints to encourage the alignment of physical priors with attention coefficients.

[0032] As a further technical solution, when training the model parameters, data-driven learning, physical law constraints and attention guidance are integrated into the loss function;

[0033] The data-driven loss function includes the node state mean square error loss and the edge current mean square error loss, which are used to fit voltage, phase angle and temperature state variables.

[0034] The loss function of physical constraints introduces the physical equations of power balance and mass flow conservation as differentiable penalty terms, and constrains the power of coupled devices to not exceed the limit;

[0035] The KL divergence loss function utilizes physical priors such as line admittance and heat transfer coefficient to guide the distribution of attention weights to conform to the causal laws of actual energy transfer, thereby improving the interpretability and generalization ability of the model.

[0036] As a further technical solution, it also includes: unifying the steady-state power flow equations of electrothermal coupled integrated energy systems;

[0037] Let the predicted system state in the first stage be... The corresponding physical residual is ,exist Perform a first-order Taylor expansion at the current node and solve for the Jacobian matrix at the current node;

[0038] After solving for the increment based on the Jacobian matrix, the correction result can be obtained by updating the initial solution once. ,in The optimal value is determined by a grid search of the validation set;

[0039] Attention weights are used to guide the sparsification and block structure of the Jacobian matrix, that is, the cross derivative is preserved in the region of high attention and the decoupling approximation is used in the region of low attention.

[0040] Describe the coupling nodes The relevant attention scores are used and a threshold is set to divide the system into strongly coupled and weakly coupled regions, resulting in a binary mask matrix.

[0041] Selective preservation and sparsification of the electric-thermal cross-blocks in the complete Jacobian matrix based on the binary mask matrix.

[0042] Secondly, a power flow calculation system for a two-stage electrothermal coupling system based on hybrid drive is disclosed, including:

[0043] The heterogeneous graph modeling and data preparation module is configured to: construct heterogeneous graph structures for integrated energy systems with electrothermal coupling, and build heterogeneous graph data based on the characteristics of the heterogeneous graph structures;

[0044] The physics-guided graph neural network prediction module is configured to input heterogeneous graph data into a graph neural network model based on a relation-aware grouped graph attention mechanism;

[0045] During training, the model fuses node feature predictions with edge features, and then optimizes them using a multi-task loss function that includes data fitting loss, physical equation soft constraint loss, and attention regularization loss. This allows the network to accurately learn data mapping relationships while its internal message passing patterns and attention weight distribution are guided by physical laws and causal priors, outputting a high-precision, physically consistent initial solution of the power flow as the prediction result.

[0046] The attention-guided physical correction module is configured to: take the prediction result output by the graph neural network model based on the relation-aware grouped graph attention mechanism as the initial value and quickly correct the initial value.

[0047] The control and output module is configured to output complete system multi-energy flow analysis results based on the correction results.

[0048] The above one or more technical solutions have the following beneficial effects:

[0049] Based on historical operating information, the technical solution of this invention leverages the natural adaptability of heterogeneous graph neural networks to electrothermal coupling systems to achieve end-to-end prediction of system states. It not only surpasses previous data-driven methods in prediction accuracy but also achieves efficient solution while ensuring physical consistency of output. Ultimately, it provides a technical solution that combines high efficiency and scalability for rapid power flow analysis, multi-topology scenario adaptation, and planning optimization of integrated energy systems.

[0050] Advantages of additional aspects of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0051] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.

[0052] Figure 1 This is an architecture diagram of a two-stage energy flow computation based on hybrid drive.

[0053] Figure 2 This is a diagram illustrating the working principle of a graph neural network.

[0054] Figure 3 This is a schematic diagram of a calculation example in this embodiment;

[0055] Figure 4 This is a comparison chart of the energy flow state prediction results in this embodiment. Detailed Implementation

[0056] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0057] It should be noted that the terminology used herein is for the purpose of describing particular implementations only and is not intended to limit the exemplary implementations of the present invention.

[0058] Where there is no conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.

[0059] Example 1

[0060] This embodiment discloses a two-stage energy flow calculation method for an electrothermal coupling system based on hybrid drive, including: an initial solution prediction stage based on graph neural networks and a physical projection correction stage. Figure 1 The overall structure of the framework is shown in detail. Through graph structure modeling, embedding propagation, physical loss function design and correction mechanism, an efficient solution framework for electro-thermal integrated systems is constructed.

[0061] The specific implementation involves the following steps:

[0062] Step 1: Construct a heterogeneous graph structure for the electrothermal coupled integrated energy system, and build heterogeneous graph data based on the characteristics of the heterogeneous graph structure;

[0063] Step 2: Input the heterogeneous graph data into a graph neural network model based on a relation-aware grouped graph attention mechanism;

[0064] Step 3: During training, the model fuses node feature predictions with edge features, and then optimizes them using a multi-task loss function that combines data fitting loss, physical equation soft constraint loss, and attention regularization loss. This ensures that while the network accurately learns the data mapping relationship, its internal message passing pattern and attention weight distribution are guided by physical laws and causal priors, outputting a high-precision, physically consistent initial solution of the power flow as the prediction result.

[0065] Step 4: Use the prediction result output by the graph neural network model based on the relation-aware grouped graph attention mechanism as the initial value, and quickly correct the initial value;

[0066] Step 5: Output complete system multi-energy flow analysis results based on the calibration results.

[0067] In one implementation example, regarding step one, the detailed process of constructing a heterogeneous graph structure for the electrothermal coupled integrated energy system and building heterogeneous graph data based on the characteristics of the heterogeneous graph structure includes:

[0068] 1-1): Based on existing mechanistic knowledge, power and thermal system models for power flow calculations are built on the MATLAB simulation platform, and the internal coupling of the energy system is realized through corresponding energy conversion equipment. The AC power flow calculation of the power system essentially involves solving nonlinear equations using known variables based on Kirchhoff's laws to derive the state variables of the power system, thereby establishing a mapping relationship between voltage and power. The thermal system model is divided into a graph-based hydraulic model and a matrix-based thermal model. The former is based on node flow balance and loop pressure balance, obtaining the mass flow distribution of each pipe segment through known simulation variables; the latter, with known mass flow rates of the pipe segments, iteratively solves to obtain the load supply water temperature, heat source return water temperature, and thermal power of the equilibrium node. The power and thermal systems are mainly deeply coupled through cogeneration (CHP) with a constant heat-to-power ratio, electric boilers, heat pumps, and other equipment. This is the most common coupling unit in integrated electric and thermal energy systems. Since the theory here is very classic and has been verified multiple times, it will not be elaborated further here.

[0069] 1-2): The Newton-Raphson method is used to perform power flow iterative calculations on the electrothermal coupled system to obtain complete system state information, including node voltage amplitude, phase angle, and supply and return water temperatures. This information serves as the baseline operating data for subsequent model training and validation. Furthermore, by applying random perturbations to the load power of each node and the output power of conventional generator sets in the system, different operating conditions and fluctuation scenarios are simulated. A large-scale historical dataset covering a wide range of operating boundaries is generated using Monte Carlo random sampling. Finally, the large-scale historical dataset undergoes data cleaning and normalization preprocessing to construct a standardized dataset suitable for training and testing machine learning models.

[0070] In this implementation example, when modeling the power and heat system, the integrated energy system with electric-thermal coupling is abstracted into a heterogeneous graph structure containing power and heat nodes, power edges, heat edges, and virtual edges of coupling devices. Based on the Monte Carlo method, a large number of operating scenarios covering different electric / heat loads and renewable energy fluctuations are randomly generated on a typical network structure, and the accurate power flow solution is calculated using the traditional high-precision Newton-Raphson method, forming an operating condition-system state dataset, i.e., a large-scale historical dataset. From this dataset, the physical features of nodes and the physical parameters of edges are extracted respectively to construct node feature matrices, edge feature matrices, and adjacency matrices representing topological connections. The input of the graph neural network model is composed of the above data in matrix form, just as the set of V, E, and A in 1-3) is matrix data.

[0071] 1-3): In this implementation example, the multimodal characteristics and complex interactions of the electro-thermal coupling system are abstracted into a heterogeneous graph structure. ,in It is the set of all nodes in the system; It is a set of edges, which not only includes the physical connections of transmission lines and pipelines, but also models the energy conversion relationships of coupled devices as a kind of virtual edge; It is an adjacency matrix with dimension 1. ,in The number of nodes is denoted by 1. When nodes are connected to each other, the matrix elements are filled with 1, while 0 indicates that there is no connection between nodes.

[0072] In one implementation example, during node modeling, system nodes are categorized into two main types based on their energy type: power nodes and thermal nodes. The input characteristics of power nodes include their active power, reactive power, and type code; the output characteristics are the node voltage amplitude and phase angle. The input characteristics of thermal nodes include thermal power and type code; the output characteristics are the node supply and return water temperatures. In the modeling, connection relationships are divided into three categories: power lines, thermal pipes, and coupling devices. Power lines use resistance and reactance as input characteristics, and the output is the active and reactive power transmitted by the line. Thermal pipes use pipe length, diameter, heat transfer coefficient per unit length, and roughness as input characteristics, and the output is the pipe segment mass flow rate. Coupling devices use energy conversion coefficients as input characteristics, and the output is their electro-thermal power conversion relationship.

[0073] Node types include PQ nodes, PV nodes, and balance nodes in power systems, as well as load nodes, heat source nodes, and balance nodes in thermal systems; edge types include power lines, thermal pipelines, and virtual edges representing coupled equipment such as cogeneration and heat pumps.

[0074] In one implementation example, regarding step two, the heterogeneous graph data from the above steps are received, and a physically guided graph neural network prediction model is constructed, such as... Figure 2 As shown, the neighbor set is first divided into several subsets based on the edge type. Then, attention coefficients are independently calculated within each subset to maintain the independence of different energy flow process characteristics. Finally, the aggregation results under each relation are weighted and fused using learnable type fusion weights. Then, node features and edge embeddings are fed together into a relation-specific attention projection vector to obtain the neighbors. For nodes Information contribution, through subset Attention weights are obtained through normalization. Finally, nodes are obtained by weighted aggregation across all relations. In the The embedding vectors of the layers are used to perform learnable weighting of different types of energy transfer paths through relational fusion.

[0075]

[0076]

[0077]

[0078] In the formula, Indicates the first Layer nodes Embedded, It represents a structure consisting of fully connected layers and nonlinear activation functions. A learnable attention vector, where || represents the concatenation operation. It is a non-linear activation function. Represents a node and edge type feature, Attention coefficient Represents a node The neighborhood group, This represents the fusion weight for relation types.

[0079] In one implementation example, regarding step three, during training, the model fuses node feature predictions with edge features, and then optimizes them using a multi-task loss function that includes data fitting loss, physical equation soft constraint loss, and attention regularization loss. This allows the network to accurately learn data mapping relationships while its internal message passing patterns and attention weight distribution are guided by physical laws and causal priors, thereby outputting a high-precision, physically consistent initial solution for the power flow.

[0080] The relation-aware grouped graph attention mechanism first divides neighboring nodes into different groups based on edge type, calculates attention coefficients independently within each group to maintain independent energy transfer characteristics, and finally aggregates cross-group information through learnable fusion weights.

[0081] Known physical experience is used to guide and constrain the distribution of attention weights, ensuring that the interaction relationships learned by the model are consistent with the actual energy flow characteristics of the electrothermal coupling system. In power lines, line admittance is selected as a priori value; in thermal networks, thermal conductivity, cross-sectional area, and pipe length are selected as priori values; and for coupling equipment, conversion efficiency and rated power are used as offline parameters. KL divergence constraints are used to encourage physical priors. With attention coefficient Alignment.

[0082]

[0083] The model parameters are trained using the Adam optimizer, and the loss function integrates data-driven learning, physical constraints, and attention guidance. This loss function, through a soft-constraint variant based on the Lagrange multiplier method, transforms the nonlinear physical equations into differentiable penalty terms, thereby achieving coordinated optimization of data fit, physical consistency, and structural interpretability during gradient descent. Overall Loss It consists of the following parts, and the weights are determined using a grid search method. .

[0084]

[0085]

[0086]

[0087]

[0088] in, Represents the predicted value. Represents the true value; This represents the calculated offset values ​​for active and reactive power in the power system. This is the offset value for calculating head loss in the heating network.

[0089] The data-driven loss function includes node state mean squared error loss and edge flow mean squared error loss, used to fit state variables such as voltage, phase angle, and temperature. The physically constrained loss function introduces physical equations such as power balance and mass flow conservation as differentiable penalty terms, and constrains the power of coupled devices to prevent them from exceeding limits. The KL divergence loss function utilizes physical priors such as line admittance and heat transfer coefficient to guide the attention weight distribution to conform to the causal laws of actual energy transfer, thereby improving the model's interpretability and generalization ability.

[0090] In the multi-task loss function, the soft constraint loss of the physics equation transforms the nonlinear power flow equation into a differentiable penalty term using the Lagrange multiplier method; the attention regularization loss uses KL divergence constraints to align the attention weights with the distribution of prior physical knowledge.

[0091] In one implementation example, regarding step four, the steady-state power flow equations of the electro-thermal coupled system are uniformly expressed as follows: The state vector is... This includes power system node voltage amplitude and phase angle, and thermal system node temperature and pipe segment mass flow rate. Let the system state predicted in the first stage be... The corresponding physical residual is To minimize the residual norm, the Gauss-Newton method is used. Perform a first-order Taylor expansion at the current node and solve for the Jacobian matrix at the current node. As shown below:

[0092]

[0093]

[0094]

[0095] in is a regularization coefficient used to improve numerical conditions and suppress excessively large step sizes. Solving for the increment. Then, updating the initial solution once will yield the correction result. ,in The optimal value is determined by a grid search of the validation set.

[0096] Using the prediction results from the first stage as initial values, a mixture of Gaussian and Newton projections guided by attention weights is employed for rapid correction. This method utilizes the attention scores obtained from training to identify the strongly or weakly coupled regions of the system, and accordingly performs intelligent sparsification and block approximation on the complete Jacobian matrix to construct a computationally efficient mixture of Jacobian matrices. This drives the residuals to converge rapidly to a physically feasible solution with minimal computational overhead.

[0097] Attention weights are used to guide the sparsification and block structure of the Jacobian matrix; that is, cross derivatives are preserved in regions of high attention, while decoupling approximations are used in regions of low attention. Let the coupling nodes be denoted. The relevant attention score is And set a threshold The system is divided into strongly coupled regions. and weakly coupled regions Binary mask matrix :

[0098]

[0099] based on Selective preservation and sparsification of the electric-thermal cross-blocks in the complete Jacobian matrix are performed. In the strongly coupled region, the complete cross derivatives are preserved to maintain accuracy, while in the weakly coupled region, decoupling approximation is used to improve computational efficiency, thus achieving an effective balance between accuracy and complexity.

[0100] When correcting the final solution, attention-guided differentiation is used to distinguish between strong and weak coupling regions. After differentiation, [the solution is then applied]. Adjustments are made, and the final solution is obtained through the above iterative method. This represents a common form of Jacobian matrix, which is approximated and adjusted to avoid complex and time-consuming calculations.

[0101] Output the final corrected power flow solution.

[0102] This embodiment of the sub-technical solution abstracts the integrated energy system of electric-thermal coupling into a heterogeneous graph structure containing power nodes, thermal nodes, and virtual edges of coupling devices; based on a given network and random operating conditions, it uses traditional numerical methods to generate an operating condition-exact solution dataset, i.e., the original historical dataset; and extracts node features, edge features, and topological adjacency relationships from it to construct a structured graph dataset.

[0103] This embodiment constructs and trains a heterogeneous graph neural network based on a relation-aware grouped graph attention mechanism. This module employs a multi-task loss function, including data fitting loss, physical equation soft constraint loss, and attention regularization loss, to jointly optimize the network, enabling it to output a high-precision and physically consistent initial solution for the power flow state.

[0104] This embodiment of the sub-technical solution receives the initial solution predicted by the graph neural network, uses the attention weights obtained during network training to identify the coupling of strong and weak regions, and accordingly performs intelligent sparsification and block division on the complete Jacobian matrix to construct an efficient hybrid Jacobian matrix. It then performs lightweight Gauss-Newton projection to quickly correct the residuals and obtain a physically feasible accurate solution.

[0105] This embodiment coordinates the sequential execution of the above steps, controls the data flow and calculation process, and finally outputs complete system multi-energy flow analysis results.

[0106] This embodiment presents a two-stage solution framework that integrates heterogeneous graph neural networks (GNNs) and physical correction mechanisms. The first stage uses a GNN to capture complex coupling relationships, balancing data-driven approaches with physical laws through a multi-task loss function with physical constraints. Attention regularization is also introduced to ensure consistency between attention weights and physical laws. The second stage uses a lightweight physical projection method module at the initial GNN solution to correct the predicted values, quickly dissipating system residuals and gradually making the power flow results a feasible solution that meets energy conservation constraints. Simulation results show that the proposed method significantly outperforms traditional methods in terms of node state and energy flow prediction accuracy. It achieves efficient solution while ensuring physical consistency, providing an efficient and scalable solution for rapid power flow analysis, topology adaptation, and planning optimization of integrated energy systems.

[0107] This embodiment constructs a test model of an integrated electric-thermal energy system. See Appendix. Figure 3 As shown, its core consists of an improved IEEE 14-node power network and a 17-node thermal network interconnected via coupling devices. The system aims to simulate and study the cooperative operation and mutual influence mechanisms of multiple energy flows in the coupled network.

[0108] To demonstrate the accuracy of the proposed model, traditional models were subjected to the same process using this method, with prediction scenarios randomly selected. The results of the proposed model were then compared with those of CNN and GCN networks. The results of the energy flow calculation method for the two-stage electrothermal coupling system based on hybrid drive are shown below. Figure 4 As shown.

[0109] exist Figure 4 (a) and (b) in the figure show that the trajectory of the proposed model has the highest degree of fit with the NR benchmark value, while the voltage amplitude of CNN and GCN deviates significantly at the nodes, which reflects the insufficient accuracy of traditional models in dealing with nonlinear voltage distributions; in terms of phase angle prediction, the present invention has better approximation ability at subtle peaks. Figure 4 Figures (c) and (d) show that the proposed model can accurately capture state fluctuations at extremely small levels of water supply temperature. Furthermore, in regions with drastic flow rate changes, CNN exhibits a significant "prediction inaccuracy" phenomenon. This invention maintains extremely high fitting consistency across the entire domain and can accurately reproduce the calculation results of the NR method.

[0110] Example 2

[0111] The purpose of this embodiment is to provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the above-described method.

[0112] Example 3

[0113] The purpose of this embodiment is to provide a computer-readable storage medium.

[0114] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the steps of the above method.

[0115] Example 4

[0116] The purpose of this embodiment is to provide an energy flow calculation system for a two-stage electrothermal coupling system based on hybrid drive, including:

[0117] The heterogeneous graph modeling and data preparation module is configured to: construct heterogeneous graph structures for integrated energy systems with electrothermal coupling, and build heterogeneous graph data based on the characteristics of the heterogeneous graph structures;

[0118] The physics-guided graph neural network prediction module is configured to input heterogeneous graph data into a graph neural network model based on a relation-aware grouped graph attention mechanism;

[0119] During training, the model fuses node feature predictions with edge features, and then optimizes them using a multi-task loss function that includes data fitting loss, physical equation soft constraint loss, and attention regularization loss. This allows the network to accurately learn data mapping relationships while its internal message passing patterns and attention weight distribution are guided by physical laws and causal priors, outputting a high-precision, physically consistent initial solution of the power flow as the prediction result.

[0120] The attention-guided physical correction module is configured to: take the prediction result output by the graph neural network model based on the relation-aware grouped graph attention mechanism as the initial value and quickly correct the initial value.

[0121] The control and output module is configured to output complete system multi-energy flow analysis results based on the correction results.

[0122] Example 5

[0123] The purpose of this embodiment is to provide a computer program product containing instructions that, when run on a computer, cause the computer to perform the methods and functions involved in any of the above embodiments.

[0124] The steps and methods involved in the apparatus of the above embodiments correspond to those in Embodiment 1. For specific implementation details, please refer to the relevant description section of Embodiment 1. The term "computer-readable storage medium" should be understood as a single medium or multiple media including one or more instruction sets; it should also be understood as including any medium capable of storing, encoding, or carrying an instruction set for execution by a processor and enabling the processor to perform any of the methods in this invention.

[0125] Those skilled in the art will understand that the modules or steps of the present invention described above can be implemented using general-purpose computer devices. Optionally, they can be implemented using computer-executable program code, thereby allowing them to be stored in a storage device for execution by a computer device, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. The present invention is not limited to any particular combination of hardware and software.

[0126] While the specific embodiments of the present invention have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of the present invention are still within the scope of protection of the present invention.

Claims

1. A method for calculating energy flow in a two-stage electrothermal coupling system based on hybrid drive, characterized by: include: A heterogeneous graph structure is constructed for an integrated energy system with electrothermal coupling, and heterogeneous graph data is built based on the characteristics of the heterogeneous graph structure. Heterogeneous graph data is input into a graph neural network model based on a relation-aware grouped graph attention mechanism; During training, the model fuses node feature predictions with edge features, and then optimizes them using a multi-task loss function that includes data fitting loss, physical equation soft constraint loss, and attention regularization loss. This allows the network to accurately learn data mapping relationships while its internal message passing patterns and attention weight distribution are guided by physical laws and causal priors, outputting a high-precision, physically consistent initial solution of the power flow as the prediction result. The prediction results output by the graph neural network model based on the relation-aware grouped graph attention mechanism are used as the initial value, and the initial value is quickly corrected. Based on the correction results, a complete system multi-energy flow analysis is output.

2. The energy flow calculation method for a two-stage electrothermal coupling system based on hybrid drive as described in claim 1, characterized in that, When rapidly correcting the initial value, the system receives the initial solution predicted by the graph neural network model, uses the attention weights obtained during network training to identify the coupling of strong and weak regions, and intelligently sparsifies and divides the complete Jacobian matrix to construct an efficient hybrid Jacobian matrix. Then, it performs lightweight Gauss-Newton projection to quickly correct the residuals and obtain a physically feasible exact solution.

3. The energy flow calculation method for a two-stage electrothermal coupling system based on hybrid drive as described in claim 1, characterized in that, When constructing a heterogeneous graphical structure for an electrothermal coupled integrated energy system, the specific steps include: Build power and heat system models for power flow calculations, and realize the internal coupling of the energy system through corresponding energy conversion equipment; Power flow iterative calculations are performed on power and heat system models to generate standardized datasets; The multimodal characteristics and complex interactions of an electrothermal coupled integrated energy system are abstracted into a heterogeneous graph structure; The process of generating the normalized dataset includes: Complete system status information, including node voltage amplitude, phase angle, and supply and return water temperature, is obtained. Then, by applying random disturbances to the load power of each node in the system and the output power of conventional generator sets, different operating conditions and fluctuation scenarios are simulated to generate a large-scale historical dataset covering a wide range of operating boundaries. After processing the historical dataset, a normalized dataset is generated.

4. The energy flow calculation method for a two-stage electrothermal coupling system based on hybrid drive as described in claim 1, characterized in that, The heterogeneous graph structure is as follows: ,in It is the set of all nodes in the system; It is a set of edges, which not only includes the physical connections of transmission lines and pipelines, but also models the energy conversion relationships of coupled devices as a kind of virtual edge; It is an adjacency matrix with dimension 1. ,in The number of nodes is denoted by 1. When nodes are connected to each other, the matrix elements are filled with 1, while 0 indicates that there is no connection between nodes.

5. The energy flow calculation method for a two-stage electrothermal coupling system based on hybrid drive as described in claim 1, characterized in that, After inputting heterogeneous graph data into a graph neural network model based on a relation-aware grouped graph attention mechanism, the following steps are taken: System nodes are classified into two main categories based on their energy type: power nodes and thermal nodes. The neighbor set is divided into several subsets according to the edge type. Then, the attention coefficient is calculated independently within each subset to maintain the independence of different energy flow process characteristics. Finally, the aggregation results under each relation are weighted and fused through learnable type fusion weights. Then, the node features and edge embeddings are fed into a relationship-specific attention projection vector to obtain the information contribution of neighbors to the node, and the attention weights are obtained by normalization within the subset. Finally, the nodes are obtained by weighted aggregation across all relationships. In the The embedding vectors of the layers are used to perform learnable weighting of different types of energy transfer paths through relational fusion; The input characteristics of the power node include its active power, reactive power, and type code, and the output characteristics are the node voltage amplitude and phase angle to be determined; the input characteristics of the thermal node include the node pressure, thermal power, and temperature, and the output characteristics are the node supply water temperature and return water temperature to be determined. In edge modeling, the connection relationships are divided into three categories: power lines, thermal pipes, and coupling devices. Power lines use resistance and reactance as input features and output the active and reactive power transmitted by the line. Thermal pipes use pipe length, diameter, heat transfer coefficient per unit length, and roughness as input features and output the mass flow rate of the pipe segment. Coupling devices use energy conversion coefficient as input features and output their electro-thermal power conversion relationship.

6. The energy flow calculation method for a two-stage electrothermal coupling system based on hybrid drive as described in claim 1, characterized in that, it further... include: The distribution of attention weights is guided and constrained by known physical experience to ensure that the interaction relationships learned by the model are consistent with the actual energy flow laws of the electrothermal coupling system. Specifically, this includes: selecting line admittance as a priori value in power lines, selecting thermal conductivity, cross-sectional area and pipe length as priori values ​​in thermal pipe networks, and using conversion efficiency and rated power as offline parameters for coupling equipment. KL divergence constraints are used to encourage the alignment of physical priors with attention coefficients. When training the model parameters, data-driven learning, physical constraints, and attention guidance are integrated into the loss function; The data-driven loss function includes the node state mean square error loss and the edge current mean square error loss, which are used to fit voltage, phase angle and temperature state variables. The loss function of physical constraints introduces the physical equations of power balance and mass flow conservation as differentiable penalty terms, and constrains the power of coupled devices to not exceed the limit; The KL divergence loss function utilizes physical priors such as line admittance and heat transfer coefficient to guide the distribution of attention weights to conform to the causal laws of actual energy transfer, thereby improving the interpretability and generalization ability of the model. It also includes: unifying the steady-state power flow equations of electrothermal coupled integrated energy systems; Let the predicted system state in the first stage be... The corresponding physical residual is ,exist Perform a first-order Taylor expansion at the current node and solve for the Jacobian matrix at the current node; After solving for the increment based on the Jacobian matrix, the correction result can be obtained by updating the initial solution once. ,in The optimal value is determined by a grid search of the validation set; Attention weights are used to guide the sparsification and block structure of the Jacobian matrix, that is, the cross derivative is preserved in the region of high attention and the decoupling approximation is used in the region of low attention. Describe the coupling nodes The relevant attention scores are used and a threshold is set to divide the system into strongly coupled and weakly coupled regions, resulting in a binary mask matrix. Selective preservation and sparsification of the electric-thermal cross-blocks in the complete Jacobian matrix based on the binary mask matrix.

7. A power flow calculation system based on a two-stage electrothermal coupling system driven by hybrid processes, characterized in that... include: The heterogeneous graph modeling and data preparation module is configured to: construct heterogeneous graph structures for integrated energy systems with electrothermal coupling, and build heterogeneous graph data based on the characteristics of the heterogeneous graph structures; The physics-guided graph neural network prediction module is configured to input heterogeneous graph data into a graph neural network model based on a relation-aware grouped graph attention mechanism; During training, the model fuses node feature predictions with edge features, and then optimizes them using a multi-task loss function that includes data fitting loss, physical equation soft constraint loss, and attention regularization loss. This allows the network to accurately learn data mapping relationships while its internal message passing patterns and attention weight distribution are guided by physical laws and causal priors, outputting a high-precision, physically consistent initial solution of the power flow as the prediction result. The attention-guided physical correction module is configured to: take the prediction result output by the graph neural network model based on the relation-aware grouped graph attention mechanism as the initial value and quickly correct the initial value; The control and output module is configured to output complete system multi-energy flow analysis results based on the correction results.

8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 6.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the method described in any one of claims 1-6.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it performs the steps of the method described in any one of claims 1-6.

Citation Information

Patent Citations

  • Structural optimization method based on mechanical embedded heterogeneous graph neural network

    CN120974952A

  • Farmland yield prediction method and system based on heterogeneous graph neural network

    CN121146219A