Gas leakage diffusion prediction method, system, electronic device and storage medium
By generating basic flow field and obstacle topological features, and combining graph neural networks and spatiotemporal graph attention networks, a spatiotemporally coupled diffusion representation is constructed. This solves the problems of high complexity and prediction bias in the three-dimensional prediction of gas leakage diffusion in existing technologies, and achieves high-precision real-time prediction and dynamic display.
Patent Information
- Application Number
- CN202611117107.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-27
- Publication Date
- 2026-11-20
AI Technical Summary
In high-risk industrial fields such as petroleum and chemical industry, the existing technology for three-dimensional prediction of gas leakage and diffusion has high computational complexity and high resource consumption, which makes it difficult to meet the needs of real-time early warning and rapid simulation in accident emergency response. Moreover, the existing deep learning models lack the ability to model the cross-height transport relationship in three-dimensional space, resulting in significant prediction bias.
By generating basic flow field and obstacle topological features, combined with environmental parameters, and utilizing graph neural networks and spatiotemporal graph attention networks, a spatiotemporally coupled diffusion characterization is constructed to extract the spatial distribution features and temporal variation patterns of gas diffusion, and output gas concentration prediction results.
It improves the accuracy of gas leak diffusion prediction, reduces real-time prediction bias, and can display the dynamic evolution of dangerous areas at different elevations in real time, providing more accurate structured data to support emergency decision-making.
Smart Images

Figure CN123138752A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of gas monitoring technology, and in particular to a method, system, electronic device and storage medium for predicting gas leakage and diffusion. Background Technology
[0002] In high-risk industrial sectors such as petroleum and chemical industries, accidents such as gas leaks, fires, and explosions occur frequently. Due to the complex on-site environment and the concentration of major hazard sources, the consequences of these accidents are often severe and have a wide-ranging impact. Therefore, achieving accurate and rapid prediction of toxic and hazardous gas leaks and their diffusion trends within petrochemical industrial parks is of great significance for emergency response and risk control. Computational Fluid Dynamics (CFD) simulation methods, widely used both domestically and internationally, can achieve high-precision three-dimensional numerical simulations of gas diffusion processes. However, CFD methods have high computational complexity and consume significant resources; a single simulation often takes more than one hour, making it difficult to meet the urgent needs for real-time early warning and rapid simulation in emergency situations.
[0003] In recent years, various simplified models and deep learning models have been applied to spatiotemporal prediction tasks of gas diffusion to improve computational efficiency. However, most existing deep learning models are limited to two-dimensional planar prediction and lack the ability to model the three-dimensional transport relationships across heights. Since the obstruction, guidance, and turbulence effects of buildings and complex terrain on gas diffusion are inherently three-dimensional, ignoring the dynamic processes in the vertical dimension will lead to significant deviations in the model's predictions in densely populated park environments, making it difficult to meet the accuracy requirements of real-time emergency decision-making. Summary of the Invention
[0004] In view of this, embodiments of this application provide a method, system, electronic device, and storage medium for predicting gas leakage diffusion, which facilitates reducing the real-time prediction deviation of gas leakage diffusion.
[0005] In a first aspect, embodiments of this application provide a method for predicting gas leakage diffusion, comprising: generating a basic flow field based on environmental parameters of a target area; and obtaining obstacle topological features based on the spatial topological relationship of the building layout in the target area; wherein the basic flow field indicates the basic velocity and direction distribution of dynamic airflow in the target area; the obstacle topological features characterize the influence weight of static buildings in the target area on the gas diffusion path and the spatial obstacle correlation; fusing the physical features of the basic flow field, the obstacle topological features, and the environmental parameters to obtain a physical and data hybrid characterization; extracting the spatial distribution features of gas diffusion on at least one height plane in the target area based on the physical and data hybrid characterization, and obtaining the variation law of the spatial distribution features over time and the transport relationship between different height planes to obtain a spatiotemporally coupled diffusion characterization; and outputting a prediction result based on the spatiotemporally coupled diffusion characterization, wherein the prediction result includes gas concentration values at at least one time discrete point and a geographic coordinate point.
[0006] According to a specific implementation of this application, before generating a basic flow field based on environmental parameters of the target area and obtaining obstacle topological features based on the spatial topological relationship of the building layout in the target area, the method includes: constructing a multi-condition dataset of the target area, wherein the multi-condition dataset includes at least one combination of environmental parameters and spatiotemporal distribution data of gas concentration at different height levels corresponding to the environmental parameters; and digitally modeling the building layout of the target area to obtain the spatial topological relationship of the building layout.
[0007] According to a specific implementation of this application, generating a basic flow field based on environmental parameters of the target area includes: inputting the environmental parameters into a differentiable physics simulator, and calculating the basic flow field reflecting the velocity and pressure distribution data of the average flow field characteristics of the target area by numerically solving the fluid dynamics equations.
[0008] According to a specific implementation of this application, obtaining obstacle topological features based on the spatial topological relationship of the building layout in the target area includes: constructing the spatial topological relationship of the building layout into graph structure data; performing feature transformation and information transmission on the graph structure data through a graph neural network to obtain the spatial interaction relationship between buildings in the target area, quantifying the diffusion influence weight between any two buildings, and generating the obstacle topological features.
[0009] According to a specific implementation of an embodiment of this application, fusing the physical features of the basic flow field, the topological features of the obstacle, and environmental parameters to obtain a hybrid physical and data representation includes: splicing the basic flow field, the topological features of the obstacle, and environmental parameters, and performing feature fusion on the splicing result through a gated convolutional layer to generate the hybrid physical and data representation.
[0010] According to a specific implementation of this application, the step of extracting spatial distribution features of gas diffusion on at least one elevation plane based on the physical and data hybrid representation, and obtaining the variation law of the spatial distribution features with discrete points over time and the transport relationship between different elevation planes to obtain a spatiotemporally coupled diffusion representation, includes: using a hierarchical convolutional network to perform feature extraction and coordinate encoding on the feature data corresponding to at least one elevation plane in the physical and data hybrid representation to obtain the spatial distribution features of each elevation plane; and constructing a spatiotemporal graph structure based on nodes and edges based on the spatial distribution features of each elevation plane, wherein the initial feature of the node is the spatial distribution feature, and the node represents different elevation planes. The diffusion state at a specific spatial location, where the edges represent the continuous temporal relationship of the same node at different discrete points, and the spatial association between nodes at different heights at the same discrete point; the initial features of the nodes are updated through a spatiotemporal graph attention network to output spatiotemporal fusion features, and influence weights between nodes at different heights are generated through the spatiotemporal graph attention network; wherein, the spatiotemporal fusion features are features characterizing the evolution of the node state at discrete points in time, and the association features characterizing the transport relationship of the node state across different heights; the influence weight values are used to quantify the intensity of gas transport across heights; through a gated fusion mechanism, the spatiotemporal fusion features are fused based on the influence weights to obtain the spatiotemporally coupled diffusion representation.
[0011] According to a specific implementation of an embodiment of this application, the step of outputting a prediction result based on the diffusion characterization of the spatiotemporal coupling includes: inputting the diffusion characterization of the spatiotemporal coupling into the time prediction branch and the spatial prediction branch optimized by the physical constraint loss function for calculation, and fusing the calculation results of the time prediction branch and the spatial prediction branch to output a prediction result.
[0012] Secondly, embodiments of this application also provide a gas leakage diffusion prediction system, comprising: a generation unit, configured to generate a basic flow field based on environmental parameters of a target area; and to obtain obstacle topological features based on the spatial topological relationship of the building layout in the target area; wherein the basic flow field indicates the basic velocity and direction distribution of dynamic airflow in the target area; the obstacle topological features characterize the influence weight of static buildings in the target area on the gas diffusion path and the spatial obstacle correlation; a fusion unit, configured to fuse the physical features of the basic flow field, the obstacle topological features, and the environmental parameters to obtain a physical and data hybrid characterization; a diffusion characterization unit, configured to extract the spatial distribution features of gas diffusion on at least one height plane in the target area based on the physical and data hybrid characterization, and obtain the variation law of the spatial distribution features over time and the transport relationship between different height planes to obtain a spatiotemporally coupled diffusion characterization; and a prediction unit, configured to output a prediction result based on the spatiotemporally coupled diffusion characterization, wherein the prediction result includes gas concentration values at at least one time discrete point and a geographic coordinate point.
[0013] According to a specific implementation of an embodiment of this application, the system further includes: a construction unit for constructing a multi-condition dataset of the target area, the multi-condition dataset including at least one combination of environmental parameters and spatiotemporal distribution data of gas concentration at different height levels corresponding to the environmental parameters; and a digital modeling unit for digitally modeling the building layout of the target area to obtain the spatial topological relationship of the building layout.
[0014] According to a specific implementation of an embodiment of this application, the generation unit is specifically used to: input the environmental parameters into a differentiable physics simulator, and calculate the basic flow field reflecting the velocity and pressure distribution data of the average flow field characteristics of the target area by numerically solving the fluid dynamics equations.
[0015] According to a specific implementation of an embodiment of this application, the generation unit includes: a first construction module, used to construct the spatial topological relationship of the building layout into graph structure data; and a generation module, used to perform feature transformation and information transmission on the graph structure data through a graph neural network to obtain the spatial interaction relationship between buildings in the target area, quantify the diffusion influence weight between any two buildings, and generate the obstacle topological features.
[0016] According to a specific implementation of an embodiment of this application, the fusion unit is specifically used to: splice the basic flow field, the obstacle topology features and environmental parameters, and perform feature fusion on the splicing result through a gated convolutional layer to generate the physical and data hybrid representation.
[0017] According to a specific implementation of an embodiment of this application, the diffusion characterization unit includes: an extraction and encoding module, used to extract features and encode coordinates of feature data corresponding to at least one height plane in the physical and data hybrid characterization through a hierarchical convolutional network to obtain the spatial distribution features of each height plane; and a second construction module, used to construct a spatiotemporal graph structure based on nodes and edges based on the spatial distribution features of each height plane, wherein the initial feature of the node is the spatial distribution feature, the node represents the diffusion state at a specific spatial location on different height planes, and the edge represents the temporal continuity relationship of the same node at different discrete time points. The system defines the spatial relationships between nodes at different altitudes at the same discrete point in time. A spatiotemporal graph attention network module is used to update the initial features of the nodes through the spatiotemporal graph attention network, output spatiotemporal fusion features, and generate influence weights between nodes at different altitudes through the spatiotemporal graph attention network. The spatiotemporal fusion features characterize the evolution of node states at discrete points in time, and the influence weights characterize the transport relationships between node states across different altitudes. The influence weights are used to quantify the intensity of gas transport across altitudes. A fusion module is used to fuse the spatiotemporal fusion features based on the influence weights through a gated fusion mechanism to obtain the diffusion characterization of the spatiotemporal coupling.
[0018] According to a specific implementation of an embodiment of this application, the prediction unit is specifically used to: input the spatiotemporal coupling diffusion representation into the time prediction branch and the spatial prediction branch optimized by the physical constraint loss function for calculation, and fuse the calculation results of the time prediction branch and the spatial prediction branch to output the prediction result.
[0019] Thirdly, embodiments of this application also provide an electronic device, the electronic device comprising: a housing, a processor, a memory, a circuit board, and a power supply circuit, wherein the circuit board is disposed within the space enclosed by the housing, and the processor and the memory are disposed on the circuit board; the power supply circuit is used to supply power to various circuits or devices of the above-mentioned electronic device; the memory is used to store executable program code; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, for executing the gas leakage diffusion prediction method provided in any embodiment of this application.
[0020] Fourthly, embodiments of this application also provide a computer-readable storage medium storing one or more programs that can be executed by one or more processors to implement the gas leakage diffusion prediction method provided in any embodiment of this application.
[0021] The gas leakage diffusion prediction method, system, electronic device, and storage medium provided in this application generate a basic flow field based on environmental parameters of the target area; and obtain obstacle topological features based on the spatial topological relationship of the building layout in the target area. Unlike traditional models that learn from scratch, this application directly injects physical laws and spatial structures as prior knowledge, more accurately capturing the diffusion mechanism and thus improving prediction accuracy. Based on the physical and data hybrid characterization, the spatial distribution features of gas diffusion on at least one height plane in the target area are extracted, and the variation law of the spatial distribution features over time and the transport relationship between different height planes are obtained to obtain a spatiotemporally coupled diffusion characterization. In this way, by analyzing the spatial, temporal, and vertical transport laws step by step, the limitations of traditional two-dimensional fitting are broken through, and the dynamic diffusion process of gas in three-dimensional space is obtained, which facilitates the reduction of real-time prediction deviation of gas leakage diffusion. Based on the spatiotemporally coupled diffusion characterization, the prediction result is output, wherein the prediction result includes gas concentration values at at least one time discrete point and geographic coordinate point, which can display the dynamic evolution of the danger zone at different height planes in real time and obtain more accurate structured data. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of this application 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 some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 A flowchart of a gas leakage diffusion prediction method provided for embodiments of this application; Figure 2 A schematic diagram of a gas leakage diffusion prediction system provided for an embodiment of this application; Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0024] The embodiments of this application will now be described in detail with reference to the accompanying drawings.
[0025] It should be understood that the described embodiments are merely some, not all, of the embodiments in this application. All other embodiments obtained by those skilled in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.
[0026] To enable those skilled in the art to better understand the technical concept, implementation scheme and beneficial effects of the embodiments of this application, detailed descriptions are provided below through specific embodiments.
[0027] In a first aspect, embodiments of this application provide a method for predicting gas leakage diffusion, which facilitates reducing the prediction bias of real-time gas leakage diffusion.
[0028] like Figure 1 As shown, embodiments of this application provide a method for predicting gas leakage diffusion, including: S11. Generate a basic flow field based on the environmental parameters of the target area; and obtain obstacle topological features based on the spatial topological relationship of the building layout in the target area; wherein, the basic flow field indicates the basic velocity and direction distribution of dynamic airflow in the target area; and the obstacle topological features characterize the influence weight of static buildings in the target area on the gas diffusion path and the spatial obstacle correlation relationship. Accurately simulating the interaction between airflow and building clusters is a core challenge in predicting gas leakage and diffusion. Therefore, this application aims to construct a hybrid input representation that integrates dynamic physical drivers and static spatial constraints. By explicitly encoding key physical laws and spatial structures into the model input, a solid physical foundation is laid for subsequent predictions, thereby significantly improving the model's starting accuracy and physical plausibility in complex urban environments.
[0029] Specifically, by inputting real-time environmental parameters of the target area, such as wind speed, wind direction, and atmospheric stability, a simplified fluid calculation module is driven to generate a basic flow field that reflects the macroscopic motion of air in the target area. In some cases, the basic flow field is defined in the form of grid data, defining the basic velocity vector and direction of air at each geographic coordinate point, forming the main dynamic basis of gas diffusion. Simultaneously, based on the three-dimensional information of the building layout in the target area, structured modeling techniques such as graph neural networks are used to extract obstacle topological features. In some cases, these features not only quantify the obstruction strength or influence weight of individual buildings on the diffusion path but also accurately depict the complex spatial structural relationships such as channels and corners formed between building groups, thus fully characterizing the blocking, guiding, and bypass effects of the static environment on gas diffusion.
[0030] By combining the dynamic driving force provided by the basic flow field with the static resistance information provided by the topological features, a physically clear and structurally well-defined input condition is formed, laying a scientific foundation for subsequent accurate predictions.
[0031] S12. The physical characteristics of the basic flow field, the topological characteristics of the obstacle, and the environmental parameters are fused to obtain a hybrid physical and data representation; After obtaining the basic flow field and obstacle topology features, a fusion step is implemented to construct a physical and data hybrid representation. In some cases, the grid data of the basic flow field, obstacle topology features, and original environmental parameters are aligned and stitched together to obtain a physical and data hybrid representation. The grid data is usually a velocity vector, i.e., velocity components in the X / Y / Z directions. The obstacle topology features are usually the embedding vectors of graph nodes and edges. The original environmental parameters can be wind speed, wind direction, temperature, etc. To achieve effective fusion of multimodal data, in one specific embodiment, the basic flow field is first subjected to deep feature extraction via a lightweight convolutional network. Simultaneously, obstacle topological features are enhanced and encoded through a graph attention network to focus on key building nodes that influence the diffusion path. Subsequently, through cross-modal attention mechanisms or tensor splicing operations, the processed physical driving features, spatial structure features, and environmental conditions are integrated to form a unified high-dimensional tensor. The high-dimensional tensor is a hybrid physical and data representation, which encodes both the regularity knowledge from the physical model and retains the detailed information from the original data and topological structure, providing a complete and structured input for the subsequent spatiotemporal prediction network.
[0032] S13. Based on the physical and data hybrid characterization, extract the spatial distribution characteristics of gas diffusion on at least one height plane in the target area, and obtain the variation law of the spatial distribution characteristics over time and the transport relationship between different height planes to obtain a spatiotemporally coupled diffusion characterization. After obtaining the physical and data hybrid representation, the spatiotemporal feature extraction and modeling process is initiated. Specifically, a hierarchical coordinate-enhanced convolutional network is first used to process the hybrid representation data corresponding to different height planes in parallel. In some cases, the convolutional network works independently for each two-dimensional plane, using convolutional layers to capture the constraints and influences of local spatial structures such as building edges and street canyons on gas concentration. Through the introduction of coordinate encoding, the model can clearly perceive the absolute geographical location and relative distance of each grid point, thereby extracting finely distributed features with spatial awareness.
[0033] Subsequently, these spatial features from different altitudes and times are organized into a unified spatiotemporal graph structure. Each graph node represents the state of a plane at a specific altitude at a given time. Nodes are connected by temporal and spatial edges; temporal edges represent adjacent times on the same plane, while spatial edges represent different altitude planes at the same time. This spatiotemporal graph structure is then fed into a Spatio-Temporal Graph Attention Network (ST-GAT) for joint inference. Specifically, the ST-GAT dynamically calculates the influence weights between nodes on different altitude planes using a graph attention mechanism, thus explicitly modeling gas transport and mixing in the vertical direction. Simultaneously, the Long Short-Term Memory (LSTM) units embedded within the ST-GAT circulate along the temporal edges, specifically designed to capture and memorize the temporal evolution of the diffusion process. Finally, the ST-GAT outputs a spatiotemporally coupled diffusion representation that deeply integrates spatial details, temporal dynamics, and vertical correlations, laying the foundation for high-precision predictions.
[0034] S14. Based on the spatiotemporal coupling diffusion characterization, output the prediction result, wherein the prediction result includes at least one time discrete point and gas concentration value at a geographic coordinate point.
[0035] After obtaining the spatiotemporally coupled diffusion characterization, the model enters the final concentration field prediction generation stage. In some examples, the spatiotemporally coupled diffusion characterization is simultaneously fed into a dual-branch decoder architecture. The outputs of the two branches are integrated through an adaptive fusion module to output a set of structured data that accurately provides the gas concentration value at each geographic coordinate point within the target area at a specified future time point, thereby providing key information that can be directly quantified and visualized for emergency decision-making.
[0036] The gas leakage diffusion prediction method provided in this application generates a basic flow field based on environmental parameters of the target area; and obtains obstacle topological features based on the spatial topological relationship of the building layout in the target area. Unlike traditional models that learn from scratch, this application directly injects physical laws and spatial structures as prior knowledge, more accurately capturing the diffusion mechanism and thus improving prediction accuracy. Based on the physical and data hybrid representation, the spatial distribution features of gas diffusion on at least one height plane in the target area are extracted, and the variation law of the spatial distribution features over time and the transport relationship between different height planes are obtained to obtain a spatiotemporally coupled diffusion representation. In this way, by analyzing the spatial, temporal, and vertical transport laws step by step, the limitations of traditional two-dimensional fitting are broken through, and the dynamic diffusion process of gas in three-dimensional space is obtained, which facilitates the reduction of real-time prediction deviation of gas leakage diffusion. Based on the spatiotemporally coupled diffusion representation, the prediction result is output, wherein the prediction result includes gas concentration values at at least one time discrete point and geographic coordinate point, which can display the dynamic evolution of the danger zone at different height planes in real time and obtain more accurate structured data.
[0037] In some embodiments, before generating a basic flow field based on environmental parameters of the target area and obtaining obstacle topological features based on the spatial topological relationship of the building layout in the target area, the method includes: constructing a multi-condition dataset of the target area, the multi-condition dataset including at least one combination of environmental parameters and spatiotemporal distribution data of gas concentration at different height levels corresponding to the environmental parameters; and digitally modeling the building layout of the target area to obtain the spatial topological relationship of the building layout.
[0038] To achieve hybrid prediction based on physics and data, it is necessary to first carry out systematic data construction and environmental digitization. In some cases, this can be achieved by building a CFD simulation dataset covering multiple operating conditions and completing topological modeling of building layouts.
[0039] Specifically, in terms of dataset construction, a three-dimensional geometric model including terrain, buildings, and equipment is first established based on actual survey data of the target petrochemical park. Then, using parametric scanning, combined operating conditions with different environmental parameters such as wind speed, wind direction, leak source location, and leak rate are set in CFD software for batch numerical simulation. The simulation results for each operating condition will output gas concentration distribution data at multiple preset height planes under a specific time series, ultimately forming a complete mapping relationship library containing environmental parameters and a three-dimensional spatiotemporal concentration field.
[0040] In terms of environmental digitization, the layout of park buildings can be converted into a topology that can be processed by graph neural networks. In some cases, the building outline information is first extracted from computer-aided design (CAD) or geographic information system (GIS) and discretized into a set of feature points. Then, based on the principle of spatial proximity, the connection relationship between building units is established by Delaunay triangulation or k-nearest neighbor algorithm, and a topology graph with buildings as nodes and spatial relationships as edges is constructed. Finally, the absolute position information of each building node is preserved by coordinate encoding, forming a digital site model that combines geometric features and topological relationships.
[0041] The aforementioned multi-condition dataset provides samples of the physical laws governing gas diffusion, while the topological building model defines the spatial constraints. Together, they lay a solid foundation for subsequent physical feature extraction and data-driven prediction.
[0042] In some embodiments, generating a basic flow field based on environmental parameters of the target area includes: inputting the environmental parameters into a differentiable physics simulator, and calculating the basic flow field reflecting the velocity and pressure distribution data of the average flow field characteristics of the target area by numerically solving the fluid dynamics equations.
[0043] After preparing the data for environmental parameters and building topology, the next crucial step is to embed physical laws, namely, to generate the basic flow field.
[0044] Specifically, environmental parameters such as wind speed, wind direction, and ambient temperature are used as boundary conditions and input into a pre-designed differentiable physical simulator. In some cases, the simulator uses a lightweight numerical solver based on the finite volume method to discretize and solve the simplified Navier-Stokes equations. This process does not involve a time-consuming full-scale CFD simulation, but rather uses differentiable operators to quickly calculate a low-resolution velocity and pressure distribution that reflects the macroscopic average flow field characteristics of the target area under given environmental conditions.
[0045] The basic flow field data generated above can serve as a physical prior characterizing the dominant atmospheric motion direction. It will be fused with the subsequently extracted obstacle topological features to provide a driving signal that combines physical regularity and environmental adaptability for gas diffusion prediction.
[0046] In some embodiments, obtaining obstacle topological features based on the spatial topological relationship of the building layout in the target area includes: constructing the spatial topological relationship of the building layout into graph structure data; performing feature transformation and information transmission on the graph structure data through a graph neural network to obtain the spatial interaction relationship between buildings in the target area, quantifying the diffusion influence weight between any two buildings, and generating the obstacle topological features.
[0047] While obtaining the basic flow field as the physical driving signal, it is necessary to extract the spatial constraint features formed by the building layout in parallel.
[0048] Specifically, the building outlines and location information obtained by digitally modeling the building layout of the target area are constructed into a graph structure data with building units as nodes and spatial proximity relationships between buildings as edges. In some cases, the graph structure data is input into a graph attention network. Through multi-level information transmission and feature transformation mechanisms, the graph attention network can adaptively learn and quantify the spatial interaction intensity between any two building nodes in the graph, and finally generate an obstacle topology feature matrix. The obstacle topology feature matrix accurately represents the complex influence weights on the gas diffusion path caused by the relative position and layout structure of the building group, providing key spatial structure prior knowledge for subsequent feature fusion with the physical flow field.
[0049] In some embodiments, fusing the physical features of the basic flow field, the topological features of the obstacle, and environmental parameters to obtain a hybrid physical and data representation includes: splicing the basic flow field, the topological features of the obstacle, and environmental parameters, and performing feature fusion on the splicing result through a gated convolutional layer to generate the hybrid physical and data representation.
[0050] After obtaining the physical characteristics of the basic flow field and the topological characteristics of the obstacles, the multi-source information integration process is initiated. In some examples, the velocity or pressure distribution data of the basic flow field, the obstacle topological feature matrix, and the original environmental parameter vector are first dimensionally aligned and concatenated to form a fusion tensor containing multi-source information. This fusion tensor is then input into a gated convolutional layer. Through the learnable gating mechanism of the gated convolutional layer, the contribution weights of physical and topological features are adaptively adjusted, achieving deep coupling of flow field laws, spatial constraints, and operating conditions. The resulting hybrid physical and data representation retains the specific boundary conditions of the environmental parameters while integrating the regularity of physical simulation and the constraints of the topological structure, providing complete input conditions for subsequent spatiotemporal predictions.
[0051] In some embodiments, the step of extracting spatial distribution features of gas diffusion on at least one elevation plane based on the physical and data hybrid representation, and obtaining the variation law of the spatial distribution features with discrete points over time and the transport relationship between different elevation planes to obtain a spatiotemporally coupled diffusion representation includes: performing feature extraction and coordinate encoding on the feature data corresponding to at least one elevation plane in the physical and data hybrid representation through a hierarchical convolutional network to obtain the spatial distribution features of each elevation plane; and constructing a spatiotemporal graph structure based on nodes and edges based on the spatial distribution features of each elevation plane, wherein the initial feature of the node is the spatial distribution feature, and the node represents a specific spatial location on different elevation planes. The diffusion state is defined as follows: the edges represent the continuous temporal relationship of the same node at different discrete time points, and the spatial correlation between nodes at different heights at the same discrete time point; the initial features of the nodes are updated through a spatiotemporal graph attention network to output spatiotemporal fusion features, and influence weights between nodes at different heights are generated through the spatiotemporal graph attention network; wherein, the spatiotemporal fusion features are features characterizing the evolution of the node state at discrete time points, and the correlation features characterizing the transport relationship of the node state across different heights; the influence weight values are used to quantify the intensity of gas transport across heights; through a gated fusion mechanism, the spatiotemporal fusion features are fused based on the influence weights to obtain the spatiotemporal coupled diffusion representation.
[0052] This application uses a hierarchical deep learning architecture to process the hybrid physical and data representations to extract the spatiotemporal features of gas diffusion.
[0053] Specifically, in the process from environmental feature input to spatiotemporal diffusion representation generation, firstly, spatial feature extraction and location encoding are performed. The receiving end integrates a physical and data hybrid representation of the basic flow field, obstacle topology, and environmental parameters. A hierarchical convolutional network is used to process the features of each height plane independently and in parallel. Convolutional operations capture local diffusion patterns within each plane, and coordinate encoding technology is introduced to inject geographic information into each spatial location to overcome the translation invariance of the convolutional network. The final output is a spatial distribution feature rich in location information that can accurately describe the spatial distribution pattern of gas at each height plane. Next, a spatiotemporal graph structure is constructed, defining the above spatial distribution features as the initial features of the graph nodes. The state evolution relationship is represented by establishing time edges connecting different time nodes of the same spatial location, and the spatiotemporal coordinates are connected to represent the state evolution relationship. The spatial vertical edges of nodes at different heights are used to characterize cross-layer transport relationships, thus constructing a structured spatiotemporal graph. Then, spatiotemporal feature fusion and weights are generated. In some cases, the spatiotemporal graph attention network enables nodes to exchange information with their spatiotemporal neighbors along defined edges through message passing and aggregation mechanisms, simultaneously achieving two functions: first, outputting spatiotemporal fusion features that integrate temporal evolution trends and cross-height correlations; second, dynamically generating interpretable influence weights that directly quantify the intensity of cross-layer transport through an attention scoring function. Finally, gated fusion and final representation generation are performed. Using the generated influence weights as guiding signals, the spatiotemporal fusion features are adaptively weighted and integrated through a gated fusion mechanism, ultimately generating a spatiotemporally coupled diffusion representation with organically unified spatial distribution, temporal dynamics, and vertical structure, providing comprehensive input for subsequent gas leakage diffusion prediction.
[0054] In some embodiments, the step of outputting a prediction result based on the spatiotemporal coupling diffusion characterization includes: inputting the spatiotemporal coupling diffusion characterization into the time prediction branch and the spatial prediction branch optimized by the physical constraint loss function for calculation, and fusing the calculation results of the time prediction branch and the spatial prediction branch to output a prediction result.
[0055] After obtaining the spatiotemporally coupled diffusion characterization, a dual-branch decoder is used to generate the final gas leakage diffusion prediction. Specifically, the spatiotemporally coupled diffusion characterization is first fed into two branch decoders: a temporal prediction branch and a spatial prediction branch. The temporal prediction branch is typically composed of a temporal convolutional network (TCN) coupled with a long short-term memory network, focusing on capturing and predicting the macroscopic evolution trend and long-term dependence of concentration over time. The spatial prediction branch utilizes a graph diffusion network or a pixel-level deconvolutional network to decode and upsample high-level features to reconstruct high-resolution two-dimensional spatial concentration distribution details. The outputs of the two branches, namely the temporal evolution sequence and the spatial distribution map, are fed into an adaptive weighted fusion module for integration, outputting a set of accurate structured data that clearly indicates the gas concentration value at each geographic coordinate point within the target area at a specific discrete time point in the future. In some cases, the entire dual-branch structure is co-optimized by a differentiable physical constraint loss function during the training phase. The loss function directly transforms core physical laws, such as the mass conservation equation, into model training objectives, and forces the network to output physically reasonable predictions through gradient backpropagation.
[0056] Secondly, embodiments of this application provide a gas leakage diffusion prediction system, which facilitates reducing real-time prediction deviations in gas leakage diffusion.
[0057] like Figure 2 As shown, embodiments of this application also provide a gas leakage diffusion prediction system, including a generation unit 31, a fusion unit 32, a diffusion characterization unit 33, and a prediction unit 34.
[0058] The generation unit 31 is used to generate a basic flow field based on the environmental parameters of the target area; and to obtain obstacle topological features based on the spatial topological relationship of the building layout in the target area; wherein the basic flow field indicates the basic velocity and direction distribution of dynamic airflow in the target area; and the obstacle topological features characterize the influence weight of static buildings in the target area on the gas diffusion path and the spatial obstacle correlation relationship. The fusion unit 32 is used to fuse the physical characteristics of the basic flow field, the topological characteristics of the obstacle, and environmental parameters to obtain a hybrid physical and data representation. The diffusion characterization unit 33 is used to extract the spatial distribution characteristics of gas diffusion on at least one height plane in the target area according to the physical and data hybrid characterization, and to obtain the variation law of the spatial distribution characteristics over time and the transport relationship between different height planes, so as to obtain a spatiotemporally coupled diffusion characterization. The prediction unit 34 is used to output a prediction result based on the spatiotemporal coupling diffusion characterization, wherein the prediction result includes at least one time discrete point and a gas concentration value at a geographic coordinate point.
[0059] The gas leakage diffusion prediction system provided in this application generates a basic flow field based on environmental parameters of the target area and obtains obstacle topological features based on the spatial topological relationship of the building layout in the target area. Unlike traditional models that learn from scratch, this application directly injects physical laws and spatial structures as prior knowledge, more accurately capturing the diffusion mechanism and thus improving prediction accuracy. Based on the physical and data hybrid representation, the spatial distribution features of gas diffusion on at least one height plane in the target area are extracted, and the variation law of the spatial distribution features over time and the transport relationship between different height planes are obtained to obtain a spatiotemporally coupled diffusion representation. In this way, by analyzing the spatial, temporal, and vertical transport laws step by step, the limitations of traditional two-dimensional fitting are broken through, and the dynamic diffusion process of gas in three-dimensional space is obtained, which facilitates the reduction of real-time prediction deviation of gas leakage diffusion. Based on the spatiotemporally coupled diffusion representation, the prediction result is output, wherein the prediction result includes gas concentration values at at least one time discrete point and geographic coordinate point, which can display the dynamic evolution of dangerous areas at different height planes in real time and obtain more accurate structured data.
[0060] In some embodiments, the system further includes: a construction unit for constructing a multi-condition dataset of a target area, the multi-condition dataset including at least one combination of environmental parameters and spatiotemporal distribution data of gas concentration at different height levels corresponding to the environmental parameters; and a digital modeling unit for digitally modeling the building layout of the target area to obtain the spatial topological relationship of the building layout.
[0061] In some embodiments, the generation unit is specifically used to: input the environmental parameters into a differentiable physics simulator, and calculate the basic flow field reflecting the velocity and pressure distribution data of the average flow field characteristics of the target area by numerically solving the fluid dynamics equations.
[0062] In some embodiments, the generation unit includes: a first construction module, configured to construct the spatial topological relationship of the building layout into graph structure data; and a generation module, configured to perform feature transformation and information transmission on the graph structure data through a graph neural network to obtain the spatial interaction relationship between buildings in the target area, quantify the diffusion influence weight between any two buildings, and generate the obstacle topological features.
[0063] In some embodiments, the fusion unit is specifically used to: splice the basic flow field, the obstacle topology features and environmental parameters, and perform feature fusion on the splicing result through a gated convolutional layer to generate the physical and data hybrid representation.
[0064] In some embodiments, the diffusion characterization unit includes: an extraction and encoding module, configured to extract features and encode coordinates of feature data corresponding to at least one height plane in the physical and data hybrid characterization using a hierarchical convolutional network to obtain spatial distribution features of each height plane; and a second construction module, configured to construct a spatiotemporal graph structure based on nodes and edges according to the spatial distribution features of each height plane, wherein the initial features of the nodes are the spatial distribution features, the nodes represent the diffusion state at a specific spatial location on different height planes, the edges represent the temporal continuity of the same node at different discrete time points, and the edges represent the same time... The spatial correlation between nodes at different heights of discrete points; a spatiotemporal graph attention network module, used to update the initial features of the nodes through the spatiotemporal graph attention network, output spatiotemporal fusion features, and generate influence weights between nodes at different heights through the spatiotemporal graph attention network; wherein, the spatiotemporal fusion features are features characterizing the evolution of the node state at discrete time points, and, and, are correlation features characterizing the transport relationship of the node state across different heights; the influence weight values are used to quantify the intensity of gas transport across heights; a fusion module, used to fuse the spatiotemporal fusion features based on the influence weights through a gated fusion mechanism to obtain the diffusion characterization of the spatiotemporal coupling.
[0065] In some embodiments, the prediction unit is specifically used to: input the spatiotemporal coupling diffusion representation into the time prediction branch and the spatial prediction branch optimized by the physical constraint loss function for calculation, and fuse the calculation results of the time prediction branch and the spatial prediction branch to output the prediction result.
[0066] Thirdly, embodiments of this application also provide an electronic device that facilitates reducing real-time prediction bias in gas leak diffusion.
[0067] like Figure 3 As shown, the electronic device provided in the embodiments of this application may include: a housing 51, a processor 52, a memory 53, a circuit board 54, and a power supply circuit 55, wherein the circuit board 54 is disposed inside the space enclosed by the housing 51, and the processor 52 and the memory 53 are disposed on the circuit board 54; the power supply circuit 55 is used to supply power to various circuits or devices of the above-mentioned electronic device; the memory 53 is used to store executable program code; the processor 52 runs a program corresponding to the executable program code by reading the executable program code stored in the memory 53, for executing the gas leakage diffusion prediction method provided in any of the foregoing embodiments.
[0068] For details on the specific execution process of the above steps by the processor 52 and the steps further executed by the processor 52 by running executable program code, please refer to the description of the foregoing embodiments, which will not be repeated here.
[0069] Fourthly, embodiments of this application also provide a computer-readable storage medium storing one or more programs, which can be executed by one or more processors to implement any of the gas leakage diffusion prediction methods provided in the foregoing embodiments, thus achieving the corresponding technical effects. This has been described in detail above and will not be repeated here.
[0070] The advantage of this application lies in its deep integration of physical constraints and data-driven approaches. By introducing a Navier-Stokes solver to generate a basic flow field as a physical prior, and combining graph attention networks and spatiotemporal graph networks to extract environmental and topological features, it effectively avoids the physical inconsistencies that may arise in pure data models. For the complex diffusion behavior of gases in three-dimensional space, the model innovatively adopts a cross-height diffusion modeling mechanism, using ST-GAT to explicitly capture transport relationships between planes at different heights, overcoming the limitations of traditional two-dimensional or single-height predictions. In terms of structural design, the model employs a multi-branch fusion strategy, with a time prediction branch capturing temporal evolution patterns and a spatial prediction branch reconstructing concentration distribution details, followed by adaptive fusion through a gating mechanism, significantly improving the expressive power of multi-dimensional diffusion features. Furthermore, this application supports dynamic optimization and real-time prediction, adjusting parameters based on test feedback to ensure the model's robustness and adaptability in changing environments. Ultimately, this application not only achieves high-precision concentration field prediction but also dynamically renders the results on 3D visualization platforms such as Tianditu, providing intuitive and scientific decision support for gas leak emergency response.
[0071] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0072] The various embodiments in this specification are described in a related manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.
[0073] In particular, the device embodiment is basically similar to the method embodiment, so the description is relatively simple. For relevant details, please refer to the description of the method embodiment.
[0074] For ease of description, the above apparatus is described by dividing it into various functional units / modules. Of course, in implementing this application, the functions of each unit / module can be implemented in one or more software and / or hardware.
[0075] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0076] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for predicting the diffusion of gas leaks, characterized in that, include: Generate a basic flow field based on the environmental parameters of the target area; Furthermore, based on the spatial topological relationship of the building layout in the target area, the topological features of obstacles are obtained; wherein, the basic flow field indicates the basic velocity and direction distribution of dynamic airflow in the target area; the topological features of obstacles characterize the influence weight of static buildings in the target area on the gas diffusion path and the spatial obstacle correlation relationship; The physical characteristics of the basic flow field, the topological characteristics of the obstacles, and the environmental parameters are fused to obtain a hybrid physical and data representation. Based on the physical and data hybrid characterization, the spatial distribution characteristics of gas diffusion on at least one height plane in the target area are extracted, and the variation law of the spatial distribution characteristics over time and the transport relationship between different height planes are obtained to obtain a spatiotemporally coupled diffusion characterization. Based on the spatiotemporal coupling diffusion characterization, a prediction result is output, wherein the prediction result includes at least one time discrete point and a gas concentration value at a geographic coordinate point.
2. The method for predicting gas leakage and diffusion according to claim 1, characterized in that, Before generating the basic flow field based on the environmental parameters of the target area, and obtaining the obstacle topological features based on the spatial topological relationship of the building layout in the target area, the process includes: A multi-condition dataset for the target region is constructed, comprising at least one combination of environmental parameters and spatiotemporal distribution data of gas concentrations at different altitude levels corresponding to the environmental parameters; and, Digital modeling is performed on the building layout of the target area to obtain the spatial topological relationship of the building layout.
3. The method for predicting gas leakage and diffusion according to claim 1, characterized in that, The step of generating a basic flow field based on environmental parameters of the target area includes: The environmental parameters are input into a differentiable physics simulator, and the basic flow field reflecting the velocity and pressure distribution data of the target area is calculated by numerically solving the fluid dynamics equations.
4. The method for predicting gas leakage and diffusion according to claim 1, characterized in that, The process of obtaining obstacle topological features based on the spatial topological relationships of the building layout in the target area includes: The spatial topological relationships of the building layout are constructed as graph structure data; By performing feature transformation and information transmission on the graph structure data through a graph neural network, the spatial interaction relationship between buildings in the target area is obtained, the diffusion influence weight between any two buildings is quantified, and the topological features of the obstacle are generated.
5. The method for predicting gas leakage and diffusion according to claim 1, characterized in that, The process of fusing the physical characteristics of the basic flow field, the topological characteristics of the obstacles, and environmental parameters to obtain a hybrid physical and data representation includes: The basic flow field, the topological features of the obstacles, and environmental parameters are spliced together, and the splicing results are fused using a gated convolutional layer to generate the physical and data hybrid representation.
6. The method for predicting gas leakage and diffusion according to claim 1, characterized in that, The step involves extracting spatial distribution features of gas diffusion on at least one elevation plane based on the physical and data hybrid characterization, and obtaining the variation law of the spatial distribution features with discrete points over time and the transport relationship between different elevation planes to obtain a spatiotemporally coupled diffusion characterization; including: By using a hierarchical convolutional network, feature extraction and coordinate encoding are performed on the feature data corresponding to at least one height plane in the physical and data hybrid representation to obtain the spatial distribution features of each height plane; Based on the spatial distribution characteristics of each height plane, a spatiotemporal graph structure based on nodes and edges is constructed. The initial characteristics of the nodes are the spatial distribution characteristics. The nodes represent the diffusion state of specific spatial locations on different height planes. The edges represent the temporal continuity of the same node at different discrete time points, as well as the spatial association between nodes at different heights at the same discrete time point. The initial features of the nodes are updated through a spatiotemporal graph attention network to output spatiotemporal fusion features, and influence weights between nodes at different altitudes are generated through the spatiotemporal graph attention network; wherein, the spatiotemporal fusion features are features characterizing the evolution of the node state at discrete points in time, and, and, are correlation features characterizing the transport relationship of the node state across different altitudes; the influence weight values are used to quantify the intensity of gas transport across altitudes; By using a gating fusion mechanism, the spatiotemporal fusion features are fused based on the influence weights to obtain the diffusion characterization of the spatiotemporal coupling.
7. The method for predicting gas leakage and diffusion according to claim 1, characterized in that, The step of outputting prediction results based on the diffusion characterization of the spatiotemporal coupling includes: The diffusion characterization of the spatiotemporal coupling is input into the time prediction branch and the spatial prediction branch optimized by the physical constraint loss function, respectively, and the calculation results of the time prediction branch and the spatial prediction branch are fused to output the prediction result.
8. A gas leakage diffusion prediction system, characterized in that, include: The generation unit is used to generate the basic flow field based on the environmental parameters of the target area; Furthermore, based on the spatial topological relationship of the building layout in the target area, the topological features of obstacles are obtained; wherein, the basic flow field indicates the basic velocity and direction distribution of dynamic airflow in the target area; the topological features of obstacles characterize the influence weight of static buildings in the target area on the gas diffusion path and the spatial obstacle correlation relationship; The fusion unit is used to fuse the physical characteristics of the basic flow field, the topological characteristics of the obstacle, and environmental parameters to obtain a hybrid physical and data representation. The diffusion characterization unit is used to extract the spatial distribution characteristics of gas diffusion on at least one height plane in the target area based on the physical and data hybrid characterization, and to obtain the variation law of the spatial distribution characteristics over time and the transport relationship between different height planes, so as to obtain a spatiotemporally coupled diffusion characterization. The prediction unit is used to output prediction results based on the spatiotemporal coupled diffusion characterization, wherein the prediction results include gas concentration values at at least one time discrete point and geographic coordinate point.
9. The gas leakage diffusion prediction system according to claim 8, characterized in that, The system also includes: A construction unit is used to construct a multi-condition dataset for a target area, wherein the multi-condition dataset includes at least one combination of environmental parameters and spatiotemporal distribution data of gas concentrations at different altitude levels corresponding to the environmental parameters; and, The digital modeling unit is used to digitally model the building layout of the target area in order to obtain the spatial topological relationship of the building layout.
10. The gas leakage diffusion prediction system according to claim 8, characterized in that, The generation unit is specifically used for: By inputting environmental parameters into a differentiable physics simulator, and numerically solving the fluid dynamics equations, the basic flow field reflecting the velocity and pressure distribution data of the average flow field characteristics of the target area is calculated.
