Petrochemical Park Gas Leakage Diffusion Prediction Method, System, Electronic Device and Storage Medium

By constructing a computational fluid dynamics model in the petrochemical park and extracting gas diffusion characteristics using deep learning technology, and constructing a prediction model of a variational autoencoder and deep neural network, the real-time and velocity problems of gas leakage diffusion prediction in the petrochemical park are solved, and efficient and accurate gas diffusion prediction is achieved.

CN119623358BActive Publication Date: 2025-06-24UNIV OF SCI & TECH BEIJING +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510158003.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-13
Publication Date
2025-06-24
Estimated Expiration
2045-02-13

AI Technical Summary

Technical Problem

The existing technology is difficult to achieve real-time rapid prediction of toxic gas leakage and its diffusion trend in petrochemical parks. The CFD model is computationally large and time-cost, while the LSTM method requires a large amount of labeled data for training, which is long.

Method used

The petrochemical park simulation model is constructed through Fluent's computational fluid dynamics technology to generate a gas diffusion image data set; the gas diffusion characteristic images are extracted using a deep convolutional neural network; a gas diffusion prediction model based on a variational autoencoder and a deep neural network is constructed and trained to generate real-time gas diffusion prediction results.

Benefits of technology

Real-time and rapid prediction of gas leakage diffusion in petrochemical parks is achieved, and the problems of large calculation volume and long training time of traditional CFD simulation and LSTM methods are overcome, and the speed and accuracy of prediction are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119623358B_ABST
    Figure CN119623358B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention discloses a method, system, electronic device and storage medium for predicting gas leakage and diffusion in a petrochemical park, which relates to the technical field of gas monitoring. It can realize real-time and rapid prediction of gas leakage and diffusion. The method includes: constructing a simulation model of the petrochemical park based on Fluent, and performing gas diffusion simulation calculations through computational fluid dynamics technology to generate a gas diffusion image dataset; extracting features from the gas diffusion data image dataset based on a deep convolutional neural network, and outputting a gas diffusion feature image; constructing a gas diffusion prediction model based on a variational autoencoder and a deep neural network, and training the gas diffusion prediction model based on the gas diffusion feature image and environmental variables; inputting the collected environmental variables into the trained gas diffusion prediction model to generate a gas diffusion prediction result under the current environmental variables. The present invention is applicable to gas leakage and diffusion prediction scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of gas monitoring, and particularly to a method, a system, an electronic device and a storage medium for predicting gas leakage and diffusion in a petrochemical park. Background Art

[0002] In the fields of oil and chemical safety, accidents such as toxic gas leakage, fire, and explosion occur frequently. Due to the large number of major hazards and complex building layouts at the accident site, the consequences of accidents are of great harm and wide influence. Therefore, accurately and quickly predicting the leakage and diffusion trend of toxic gases in a petrochemical park is crucial for timely response and reducing accident risks.

[0003] Currently, the research methods for the law of toxic gas leakage and diffusion mainly include: based on the computational fluid dynamics (CFD) model, which has been widely used to accurately simulate the diffusion behavior of various gases in different spatial ranges; based on deep learning, such as methods like Long Short Term Memory (LSTM) and Generative Adversarial Networks (GAN).

[0004] However, the CFD-based modeling method has a large amount of calculation and high time cost, which makes it inapplicable to the real-time prediction of the toxic gas leakage area; although LSTM can effectively process time series data, it usually requires a large amount of labeled data for training and has a long training time. Summary of the Invention

[0005] In view of this, the embodiments of the present invention provide a method, a system, an electronic device and a storage medium for predicting gas leakage and diffusion in a petrochemical park, which can achieve real-time and rapid prediction of gas leakage and diffusion.

[0006] In a first aspect, the embodiments of the present invention provide a method for predicting gas leakage and diffusion in a petrochemical park, including:

[0007] Constructing a petrochemical park simulation model based on Fluent, and performing gas diffusion simulation calculation through computational fluid dynamics technology to generate a gas diffusion image data set; extracting features from the gas diffusion data image data set based on a deep convolutional neural network to output a gas diffusion feature image; constructing a gas diffusion prediction model based on a variational autoencoder and a deep neural network, and training the gas diffusion prediction model based on the gas diffusion feature image and environmental variables; inputting the collected environmental variables into the trained gas diffusion prediction model to generate a gas diffusion prediction result under the current environmental variables.

[0008] Optionally, a petrochemical park simulation model is constructed based on Fluent, and gas diffusion simulation calculations are performed through computational fluid dynamics technology to generate a gas diffusion image dataset, including: constructing a petrochemical park simulation model based on Fluent, where the petrochemical park simulation model at least includes the terrain and buildings of the petrochemical park; obtaining the data file of the gas diffusion dataset using computational fluid dynamics simulation technology; the gas diffusion dataset is the gas concentration distribution under different environmental variables and its variation data over time; the data file is subjected to simulation post-processing to generate a gas diffusion image dataset.

[0009] Optionally, feature extraction is performed on the gas diffusion data image dataset based on a deep convolutional neural network to output a gas diffusion feature image, including: normalizing the gas diffusion image dataset, and scaling the pixel values of the image data in the gas diffusion image post-dataset from [0, 255] to [0, 1]; inputting the processed image data into a deep convolutional neural network module to generate a gas diffusion feature image, and the gas diffusion feature image is used to characterize the concentration change and gas diffusion pattern of gas diffusion.

[0010] Optionally, the gas diffusion prediction model based on a variational autoencoder and a deep neural network includes: a variational autoencoder module and a deep neural network module; the environmental variables at least include wind direction, wind speed, and gas leakage speed; training the gas diffusion prediction model based on the gas diffusion feature image and environmental variables includes: inputting the gas diffusion feature image into the gas diffusion prediction model based on a variational autoencoder and a deep neural network, and generating a new gas diffusion feature image through the variational autoencoder module; inputting the new gas diffusion feature image and environmental variables into the deep neural network module for training to identify the relationship between the gas diffusion feature image and the corresponding environmental variables, so that the gas diffusion prediction model based on a variational autoencoder and a deep neural network can generate a corresponding gas diffusion image according to the environmental variables.

[0011] Optionally, training the gas diffusion prediction model based on the gas diffusion feature image and environmental variables further includes: adjusting the hyperparameters of the gas diffusion prediction model based on the gas diffusion feature image and the generated new gas diffusion feature image, and retraining the gas diffusion prediction model to obtain a trained gas diffusion prediction model.

[0012] Second aspect, an embodiment of the present invention further provides a gas leakage and diffusion prediction system for a petrochemical park, including: a construction module, configured to construct a petrochemical park simulation model based on Fluent, and perform gas diffusion simulation calculation through computational fluid dynamics technology to generate a gas diffusion image dataset; an extraction module, configured to extract features from the gas diffusion data image dataset based on a deep convolutional neural network and output a gas diffusion feature image; a model training module, configured to construct a gas diffusion prediction model based on a variational autoencoder and a deep neural network, and train the gas diffusion prediction model based on the gas diffusion feature image and environmental variables; a prediction module, configured to input the collected environmental variables into the trained gas diffusion prediction model to generate a gas diffusion prediction result under the current environmental variables.

[0013] Optionally, the construction module includes: a first construction sub-module, configured to construct a petrochemical park simulation model based on Fluent, where the petrochemical park simulation model at least includes the terrain and buildings of the petrochemical park; a calculation sub-module, configured to obtain a data file of the gas diffusion dataset by using computational fluid dynamics technology; the gas diffusion dataset is data of gas concentration distribution and its change over time under different environmental variables; a second construction sub-module, configured to perform simulation post-processing on the data file to generate a gas diffusion image dataset.

[0014] Optionally, the gas diffusion prediction model based on a variational autoencoder and a deep neural network includes: a variational autoencoder module and a deep neural network module; the environmental variables at least include wind direction, wind speed, and gas leakage speed; the model training module includes: a variational autoencoder sub-module, configured to input the gas diffusion feature image into the gas diffusion prediction model based on a variational autoencoder and a deep neural network, and generate a new gas diffusion feature image through the variational autoencoder module; a deep neural network sub-module, configured to input the new gas diffusion feature image and environmental variables into the deep neural network module for training, and identify the relationship between the gas diffusion feature image and the corresponding environmental variables, so that the gas diffusion prediction model based on a variational autoencoder and a deep neural network can generate a corresponding gas diffusion image according to the environmental variables.

[0015] Third aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes: a housing, a processor, a memory, a circuit board, and a power supply circuit. Among them, the circuit board is arranged inside the space surrounded by the housing, and the processor and the memory are arranged on the circuit board; the power supply circuit is configured to supply power to each circuit or device 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, and is used to execute the petrochemical park gas leakage and diffusion prediction method according to any one of the first aspects described above.

[0016] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium storing one or more programs, which can be executed by one or more processors to implement the petrochemical park gas leakage and diffusion prediction method according to any one of the first aspects.

[0017] The petrochemical park gas leakage and diffusion prediction method, system, electronic device and storage medium provided by the embodiments of the present invention perform simulation calculations in a constructed petrochemical park simulation model through computational fluid dynamics technology to obtain a gas diffusion image data set; use a deep convolutional neural network to extract the feature images of the gas diffusion data images, and train a gas diffusion prediction model based on variational autoencoders and deep neural networks based on the gas diffusion feature images and environmental variables to learn the complex non-linear relationship between environmental variables and gas diffusion features, so as to obtain a trained gas diffusion prediction model, enabling a real-time gas diffusion prediction result image to be generated according to the trained gas diffusion prediction model and real-time environmental data. In this way, the gas leakage and diffusion can be predicted in real time and effectively. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0019] Figure 1 It is a schematic flowchart of the petrochemical park gas leakage and diffusion prediction method according to an embodiment of the present invention;

[0020] Figure 2 It is a schematic flowchart of the method of step S110 according to an embodiment of the present invention;

[0021] Figure 3 It is a schematic flowchart of the method of step S120 according to an embodiment of the present invention;

[0022] Figure 4 It is a schematic flowchart of the method of step S130 according to an embodiment of the present invention;

[0023] Figure 5 It is a schematic diagram of the architecture of the petrochemical park gas leakage and diffusion prediction system provided by an embodiment;

[0024] Figure 6 It is a schematic block diagram of the architecture of an embodiment of the electronic device of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0025] The embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0026] It should be clear that the described embodiments are only a part of the embodiments of the present invention, rather than all of them. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts belong to the scope of protection of the present invention.

[0027] Currently, the existing gas diffusion prediction methods mainly include:

[0028] Computational Fluid Dynamics (CFD) simulation: used to simulate and analyze gas diffusion in petrochemical parks. CFD can consider geographical information and gas characteristics and provide highly accurate simulation results. However, CFD simulation requires a large amount of computing resources and time because they usually require more than 1 hour of simulation time and are not suitable for real-time alarm systems.

[0029] Surrogate models based on statistics and machine learning: For example, models based on Gaussian Processes Regression (GPR) have been used to simplify complex models and shorten computing time. However, these models may not be able to capture all the non-linear features and complex spatial relationships in the CFD model, especially in urban areas where buildings and other obstacles have a great impact on gas diffusion.

[0030] The embodiments of the present invention provide a gas diffusion prediction method for petrochemical parks. By combining deep learning and variational auto-encoder technology, it can overcome the shortcomings of traditional CFD simulation and statistical surrogate models and achieve real-time, efficient, and accurate gas diffusion prediction.

[0031] Variational Auto-encoder (VAE): A generative model that encodes input data into a distribution in a latent space through an encoder and then samples from this distribution through a decoder to reconstruct the input data. VAE aims to learn the latent representation of data and can generate new data similar to the training data.

[0032] Deep Convolutional Neural Network (DCNN): A special neural network that uses convolutional layers to process image data. The convolutional layers can capture local features in the image and extract more complex features by stacking multiple convolutional layers.

[0033] Embodiment 1

[0034] An embodiment of the present invention provides a method for predicting gas leakage and diffusion in a petrochemical park. Refer to Figure 1 as shown, including:

[0035] S110. Build a petrochemical park simulation model based on Fluent, and perform gas diffusion simulation calculations through computational fluid dynamics technology to generate a gas diffusion image dataset;

[0036] In this step, according to the actual scenario conditions of the petrochemical park to be predicted, use Fluent computational fluid dynamics simulation software to build a geometric simulation model of the petrochemical park, and set multiple groups of environmental variables in Fluent to perform gas diffusion simulation calculations to simulate gas diffusion scenarios, specifically including setting different wind directions, wind speeds, gas leakage speeds, and gas leakage positions, etc., to generate gas diffusion datasets under different environmental variables.

[0037] Optionally, in some embodiments, refer to Figure 2 as shown, step S110. Build a petrochemical park simulation model based on Fluent, and perform gas diffusion simulation calculations through computational fluid dynamics technology to generate a gas diffusion image dataset, including:

[0038] S111. Build a petrochemical park simulation model based on Fluent, and the petrochemical park simulation model includes at least the terrain and buildings of the petrochemical park;

[0039] S113. Use computational fluid dynamics simulation technology to obtain the.data file of the gas diffusion dataset; the gas diffusion dataset is the gas concentration distribution under different environmental variables and its change data over time;

[0040] S115. Perform simulation post-processing on the.data file to generate a gas diffusion image dataset.

[0041] Specifically, build a petrochemical park simulation model based on Fluent to ensure that the built petrochemical park simulation model includes information such as the actual terrain and landform of the petrochemical park to be predicted, buildings in the park, and roads in the park; after building the petrochemical park simulation model, set multiple groups of different environmental variables in Fluent to perform gas diffusion simulation experiments to simulate gas diffusion scenarios, specifically including different wind speeds, wind directions, gas leakage speeds, and gas leakage positions, etc., and through computational fluid dynamics simulation technology (Computational Fluid Dynamics, CFD) simulation calculations, obtain the gas concentration distribution under different environmental variables and its change data over time, and export it as a.data file, and then import the.data file into CFD-POST for simulation post-processing to generate a colored GIF animation to intuitively display the process and trend of gas diffusion.

[0042] S120. Extract features from the gas diffusion image dataset based on a deep convolutional neural network and output a gas diffusion feature image;

[0043] In this step, the generated gas diffusion image dataset is input into a deep convolutional neural network (Deep Convolutional Neural Networks, DCNN) for feature extraction to identify the local structures and details of gas diffusion, generate a gas diffusion feature image, and capture the complex spatial features in gas diffusion, without being affected by buildings and obstacles.

[0044] Optionally, in some embodiments, refer to Figure 3 As shown, step S120, the extracting features from the gas diffusion data image dataset based on a deep convolutional neural network and outputting a gas diffusion feature image, includes:

[0045] S121. Normalize the gas diffusion image dataset and scale the pixel values of the image data in the gas diffusion image dataset after the data from [0, 255] to [0, 1];

[0046] S123. Input the processed image data into a deep convolutional neural network module to generate a gas diffusion feature image, where the gas diffusion feature image is used to characterize the concentration change and gas diffusion pattern of gas diffusion.

[0047] Specifically, before using a deep convolutional neural network (Deep Convolutional Neural Networks, DCNN) for feature extraction, in order to ensure the uniformity of the image sizes in the gas diffusion data image dataset, the images in the gas diffusion data image dataset are preprocessed and normalized, and the pixel values of the images are scaled from [0, 255] to [0, 1] to facilitate model processing;

[0048] Subsequently, through the convolutional layer of the deep convolutional neural network, local features of the gas diffusion image are extracted. The convolutional layer performs convolutional operations on the input gas diffusion image by using different convolutional kernels to extract features on the gas diffusion image. The convolutional operation uses the convolutional kernel as a filter, slides it one by one on the input image, and performs convolutional operations, thereby outputting a gas diffusion feature image; through multiple layers of convolution, high-level spatial features are extracted from the gas diffusion image data to identify the local structure and details of gas diffusion, including concentration changes and diffusion patterns; among them, the diffusion patterns include, for example, gas ascending diffusion, gas descending diffusion, and gas bypassing diffusion after encountering obstacles, etc.; then these gas diffusion feature images enter the pooling layer, and by performing downsampling on the input gas diffusion feature images, important feature information is retained and the dimension is reduced; the operations of the convolutional layer and the pooling layer are repeated multiple times to obtain a more stable and clear gas diffusion feature image, and the complex spatial characteristics of gas diffusion are captured in these gas diffusion feature images.

[0049] S130. Construct a gas diffusion prediction model based on a variational auto-encoder and a deep neural network, and train the gas diffusion prediction model based on the gas diffusion feature image and environmental variables;

[0050] In this step, by constructing a gas diffusion prediction model based on a variational auto-encoder (VAE) and a deep neural network (DNN), the gas diffusion feature image obtained by the deep convolutional neural network and environmental variables are input into the gas diffusion prediction model for training; among them, the variational auto-encoder module acts as a generator to generate a predicted gas diffusion image, and the deep neural network model is trained based on the combination of the gas diffusion feature image and environmental variables to identify images corresponding to different environmental variables, so as to obtain corresponding gas diffusion image data according to environmental variables, such as the gas diffusion image corresponding to a wind speed of 2 m / s, a wind direction of west, and a gas leakage speed of 5 kg / s, or the gas diffusion image corresponding to a wind speed of 5 m / s, a wind direction of south, and a gas leakage speed of 6 kg / s.

[0051] Furthermore, the variational auto-encoder is also used to extract spatial features in the gas diffusion feature image; by combining the variational auto-encoder and the deep convolutional neural network, key features can be effectively extracted from high-dimensional data, noise can be reduced, and the generalization ability of the model can be improved. Among them, the deep convolutional neural network mines high-level spatial features and diffusion patterns from the data, and the variational auto-encoder can effectively map these features to a low-dimensional latent space, enabling the model to capture complex spatial features and non-linear relationships.

[0052] Optionally, in some embodiments, the gas diffusion prediction model based on variational autoencoder and deep neural network includes: a variational autoencoder module and a deep neural network module; the environmental variables at least include wind direction, wind speed, and gas leakage speed;

[0053] See Figure 4 As shown, training the gas diffusion prediction model based on the gas diffusion feature image and environmental variables includes:

[0054] S131. Input the gas diffusion feature image into the gas diffusion prediction model based on variational autoencoder and deep neural network, and generate a new gas diffusion feature image through the variational autoencoder module;

[0055] S133. Input the new gas diffusion feature image and environmental variables into the deep neural network module for training, and identify the relationship between the gas diffusion feature image and the corresponding environmental variables, so that the gas diffusion prediction model based on variational autoencoder and deep neural network can generate the corresponding gas diffusion image according to the environmental variables.

[0056] Optionally, in some embodiments, training the gas diffusion prediction model based on the gas diffusion feature image and environmental variables further includes:

[0057] Based on the gas diffusion feature image and the generated new gas diffusion feature image, adjust the hyperparameters of the gas diffusion prediction model, and retrain the gas diffusion prediction model to obtain the trained gas diffusion prediction model.

[0058] Specifically, in this embodiment, a deep convolutional neural network and a variational autoencoder are combined. The images in the gas diffusion image dataset are first input into the deep convolutional neural network for feature extraction to obtain the first feature image, so as to identify the concentration change and diffusion model during gas diffusion. Then, the first feature image is input into the variational autoencoder module, and the first feature image is further processed through the convolutional layer and pooling layer of the variational autoencoder to further extract the spatial features of gas diffusion, so as to identify information such as the diffusion position. At the same time, the variational autoencoder module also acts as a generator to generate a new gas diffusion feature image based on the input gas diffusion feature image. Then, through the deep neural network module, training is performed based on the combination of the gas diffusion feature image generated by the variational autoencoder module and the environmental variables to identify the relationship between the gas diffusion feature image and the corresponding environmental variables, so that the gas diffusion prediction model can generate the corresponding gas diffusion image according to the environmental variables.

[0059] Specifically, during the training process of the gas diffusion prediction model, by monitoring the loss function and R of the model 2Observe the learning progress of the model by the change of values; after the model training is completed, check the loss function image and the R 2 value image to detect whether the loss function image continuously decreases and the R 2 value image continuously increases. When it is detected that the loss function image does not continuously decrease and the R 2 value image does not continuously increase, adjust the model parameters, optimize the model and retrain it until the model training is completed.

[0060] In addition, the number of model parameters in the embodiments of the present invention is much less than that of the traditional fully connected network, which can reduce the complexity of the model, and at the same time reduce the computing cost and storage requirements.

[0061] Furthermore, the gas diffusion prediction model provided by the embodiments of the present invention can make predictions according to real-time environmental conditions, and adjust and optimize according to the prediction results to ensure accuracy and timeliness under various environmental conditions.

[0062] After the model training is completed, input the test data set into the trained model to generate prediction results, that is, input a part of the actual working condition images into the trained model to generate gas diffusion images. Compare and analyze the generated gas diffusion images with the actual working condition images to analyze the errors of the model and find out the main factors causing the errors, such as data noise, feature loss, etc.; based on the error results, adjust the hyperparameters of the model and retrain the model until the optimal gas diffusion prediction model is obtained.

[0063] In the above model, the deep convolutional neural network is responsible for processing data with spatial correlation and extracting local features. The variational autoencoder is responsible for extracting the features of the data and encoding them into a low-dimensional latent space, and is also responsible for generating images. The deep neural network is responsible for learning the mapping relationship from the input feature image to the latent space. In this way, by combining the deep convolutional neural network, the variational autoencoder and the convolutional neural network, a real-time and accurate gas diffusion prediction task can be achieved.

[0064] S140: Input the collected environmental variables into the trained gas diffusion prediction model to generate the gas diffusion prediction result under the current environmental variables.

[0065] In this step, input the environmental variables into the trained gas diffusion prediction model to predict the current latest gas leakage diffusion working condition image. Specifically, by collecting the current latest environmental variables of the petrochemical park to be predicted and inputting them into the trained optimal gas diffusion prediction model, the latest gas diffusion prediction result image of the petrochemical park is generated, so as to make timely preparations and reduce the accident risk.

[0066] The gas leakage and diffusion prediction method provided by the embodiment of the present invention performs simulation calculations in the constructed petrochemical park simulation model through computational fluid dynamics technology to obtain a gas diffusion image dataset; uses a deep convolutional neural network to extract the feature images of the gas diffusion data images, and trains a gas diffusion prediction model based on variational autoencoders and deep neural networks based on the gas diffusion feature images and environmental variables to learn the complex non-linear relationship between environmental variables and gas diffusion characteristics, so as to obtain a trained gas diffusion prediction model, enabling real-time gas diffusion prediction results to be generated according to the trained gas diffusion prediction model and real-time environmental data. In this way, compared with traditional CFD simulations, the prediction speed of gas diffusion is improved, and gas leakage and diffusion can be predicted effectively in real time.

[0067] Furthermore, the embodiment of the present invention combines CFD simulation, DCNN feature extraction, VAE encoder, and DNN model to improve the accuracy, real-time performance, and generalization ability of the model; through the gas leakage and diffusion prediction method for petrochemical parks provided by the embodiment of the invention, gas leakage and diffusion can be predicted more effectively, providing support for emergency response.

[0068] Embodiment 2

[0069] Combined with specific embodiments, the gas leakage and diffusion prediction method for petrochemical parks provided by the present invention will be described:

[0070] Specifically, it includes the following steps:

[0071] S1. Establish a petrochemical park model by collecting the actual structural information of the petrochemical park, and perform gas diffusion simulation calculations through computational fluid dynamics technology to generate a gas diffusion image dataset.

[0072] Among them, step S1 includes:

[0073] S11. Collect the actual structural information of the petrochemical park to establish an accurate petrochemical park simulation model, ensuring that the petrochemical park simulation model contains actual terrain, buildings, streets, and obstacle information;

[0074] S12. Set various environmental variables as experimental conditions in Fluent, specifically including different wind speeds, wind directions, gas leakage speeds, and gas leakage positions, collect the gas concentration distribution and its change data over time under different conditions, and export them as.data files;

[0075] S13. Import the.data file into CFD-POST for further processing to generate a colored GIF animation to visually display the process and trend of gas diffusion.

[0076] S2. Input the gas diffusion image dataset into a deep convolutional neural network for feature extraction, identify the local structures and details of gas diffusion, generate feature maps, and capture the complex spatial characteristics in gas diffusion.

[0077] Step S2 includes:

[0078] S21. Load the gas diffusion image dataset. To ensure uniform image sizes, normalize the image data, scaling the pixel values of the images from [0, 255] to [0, 1].

[0079] S22. Conduct layer-by-layer abstraction through the convolutional layers of the deep convolutional neural network to extract high-level spatial features from the image data, identifying the local structures and details of gas diffusion, including changes in gas diffusion concentration and diffusion patterns.

[0080] S23. Reduce the spatial dimension of the features through the pooling layer while retaining important features.

[0081] S24. After repeating S22 and S23 multiple times, obtain the gas diffusion feature maps, which capture the complex spatial characteristics of gas diffusion.

[0082] S3. Input the feature maps obtained in step S2 into the variational autoencoder module to extract the core features of the gas diffusion image data and reduce noise.

[0083] Step S3 includes:

[0084] S31. Input the gas diffusion feature maps into the variational autoencoder module. The convolutional and pooling layers of the encoder continue to process the feature maps to further extract spatial features.

[0085] S32. After the operation in S31, the feature maps are flattened and passed through the fully connected layer to generate the mean and log variance of the latent variables.

[0086] S33. Use the reparameterization trick to sample from the distribution of the latent variables, enabling the model to learn the data distribution during training.

[0087] S34. Optimize the parameters of the encoder and decoder by minimizing the reconstruction loss and KL divergence, where the KL divergence helps regularize the latent space and reduce noise.

[0088] S4. Input the environmental variables into a deep neural network for training to learn the complex non-linear relationship between the environmental variables and gas diffusion features.

[0089] Step S4 includes:

[0090] S41. Input the combination of the feature map obtained in S3 and the environmental variables into the deep neural network to identify the images corresponding to different environmental variables, facilitating the obtaining of the corresponding gas diffusion images based on the environmental variables.

[0091] S42. During the training process, monitor the changes in the loss function and the R 2 value to observe the learning progress of the model.

[0092] S43. After the training is completed, check whether the loss function image continuously decreases and whether the R 2 value image continuously increases.

[0093] S44. If not, adjust the parameters, optimize the model, and retrain it.

[0094] S5. After the model training is completed, use the test data set to evaluate the model, adjust the model parameters based on the prediction results to optimize the model performance, obtain the optimal model, and ensure the accuracy and real-time performance of the model under various environmental conditions.

[0095] Step S5 includes:

[0096] S51. Input the test data set into the trained model to generate prediction results.

[0097] S52. Analyze the prediction results, analyze the mispredictions of the model, and find out the main factors causing the errors.

[0098] S53. Based on the evaluation results, adjust the hyperparameters of the model, and repeat the process of Step S4 with the new parameter settings to retrain the model.

[0099] S54. After the training is completed, repeat S51 to S53, and use the test data set to evaluate the model performance again until the optimal model is obtained.

[0100] Specifically, when conducting model testing, input a part of the pictures of the actual working conditions into the trained model to generate prediction results, compare the generated prediction result images with the actual working condition images to find out the factors causing the errors, such as data noise, feature missing, etc., and then adjust the hyperparameters of the model and retrain the adjusted model until the optimal model is obtained.

[0101] S6. Input the real-time collected environmental data into the optimal model for gas diffusion prediction to obtain the gas diffusion prediction results under the current environmental variables.

[0102] Specifically, an accurate petrochemical park model is established by collecting the actual structural information of the petrochemical park. Gas diffusion simulation calculations are carried out through computational fluid dynamics technology, and a gas diffusion image dataset is collected. The collected gas diffusion image dataset is used to train the gas diffusion prediction model. First, the gas diffusion image dataset is input into a deep convolutional neural network for feature extraction to identify the local structure and details of gas diffusion, generate feature maps, and capture the complex spatial characteristics in gas diffusion. Then, the obtained feature maps are input into a variational autoencoder module to extract the core features of the gas diffusion image data and reduce noise. Then, the environmental variables are input into a deep neural network for training to learn the complex non-linear relationship between the environmental variables and the gas diffusion characteristics. Finally, the test dataset is input into the trained gas diffusion prediction model to generate gas diffusion prediction results, and the generated results are compared with the actual results. The model parameters are adjusted for optimization and retraining to obtain the optimal gas diffusion prediction model. The real-time collected environmental data is input into the optimal gas diffusion prediction model for gas diffusion prediction to generate a gas leakage diffusion condition image under the current environment and obtain gas diffusion prediction results.

[0103] Embodiment 3

[0104] See Figure 5 As shown, the present invention also provides a gas leakage diffusion prediction system for a petrochemical park, including:

[0105] A construction module 51, configured to construct a petrochemical park simulation model based on Fluent, and perform gas diffusion simulation calculations through computational fluid dynamics technology to generate a gas diffusion image dataset;

[0106] An extraction module 52, configured to perform feature extraction on the gas diffusion data image dataset based on a deep convolutional neural network and output a gas diffusion feature image;

[0107] A model training module 53, configured to construct a gas diffusion prediction model based on a variational autoencoder and a deep neural network, and train the gas diffusion prediction model based on the gas diffusion feature image and environmental variables;

[0108] A prediction module 54, configured to input the collected environmental variables into the trained gas diffusion prediction model to generate a gas diffusion prediction result under the current environmental variables.

[0109] Optionally, in some embodiments, the construction module includes:

[0110] A first construction sub-module, configured to construct a petrochemical park simulation model based on Fluent, where the petrochemical park simulation model includes at least the terrain and buildings of the petrochemical park;

[0111] A calculation sub-module for obtaining the data file of the gas diffusion dataset by using computational fluid dynamics technology; the gas diffusion dataset is the gas concentration distribution under different environmental variables and its change data over time;

[0112] A second construction sub-module for performing simulation post-processing on the data file to generate a gas diffusion image dataset.

[0113] Optionally, in some embodiments, the extraction module includes:

[0114] A data processing sub-module for performing normalization processing on the gas diffusion image dataset, scaling the pixel values of the image data in the gas diffusion image post-dataset from [0, 255] to [0, 1];

[0115] A feature extraction sub-module for inputting the processed image data into a deep convolutional neural network module to generate a gas diffusion feature image, which is used to characterize the concentration change and gas diffusion pattern of gas diffusion.

[0116] Optionally, in some embodiments, the gas diffusion prediction model based on variational autoencoder and deep neural network includes: a variational autoencoder module and a deep neural network module; the environmental variables at least include wind direction, wind speed, and gas leakage speed;

[0117] The model training module includes:

[0118] A variational autoencoder sub-module for inputting the gas diffusion feature image into the gas diffusion prediction model based on variational autoencoder and deep neural network, and generating a new gas diffusion feature image through the variational autoencoder module;

[0119] A deep neural network sub-module for inputting the new gas diffusion feature image and environmental variables into the deep neural network module for training, identifying the relationship between the gas diffusion feature image and the corresponding environmental variables, so that the gas diffusion prediction model based on variational autoencoder and deep neural network can generate the corresponding gas diffusion image according to the environmental variables.

[0120] Optionally, in some embodiments, the model training module further includes:

[0121] A model optimization sub-module for adjusting the hyperparameters of the gas diffusion prediction model based on the gas diffusion feature image and the generated new gas diffusion feature image, retraining the gas diffusion prediction model, and obtaining the trained gas diffusion prediction model.

[0122] The petrochemical park gas leakage diffusion prediction system provided in this embodiment can be used to execute Figure 1The technical solution of the method embodiment shown has a similar implementation principle and technical effect to those of Embodiment 1, and will not be elaborated here. For details, please refer to each other.

[0123] Embodiment 4

[0124] Figure 6 The following is a schematic block diagram of the architecture of an embodiment of the electronic device of the present invention; based on the same technical concept as that of the foregoing Embodiment 1, the electronic device provided in the embodiment of the present invention, as Figure 6 shown, can implement the step flow of any of the method embodiments described in Embodiment 1 of the present invention.

[0125] The above-mentioned electronic device may include: a housing 61, a processor 62, a memory 63, a circuit board 64, and a power supply circuit 65. Among them, the circuit board 64 is arranged inside the space surrounded by the housing 61, and the processor 62 and the memory 63 are arranged on the circuit board 64; the power supply circuit 65 is used to supply power to each circuit or device of the above-mentioned electronic device; the memory 63 is used to store executable program codes; the processor 62 runs a program corresponding to the executable program code by reading the executable program code stored in the memory 63, and is used to execute any of the petrochemical park gas leakage diffusion prediction methods described in the foregoing Embodiment 1.

[0126] For the specific execution process of the above steps by the processor 62 and the steps further executed by the processor 62 by running the executable program code, please refer to the description of Embodiment 1 of the present invention and will not be elaborated here.

[0127] The above-mentioned electronic device exists in various forms, including but not limited to:

[0128] (1) Mobile communication devices: These devices are characterized by having mobile communication functions and mainly aim to provide voice and data communication. Such terminals include: smart phones (such as iPhone), multimedia phones, functional phones, and low-end phones, etc.

[0129] (2) Ultra-mobile personal computer devices: These devices belong to the category of personal computers, have computing and processing functions, and generally also have the characteristics of mobile Internet access. Such terminals include: PDA, MID, and UMPC devices, etc., such as iPad.

[0130] (3) Portable entertainment devices: These devices can display and play multimedia content. Such devices include: audio and video players (such as iPod), handheld game consoles, e-books, and smart toys and portable vehicle navigation devices.

[0131] (4) Server: A device that provides computing services. The server consists of a processor, hard disk, memory, system bus, etc. The server is similar to a general computer architecture, but due to the need to provide highly reliable services, it has higher requirements in terms of processing power, stability, reliability, security, scalability, manageability, etc.

[0132] (5) Other electronic devices with data interaction functions.

[0133] An embodiment of the present invention also provides a computer-readable storage medium. The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the petrochemical park gas leakage and diffusion prediction method described in any one of the foregoing Embodiment 1.

[0134] In summary, an embodiment of the present invention provides a petrochemical park gas leakage and diffusion prediction method, system, electronic device, and storage medium. By performing simulation calculations in the constructed petrochemical park simulation model through computational fluid dynamics technology, a gas diffusion image dataset is obtained; a deep convolutional neural network is used to extract the feature images of the gas diffusion data images, and based on the gas diffusion feature images and environmental variables, a gas diffusion prediction model based on a variational autoencoder and a deep neural network is trained to learn the complex non-linear relationship between the environmental variables and the gas diffusion characteristics, thereby obtaining a trained gas diffusion prediction model, so as to be able to generate a real-time gas diffusion prediction result image according to the trained gas diffusion prediction model and real-time environmental data. In this way, the gas leakage and diffusion can be predicted effectively in real time.

[0135] Furthermore, in the embodiment of the present invention, the number of model parameters is much less than that of the traditional fully connected network, which can reduce the complexity of the model, and at the same time reduce the computational cost and storage requirements.

[0136] It should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the element.

[0137] Each embodiment in this specification is described in a related manner. For the same or similar parts among the embodiments, reference can be made to each other. The key point of each embodiment is to illustrate the differences from other embodiments.

[0138] For the convenience of description, if a system, server, etc. are involved, they may be described separately as various units / modules according to functions. Of course, when implementing the present invention, the functions of the various units / modules can be realized in the same or multiple software and / or hardware.

[0139] Those of ordinary skill in the art can understand that all or part of the processes of implementing the methods in the above embodiments can be completed by instructing relevant hardware through a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above methods. Among them, the storage medium can be a magnetic disk, an optical disc, a read-only memory (ROM), a random access memory (RAM), etc.

[0140] The above is only the specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by those skilled in the art within the technical scope disclosed by the present invention should be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.

Claims

1. A method for predicting gas leakage and diffusion in a petrochemical park, characterized in that: include: A petrochemical park simulation model was built based on Fluent, and gas diffusion simulation calculations were performed using computational fluid dynamics technology to generate a gas diffusion image data set; Extracting features from the gas diffusion image data set based on a deep convolutional neural network, and outputting a gas diffusion feature image; Constructing a gas diffusion prediction model based on a variational autoencoder and a deep neural network, and training the gas diffusion prediction model based on the gas diffusion characteristic image and environmental variables; Input the collected environmental variables into the trained gas diffusion prediction model to generate gas diffusion prediction results under the current environmental variables; The method of constructing a gas diffusion prediction model based on a variational autoencoder and a deep neural network, and training the gas diffusion prediction model based on the gas diffusion feature image and environmental variables, comprises: The gas diffusion feature image is input into the variational autoencoder module, and the convolution layer and pooling layer of the variational autoencoder continue to process the gas diffusion feature image to further extract spatial features; After the convolution and pooling layer operations, the gas diffusion feature image is flattened and passed through the fully connected layer to generate the mean and logarithmic variance of the latent variables; Use reparameterization techniques to sample from the distribution of latent variables so that the model can learn the distribution of the data during training; Optimize the parameters of the encoder and decoder by minimizing the reconstruction loss and KL divergence, where KL divergence helps regularize the latent space and reduce noise; The combination of the gas diffusion feature image obtained after the variational autoencoder module and the environmental variables is input into the deep neural network to identify the images corresponding to different environmental variables, so as to obtain the corresponding gas diffusion image according to the environmental variables; During training, monitor the loss function and R 2 The value changes to observe the learning progress of the model; After training is completed, check whether the loss function graph continues to decrease, R 2 Whether the value image continues to increase; Otherwise adjust the parameters and optimize the model to retrain.

2. The petrochemical park gas leakage and diffusion prediction method according to claim 1, characterized in that: The petrochemical park simulation model is constructed based on Fluent, and gas diffusion simulation calculation is performed through computational fluid dynamics technology to generate a gas diffusion image data set; including: Building a petrochemical park simulation model based on Fluent, wherein the petrochemical park simulation model at least includes the terrain and buildings of the petrochemical park; A data file of a gas diffusion data set is obtained by using computational fluid dynamics technology; the gas diffusion data set is the gas concentration distribution under different environmental variables and its change data over time; The data file is subjected to simulation post-processing to generate a gas diffusion image data set.

3. The method for predicting gas leakage and diffusion in a petrochemical park according to claim 1, characterized in that: The method of extracting features from the gas diffusion data image dataset based on a deep convolutional neural network and outputting a gas diffusion feature image comprises: Normalizing the gas diffusion image data set to scale pixel values ​​of image data in the gas diffusion image data set from [0, 255] to [0, 1]; The processed image data is input into a deep convolutional neural network module to generate a gas diffusion characteristic image, which is used to characterize the concentration change and gas diffusion pattern of gas diffusion.

4. The method for predicting gas leakage and diffusion in a petrochemical park according to claim 1, characterized in that: The gas diffusion prediction model based on variational autoencoder and deep neural network includes: a variational autoencoder module and a deep neural network module; the environmental variables include at least wind direction, wind speed and gas leakage speed; The training of the gas diffusion prediction model based on the gas diffusion characteristic image and environmental variables includes: Inputting the gas diffusion characteristic image into the gas diffusion prediction model based on variational autoencoder and deep neural network, and generating a new gas diffusion characteristic image through the variational autoencoder module; The new gas diffusion characteristic image and environmental variables are input into a deep neural network module for training to identify the relationship between the gas diffusion characteristic image and the corresponding environmental variables, so that the gas diffusion prediction model based on variational autoencoder and deep neural network can generate the corresponding gas diffusion image according to the environmental variables.

5. The method for predicting gas leakage and diffusion in a petrochemical park according to claim 1, characterized in that: The training of the gas diffusion prediction model based on the gas diffusion characteristic image and the environmental variables further includes: Based on the gas diffusion characteristic image and the generated new gas diffusion characteristic image, the hyperparameters of the gas diffusion prediction model are adjusted, and the gas diffusion prediction model is retrained to obtain a trained gas diffusion prediction model.

6. A petrochemical park gas leakage and diffusion prediction system, characterized in that: include: The construction module is used to build a petrochemical park simulation model based on Fluent, and perform gas diffusion simulation calculations through computational fluid dynamics technology to generate a gas diffusion image data set; An extraction module, used for performing feature extraction on the gas diffusion image data set based on a deep convolutional neural network, and outputting a gas diffusion feature image; A model training module, used to construct a gas diffusion prediction model based on a variational autoencoder and a deep neural network, and to train the gas diffusion prediction model based on the gas diffusion characteristic image and environmental variables; A prediction module is used to input the collected environmental variables into the trained gas diffusion prediction model to generate gas diffusion prediction results under the current environmental variables; The model training module is specifically used to input the gas diffusion feature image into the variational autoencoder module, and the convolution layer and pooling layer of the variational autoencoder continue to process the gas diffusion feature image to further extract spatial features; After the convolution and pooling layer operations, the gas diffusion feature image is flattened and passed through the fully connected layer to generate the mean and logarithmic variance of the latent variables; Use reparameterization techniques to sample from the distribution of latent variables so that the model can learn the distribution of the data during training; Optimize the parameters of the encoder and decoder by minimizing the reconstruction loss and KL divergence, where KL divergence helps regularize the latent space and reduce noise; The combination of the gas diffusion feature image obtained after the variational autoencoder module and the environmental variables is input into the deep neural network to identify the images corresponding to different environmental variables, so as to obtain the corresponding gas diffusion image according to the environmental variables; During training, monitor the loss function and R 2 The value changes to observe the learning progress of the model; After training is completed, check whether the loss function graph continues to decrease, R 2 Whether the value image continues to increase; Otherwise adjust the parameters and optimize the model to retrain.

7. The petrochemical park gas leakage and diffusion prediction system according to claim 6, characterized in that: The building blocks include: A first construction submodule is used to construct a petrochemical park simulation model based on Fluent, wherein the petrochemical park simulation model at least includes the terrain and buildings of the petrochemical park; A calculation submodule is used to obtain a data file of a gas diffusion data set using computational fluid dynamics technology; the gas diffusion data set is the gas concentration distribution under different environmental variables and its change data over time; The second construction submodule is used to perform simulation post-processing on the data file to generate a gas diffusion image data set.

8. The petrochemical park gas leakage and diffusion prediction system according to claim 6, characterized in that: The gas diffusion prediction model based on variational autoencoder and deep neural network includes: a variational autoencoder module and a deep neural network module; the environmental variables include at least wind direction, wind speed and gas leakage speed; The model training module includes: A variational autoencoder submodule, used for inputting the gas diffusion characteristic image into the gas diffusion prediction model based on the variational autoencoder and deep neural network, and generating a new gas diffusion characteristic image through the variational autoencoder module; The deep neural network submodule is used to input the new gas diffusion characteristic image and environmental variables into the deep neural network module for training, and identify the relationship between the gas diffusion characteristic image and the corresponding environmental variables, so that the gas diffusion prediction model based on the variational autoencoder and the deep neural network can generate the corresponding gas diffusion image according to the environmental variables.

9. An electronic device, characterized in that: The electronic device comprises: a shell, a processor, a memory, a circuit board and a power supply circuit, wherein the circuit board is placed inside the space enclosed by the shell, and the processor and the memory are arranged 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 codes; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the petrochemical park gas leakage and diffusion prediction method described in any one of claims 1 to 5.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the petrochemical park gas leakage and diffusion prediction method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Hydrogen concentration distribution prediction method, device and equipment and storage medium

    CN117113882A

  • Harmful gas diffusion process rapid prediction method based on 3DCNN-LSTM coupling model

    CN118969132A