Heating system prediction method and system based on double-layer attention mechanism and graph neural network
By employing a two-layer attention mechanism and graph neural network approach, a fine-grained topology graph and GATv2 network are constructed, which solves the problems of data heterogeneity and insufficient topological relationships in heating systems, and achieves high-precision heating prediction and energy-saving heating effects.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TIANJIN HONGDA CREDIT SUISSE TECH CO LTD
- Filing Date
- 2026-03-11
- Publication Date
- 2026-04-10
AI Technical Summary
Existing heating systems suffer from data heterogeneity and insufficient utilization of system topology, resulting in low accuracy in heating forecasts and making it difficult to achieve on-demand heating and energy conservation.
We employ a method based on a two-layer attention mechanism and a graph neural network. By constructing a fine-grained topological graph and a GATv2 graph neural network, combined with Transformer-Encoder for independent encoding and feature aggregation, and using a composite loss function to optimize model parameters, we can accurately characterize the complex coupling relationship of the heating system.
This approach achieves deep decoupling of multi-source heterogeneous data, improves the accuracy of feature extraction and the generalization ability of the model, ensures that the prediction results conform to the law of conservation of total thermodynamic quantities, and enhances the usability and effectiveness of temperature prediction.
Smart Images

Figure CN121836040A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of intelligent heating systems, in particular to a heating system prediction method and system based on a double-layer attention mechanism and a graph neural network. BACKGROUND
[0002] A central heating system is a complex industrial system with large hysteresis, strong coupling, and nonlinear characteristics. Accurate heating prediction is the key to realizing on-demand heating and energy saving. However, existing technologies face many challenges when dealing with heating prediction tasks.
[0003] The heating system involves a variety of data types, including continuous changing attribute quantities such as temperature, pressure, and flow, as well as discrete data such as holidays and device IDs, with serious data heterogeneity problems. The time variation laws of different attribute quantities (such as wind speed and return water temperature) differ greatly, and traditional methods directly concatenate them into a single model, which can easily cause feature interference and make it difficult to extract effective rules.
[0004] Moreover, existing models usually ignore the complex topology between "heat source-pipe network-unit". In the heating network, changes in the heat source are transmitted to each unit through the pipe network, and there is also mutual influence of hydraulic working conditions between units. Simple fully connected networks or graph networks that do not consider attribute nodes cannot accurately depict this fine-grained coupling relationship, and the system topology relationship is underutilized. SUMMARY
[0005] To solve the above technical problems, avoid interference between multi-source heterogeneous data in the heating system, and enable the model to accurately depict the complex coupling relationship in the system, the present application provides a heating system prediction method and system based on a double-layer attention mechanism and a graph neural network.
[0006] In a first aspect, the present application provides a heating system prediction method based on a double-layer attention mechanism and a graph neural network, which adopts the following technical solution: A heating system prediction method based on a double-layer attention mechanism and a graph neural network, characterized in that it comprises the following steps: Obtain multi-dimensional operating data of the heating system, including a+b+c+d kinds of attribute features of a kinds of characteristics data of m heat sources, b kinds of characteristics data of n units, c kinds of weather data, and d kinds of time holiday data, and 2 kinds of identification features of unit encoding and heat source encoding; Build a feature encoding layer containing a+b+c+d+2 parallelly set Transformer-Encoders, input the obtained a+b+c+d+2 kinds of data into the corresponding Transformer-Encoders for independent encoding, and obtain a+b+c+d+2 groups of high-dimensional feature vectors; A fine-grained topology graph of the heating system is constructed, which contains m×a+n×b+m+n+c+d nodes. According to the attribute subordination relationship and equipment coupling relationship of the heating system, edge connections are established between each node, and a+b+c+d+2 sets of high-dimensional feature vectors are mapped to the nodes of the topology graph respectively. The topology graph is aggregated using a GATv2 graph neural network to update the feature representation of each node. Extract the updated features of m heat source nodes and n unit nodes, and output the predicted values of heat source temperature and unit temperature respectively through the prediction head.
[0007] By adopting the above technical solution, each type of acquired data is mapped one-to-one with a parallel and independent Transformer-Encoder in the feature encoding layer and encoded independently, achieving deep decoupling of features. On the one hand, this completely isolates semantic interference and dimensional conflicts between various attribute feature data and representation feature data in the heating system. On the other hand, it allows each type of data to independently learn its own temporal change patterns, significantly improving the accuracy and specificity of feature extraction. Furthermore, the decoupled high-dimensional feature vectors provide an input basis for subsequent graph fusion, enhancing the model's generalization ability to complex operating conditions. By constructing a fine-grained topological graph that includes the attribute hierarchy and equipment coupling relationships of the heating system, the problem of coarse topological characterization caused by traditional models focusing only on equipment entities and ignoring attribute associations is solved. Combined with the GATv2 graph neural network, it can accurately capture the complex nonlinear coupling and spatiotemporal dependencies in the heating system, making the model's prediction accuracy fluctuate less under dynamic scenarios such as sudden weather changes, equipment start-up and shutdown switching, and hydraulic imbalance in the pipeline network, making temperature prediction more consistent with the actual operating logic of the heating system.
[0008] In a specific feasible implementation, the topology graph nodes include attribute nodes, entity nodes, and environment nodes. The attribute nodes include m×a heat source attribute nodes and n×b unit attribute nodes, corresponding to a type of characteristic parameter of the heat source and b type of characteristic parameter of the unit, respectively. The entity nodes include m heat source entity nodes and n unit entity nodes, corresponding to the heat source equipment body and the unit equipment body, respectively. The environment nodes include c weather nodes and d time and holiday nodes.
[0009] In a specific feasible implementation, establishing edge connections between nodes based on the attribute dependency relationship and equipment coupling relationship of the heating system specifically includes: Connect each heat source's 'a' heat source attribute nodes to its corresponding heat source entity node, and connect each unit's 'b' unit attribute nodes to its corresponding unit entity node. Connect c weather nodes and d holiday time nodes to each of the m heat source entity nodes and n unit entity nodes respectively; Connect m heat source entity nodes and n unit entity nodes in pairs to form a fully connected subgraph.
[0010] In one specific implementation, the GATv2 graph neural network employs a dynamic attention mechanism, calculating attention weights based on the node features connecting the two ends of each edge.
[0011] By adopting the above technical solutions, the dynamic attention mechanism of the GATv2 network can adaptively calculate the attention weights between nodes, accurately quantify the thermal hysteresis effect and the coupling strength between devices, thereby efficiently capturing the complex nonlinear spatiotemporal dependencies in the system.
[0012] In a specific feasible implementation, it also includes: Construct a composite loss function that includes attribute constraints, wherein the composite loss function includes a basic prediction error term, a total unit constraint loss term, and a total heat source constraint loss term; The gradient is calculated based on the composite loss function, and the model parameters are updated using the gradient descent algorithm.
[0013] Traditional deep learning models only pursue single-point prediction accuracy (MSE minimization), which often results in small errors in the prediction results at a single point, but the total heat or total temperature difference of the entire network deviates significantly from the property conservation law, causing scheduling instructions to fail.
[0014] By adopting the above technical solution, the composite loss function includes basic prediction error, total unit constraint loss, and total heat source constraint loss. This not only reduces the temperature prediction error of individual heat sources and units, meeting local control needs, but also makes the temperature prediction results conform to the thermodynamic law of total conservation. This effectively avoids the problem of total heat deviation in the whole network caused by traditional models that only pursue the minimization of single-point errors. As a result, the prediction results can directly guide the actual heating scheduling, reduce the heat surplus caused by total deviation, and improve the usability and effectiveness of temperature prediction results.
[0015] In one specific implementation, the basic prediction error term is the difference between the predicted node temperature values and the actual values. The total unit constraint loss term is to minimize the difference between the sum of the predicted temperature values of all n units and the sum of the actual temperature values; The total heat source constraint loss term is to minimize the difference between the sum of the predicted temperature values of all m heat sources and the sum of the actual values.
[0016] In one specific implementation scheme, the step of inputting the acquired data a+b+c+d+2 into the corresponding Transformer-Encoder for independent encoding specifically includes: The two types of data, a+b+c+d+2, are input into their respective Transformer-Encoders for independent temporal feature extraction. Each Transformer-Encoder learns the dimensional characteristics and semantic rules of each type of data separately.
[0017] In one specific implementation scheme, the a-type characteristic data of the heat source includes rated heating capacity, real-time outlet water temperature, real-time outlet water pressure, real-time outlet water flow rate, real-time return water temperature, real-time return water pressure, fuel consumption, operating power, heat source thermal efficiency, and continuous operating time. The unit's type B characteristic data includes primary network supply water temperature, primary network return water temperature, primary network operating pressure, primary network circulation flow rate, secondary network supply water temperature, secondary network return water temperature, secondary network operating pressure, secondary network circulation flow rate, unit heat exchange efficiency, and unit start-up / shutdown status. Type C weather data includes daily average temperature, daily maximum temperature, daily minimum temperature, average relative humidity, average wind speed, maximum wind speed, solar radiation intensity, and sunshine duration; Type d time holiday data includes statutory holiday identifiers, weekday / weekend identifiers, heating season / non-heating season identifiers, month identifiers, day / time period identifiers, hour / time period identifiers, heating peak period identifiers, and extreme weather warning period identifiers.
[0018] Secondly, this application provides a heating system prediction system based on a two-layer attention mechanism and a graph neural network, employing the following technical solution: A heating system prediction system based on a two-layer attention mechanism and a graph neural network, used to execute the aforementioned heating system prediction method based on a two-layer attention mechanism and a graph neural network, includes: The data acquisition unit is used to acquire multi-dimensional operating data of the heating system. The multi-dimensional operating data includes a type of characteristic data of m heat sources, b type of characteristic data of n units, c type of weather data, d type of time and holiday data, totaling a+b+c+d attribute features, as well as two identification features: unit code and heat source code. The encoding architecture unit is used to build a feature encoding layer containing a+b+c+d+2 parallel Transformer-Encoders. The acquired a+b+c+d+2 types of data are input into the corresponding Transformer-Encoders for independent encoding to obtain a+b+c+d+2 sets of high-dimensional feature vectors. The graph construction unit is used to construct a fine-grained topology graph of the heating system. The topology graph contains m×a+n×b+m+n+c+d nodes. According to the attribute subordination relationship and equipment coupling relationship of the heating system, edge connections are established between each node, and a+b+c+d+2 sets of high-dimensional feature vectors are mapped to the nodes of the topology graph respectively. The feature fusion unit is used to aggregate node features of the topology graph through the GATv2 graph neural network and update the feature representation of each node. The prediction output unit is used to extract the updated features of m heat source nodes and n unit nodes, and output the predicted values of heat source temperature and unit temperature respectively through the prediction head.
[0019] Secondly, this application provides a computer-readable storage medium, which adopts the following technical solution: A computer-readable storage medium is characterized in that it stores a computer program capable of being loaded by a processor and executed by the above-described heating system prediction method based on a two-layer attention mechanism and a graph neural network.
[0020] In summary, this application includes at least one of the following beneficial technical effects: By mapping the acquired data one-to-one with Transformer-Encoder and encoding them independently, deep decoupling of features is achieved, avoiding mutual interference between multi-source heterogeneous data; By constructing a fine-grained topological graph that includes the attribute hierarchy and equipment coupling relationships of the heating system, and combining it with the GATv2 graph neural network, it is possible to accurately capture the complex nonlinear coupling and spatiotemporal dependencies in the heating system. By introducing a composite loss function, the model not only makes accurate single-point predictions, but also ensures that the prediction results conform to the thermodynamic conservation law in the system, thereby improving the availability and effectiveness of temperature prediction results in actual scheduling. Attached Figure Description
[0021] Figure 1 This is a flowchart illustrating the heating system prediction method based on a two-layer attention mechanism and graph neural network according to an embodiment of this application. Detailed Implementation
[0022] The following is in conjunction with the appendix Figure 1 This application will be described in further detail.
[0023] This application discloses a heating system prediction method based on a two-layer attention mechanism and a graph neural network.
[0024] Reference Figure 1 A heating system prediction method based on a two-layer attention mechanism and graph neural network includes the following steps: S1: Obtain multi-dimensional operation data of the heating system. The multi-dimensional operation data includes a type of characteristic data of m heat sources, b type of characteristic data of n units, c type of weather data, d type of time and holiday data, totaling a+b+c+d attribute features, as well as two identification features: unit code and heat source code.
[0025] Specifically, the heat source's type a characteristic data includes rated heating capacity, real-time outlet water temperature, real-time outlet water pressure, real-time outlet water flow rate, real-time return water temperature, real-time return water pressure, fuel consumption, operating power, heat source thermal efficiency, and continuous operating time; the unit's type b characteristic data includes primary network supply water temperature, primary network return water temperature, primary network operating pressure, primary network circulation flow rate, secondary network supply water temperature, secondary network return water temperature, secondary network operating pressure, secondary network circulation flow rate, unit heat exchange efficiency, and unit start-up / shutdown status; type c weather data includes daily average temperature, daily maximum temperature, daily minimum temperature, average relative humidity, average wind speed, maximum wind speed, solar radiation intensity, and sunshine duration; type d time and holiday data includes statutory holiday indicators, weekday / weekend indicators, heating season / non-heating season indicators, month indicators, day / time period indicators, hourly period indicators, peak heating period indicators, and extreme weather warning period indicators.
[0026] S2: Construct a feature encoding layer containing two parallel Transformer-Encoders (a+b+c+d+2). Input the acquired data (a+b+c+d+2) into the corresponding Transformer-Encoders for independent encoding to obtain two sets of high-dimensional feature vectors (a+b+c+d+2).
[0027] Specifically, the a+b+c+d+2 Transformer-Encoders have the same structure but do not share parameters. Each type of data corresponds to a separate Transformer-Encoder. The a+b+c+d+2 types of data are input into their respective Transformer-Encoders for independent temporal feature extraction. Each Transformer-Encoder learns its own exclusive temporal features based on the dimensional characteristics and semantic rules of each type of data. This achieves feature-level decoupling of multi-source heterogeneous data in the heating system and avoids noise interference between different types of data in shallow networks.
[0028] S3: Construct a fine-grained topology graph of the heating system. The topology graph contains m×a+n×b+m+n+c+d nodes. Based on the attribute hierarchy and equipment coupling relationship of the heating system, establish edge connections between the nodes and map the a+b+c+d+2 sets of high-dimensional feature vectors to the nodes of the topology graph respectively.
[0029] Specifically, the topology graph nodes include attribute nodes, entity nodes, and environment nodes. Attribute nodes include m×a heat source attribute nodes and n×b unit attribute nodes, corresponding to a type of characteristic parameter of the heat source and b type of characteristic parameter of the unit, respectively. Entity nodes include m heat source entity nodes and n unit entity nodes, corresponding to the heat source equipment body and the unit equipment body, respectively. Environment nodes include c weather nodes and d time and holiday nodes.
[0030] Connect each heat source's 'a' attribute nodes to its corresponding heat source entity node; connect each unit's 'b' attribute nodes to its corresponding unit entity node; connect each of the 'c' weather nodes and 'd' holiday nodes to each of the 'm' heat source entity nodes and 'n' unit entity nodes; connect each of the 'm' heat source entity nodes and 'n' unit entity nodes in pairs to form a fully connected subgraph.
[0031] S4: Aggregate node features of the topology graph using the GATv2 graph neural network and update the feature representation of each node.
[0032] Specifically, the GATv2 graph neural network adopts a dynamic attention mechanism, which calculates attention weights based on the node features connecting the two ends of each edge. This allows for adaptive learning of the coupling strength and thermal hysteresis effect between different devices in the heating system. The GATv2 network is used to perform message passing and feature fusion on the constructed topology graph, effectively capturing the complex nonlinear coupling and spatiotemporal dependencies of the system, and providing spatial dimension feature support for high-precision prediction.
[0033] S5: Extract the updated features of m heat source nodes and n unit nodes, and output the predicted values of heat source temperature and unit temperature respectively through the prediction head. Construct a composite loss function with attribute constraints, calculate the gradient based on the composite loss function, and update the model parameters through the gradient descent algorithm.
[0034] Specifically, the composite loss function includes a basic prediction error term, a unit total constraint loss term, and a heat source total constraint loss term. The basic prediction error term is the difference between the predicted temperature values of all nodes and the actual values; the unit total constraint loss term minimizes the difference between the sum of the predicted temperature values of all n units and the sum of the actual values; the heat source total constraint loss term minimizes the difference between the sum of the predicted temperature values of all m heat sources and the sum of the actual values.
[0035] The expression for the composite loss function is: Loss=MSE(Pred,True)+λ1*|Sum(Pred_unit)-Sum(True_unit)|+λ2*|Sum(Pred_heat source)-Sum(True_heat source)|, where λ1 and λ2 are weighting coefficients, Pred is the predicted value, and True is the actual value.
[0036] In this embodiment, each heat source includes 10 characteristic data: rated heating capacity, real-time outlet water temperature, real-time outlet water pressure, real-time outlet water flow rate, real-time return water temperature, real-time return water pressure, fuel consumption, operating power, heat source thermal efficiency, and continuous operating time. Each unit includes 10 characteristic data: primary network supply water temperature, primary network return water temperature, primary network operating pressure, primary network circulation flow rate, secondary network supply water temperature, secondary network return water temperature, secondary network operating pressure, secondary network circulation flow rate, unit heat exchange efficiency, and unit start-up / shutdown status. It also includes 8 weather characteristics: daily average temperature, daily maximum temperature, daily minimum temperature, average relative humidity, average wind speed, maximum wind speed, solar radiation intensity, and sunshine duration. Furthermore, it includes 8 time-related holiday characteristics: statutory holiday identifier, weekday / weekend identifier, heating season / non-heating season identifier, month identifier, day / time period identifier, hour / time period identifier, heating peak period identifier, and extreme weather warning period identifier.
[0037] In this embodiment, a prediction is made for a centralized heating system, which includes m=3 heat sources and n=50 heat exchange units. The specific steps include: S1: Collect historical operating data of the system, including the above 36 attribute characteristics and two identification features: unit code and heat source code. Input this data into the data matrix, which includes 3 heat sources × 10 characteristic sequences, 50 units × 10 characteristic sequences, 8 weather sequences, and 8 time holiday sequences.
[0038] S2: Initialize 38 Transformer-Encoders with the same structure but different parameters.
[0039] Input the rated heating capacity data of the three heat sources into the first encoder; input the real-time outlet water temperature data of the three heat sources into the second encoder, and so on; input the primary network water supply temperature data of the 50 units into the eleventh encoder, and so on; until the weather data, time and holiday data, unit code and heat source code are input into the corresponding encoders respectively.
[0040] Each encoder outputs a high-dimensional vector representation of the corresponding feature.
[0041] S3: Construct a fine-grained topology graph of the heating system. The total number of nodes in the graph is: 3×10 (heat source attributes) + 50×10 (unit attributes) + 3 (heat source entities) + 50 (unit entities) + 8 (weather) + 8 (time and holiday) = 599 nodes.
[0042] Based on the attribute hierarchy and equipment coupling relationships of the heating system, edge connections are established between each node: (1) Point the 10 attribute nodes belonging to heat source A to the entity node of heat source A; (2) Point the 10 attribute nodes belonging to unit B to the unit B entity node; (3) Establish connection edges between 8 weather nodes and 8 time nodes and 3 heat source entity nodes and 50 unit entity nodes respectively; (4) Construct a fully connected layer between entities: Connect the 3 heat source nodes and 50 unit nodes in pairs (i.e., establish 3×50 bidirectional edges and possible interconnections within the entities) to form a fully connected subgraph.
[0043] S4: The GATv2 network is used to perform message passing and feature fusion on the constructed topology graph. The feature vector output from step S2 is filled into the corresponding nodes in step S3 and input into the GATv2 network. The GATv2 network calculates the attention coefficient between nodes according to the formula and aggregates neighbor information. For example, when the temperature drops sharply, the GATv2 network will automatically assign a higher weight to the edge pointing from the "daily average temperature node" to the "unit entity node".
[0044] S5: The model outputs predicted temperatures for 3 heat sources and 50 units at future times.
[0045] Calculate the composite loss function Loss=MSE(Pred,True)+λ1*|Sum(Pred_unit)-Sum(True_unit)|+λ2*|Sum(Pred_heat source)-Sum(True_heat source)|, where λ1 and λ2 are weighting coefficients, Pred is the predicted value, and True is the actual value.
[0046] By optimizing the composite loss function Loss, the model is forced to learn the overall trend of heat supply changes.
[0047] This application also discloses a heating system prediction system based on a two-layer attention mechanism and a graph neural network.
[0048] A heating system prediction system based on a two-layer attention mechanism and a graph neural network, comprising: The data acquisition unit is used to acquire multi-dimensional operating data of the heating system. The multi-dimensional operating data includes a type of characteristic data of m heat sources, b type of characteristic data of n units, c type of weather data, d type of time and holiday data, totaling a+b+c+d attribute features, as well as two identification features: unit code and heat source code.
[0049] Specifically, the heat source's type a characteristic data includes rated heating capacity, real-time outlet water temperature, real-time outlet water pressure, real-time outlet water flow rate, real-time return water temperature, real-time return water pressure, fuel consumption, operating power, heat source thermal efficiency, and continuous operating time; the unit's type b characteristic data includes primary network supply water temperature, primary network return water temperature, primary network operating pressure, primary network circulation flow rate, secondary network supply water temperature, secondary network return water temperature, secondary network operating pressure, secondary network circulation flow rate, unit heat exchange efficiency, and unit start-up / shutdown status; type c weather data includes daily average temperature, daily maximum temperature, daily minimum temperature, average relative humidity, average wind speed, maximum wind speed, solar radiation intensity, and sunshine duration; type d time and holiday data includes statutory holiday indicators, weekday / weekend indicators, heating season / non-heating season indicators, month indicators, day / time period indicators, hourly period indicators, peak heating period indicators, and extreme weather warning period indicators.
[0050] The encoding architecture unit is used to build a feature encoding layer containing two parallel Transformer-Encoders (a+b+c+d+2). The acquired data (a+b+c+d+2) are input into the corresponding Transformer-Encoders for independent encoding to obtain two sets of high-dimensional feature vectors (a+b+c+d+2).
[0051] Specifically, the a+b+c+d+2 Transformer-Encoders have the same structure but do not share parameters. Each type of data corresponds to a separate Transformer-Encoder. The a+b+c+d+2 types of data are input into their respective Transformer-Encoders for independent temporal feature extraction. Each Transformer-Encoder learns its own exclusive temporal features based on the dimensional characteristics and semantic rules of each type of data. This achieves feature-level decoupling of multi-source heterogeneous data in the heating system and avoids noise interference between different types of data in shallow networks.
[0052] The graph construction unit is used to construct a fine-grained topology graph of the heating system. The topology graph contains m×a+n×b+m+n+c+d nodes. Based on the attribute subordination relationship and equipment coupling relationship of the heating system, edge connections are established between the nodes, and the a+b+c+d+2 sets of high-dimensional feature vectors are mapped to the nodes of the topology graph respectively.
[0053] Specifically, the topology graph nodes include attribute nodes, entity nodes, and environment nodes. Attribute nodes include m×a heat source attribute nodes and n×b unit attribute nodes, corresponding to a type of characteristic parameter of the heat source and b type of characteristic parameter of the unit, respectively. Entity nodes include m heat source entity nodes and n unit entity nodes, corresponding to the heat source equipment body and the unit equipment body, respectively. Environment nodes include c weather nodes and d time and holiday nodes.
[0054] Connect each heat source's 'a' attribute nodes to its corresponding heat source entity node; connect each unit's 'b' attribute nodes to its corresponding unit entity node; connect each of the 'c' weather nodes and 'd' holiday nodes to each of the 'm' heat source entity nodes and 'n' unit entity nodes; connect each of the 'm' heat source entity nodes and 'n' unit entity nodes in pairs to form a fully connected subgraph.
[0055] The feature fusion unit is used to aggregate node features of the topology graph through the GATv2 graph neural network and update the feature representation of each node.
[0056] Specifically, the GATv2 graph neural network adopts a dynamic attention mechanism, which calculates attention weights based on the node features connecting the two ends of each edge. This allows for adaptive learning of the coupling strength and thermal hysteresis effect between different devices in the heating system. The GATv2 network is used to perform message passing and feature fusion on the constructed topology graph, effectively capturing the complex nonlinear coupling and spatiotemporal dependencies of the system, and providing spatial dimension feature support for high-precision prediction.
[0057] The prediction output unit is used to extract the updated features of m heat source nodes and n unit nodes, and output the predicted values of heat source temperature and unit temperature respectively through the prediction head; construct a composite loss function containing attribute constraints, calculate the gradient based on the composite loss function, and update the model parameters through the gradient descent algorithm.
[0058] Specifically, the composite loss function includes a basic prediction error term, a unit total constraint loss term, and a heat source total constraint loss term. The basic prediction error term is the difference between the predicted temperature values of all nodes and the actual values; the unit total constraint loss term minimizes the difference between the sum of the predicted temperature values of all n units and the sum of the actual values; the heat source total constraint loss term minimizes the difference between the sum of the predicted temperature values of all m heat sources and the sum of the actual values.
[0059] The expression for the composite loss function is: Loss=MSE(Pred,True)+λ1*|Sum(Pred_unit)-Sum(True_unit)|+λ2*|Sum(Pred_heat source)-Sum(True_heat source)|, where λ1 and λ2 are weighting coefficients, Pred is the predicted value, and True is the actual value.
[0060] Figure 1 This is a flowchart illustrating the heating system prediction method based on a two-layer attention mechanism and graph neural network according to an embodiment of this application. It should be understood that, although... Figure 1The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows; unless explicitly stated otherwise, there is no strict order requirement for the execution of these steps, and they can be executed in other orders; and Figure 1 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
[0061] This application also discloses a computer-readable storage medium.
[0062] Specifically, the computer-readable storage medium stores a computer program that can be loaded and executed by a processor, such as the heating system prediction method based on the two-layer attention mechanism and graph neural network described above. The computer-readable storage medium includes, for example, various media that can store program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0063] This specific embodiment is merely an explanation of the present invention and is not intended to limit the invention. After reading this specification, those skilled in the art can make modifications to this embodiment without contributing any inventive step, but such modifications are protected by patent law as long as they are within the scope of the claims of the present invention.
Claims
1. A heating system prediction method based on a two-layer attention mechanism and graph neural network, characterized in that, Includes the following steps: Acquire multidimensional operational data of the heating system. The multidimensional operational data includes a type of characteristic data of m heat sources, b type of characteristic data of n units, c type of weather data, d type of time and holiday data, totaling a+b+c+d attribute features, as well as two identification features: unit code and heat source code. Construct a feature encoding layer containing two parallel Transformer-Encoders (a+b+c+d+2). Input the acquired data (a+b+c+d+2) into the corresponding Transformer-Encoders for independent encoding to obtain two sets of high-dimensional feature vectors (a+b+c+d+2). A fine-grained topology graph of the heating system is constructed, which contains m×a+n×b+m+n+c+d nodes. According to the attribute subordination relationship and equipment coupling relationship of the heating system, edge connections are established between each node, and a+b+c+d+2 sets of high-dimensional feature vectors are mapped to the nodes of the topology graph respectively. The topology graph is aggregated using a GATv2 graph neural network to update the feature representation of each node. Extract the updated features of m heat source nodes and n unit nodes, and output the predicted values of heat source temperature and unit temperature respectively through the prediction head.
2. The heating system prediction method based on a two-layer attention mechanism and graph neural network according to claim 1, characterized in that, The topology graph nodes include attribute nodes, entity nodes, and environment nodes. The attribute nodes include m×a heat source attribute nodes and n×b unit attribute nodes, corresponding to a type of characteristic parameter of the heat source and b type of characteristic parameter of the unit, respectively. The entity nodes include m heat source entity nodes and n unit entity nodes, corresponding to the heat source equipment body and the unit equipment body, respectively. The environment nodes include c weather nodes and d time and holiday nodes.
3. The heating system prediction method based on a two-layer attention mechanism and graph neural network according to claim 2, characterized in that, The step of establishing edge connections between nodes based on the attribute hierarchy and equipment coupling relationships of the heating system specifically includes: Connect each heat source's 'a' heat source attribute nodes to its corresponding heat source entity node, and connect each unit's 'b' unit attribute nodes to its corresponding unit entity node. Connect c weather nodes and d holiday time nodes to each of the m heat source entity nodes and n unit entity nodes respectively; Connect m heat source entity nodes and n unit entity nodes in pairs to form a fully connected subgraph.
4. The heating system prediction method based on a two-layer attention mechanism and graph neural network according to claim 1, characterized in that, The GATv2 graph neural network employs a dynamic attention mechanism, calculating attention weights based on the node features connecting the two ends of each edge.
5. The heating system prediction method based on a two-layer attention mechanism and graph neural network according to claim 1, characterized in that, Also includes: Construct a composite loss function that includes attribute constraints, wherein the composite loss function includes a basic prediction error term, a total unit constraint loss term, and a total heat source constraint loss term; The gradient is calculated based on the composite loss function, and the model parameters are updated using the gradient descent algorithm.
6. The heating system prediction method based on a two-layer attention mechanism and graph neural network according to claim 5, characterized in that, The basic prediction error term is the difference between the predicted node temperature values and the actual values; The total unit constraint loss term is to minimize the difference between the sum of the predicted temperature values of all n units and the sum of the actual temperature values; The total heat source constraint loss term is to minimize the difference between the sum of the predicted temperature values of all m heat sources and the sum of the actual values.
7. The heating system prediction method based on a two-layer attention mechanism and graph neural network according to claim 1, characterized in that, The step of inputting the acquired data a+b+c+d+2 types into the corresponding Transformer-Encoder for independent encoding specifically includes: The two types of data, a+b+c+d+2, are input into their respective Transformer-Encoders for independent temporal feature extraction. Each Transformer-Encoder learns the dimensional characteristics and semantic rules of each type of data separately.
8. The heating system prediction method based on a two-layer attention mechanism and graph neural network according to claim 1, characterized in that, The heat source's characteristic data (type a) includes rated heating capacity, real-time outlet water temperature, real-time outlet water pressure, real-time outlet water flow rate, real-time return water temperature, real-time return water pressure, fuel consumption, operating power, heat source thermal efficiency, and continuous operating time. The unit's type B characteristic data includes primary network supply water temperature, primary network return water temperature, primary network operating pressure, primary network circulation flow rate, secondary network supply water temperature, secondary network return water temperature, secondary network operating pressure, secondary network circulation flow rate, unit heat exchange efficiency, and unit start-up / shutdown status. Type C weather data includes daily average temperature, daily maximum temperature, daily minimum temperature, average relative humidity, average wind speed, maximum wind speed, solar radiation intensity, and sunshine duration; Type d time holiday data includes statutory holiday identifiers, weekday / weekend identifiers, heating season / non-heating season identifiers, month identifiers, day / time period identifiers, hour / time period identifiers, heating peak period identifiers, and extreme weather warning period identifiers.
9. A heating system prediction system based on a two-layer attention mechanism and a graph neural network, characterized in that, The method for performing the heating system prediction method based on a two-layer attention mechanism and graph neural network as described in any one of claims 1 to 8 includes: The data acquisition unit is used to acquire multi-dimensional operating data of the heating system. The multi-dimensional operating data includes a type of characteristic data of m heat sources, b type of characteristic data of n units, c type of weather data, d type of time and holiday data, totaling a+b+c+d attribute features, as well as two identification features: unit code and heat source code. The encoding architecture unit is used to build a feature encoding layer containing a+b+c+d+2 parallel Transformer-Encoders. The acquired a+b+c+d+2 types of data are input into the corresponding Transformer-Encoders for independent encoding to obtain a+b+c+d+2 sets of high-dimensional feature vectors. The graph construction unit is used to construct a fine-grained topology graph of the heating system. The topology graph contains m×a+n×b+m+n+c+d nodes. According to the attribute subordination relationship and equipment coupling relationship of the heating system, edge connections are established between each node, and a+b+c+d+2 sets of high-dimensional feature vectors are mapped to the nodes of the topology graph respectively. The feature fusion unit is used to aggregate node features of the topology graph through the GATv2 graph neural network and update the feature representation of each node. The prediction output unit is used to extract the updated features of m heat source nodes and n unit nodes, and output the predicted values of heat source temperature and unit temperature respectively through the prediction head.
10. A computer-readable storage medium, characterized in that, The computer program is stored in which the heating system prediction method based on a two-layer attention mechanism and graph neural network as described in any one of claims 1 to 8 can be loaded by a processor and executed.
Citation Information
Patent Citations
Multi-heat-source networking heat supply optimized operation method and system
CN120557702A
Heat supply system load prediction method and system
CN120868489A
Intelligent hydraulic equilibrium method, equipment, medium and product for branch lines of heat supply secondary network
CN121140066A