A heat pipe network pressure field reconstruction method and system based on a physical information graph neural network
By constructing a dual-output model based on a physical information graph neural network and combining the Hassen-Williams hydraulic equation and dynamic loss weights, the pressure field reconstruction of the thermal pipeline network under sparse sensor conditions was realized, solving the problems of insufficient reconstruction accuracy and interpretability in existing technologies and achieving high-precision pressure distribution across the entire network.
Patent Information
- Application Number
- CN202611292138.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-25
- Publication Date
- 2026-11-10
AI Technical Summary
Existing technologies cannot effectively reconstruct the pressure field of thermal pipelines under extremely sparse sensor conditions, cannot balance physical interpretability and reconstruction accuracy, and the prediction results are prone to violating physical laws.
A method based on physical information graph neural networks is adopted. By constructing a dual-output graph neural network and combining the Hassen-Williams hydraulic equation and dynamic loss weights, a two-stage training is performed to realize the reconstruction of the pressure field under sparse sensors.
Under extremely sparse sensor conditions, it can output physically consistent pressure distribution across the entire network, improving the reliability and accuracy of the reconstruction results, solving the problem of prediction results violating physical laws in traditional methods, and significantly improving the uniqueness and accuracy of reconstruction.
Smart Images

Figure CN123069602A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of urban pipeline safety and intelligent monitoring technology, and more specifically to a method and system for reconstructing the pressure field of thermal pipelines based on physical information graph neural networks. Background Technology
[0002] Heating networks are a crucial component of urban lifeline engineering, and their safe, stable, and efficient operation directly impacts residential heating quality, industrial heat supply, and energy utilization efficiency. Accurate and real-time sensing of the hydraulic status within the heating network is a fundamental prerequisite for leak diagnosis, hydraulic balance regulation, optimized pump scheduling, and accident early warning. However, in actual engineering projects, due to limitations in construction costs and maintenance conditions, sensors are only installed at a very few critical locations such as the main inlet pipe and heat source outlet. Many pipe sections still lack monitoring methods, resulting in an inability to grasp the pressure distribution of the entire network. When leaks, blockages, or hydraulic imbalances occur in the network, the lack of monitoring often leads to severely delayed detection, resulting in serious consequences such as widespread heating outages and pipe freezing and cracking.
[0003] Currently, there are still many shortcomings in the pressure estimation methods for thermal pipeline systems. Existing data-driven methods can use models such as neural networks to learn the mapping from sensor readings to the pressure of the entire pipeline network, but under the condition of extremely sparse sensors, there is a lack of sufficient training samples, and the prediction results are prone to violating physical laws and have low reliability. Based on spatial distance, interpolation or statistical regression is used for sparse observation data, which completely ignores the pipeline network topology and hydraulic physical processes, resulting in poor prediction accuracy.
[0004] In summary, existing technologies have not yet provided a real-time reconstruction scheme for the pressure field of heating pipe networks that can simultaneously ensure physical interpretability, reconstruction accuracy, and generalization ability under extremely sparse sensor conditions. Therefore, proposing a method for reconstructing the pressure field of thermal pipe networks that can integrate pipe network topology, physical equations, and sparse monitoring data has urgent engineering needs and significant technical value, and is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0005] In view of this, the present invention provides a method and system for reconstructing the pressure field of a thermal pipeline network based on a physical information graph neural network. By constructing a physical information graph neural network, the hydraulic equation of the pipeline network is used as a soft constraint embedded in the graph neural network loss function. A dual-output structure is used to predict pressure and water demand. Combined with dynamic loss weights and a two-stage training strategy, the pressure reconstruction of the pipeline network system with a very small number of sensors is achieved.
[0006] To achieve the above objectives, the present invention adopts the following technical solution: A method for reconstructing the pressure field of a thermal pipeline network based on a physical information graph neural network includes: S1. Obtain thermal pipeline network data; S2. Construct a dual-output graph neural network prediction model based on thermal pipeline network data; S3. Construct a physical constraint loss function and implement dynamic weight optimization; S4. Perform two-stage training: simulated pre-training and fine-tuning with real sparse data. Fine-tune the model by combining the physical constraint loss function to obtain the trained physical information graph neural network model. S5. Deploy the trained physical information graph neural network model into the online monitoring system of the heating network to read the pressure and flow data of sparse sensors in real time and obtain complete network status information.
[0007] Preferably, S1 specifically includes: The thermal pipeline network map data includes the topology, pipeline attributes, and monitoring data of the thermal pipeline network; the graph data structure is constructed with network nodes as graph nodes and pipe segments as edges; edge features include pipe length, pipe diameter, and roughness coefficient, and the hydraulic resistance coefficient is calculated as an additional edge feature; prior features including normalized coordinates, node degree, shortest path length to the heat source, sensor label, and heat user type are extracted for each node to form a node feature vector that integrates multi-source information.
[0008] Preferably, S2 specifically includes: An edge-conditional graph convolutional network is used as the backbone, which includes multiple message passing layers. The message passing layers take node states and edge features as input, and obtain the node hidden layer representation after aggregation and updating. A pressure prediction head and a flow prediction head are connected in parallel above the message passing layers. The pressure prediction head outputs the node pressure value, and the flow prediction head outputs the non-negative node branch cyclic flow prediction value after Softplus activation.
[0009] Preferably, S3 specifically includes: The flow rate of each pipe segment is calculated based on the node pressure value using the differentiable Hassen-Williams formula. The node continuity loss, pipe segment flow observation loss, and global circulating flow balance loss are constructed. The physical loss is combined with the sensor node pressure supervision loss. A trainable homoscedastic uncertainty parameter is introduced to adaptively weight each loss, automatically balance the gradient of multiple tasks, and form the total loss function.
[0010] Preferably, the S4 two-stage training includes: the first stage establishes a hydraulic simulation model of the heating network based on the topology, attribute characteristics, and statistical priors of the heat user load of the heating network; the second stage uses the hydraulic simulation model to generate synthetic data of the whole network pressure and the circulating flow of the node branches under multiple operating conditions; the third stage pre-trains the dual-output graph neural network prediction model in a fully supervised manner to learn the mapping law of pressure and flow distribution; the fourth stage loads the pre-training weights, freezes the main parameters of the dual-output graph neural network prediction model, and uses only the field measured data of the pressure and flow sensors on the inlet main pipe, combined with the total loss function for fine-tuning, so that the dual-output graph neural network prediction model adapts to the real network characteristics, and obtains the final pressure field reconstruction model.
[0011] Preferably, in step S5, the trained physical information graph neural network model is deployed in the heating network online monitoring system to read the pressure and flow data of sparse sensors in real time. Through a single forward calculation, the pressure distribution of all nodes in the network and the estimated results of the circulating flow of the node branches are output to obtain complete network status information.
[0012] Preferably, a thermal pipeline pressure field reconstruction system based on a physical information graph neural network includes: Data acquisition module: used to acquire thermal network diagram data; Graph Neural Network Module: Constructs a dual-output graph neural network prediction model based on thermal pipeline network data; Constraint module: Used to construct physical constraint loss functions and implement dynamic weight optimization; Training and fine-tuning module: Used to perform two-stage training, namely simulated pre-training and fine-tuning with real sparse data, and fine-tuning with physical constraint loss function to obtain a trained physical information graph neural network model; Information reading module: This module is used to deploy the trained physical information graph neural network model in the online monitoring system of the heating network, and read the pressure and flow data of sparse sensors in real time to obtain complete network status information.
[0013] As can be seen from the above technical solution, compared with the prior art, the present invention provides a method and system for reconstructing the pressure field of a thermal pipeline network based on a physical information graph neural network, which has the following beneficial effects: (1) This invention embeds the Hassen-Williams hydraulic equations into a differentiable computational graph of a graph neural network, applying physical laws to the model training in the form of soft constraints. This enables the pressure field reconstruction model to possess both data-driven adaptive capabilities and strict adherence to the hydraulic conservation laws of the pipeline network. Compared to purely data-driven methods, this method can still output physically consistent pressure distribution across the entire network under extremely sparse sensor conditions, avoiding non-physical interpretations such as violations of mass conservation or pressure inverse gradients, and significantly improving the credibility and interpretability of the reconstruction results.
[0014] (2) The present invention adopts a dual-output network structure to simultaneously predict node pressure and branch circulation flow, and forces the two to couple through node continuity loss. Compared with the single-task model that only outputs pressure, the dual-output structure transforms the underdetermined inverse problem under sparse observation into a joint inference problem under physical constraints, so that local sensor information can be propagated to unmonitored areas through physical equations, which greatly improves the uniqueness and accuracy of the pressure reconstruction of the entire pipeline network.
[0015] (3) This invention adopts a two-stage training strategy of "pre-training with simulation data + fine-tuning with real data". It uses the hydraulic simulation model to generate multi-condition synthetic data for fully supervised pre-training, giving the network pipeline prior hydraulic knowledge, and then fine-tuning is performed based on only a very small amount of sensor measured data from the inlet main pipe. This strategy effectively overcomes the difficulty of extremely sparse field sensors and insufficient measured data to train the network from scratch, enabling the model to achieve reliable full network reconstruction even with only a small number of measuring points.
[0016] (4) This invention introduces a dynamic loss weighting mechanism based on homoscedastic uncertainty, which assigns trainable uncertainty parameters to the data fitting loss, continuity loss, flow observation loss, and global balance loss respectively, and automatically balances the gradient magnitudes of each task during training. This method avoids the tedious manual parameter tuning process under the traditional fixed weight method, solves the training instability problem caused by the imbalance between physical loss and data loss gradients, and improves the convergence speed and final accuracy of model training. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0018] Figure 1 The method flowchart provided by the present invention. Detailed Implementation
[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0020] like Figure 1 As shown, this embodiment of the invention discloses a method for reconstructing the pressure field of a thermal pipeline network based on a physical information graph neural network, including: S1. Obtain thermal pipeline network data; S2. Construct a dual-output graph neural network prediction model based on thermal pipeline network data; S3. Construct a physical constraint loss function and implement dynamic weight optimization; S4. Perform two-stage training: simulated pre-training and fine-tuning with real sparse data. Fine-tune the model by combining the physical constraint loss function to obtain the trained physical information graph neural network model. S5. Deploy the trained physical information graph neural network model into the online monitoring system of the heating network to read the pressure and flow data of sparse sensors in real time and obtain complete network status information.
[0021] Specifically, S1 includes: The thermal pipeline network map data includes the topology, pipeline attributes, and monitoring data of the thermal pipeline network; the graph data structure is constructed with network nodes as graph nodes and pipe segments as edges; edge features include pipe length, pipe diameter, and roughness coefficient, and the hydraulic resistance coefficient is calculated as an additional edge feature; prior features including normalized coordinates, node degree, shortest path length to the heat source, sensor label, and heat user type are extracted for each node to form a node feature vector that integrates multi-source information.
[0022] In a specific embodiment of the present invention, the fusion of thermal network map data and prior features in S1 includes: S1-1: Obtain basic data of the heating network. Extract pipe segment and node information from the heating network geographic information system or design data, including pipe segment number, starting node coordinates, ending node coordinates, pipe length, pipe diameter, roughness coefficient, and monitoring data of some nodes and pipe segments, including pressure monitoring values and flow monitoring values from sensors.
[0023] S1-2: Construct the graph topology. Using the nodes of the heating pipe network as graph nodes and pipe segments as edges, construct the graph data structure and store it as an edge index matrix and an edge attribute matrix. Record the coordinates and number information and physical attribute characteristics of each pipe segment, respectively. The physical attribute characteristics of the pipe segment should include pipe length L, pipe diameter D, and roughness coefficient C.
[0024] S1-3: Calculate edge features. Based on the Hassen-Williams formula, calculate the hydraulic resistance coefficient K for each pipe segment, as shown in the following formula. This coefficient reflects the resistance characteristics of the pipe segment to water flow, providing prior constraints for subsequent message passing and physical loss calculation in the graph neural network. Then, this coefficient is used as an additional edge feature and concatenated with the original attribute matrix to form a complete pipe segment attribute matrix.
[0025]
[0026] S1-4: Extract prior features of nodes. For each node, calculate and combine the following features to form the node feature vector: Normalized spatial coordinates are used to standardize the coordinates of all nodes in the network (subtract the mean and divide by the standard deviation) and serve as node features, enabling the network to perceive the spatial distribution and neighborhood relationships of nodes. Node degree refers to the number of pipes directly connected to the current node. A higher node degree usually means that the node is located on the main trunk or a critical branch of the pipeline network, which is considered prior knowledge of the topology. The shortest path length to the heat source is calculated using Dijkstra's algorithm on the graph, starting from the node where the heat source is located. This calculation accumulates the shortest path length along the actual pipe segment length and then normalizes the result. This characteristic approximately reflects the pressure attenuation trend along the pipe; the farther away from the heat source, the greater the accumulated friction resistance and the lower the supply pressure. This incorporates prior knowledge of the hydraulic characteristics of the heating network.
[0027] Sensor markers, using binary characteristics (0 or 1), indicate whether a node is equipped with a pressure sensor. This distinguishes nodes with supervised signals from those without, guiding the calculation range of the subsequent loss function.
[0028] Heat user type embedding encodes and embeds the types of heat users served by the nodes, including residential heating, commercial heating, industrial heating, and public building heating. Different types of heat users have different heat load characteristics and branch diversion ratios. The types are mapped into dense vectors through a learnable embedding layer, providing the model with structured prior knowledge of load distribution.
[0029] S1-4: Encapsulate the graph data object. The prior features of the nodes mentioned above are uniformly encapsulated into a graph data structure, which is used for the subsequent input to the graph neural network and the calculation of physical information loss.
[0030] Specifically, S2 includes: An edge-conditional graph convolutional network is used as the backbone, which includes multiple message passing layers. The message passing layers take node states and edge features as input, and obtain the node hidden layer representation after aggregation and updating. A pressure prediction head and a flow prediction head are connected in parallel above the message passing layers. The pressure prediction head outputs the node pressure value, and the flow prediction head outputs the non-negative node branch cyclic flow prediction value after Softplus activation.
[0031] In a specific embodiment of the present invention, S2 constructs a dual-output graph neural network prediction model, including: S2-1: Constructing the backbone of the edge-conditional message passing network. Three edge-conditional convolutional layers are used as message passing layers. The message function of each edge-conditional convolutional layer is a multilayer perceptron, whose input is a concatenated vector of the current state of the source node, the current state of the target node, and the corresponding edge features; the output is a message vector. The aggregation method uses mean pooling, which averages the messages sent by all neighbors of the target node. Node state updates use gated recurrent units, taking the previous node state and the aggregated message vector as input, and outputting the updated node state.
[0032] S2-2: Construct parallel dual prediction heads. Two independent prediction heads are connected in parallel above the node hidden representations output from the last layer of the message passing network: The pressure prediction head is a single-layer fully connected network. It does not set an activation function and directly outputs the scalar node pressure value P. The pressure value output by this prediction head will be directly used for subsequent physical loss calculation. The flow prediction head is a two-layer fully connected network with a Softplus activation function added to the last layer. It outputs a non-negative node branch circulation flow q, which represents the flow from the water supply pipe to the heat user at that node. This part of the fluid flows into the return water network after heat exchange and is a key physical quantity to meet the heating load.
[0033] In thermal pipeline networks, relying solely on limited sensor data is insufficient to uniquely determine pressure and flow distribution. Outputting only node pressures leaves node flow rates unknown, failing to provide effective constraints. The network can arbitrarily predict the pressure field; simply achieving pipeline flow self-balancing (net inflow ≈ 0) allows physical losses to approach zero without any prior flow information. This results in a predicted pressure field that, while mathematically satisfying physical equations, deviates significantly from actual operating conditions. Employing a dual-output approach leverages physical constraints to convert pressure differences into pipe flow rate Q. ij By applying continuity loss to each node, coupling the pressure and flow fields, and introducing pipeline flow observation loss and global circulation flow balance loss, strong constraints are imposed on individual measured flow rates and total circulation flow. Under this method, reducing physical losses requires that the predicted pressure and flow distributions be mutually coordinated and physically self-consistent. When sensors provide pressure and flow information at a small number of key locations, the physical equations propagate local observations to the entire pipeline network, enabling the flow and pressure in unmonitored areas to be uniquely or approximately uniquely determined, significantly improving the reconstruction uniqueness and accuracy in sparse observation scenarios.
[0034] S2-3: Model Initialization and Parameter Configuration. The hidden layer dimension of the message passing layer is set to 128, the aggregation method is mean, and the intermediate layer dimension of the traffic prediction header is 64; all weights are initialized using the Xavier initialization strategy. The edge-conditional convolutional message function MLP contains two linear layers with ReLU activation in between. The overall network constitutes the forward inference body of the physical information and the graph neural network, and will be optimized in subsequent training by embedding the total loss of the physical equations.
[0035] Specifically, S3 includes: The flow rate of each pipe segment is calculated based on the node pressure value using the differentiable Hassen-Williams formula. The node continuity loss, pipe segment flow observation loss, and global circulating flow balance loss are constructed. The physical loss is combined with the sensor node pressure supervision loss. A trainable homoscedastic uncertainty parameter is introduced to adaptively weight each loss, automatically balance the gradient of multiple tasks, and form the total loss function.
[0036] In a specific embodiment of the present invention, S3 involves constructing a physical constraint loss function and implementing dynamic weight optimization, including: S3-1: Flow rate calculation for differentiable pipes. For each pipe e, its two endpoints are nodes i and j, respectively. The flow rate Q for each pipe segment can be calculated based on the Hassen-Williams formula. ij As shown in the following formula.
[0037]
[0038] Among them, h f For head loss along the route, P i and P j K represents the predicted pressure at both ends of the pipe segment. ij The hydraulic drag coefficients at nodes i and j pre-calculated in step S1, where ρ is the fluid density, g is the gravitational acceleration, and ε is a small constant (1×10⁻⁶) to avoid gradient vanishing. -6 .
[0039] The absolute value operations and sign functions in the formula use smooth approximations to ensure that the entire calculation process is fully differentiable and can be embedded in the automatic differentiation chain of a neural network. Pipe flow rate Q ij The positive direction is from node i to node j, i.e., Q. ij >0 indicates that the flow direction is consistent with the direction defined by the edge index.
[0040] S3-2: The calculation process for the physical loss of node continuity includes: For each node v in a heating network system, considering all connected pipes, the net inflow rate of node v is defined as the sum of the inflow rates of all connected pipes minus the sum of the outflow rates. According to the law of conservation of mass, this net inflow rate should be equal to the circulating flow rate d of the branch pipes serving the heat users connected to node v. v (Step S2 Flow Prediction Header Output). Node Continuity Loss Term L cont Defined as the mean square value of the residuals of all nodes in the entire pipeline network, as shown in the following formula.
[0041] Where V is the set of nodes, N(v) is the set of neighboring nodes of node v, and Q... vu Let d be the flow rate of the pipe segment from node v to node u. v Let V be the branch circulation flow of node v.
[0042] This loss forces the pressure field to be coupled with the branch flow field through the pipeline flow. For the network to reduce this loss, the predicted node pressure and the node branch flow must be coordinated and physically consistent.
[0043] S3-3: Pipeline flow observation loss. This applies to the set of pipes ε equipped with sensors. obs The predicted flow rate calculated in S3-1 is compared with the monitored value, and the mean square error is calculated as the flow rate observation loss of the pipe section, as shown in the following formula.
[0044] ; Among them, Q e The predicted flow rate, Q e obs Refers to the readings from the flow sensor; This loss directly uses real data from pipeline flow sensors to strongly constrain the model. In extremely sparse monitoring scenarios, even with only one or two flow meters on the main water supply pipe, this loss can still play a significant corrective role in the flow distribution of the downstream pipe network and the estimation of flow in nodal branches through physical equations.
[0045] S3-4: Global circulation flow balance loss. Under ideal conditions, the heating network is a closed-loop system, and the sum of the branch circulation flow of all nodes should equal the total circulation flow Q of the heat source. total Define the global circulating flow balancing loss L. global As shown in the following formula.
[0046]
[0047] This loss constrains the total branch flow, preventing the sum of branch flows predicted by the network from deviating significantly from the known total circulation flow, and ensuring water balance within the closed system.
[0048] S3-5: Sensor node pressure monitoring loss. In the set of nodes V with pressure sensors... obs Above, calculate the predicted pressure P. v Compared with the measured pressure P v obs The mean square error is used as the data fitting loss L. data As shown in the following formula.
[0049]
[0050] S3-6: Dynamic loss weighting based on homoscedasticity uncertainty. The above four losses include the continuity loss L. cont Flow observation loss L flow Global circulation flow balancing loss L global And data fitting loss L data During training, the magnitude of gradients and convergence speed often differ significantly. Fixed weights can easily lead to a single loss term dominating training, causing gradient imbalance. Therefore, a homoscedastic uncertainty weighting mechanism is introduced, assigning a trainable uncertainty parameter logσ to each loss term. i 2 ( Each loss is treated as an uncertain task with homoscedasticity following a Gaussian distribution, σ i This indicates the inherent noise level of the task. During training, high noise (high σ) i Tasks automatically receive lower weights (1 / 2σ). i 2 Smaller (lower) tasks automatically receive higher weights; regularization term logσ i To prevent the weights from degenerating to 0 or infinity, the total loss function L... total The definition is shown in the following formula.
[0051]
[0052] Among them, each σ i The method automatically optimizes during training, causing the gradient magnitudes of various loss terms to automatically tend towards balance. This eliminates the need for manual setting and iterative adjustment of loss weights, reducing hyperparameter tuning workload. The weights dynamically change at different training stages. Initially, when the physical loss residual is large, its weight automatically decreases to allow the network to learn data fitting first. Later, as the physical loss decreases, its weight automatically increases to strengthen physical constraints, effectively avoiding convergence difficulties caused by excessively large or small gradients in a particular loss term, thus improving training stability and final prediction accuracy.
[0053] Ultimately, the training objective of the physical information graph neural network is to minimize the total loss L. totalThe optimization process updates network weights simultaneously through the backpropagation algorithm, including the message passing layer, pressure header, traffic header, and the uncertainty parameter logσ. i 2 This enables end-to-end learning.
[0054] Specifically, the S4 two-stage training includes: In the first stage, based on the topology, attribute characteristics, and statistical priors of heat user loads of the heating network, a hydraulic simulation model of the heating network is established. The model is used to generate synthetic data of the entire network pressure and the circulating flow of the node branches under multiple operating conditions. The dual-output graph neural network prediction model is pre-trained in a fully supervised manner to learn the mapping law of pressure and flow distribution. In the second stage, the pre-trained weights are loaded, the main parameters of the dual-output graph neural network prediction model are frozen, and fine-tuning is performed using only the field measured data of the pressure and flow sensors on the inlet main pipe, combined with the total loss function, so that the dual-output graph neural network prediction model can be adapted to the real network characteristics, and the final pressure field reconstruction model is obtained.
[0055] In a specific embodiment of the present invention, the two-stage training of performing simulated pre-training and fine-tuning with real sparse data in S4 includes: S4-1: Constructing a Multi-Condition Hydraulic Simulation Dataset. Based on the topology, attribute characteristics, and statistical priors of heat user loads of the heating network, a hydraulic simulation model of the heating network is established. Using node mass conservation and loop energy conservation as the basic equations, and the Hassen-Williams formula as the basis for calculating pipe segment pressure drop, EPANET hydraulic simulation software is used to generate .inp input files. The baseline water demand of each node is randomly perturbed to form various water usage conditions. The perturbation amplitude and spatial correlation can be set according to the fluctuation range of actual operating data. Hydraulic simulations are performed for each scenario to obtain the true values of pressure and pipeline flow rate at all network nodes under each condition, while simultaneously recording the branch circulation flow rate at each node. The network state, pressure, and flow rate for each condition are saved as training samples to form a synthetic dataset.
[0056] S4-2: Fully Supervised Pre-training. Based on the synthetic dataset, the dual-output graph neural network constructed in step S2 is pre-trained in a fully supervised manner. The loss function in the pre-training stage is the sum of the mean square errors of the predicted pressure and simulated pressure, and the mean square errors of the predicted flow rate and simulated flow rate, as shown in the following equation.
[0057] Where, λ q Weights for traffic prediction loss, and These refer to the normalized pressure and flow results generated by the hydraulic simulation, respectively.
[0058] Pre-training does not include a physical constraint loss term. The purpose is to enable the network to converge quickly under a large number of complete simulation supervision signals, obtain basic modeling capabilities for the spatial distribution of pressure field and branch flow, and learn reasonable internal representations of pipeline topology and edge features.
[0059] S4-3: Pre-training Weight Loading and Network Freezing. After pre-training converges, the model parameters are saved. Before fine-tuning, pre-training weights are loaded, and some network layers are selectively frozen based on the scarcity of field data for the thermal pipeline network. Generally, the parameters of the first two layers of the edge-conditional message passing network are frozen, retaining only the parameters of the last message passing layer, the pressure prediction head, and the flow prediction head as trainable. This "fixed backbone, fine-tuned ends" strategy can preserve the universal topology and physical priors learned from the simulation data, while allowing the model to perform local adaptations on real data, significantly reducing the need for measured sample size and suppressing overfitting.
[0060] S4-4: Fine-tuning based on physical information from real sparse data. The fine-tuning phase uses only field-measured data from a very small number of pressure and flow sensors on the main inlet pipe of the heating network. This data is combined with the graph data object constructed in S1 to form fine-tuning training samples. In each iteration, the following steps are performed: Forward propagation: Input node features and edge features, and obtain the predicted pressure P through the network. v And predicted branch flow q v ; The various losses calculated using S3-1 to S3-5 are called. The objective function is calculated using the total loss formula in S3-6, where the weights of each loss term are automatically adjusted by a trainable homoscedastic uncertainty parameter. Backpropagation: Update unfrozen network parameters and uncertain parameters.
[0061] In the initial fine-tuning phase, because the network has not yet adapted to the real data, the residuals of the physical loss term are relatively large. The dynamic weighting mechanism automatically reduces its weight, allowing optimization to be dominated by data fitting loss, ensuring that the network first matches the measured pressure and flow. As fine-tuning progresses, the physical loss residuals gradually decrease, and its weight automatically increases, prompting the network output to satisfy the physical equations while matching the observations.
[0062] S4-5: Model Validation and Output. One or a very small number of real sensor nodes from the fine-tuning data are retained as the validation set. The mean square error of pressure prediction on the validation set is monitored as the number of fine-tuning steps increases. When the validation error stabilizes or begins to rise, an early stopping mechanism is activated, and the model with the smallest validation error is selected as the final model. This method can effectively determine whether the model is overfitting or underfitting, even under extreme conditions with only one or two sensors, ensuring generalization performance.
[0063] After the above two stages of training, a fully trained physical information graph neural network model is obtained. This model can accept pipeline topology and feature inputs under arbitrary operating conditions. A single forward propagation outputs the pressure of all nodes in the entire network and the circulating flow of node branches. The two are highly self-consistent under the constraints of physical equations, constituting the final pressure field and flow field of the thermal pipeline system.
[0064] Specifically, in S5, the trained physical information graph neural network model is deployed in the online monitoring system of the heating network to read the pressure and flow data of sparse sensors in real time. Through a single forward calculation, the pressure distribution of all nodes in the network and the estimated results of the circulating flow of the node branches are output to obtain complete network status information.
[0065] In a specific embodiment of the present invention, S5 further includes online deployment and real-time reconstruction, as detailed below: S5-1: Data Interface and Preprocessing. Develop a standardized data adapter to acquire pressure and flow data from existing monitoring systems in real time via industrial communication protocols, and convert and standardize the data according to the format defined in step S1 to construct a graph data object that is completely consistent with the training. Simultaneously, receive pipeline topology change information, such as changes in valve on / off states leading to changes in the topology structure.
[0066] S5-2: Model Loading and Inference Graph Construction. The physical information graph neural network model trained in step S4 is exported as an inference format and loaded into the online inference engine. For each pressure reconfiguration request, input graph data is constructed based on the current real-time pipeline topology and sensor data, and sensor masks are set to mark nodes and pipes with observations.
[0067] S5-3: Forward computation and result output. The constructed graph data object is input into the loaded physical information graph neural network model, and a single forward propagation is performed. The model simultaneously outputs the pressure prediction value and the branch circulation flow prediction value.
[0068] S5-4: Result Visualization and Anomaly Early Warning. The predicted pressure values for the entire network are displayed through a visualization interface in the form of colored pipeline maps or contour lines. Multiple early warning thresholds are set. When the number of abnormal nodes or the area of abnormal regions exceeds the preset threshold, an alarm is automatically triggered, prompting operators to take measures such as pressurizing, adjusting valve openings, or checking for pipeline blockages. At the same time, the circulation flow distribution of node branches is output for operation and dispatch personnel to refer to.
[0069] S5-5: Data Storage and Model Optimization. Input data (sensor readings, pipeline topology), output results (total node pressure, branch flow), and early warning information from each online inference are stored in a time-series database to form an operational history. After accumulating a certain amount of real operational data, this data can be used to periodically retrain or incrementally learn the model, enabling it to continuously adapt to slowly time-varying factors such as pipeline aging and seasonal load changes, maintaining long-term prediction accuracy.
[0070] Specifically, a thermal pipeline pressure field reconstruction system based on a physical information graph neural network includes: Data acquisition module: used to acquire thermal network diagram data; Graph Neural Network Module: Constructs a dual-output graph neural network prediction model based on thermal pipeline network data; Constraint module: Used to construct physical constraint loss functions and implement dynamic weight optimization; Training and fine-tuning module: Used to perform two-stage training, namely simulated pre-training and fine-tuning with real sparse data, and fine-tuning with physical constraint loss function to obtain a trained physical information graph neural network model; Information reading module: This module is used to deploy the trained physical information graph neural network model in the online monitoring system of the heating network, and read the pressure and flow data of sparse sensors in real time to obtain complete network status information.
[0071] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.
[0072] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for reconstructing the pressure field of a thermal pipeline network based on a physical information graph neural network, characterized in that, include: S1. Obtain thermal pipeline network data; S2. Construct a dual-output graph neural network prediction model based on thermal pipeline network data; S3. Construct a physical constraint loss function and implement dynamic weight optimization; S4. Perform two-stage training: simulated pre-training and fine-tuning with real sparse data. Fine-tune the model by combining the physical constraint loss function to obtain the trained physical information graph neural network model. S5. Deploy the trained physical information graph neural network model in the online monitoring system of the heating network to read the pressure and flow data of sparse sensors in real time and obtain complete network status information.
2. The method for reconstructing the pressure field of a thermal pipeline network based on a physical information graph neural network according to claim 1, characterized in that, S1 specifically includes: The thermal pipeline network map data includes the topology, pipeline attributes, and monitoring data of the thermal pipeline network; the graph data structure is constructed with network nodes as graph nodes and pipe segments as edges; edge features include pipe length, pipe diameter, and roughness coefficient, and the hydraulic resistance coefficient is calculated as an additional edge feature; prior features including normalized coordinates, node degree, shortest path length to the heat source, sensor label, and heat user type are extracted for each node to form a node feature vector that integrates multi-source information.
3. The method for reconstructing the pressure field of a thermal pipeline network based on a physical information graph neural network according to claim 1, characterized in that, S2 specifically includes: An edge-conditional graph convolutional network is used as the backbone, which includes multiple message passing layers. The message passing layers take node states and edge features as input, and obtain the node hidden layer representation after aggregation and updating. A pressure prediction head and a flow prediction head are connected in parallel above the message passing layers. The pressure prediction head outputs the node pressure value, and the flow prediction head outputs the non-negative node branch cyclic flow prediction value after Softplus activation.
4. The method for reconstructing the pressure field of a thermal pipeline network based on a physical information graph neural network according to claim 3, characterized in that, S3 specifically includes: The flow rate of each pipe segment is calculated based on the node pressure value using the differentiable Hassen-Williams formula. The node continuity loss, pipe segment flow observation loss, and global circulating flow balance loss are constructed. The physical loss is combined with the sensor node pressure supervision loss. A trainable homoscedastic uncertainty parameter is introduced to adaptively weight each loss, automatically balance the gradient of multiple tasks, and form the total loss function.
5. The method for reconstructing the pressure field of a thermal pipeline network based on a physical information graph neural network according to claim 4, characterized in that, The S4 two-stage training includes: The first stage establishes a hydraulic simulation model of the heating network based on its topology, attribute characteristics, and statistical priors of heat user loads. This model generates composite data of network pressure and node branch circulation flow under multiple operating conditions. The dual-output graph neural network prediction model is then pre-trained in a fully supervised manner to learn the mapping pattern between pressure and flow distribution. The second stage loads the pre-trained weights, freezes the main parameters of the dual-output graph neural network prediction model, and fine-tunes it using only the field-measured data from pressure and flow sensors on the inlet main pipe, combined with the total loss function. This allows the dual-output graph neural network prediction model to adapt to the real network characteristics, resulting in the final pressure field reconstruction model.
6. The method for reconstructing the pressure field of a thermal pipeline network based on a physical information graph neural network according to claim 4, characterized in that, In S5, the trained physical information graph neural network model is deployed in the heating network online monitoring system to read the pressure and flow data of sparse sensors in real time. Through a single forward calculation, the pressure distribution of all nodes in the network and the estimated results of the circulating flow of the node branches are output to obtain complete network status information.
7. A thermal pipeline pressure field reconstruction system based on a physical information graph neural network, characterized in that, include: Data acquisition module: used to acquire thermal pipeline network data; Graph Neural Network Module: Constructs a dual-output graph neural network prediction model based on thermal pipeline network data; Constraint module: Used to construct physical constraint loss functions and implement dynamic weight optimization; Training and fine-tuning module: Used to perform two-stage training, namely simulated pre-training and fine-tuning with real sparse data, and fine-tuning with physical constraint loss function to obtain a trained physical information graph neural network model; Information reading module: This module is used to deploy the trained physical information graph neural network model in the online monitoring system of the heating network, and read the pressure and flow data of sparse sensors in real time to obtain complete network status information.
