A Simulation and Optimization Method for Natural Gas Industrial Systems in a Harsh Environment
By constructing a physical constraint diffusion model and a federal transfer learning framework, eliminating data distribution differences, combining multi-physics coupling equations, the simulation accuracy and model generalization problems of natural gas industrial systems in extreme environments are solved, and higher real-time response accuracy and robustness are achieved.
Patent Information
- Application Number
- CN202510685264.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-27
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2045-05-27
AI Technical Summary
In the extreme environment, traditional simulation models have problems such as insufficient multi-field coupled simulation accuracy and poor generalization of model caused by the difference in data distribution across nodes. They cannot effectively eliminate the distribution differences caused by spatiotemporal asynchronousness, which seriously restricts real-time risk control capabilities.
By constructing a physical constraint diffusion model, the extreme environment data set is generated, combined with the federated transfer learning framework to align adversarial feature alignment, eliminate the differences in data distribution across environments, build a global environmental threat prediction model, and combine multi-physics coupling equations to build a dynamic simulation engine, receive real-time sensor data flow, simulate the multi-physics coupling behavior of pipeline networks in extreme environments, and output simulation results of multi-dimensional performance indicators.
It improves the physical consistency of multi-field coupled simulation, enhances the generalization ability of global threat prediction models, and improves the real-time response accuracy and robustness of natural gas industrial systems in extreme environments.
Smart Images

Figure CN120197528B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent optimization technology, and in particular to a method for simulating and optimizing a natural gas industrial system under a rough environment. Background Art
[0002] In recent years, the safety monitoring and dynamic optimization of natural gas industry systems in extreme environments have gradually shifted toward multi-physics coupled modeling and data-driven decision-making. Multi-field coupled simulation methods in computational fluid dynamics have been widely used to simulate pipeline network behavior. Joint training with distributed node data improves model generalization. Digital twins enable real-time monitoring of system status through virtual-real mapping. Multi-objective optimization algorithms can balance safety and efficiency objectives.
[0003] Traditional simulation models rely on limited historical data to generate extreme environment data sets, resulting in a lack of physical constraints and distribution deviations. The federated learning framework's handling of cross-node data heterogeneity remains at the static feature alignment level and is unable to eliminate the distribution differences caused by spatiotemporal asynchrony. This seriously restricts the natural gas industry system's real-time risk control capabilities in extreme environments. Summary of the Invention
[0004] In view of the above existing problems, the present invention is proposed.
[0005] Therefore, the present invention provides a simulation and optimization method for a natural gas industrial system in a rough environment to solve the problems of insufficient accuracy of multi-field coupling simulation of a natural gas industrial system in a complex environment and poor model generalization caused by differences in data distribution across nodes.
[0006] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0007] In a first aspect, the present invention provides a method for simulating and optimizing a natural gas industrial system in a rough environment, which comprises collecting environmental data, constructing a physically constrained diffusion model, and generating an extreme environment data set by embedding fluid mechanics equations and thermodynamic laws;
[0008] Combining real sensor data from multiple gas field nodes, a federated transfer learning framework is pre-trained to eliminate cross-environment data distribution differences through adversarial feature alignment to build a global environmental threat prediction model.
[0009] Combine the global environmental threat prediction model with the multi-physics coupling equation to build a dynamic simulation engine that receives real-time sensor data streams, simulates the multi-physics coupling behavior of the pipeline network in extreme environments, and outputs simulation results of multi-dimensional performance indicators;
[0010] Based on simulation results and real-time sensor data streams, a multi-objective fitness function is constructed, and control variables are generated through population evolution and dynamic strategy adjustment;
[0011] The control variables are input into the pre-trained digital twin verification model, and the residuals of the simulation results and real-time sensor data streams are compared to trigger the incremental learning mechanism and update the global environmental threat prediction model.
[0012] As a preferred solution of the method for simulating and optimizing the natural gas industry system under a rough environment of the present invention, the steps of generating the extreme environment data set are as follows:
[0013] Collect environmental data, perform normalization processing, generate a spatiotemporal continuous environmental data matrix, and construct a physical constraint diffusion model;
[0014] Fluid mechanics equations and thermodynamics laws are embedded in the physical constrained diffusion model, and extreme environmental condition parameters are generated within the preset multi-field critical range through the Monte Carlo sampling method;
[0015] Conduct adversarial sampling of parameters under extreme environmental conditions to generate multi-physics coupled datasets;
[0016] Perform spatiotemporal alignment and noise filtering on multiphysics coupled datasets to generate extreme environment datasets.
[0017] As a preferred solution of the method for simulating and optimizing a natural gas industrial system under a rough environment described in the present invention, the preset multi-field critical range includes a preset temperature threshold range, a pressure threshold range and a corrosive gas concentration threshold range.
[0018] As a preferred solution of the method for simulating and optimizing the natural gas industry system under a rough environment of the present invention, the specific steps of constructing the global environmental threat prediction model are as follows:
[0019] Perform spatiotemporal feature mapping on the real sensor data of each gas field node to generate dynamic feature projections;
[0020] An adversarial distribution alignment loss function is constructed based on dynamic feature projection, and the feature differences between nodes are calculated using a Gaussian time-domain kernel.
[0021] The adversarial discriminator and the dynamic feature projection layer are alternately trained using the adversarial distribution alignment loss function until the feature differences between nodes converge to a preset difference threshold.
[0022] The federation aggregation weight is calculated based on the converged dynamic feature projection to build a global environment threat prediction model.
[0023] As a preferred solution of the method for simulating and optimizing the natural gas industrial system under a rough environment of the present invention, the specific steps of outputting the simulation results of the multi-dimensional performance indicators are as follows:
[0024] Associating the output parameters of the global environmental threat prediction model with the control terms of the multi-physics coupling equations to construct the initialization parameters of the dynamic simulation engine;
[0025] Build an adaptive spatiotemporal grid based on initialization parameters, and dynamically adjust the grid node density according to temperature and pressure changes in real-time sensor data streams;
[0026] The real-time sensor data stream is embedded into the multi-physics coupling equation through the Gaussian time domain kernel to generate the modified fluid mechanics equation and thermodynamics equation;
[0027] Solve the modified fluid mechanics and thermodynamics equations, obtain the multi-physics coupling behavior of the pipeline network under extreme environments, calculate multi-dimensional performance indicators, and output simulation results.
[0028] As a preferred solution of the method for simulating and optimizing the natural gas industrial system under a rough environment of the present invention, wherein: the multi-physical field coupling behavior includes velocity field, pressure field and temperature field behavior;
[0029] The multi-dimensional performance indicators include safety indicators, efficiency indicators and corrosion rate indicators.
[0030] As a preferred solution of the method for simulating and optimizing the natural gas industrial system under a rough environment of the present invention, wherein: the control variables are generated by population evolution and dynamic strategy adjustment, the specific steps are as follows:
[0031] Based on the simulation results, a multi-objective fitness function is constructed. According to the real-time sensor data stream, the variance of each sensor data is calculated according to the preset time window to generate a variance vector.
[0032] Initialize the mixed population through the multi-objective fitness function, perform non-dominated sorting on the individuals in the mixed population, and calculate the information entropy weight of the Pareto front solution set;
[0033] Screen the individuals of the mixed population according to the information entropy weight and perform the directed mutation operation of the variance vector;
[0034] Update the control variables and adjust the strategy through the reinforcement learning strategy network to generate a new generation of mixed population;
[0035] The control variables are generated using the Pareto front solution set of the new generation of mixed populations.
[0036] As a preferred solution of the method for simulating and optimizing the natural gas industry system under a rough environment of the present invention, the specific steps of updating the global environmental threat prediction model are as follows:
[0037] Input the control variables into the pre-trained digital twin verification model to generate control variable simulation data;
[0038] Calculate the residual between the control variable simulation data and the real-time sensor data stream. If the residual exceeds the preset threshold, the incremental learning mechanism is triggered to collect incremental training data sets of the real-time sensor data stream and the control variable simulation data.
[0039] The parameters of the global environmental threat prediction model are updated through the incremental training data set to generate an updated global environmental threat prediction model.
[0040] In a second aspect, the present invention provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: when the computer program is executed by the processor, any step of the method for simulating and optimizing a natural gas industrial system under a rough environment as described in the first aspect of the present invention is implemented.
[0041] In a third aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, any step of the method for simulating and optimizing a natural gas industrial system under a rough environment as described in the first aspect of the present invention is implemented.
[0042] The beneficial effects of the present invention are: generating high-fidelity extreme environment data sets through a physical constrained diffusion model, improving the physical consistency of multi-field coupled simulation; eliminating the spatiotemporal heterogeneity of cross-node data and enhancing the generalization capability of the global threat prediction model based on a federated transfer learning framework based on adversarial feature alignment; and improving the real-time response accuracy and robustness of the natural gas industry system in extreme environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0044] Figure 1 A flow chart of the simulation and optimization method for natural gas industrial systems in rough environments;
[0045] Figure 2 Flowchart for generating extreme environment datasets;
[0046] Figure 3 A flowchart for building a global environmental threat prediction model;
[0047] Figure 4 Flowchart for generating control variables for population evolution and dynamic strategy adjustment. DETAILED DESCRIPTION
[0048] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0049] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0050] Secondly, the term "one embodiment" or "embodiment" herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in various places throughout this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive of other embodiments.
[0051] Reference Figures 1 to 4 , is an embodiment of the present invention, which provides a method for simulating and optimizing a natural gas industrial system in a rough environment, comprising the following steps:
[0052] S1. Collect environmental data, build a physical constrained diffusion model, and generate extreme environment data sets by embedding fluid mechanics equations and thermodynamics laws.
[0053] Furthermore, environmental data are collected and normalized to generate a spatiotemporally continuous environmental data matrix and construct a physical constraint diffusion model;
[0054] It should be noted that the environmental data includes temperature, pressure and real-time corrosive gas concentration data.
[0055] Specifically, distributed temperature sensors, pressure sensors, and corrosive gas concentration sensors deployed in the natural gas pipeline network collect real-time temperature data, real-time pressure data, and real-time corrosive gas concentration data at a fixed frequency. These data are mapped to the range of 0 to 1 using the minimum-maximum normalization method, eliminating interference caused by dimensional differences while preserving the distribution of environmental data.
[0056] Based on the normalized real-time temperature data, real-time pressure data, and real-time corrosive gas concentration data, the discrete data points are aligned in the time dimension and missing values are filled in the spatial dimension using the cubic spline interpolation method. The interpolation results are arranged into a three-dimensional matrix according to the timestamp and spatial position. The matrix rows are time series, the columns are spatial coordinates, and the channel dimensions are temperature, pressure, and corrosive gas concentration parameters, forming a spatiotemporal continuous environmental data matrix.
[0057] A diffusion model based on the Markov chain architecture is constructed with a spatiotemporal continuous environmental data matrix as input. In the forward process of the diffusion model, Gaussian noise is gradually injected into the environmental data matrix according to the noise addition rules of the Markov chain. In the reverse process, the weight parameters of the denoising network are optimized by the gradient descent algorithm to minimize the mean square error between the predicted noise and the actual noise. The trained diffusion model is used to generate a data distribution that conforms to physical laws, completing the construction of the physically constrained diffusion model.
[0058] Fluid mechanics equations and thermodynamics laws are embedded in the physical constrained diffusion model, and extreme environmental condition parameters are generated within the preset multi-field critical range through the Monte Carlo sampling method;
[0059] Specifically, the Navier-Stokes equations in the fluid mechanics equations and the ideal gas state equations in the laws of thermodynamics are converted into partial differential constraints; the weighted sum of the noise prediction error and the partial differential constraints of the physical constraint diffusion model are jointly optimized through the gradient descent algorithm; the Monte Carlo sampling method is used to search for multi-field critical parameters within the preset multi-field critical range to generate extreme environmental condition parameters that meet the fluid mechanics equations and thermodynamics laws.
[0060] It should be noted that the preset multi-field critical ranges include a preset temperature threshold range, a pressure threshold range, and a corrosive gas concentration threshold range.
[0061] The preset temperature threshold range is based on the temperature resistance limit of natural gas pipeline materials and historical accident data. For example, the preset range is -50°C to 200°C, covering extreme conditions such as extreme cold cracking and high temperature expansion.
[0062] The preset pressure threshold range is based on the pipeline design pressure level and burst test data. For example, the preset range is 0.1MPa to 50MPa, covering low-pressure leakage to high-pressure explosion scenarios;
[0063] The preset corrosive gas concentration threshold range is based on accelerated corrosion rate experiments and safety regulations. For example, the preset range of hydrogen sulfide concentration is 0-500ppm, covering the safety threshold to the critical value of rapid corrosion of the material.
[0064] Extreme environmental condition parameters include extreme temperature range, extreme pressure range and extreme corrosive gas concentration range;
[0065] The extreme temperature range refers to the extremely high or low temperature interval that the pipeline network may encounter, which is used to define the generation boundary of the temperature field;
[0066] The extreme pressure range refers to the extremely high or low pressure range that the fluid inside the pipeline may reach, which is used to define the generation boundary of the pressure field;
[0067] The extreme corrosive gas concentration range refers to the possible maximum concentration range of corrosive gases (such as hydrogen sulfide) in the pipeline environment, which is used to define the generation boundary of the corrosive gas concentration field.
[0068] Conduct adversarial sampling of parameters under extreme environmental conditions to generate multi-physics coupled datasets;
[0069] Specifically, during the training process of the physical constrained diffusion model, a generative adversarial network framework is constructed. The generator network receives extreme temperature range, extreme pressure range and extreme corrosive gas concentration range as input conditions, and outputs extreme environmental condition parameters that conform to the fluid mechanics equations and thermodynamics laws; the discriminator network evaluates the rationality of the generated parameters based on the loss function of the physical constrained diffusion model, and forces the parameters output by the generator to approach the real extreme environmental distribution through adversarial training; the generated extreme environmental condition parameters are input into the physical constrained diffusion model, and multi-field coupling simulation is performed to generate a multi-physical field coupling data set containing extreme temperature fields, extreme pressure fields and extreme corrosive gas concentration fields.
[0070] It should be noted that the multiphysics coupling dataset includes extreme temperature fields, extreme pressure fields, and extreme corrosive gas concentration fields;
[0071] The extreme temperature field refers to the distribution of temperature values at various spatial points in the environment where the natural gas pipeline network is located, describing the location and intensity of high or low temperature areas;
[0072] The extreme pressure field refers to the static or dynamic pressure distribution of the fluid inside the natural gas pipeline network, reflecting the fluid flow state and the stress distribution on the pipe wall;
[0073] The extreme corrosive gas concentration field refers to the concentration distribution of corrosive gases such as hydrogen sulfide and carbon dioxide in the natural gas pipeline environment, which is used to quantify the degree of local corrosion risk.
[0074] Perform spatiotemporal alignment and noise filtering on multiphysics coupled datasets to generate extreme environment datasets.
[0075] Specifically, a spatiotemporal alignment operation is performed on the extreme temperature field, extreme pressure field, and extreme corrosive gas concentration field in the multi-physics field coupling data set. The cubic spline interpolation method is used to align discrete data points in the time dimension and fill in missing values in the spatial dimension. The spatiotemporal aligned data set is noise filtered using the wavelet transform method to decompose the high-frequency noise component of the signal and reconstruct the low-frequency effective signal. The denoised extreme temperature field, extreme pressure field, and extreme corrosive gas concentration field are integrated into a three-dimensional matrix with unified timestamps and spatial coordinates to form an extreme environment data set that conforms to the fluid mechanics equations and thermodynamics laws.
[0076] S2. Combining real sensor data from multiple gas field nodes, pre-training a federated transfer learning framework, eliminating cross-environment data distribution differences through adversarial feature alignment, and building a global environmental threat prediction model.
[0077] Perform spatiotemporal feature mapping on the real sensor data of each gas field node to generate dynamic feature projections;
[0078] Specifically, within the range from the start timestamp of the time window to the end timestamp of the time window, an integration operation is performed on the timestamps of the real sensor data collection. During the integration process, the first-order partial derivative of the nonlinear mapping function with respect to time is calculated. At the same time, the norm square of the spatial gradient operator of the nonlinear mapping function with respect to the real sensor data matrix is calculated. The norm square of the spatial gradient operator is multiplied by the stability coefficient and the negative exponential function is taken as the dynamic attenuation factor. The first-order partial derivative of the nonlinear mapping function with respect to time is multiplied by the dynamic attenuation factor and then integrated along the time window to generate a dynamic feature projection.
[0079] Dynamic feature projection, the expression is:
[0080] ;
[0081] Where, Indicates a gas field node Dynamic feature projection of Indicates the gas field node index, Indicates a gas field node The real sensor data matrix, Indicates a gas field node Dynamic feature projection parameters, Indicates the start timestamp of the time window for real sensor data collection, Indicates the end timestamp of the time window for real sensor data collection, Indicates from arrive The timestamp of the time window of the real sensor data collection is integrated. represents a nonlinear mapping function, represents the stability coefficient, represents the spatial gradient operator of the real sensor data matrix, represents the current time integral, represents the partial differential operator, Indicates the current time The partial derivative of .
[0082] It should be noted that the stability coefficient is calibrated by gradient norm regularization to suppress gradient explosion during feature projection. For example, the value range is .
[0083] An adversarial distribution alignment loss function is constructed based on dynamic feature projection, and the feature differences between nodes are calculated using a Gaussian time-domain kernel.
[0084] Specifically, all gas field nodes within the total number of gas field nodes are traversed in pairs, and the squared Euclidean distance of the dynamic feature projections of each pair of gas field nodes is calculated. The time alignment center point is used as the mean parameter of the Gaussian time domain kernel function, and the time tolerance parameter is used as the standard deviation parameter of the Gaussian time domain kernel function. The squared Euclidean distance is multiplied by the Gaussian time domain kernel function value and then integrated over the current time in the range from negative infinity to positive infinity. The integral results of all gas field node combinations are accumulated and normalized to generate an adversarial distribution alignment loss function.
[0085] The adversarial distribution alignment loss function is constructed based on dynamic feature projection, and its expression is:
[0086] ;
[0087] Where, represents the adversarial distribution alignment loss function, Indicates the total number of gas field nodes, Indicates the gas field node From 1 to All gas field nodes are accumulated and summed up, Indicates other nodes arrive All gas field nodes are accumulated and summed up, represents the time tolerance parameter, Indicates the current time Integrate from negative infinity to positive infinity, Indicates other nodes Dynamic feature projection of Indicates other nodes The real sensor data matrix, Indicates the time alignment center point.
[0088] The adversarial discriminator and the dynamic feature projection layer are alternately trained using the adversarial distribution alignment loss function until the feature differences between nodes converge to a preset difference threshold.
[0089] The federation aggregation weight is calculated based on the converged dynamic feature projection to build a global environment threat prediction model.
[0090] Specifically, the dynamic feature projections corresponding to the real sensor data matrices of all samples of the gas field nodes are accumulated and summed, and the sum result is used as the numerator. The dynamic feature projections of all samples of all gas field nodes are accumulated and summed, and the sum result is used as the denominator. The numerator and denominator are divided to generate the federal aggregation weight of the gas field node.
[0091] The federated aggregation weight is multiplied by the loss function of the environmental threat prediction with the gradient of the global environmental threat prediction model, and the sum is calculated. The sum is multiplied by the adaptive learning rate and then subtracted from the global environmental threat prediction model parameters after the current iterative update to obtain the global environmental threat prediction model.
[0092] The federation aggregation weight is calculated based on the converged dynamic feature projection, and the expression is:
[0093] ;
[0094] Where, Indicates a gas field node The federation aggregation weight of Indicates the sample From 1 to All the values of are accumulated and summed up, represents the sample index, represents the total number of samples, Indicates a gas field node No. The real sensor data matrix of samples.
[0095] Construct a global environmental threat prediction model, the expression is:
[0096] ;
[0097] Where, represents the global environment threat prediction model, Indicates the The global environment threat prediction model after the iteration update, represents the number of iterative updates, Indicates the The global environment threat prediction model after the iteration update, represents the adaptive learning rate, represents the gradient operator of the global environment threat prediction model, represents the loss function for environmental threat prediction, Indicates a gas field node Threat label.
[0098] S3. Combine the global environmental threat prediction model with the multi-physics coupling equation to build a dynamic simulation engine, receive real-time sensor data streams, simulate the multi-physics coupling behavior of the pipeline network in extreme environments, and output simulation results of multi-dimensional performance indicators.
[0099] Furthermore, the output parameters of the global environmental threat prediction model are associated with the control terms of the multi-physics coupling equations to construct the initialization parameters of the dynamic simulation engine;
[0100] Specifically, the time derivative of the threat probability value output by the global environmental threat prediction model is multiplied by the Gaussian spatial attenuation kernel of the threat position, and the space-time grid density function is generated through space-time integration. The space-time grid density function is combined with the dynamic data assimilation weight function of the real-time sensor data to generate the real-time data assimilation weight function. The real-time data assimilation weight function is multiplied by the spatial gradient of the threat probability value output by the global environmental threat prediction model, and the product is used as the exogenous driving term of the revised fluid mechanics equation and thermodynamic energy equation. The initialization parameters of the dynamic simulation engine are constructed based on the initial distribution of the velocity field, the initial distribution of the pressure field, and the initial distribution of the temperature field in the revised fluid mechanics equation and the thermodynamic energy equation.
[0101] Build an adaptive spatiotemporal grid based on initialization parameters, and dynamically adjust the grid node density according to temperature and pressure changes in real-time sensor data streams;
[0102] Specifically, the time derivative of the threat probability value output by the global environmental threat prediction model is multiplied by the Gaussian attenuation kernel function of the threat location coordinates, and spatial integration is performed in the three-dimensional geometric space domain of the natural gas pipeline network to generate an adaptive spatiotemporal grid density function. The gradient amplitude of the temperature and pressure changes in the real-time sensor data stream is combined with the threat impact radius to generate a local grid refinement factor. The local grid refinement factor is multiplied point by point with the adaptive spatiotemporal grid density function, and the weight coefficient of the Gaussian attenuation kernel function is updated according to the timestamp. By dynamically adjusting the grid node density in the three-dimensional geometric space domain, high-resolution characterization of the threat diffusion path and the temperature and pressure change area is achieved, and a non-uniform adaptive spatiotemporal grid distribution fused with the real-time sensor data stream is output.
[0103] The adaptive space-time grid is constructed based on the initialization parameters, and the expression is:
[0104] ;
[0105] Where, Representing a 3D location in a natural gas pipeline network and the current time The adaptive space-time grid density function at , The geometric space domain representing the natural gas pipeline network, Representation of the three-dimensional geometric space domain of the natural gas pipeline network Perform integration, represents the natural exponential function, Represents the threat probability value output by the global environment threat prediction model, represents the coordinates of the threat location in the natural gas pipeline network, Indicates the threat impact radius, represents an integration over three-dimensional locations in a natural gas pipeline network.
[0106] The real-time sensor data stream is embedded into the multi-physics coupling equation through the Gaussian time domain kernel to generate the modified fluid mechanics equation and thermodynamics equation;
[0107] Specifically, all sensor nodes within the total number of sensor nodes are traversed, and the confidence weight of the sensor node is multiplied by the real-time sensor data and then divided by the product of the time attenuation coefficient and the Gaussian kernel normalization coefficient. The product result is multiplied by the integral result of the adaptive spatiotemporal grid density function in the time window to generate a fusion weight that integrates all real-time sensor data streams. The fusion weight is multiplied by the spatial gradient of the threat probability value output by the global environmental threat prediction model as the exogenous driving term of the modified fluid mechanics equation. The fusion weight is multiplied by the time derivative of the threat probability value output by the global environmental threat prediction model as the exogenous driving term of the modified thermodynamic energy equation. The modified fluid mechanics equation and thermodynamic energy equation of the fused real-time sensor data stream are output.
[0108] Generate the modified fluid mechanics equation and thermodynamics equation, the expression is:
[0109] ;
[0110] Where, Representing a 3D location in a natural gas pipeline network and the current time The fusion weight of all real-time sensor data streams at represents the sensor node index, represents the total number of sensor nodes, represents the sum of all sensor nodes, Represents a sensor node The confidence weight of Represents a sensor node At the current time Real-time data at Represents a sensor node The time decay coefficient, Indicates from arrive The points, Indicates the current time and historical moments The time difference, Representing a 3D location in a natural gas pipeline network and historical moments The adaptive space-time grid density function, Expressing gratitude for historical moments integral.
[0111] It should be noted that the sensor node The time attenuation coefficient is dynamically calibrated through noise analysis of historical sensor data. For example, the value range of high-frequency sensors is [1,5], and the value range of low-frequency sensors is [30,60].
[0112] Solve the modified fluid mechanics and thermodynamics equations, obtain the multi-physics coupling behavior of the pipeline network under extreme environments, calculate multi-dimensional performance indicators, and output simulation results.
[0113] Specifically, the finite volume method is used to discretize the spatial gradient terms of the velocity field vector, pressure field scalar, and temperature field scalar, and the implicit Euler method is used to discretize the time partial derivative terms. The spatial gradient or time derivative terms of the fusion weight and the threat probability value are substituted into the discrete equation as exogenous terms, and the nonlinear equation group is solved by the Newton-Raphson iteration method to obtain the velocity field distribution, pressure field distribution, and temperature field distribution of the current time step; based on the velocity field distribution, the maximum flow velocity of the natural gas pipeline network is calculated, the pressure fluctuation amplitude is calculated based on the pressure field distribution, and the temperature gradient amplitude is calculated based on the temperature field distribution; the spatial gradient and time derivative of the threat probability value are combined to generate multi-dimensional performance indicators; and the simulation results are output.
[0114] Solve the modified fluid mechanics equation, the expression is:
[0115] ;
[0116] Where, represents the fluid density, represents the velocity field vector, Represents the velocity field vector For the current time The partial derivative of Represents the velocity field vector The gradient, Represents the pressure field scalar The gradient, represents the pressure field scalar, represents the dynamic viscosity coefficient, Represents the gradient of the threat probability value output by the global environment threat prediction model.
[0117] Solve the modified thermodynamic equation, the expression is:
[0118] ;
[0119] Where, represents the temperature field scalar, Represents the temperature field scalar For the current time The partial derivative of Represents the temperature field scalar The gradient, represents the thermal diffusivity, Represents the threat probability value output by the global environment threat prediction model for the current time The partial derivative of .
[0120] It should be noted that the thermal diffusivity is calibrated by the inherent thermal physical parameters of the material. For common steel materials for natural gas pipelines, such as carbon steel, the value is .
[0121] Multi-physics coupling behavior includes velocity field, pressure field and temperature field behavior;
[0122] It should be noted that velocity field behavior refers to the velocity vector distribution of natural gas at each three-dimensional position in the pipeline network and its flow characteristics that change with time, including the combined effects of convective acceleration, viscous stress and external driving force.
[0123] Pressure field behavior refers to the pressure scalar distribution and its spatiotemporal evolution at each point in the pipeline network, reflecting the spatial correlation between pressure fluctuations and leakage risks under extreme environments.
[0124] Temperature field behavior refers to the temperature scalar distribution and dynamic change process of pipeline materials and fluids, which characterizes the synergistic effect of heat conduction, convection heat transfer and external heat drive.
[0125] Multi-dimensional performance indicators include safety indicators, efficiency indicators and corrosion rate indicators.
[0126] It should be noted that the safety index refers to a quantitative parameter generated by combining the gradient of the threat probability value and the pressure field fluctuation amplitude, which is used to evaluate the structural integrity risk level of the natural gas pipeline network under extreme environments.
[0127] The efficiency index refers to the transportation efficiency parameter calculated based on the velocity field distribution and the dynamic evolution of the temperature field, reflecting the transportation efficiency and energy loss ratio of natural gas per unit time in the pipeline network.
[0128] The corrosion rate index refers to the material degradation rate parameter constructed by the time derivative of the temperature field gradient and the threat probability value, which characterizes the average annual thinning of the pipeline wall thickness due to chemical corrosion and thermal stress.
[0129] S4. Based on the simulation results and real-time sensor data streams, a multi-objective fitness function is constructed, and control variables are generated through population evolution and dynamic strategy adjustment.
[0130] Furthermore, a multi-objective fitness function is constructed based on the simulation results. According to the real-time sensor data stream, the variance of each sensor data is calculated according to the preset time window to generate a variance vector;
[0131] It should be noted that the preset time window refers to a fixed time interval pre-set in the federated aggregation weight calculation and real-time sensor data stream processing, and the time interval is defined by the time window start timestamp and the time window end timestamp.
[0132] Specifically, multi-dimensional performance indicator data is extracted, the timestamp sequence of the real-time sensor data stream is divided according to the preset time window, the statistical variance of the safety indicator, efficiency indicator, and corrosion rate indicator in each time window is calculated, the variances of different time windows are sorted according to the sensor node index to generate a variance vector, and the variance vector corresponding to the multi-dimensional performance indicator is combined with the federated aggregation weight in a linear weighted manner to generate the optimal solution evaluation criterion of the multi-objective fitness function.
[0133] Initialize the mixed population through the multi-objective fitness function, perform non-dominated sorting on the individuals in the mixed population, and calculate the information entropy weight of the Pareto front solution set;
[0134] Specifically, the federal aggregation weight, safety index variance vector, efficiency index variance vector and corrosion rate index variance vector are used as genetic coding dimensions, and a set of candidate individuals that meet the federal aggregation weight normalization constraint is randomly generated. The multi-objective fitness function value of each candidate individual in terms of safety index, efficiency index and corrosion rate index is calculated. Based on the Pareto dominance relationship, the advantages and disadvantages of different candidate individuals in terms of multi-objective fitness function values are compared, and the non-dominated individuals are divided into the first frontier layer, and the individuals dominated by the individuals in the first frontier layer are divided into the second frontier layer, and so on to generate hierarchical ranking results. The neighborhood distribution density of each individual in the Pareto frontier solution set in the multi-objective fitness function value space is statistically analyzed, and the individual entropy value is calculated according to the distribution density. The individual entropy value is linearly combined with the federal aggregation weight and then normalized to generate the information entropy weight.
[0135] Screen the individuals of the mixed population according to the information entropy weight and perform the directed mutation operation of the variance vector;
[0136] Specifically, the normalized value of the linear combination of the information entropy weight and the federated aggregation weight is used as the selection probability. Roulette wheel selection is performed on individuals in the mixed population, retaining high-probability individuals and eliminating low-probability individuals. Based on the sparse distribution of the Pareto front solution set in the multi-objective fitness function value space, Gaussian random perturbations are applied to the variance vectors of the safety index, efficiency index, and corrosion rate index. The perturbation amplitude is inversely proportional to the information entropy weight. The perturbed variance vectors are then subjected to a federated aggregation weight normalization constraint check to generate a set of mutant individuals that meet the multi-objective optimization conditions.
[0137] Update the control variables and adjust the strategy through the reinforcement learning strategy network to generate a new generation of mixed population;
[0138] Specifically, the federal aggregation weight, safety index variance vector, efficiency index variance vector and corrosion rate index variance vector of the current mixed population individuals are input into the state space of the strategy network, and the strategy network outputs the action vector of the federal aggregation weight adjustment ratio, variance vector perturbation amplitude and direction. The action vector is cross- and mutated with the genetic code of the mixed population individuals to generate a set of candidate new individuals containing the federal aggregation weight correction term and variance vector offset. The candidate new individuals are substituted into the multi-objective fitness function to calculate the fitness values of the safety index, efficiency index and corrosion rate index. The Pareto front solution set is screened through non-dominated sorting to generate a new generation of mixed population.
[0139] The control variables are generated using the Pareto front solution set of the new generation of mixed populations.
[0140] Specifically, the optimal parameter combination of federal aggregation weight, safety index variance vector, efficiency index variance vector and corrosion rate index variance vector is extracted from the Pareto front solution set, the median of the federal aggregation weight is taken, the mean of the safety index variance vector, efficiency index variance vector and corrosion rate index variance vector are taken respectively, and then statistical aggregation is performed. The statistical aggregation result is substituted into the federal aggregation weight normalization constraint equation to generate the federal aggregation weight correction factor, and the federal aggregation weight correction factor and the variance vector mean are weightedly fused according to the multi-objective optimization conditions to output the control variable.
[0141] It should be noted that the control variables include federal aggregation weight control variables, safety index variance control variables, efficiency index variance control variables, and corrosion rate index variance control variables.
[0142] S5. Input the control variables into the pre-trained digital twin verification model, compare the residuals of the simulation results with the real-time sensor data stream, trigger the incremental learning mechanism, and update the global environmental threat prediction model.
[0143] Furthermore, the control variables are input into the pre-trained digital twin verification model to generate control variable simulation data;
[0144] Specifically, the federated aggregation weight control variable acts on the parameter update process of the global environmental threat prediction model. The safety index variance control variable, efficiency index variance control variable and corrosion rate index variance control variable are respectively combined with the exogenous driving terms of the multi-physics field coupling equation. The velocity field distribution, pressure field distribution and temperature field distribution are solved by the modified fluid mechanics equation and thermodynamics equation. The spatial gradient and time derivative of the threat probability value are substituted into the adaptive space-time grid density function to generate dynamic grid node density. The timestamps of the real-time sensor data stream are integrated and aligned based on the preset time window, and the control variable simulation data is output.
[0145] Calculate the residual between the control variable simulation data and the real-time sensor data stream. If the residual exceeds the preset threshold, the incremental learning mechanism is triggered to collect incremental training data sets of the real-time sensor data stream and the control variable simulation data.
[0146] It should be noted that the preset residual threshold is set based on the historical evolution error of the federal aggregation weight control variable, the statistical distribution characteristics of the safety index variance control variable and the efficiency index variance control variable, and the allowable deviation range of the material degradation of the corrosion rate index variance control variable. For example, the safety index residual threshold is 5%-15%, the efficiency index residual threshold is 3%-10%, the corrosion rate residual threshold is 1%-5%, and the comprehensive residual threshold is 8%-20%.
[0147] Specifically, within a preset time window, the root mean square error (RMS) of the control variable simulation data and the measured data of the corresponding sensor node in the real-time sensor data stream is calculated for each time stamp, and the RMS errors of each dimension are weighted averaged to generate a comprehensive residual. If the comprehensive residual exceeds the preset residual threshold, the incremental learning mechanism is triggered, and the real-time sensor data stream and control variable simulation data of the current time window are stored in chronological order as an incremental training data set.
[0148] The parameters of the global environmental threat prediction model are updated through the incremental training data set to generate an updated global environmental threat prediction model.
[0149] Specifically, the velocity field distribution, pressure field distribution, temperature field distribution and threat probability distribution in the incremental training data set are input together with the federal aggregation weight control variables, safety index variance control variables, efficiency index variance control variables and corrosion rate index variance control variables into the parameter optimization process of the global environmental threat prediction model. A joint loss function is constructed based on the exogenous driving terms of the modified fluid mechanics equation and thermodynamic energy equation. The stochastic gradient descent method is used to backpropagate the gradient update of the time derivative term and the spatial gradient term of the threat probability value of the global environmental threat prediction model. At the same time, the federal aggregation weight control variables are combined to perform constrained optimization on the exogenous driving terms of the multi-physics field coupling equation to generate an updated global environmental threat prediction model.
[0150] This embodiment also provides a computer device suitable for the simulation and optimization method of the natural gas industry system in a rough environment, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the simulation and optimization method of the natural gas industry system in a rough environment proposed in the above embodiment.
[0151] The computer device may be a terminal, comprising a processor, memory, a communication interface, a display, and an input device connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores an operating system and computer programs. The internal memory provides an environment for the operating system and computer programs stored in the non-volatile storage media. The communication interface of the computer device is used to communicate with external terminals via wired or wireless communication. Wireless communication may be achieved via Wi-Fi, a carrier network, NFC (near-field communication), or other technologies. The display of the computer device may be a liquid crystal display or an electronic ink display. The input device may be a touchscreen overlay on the display, buttons, a trackball, or a touchpad on the computer device housing, or an external keyboard, touchpad, or mouse.
[0152] This embodiment also provides a storage medium having a computer program stored thereon. When the program is executed by a processor, it implements the method for simulating and optimizing a natural gas industrial system in a rough environment as proposed in the above embodiment. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0153] In summary, the present invention achieves this by: generating a high-fidelity extreme environment dataset using a physically constrained diffusion model to improve the physical consistency of multi-field coupled simulations; eliminating the spatiotemporal heterogeneity of cross-node data and enhancing the generalization capability of the global threat prediction model based on a federated transfer learning framework based on adversarial feature alignment; and improving the real-time response accuracy and robustness of the natural gas industry system in extreme environments.
[0154] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. A method for simulating and optimizing a natural gas industrial system in a rough environment, characterized by: include, Collect environmental data, build a physical constraint diffusion model, and generate extreme environment data sets by embedding fluid mechanics equations and thermodynamics laws; Combining real sensor data from multiple gas field nodes, a federated transfer learning framework is pre-trained to eliminate cross-environment data distribution differences through adversarial feature alignment to build a global environmental threat prediction model. Combine the global environmental threat prediction model with the multi-physics coupling equation to build a dynamic simulation engine that receives real-time sensor data streams, simulates the multi-physics coupling behavior of the pipeline network in extreme environments, and outputs simulation results of multi-dimensional performance indicators; Based on simulation results and real-time sensor data streams, a multi-objective fitness function is constructed, and control variables are generated through population evolution and dynamic strategy adjustment; The control variables are input into the pre-trained digital twin verification model, and the residuals of the simulation results and real-time sensor data streams are compared to trigger the incremental learning mechanism and update the global environmental threat prediction model.
2. The method for simulating and optimizing a natural gas industrial system under a rough environment according to claim 1, characterized in that: The specific steps for generating the extreme environment dataset are as follows: Collect environmental data, perform normalization processing, generate a spatiotemporal continuous environmental data matrix, and construct a physical constraint diffusion model; Fluid mechanics equations and thermodynamics laws are embedded in the physical constrained diffusion model, and extreme environmental condition parameters are generated within the preset multi-field critical range through the Monte Carlo sampling method; Conduct adversarial sampling of parameters under extreme environmental conditions to generate multi-physics coupled datasets; Perform spatiotemporal alignment and noise filtering on multiphysics coupled datasets to generate extreme environment datasets.
3. The method for simulating and optimizing a natural gas industrial system under a rough environment according to claim 2, characterized in that: The preset multi-field critical ranges include a preset temperature threshold range, a pressure threshold range, and a corrosive gas concentration threshold range.
4. The method for simulating and optimizing a natural gas industrial system under a rough environment according to claim 3, characterized in that: The specific steps of constructing the global environmental threat prediction model are as follows: Perform spatiotemporal feature mapping on the real sensor data of each gas field node to generate dynamic feature projections; An adversarial distribution alignment loss function is constructed based on dynamic feature projection, and the feature differences between nodes are calculated using a Gaussian time-domain kernel. The adversarial discriminator and the dynamic feature projection layer are alternately trained using the adversarial distribution alignment loss function until the feature differences between nodes converge to a preset difference threshold. The federation aggregation weight is calculated based on the converged dynamic feature projection to build a global environment threat prediction model.
5. The method for simulating and optimizing a natural gas industrial system under a rough environment according to claim 4, characterized in that: The specific steps of outputting the simulation results of multi-dimensional performance indicators are as follows: Associating the output parameters of the global environmental threat prediction model with the control terms of the multi-physics coupling equations to construct the initialization parameters of the dynamic simulation engine; Build an adaptive spatiotemporal grid based on initialization parameters, and dynamically adjust the grid node density according to temperature and pressure changes in real-time sensor data streams; The real-time sensor data stream is embedded into the multi-physics coupling equation through the Gaussian time domain kernel to generate the modified fluid mechanics equation and thermodynamics equation; Solve the modified fluid mechanics and thermodynamics equations, obtain the multi-physics coupling behavior of the pipeline network under extreme environments, calculate multi-dimensional performance indicators, and output simulation results.
6. The method for simulating and optimizing a natural gas industrial system under a rough environment according to claim 5, characterized in that: The multi-physics field coupling behavior includes velocity field, pressure field and temperature field behavior; The multi-dimensional performance indicators include safety indicators, efficiency indicators and corrosion rate indicators.
7. The method for simulating and optimizing a natural gas industrial system under a rough environment according to claim 6, characterized in that: The specific steps of generating control variables through population evolution and dynamic strategy adjustment are as follows: Based on the simulation results, a multi-objective fitness function is constructed. According to the real-time sensor data stream, the variance of each sensor data is calculated according to the preset time window to generate a variance vector. Initialize the mixed population through the multi-objective fitness function, perform non-dominated sorting on the individuals in the mixed population, and calculate the information entropy weight of the Pareto front solution set; Screen the individuals of the mixed population according to the information entropy weight and perform the directed mutation operation of the variance vector; Update the control variables and adjust the strategy through the reinforcement learning strategy network to generate a new generation of mixed population; The control variables are generated using the Pareto front solution set of the new generation of mixed populations.
8. The method for simulating and optimizing a natural gas industrial system under a rough environment according to claim 7, characterized in that: The specific steps of updating the global environment threat prediction model are as follows: Input the control variables into the pre-trained digital twin verification model to generate control variable simulation data; Calculate the residual between the control variable simulation data and the real-time sensor data stream. If the residual exceeds the preset threshold, the incremental learning mechanism is triggered to collect incremental training data sets of the real-time sensor data stream and the control variable simulation data. The parameters of the global environmental threat prediction model are updated through the incremental training data set to generate an updated global environmental threat prediction model.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method for simulating and optimizing a natural gas industrial system under a rough environment according to any one of claims 1 to 8 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for simulating and optimizing a natural gas industrial system under a rough environment according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Simulation prediction method and device based on big data, equipment and storage medium
CN119066617A
Natural gas comprehensive operation management and control platform based on Internet of Things
CN119356454A