Real-time detection method and system for oil and gas transportation pipeline based on data-model combined driving
By combining a hybrid model of fluid dynamics model with a particle swarm-radial basis neural network, the problem of uncertainty and poor interpretability of model parameters in pipeline leakage detection is solved, and higher detection accuracy and real-time performance are achieved.
Patent Information
- Application Number
- CN202410653402.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-24
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2044-05-24
AI Technical Summary
In the prior art, when a single model or data method detects pipeline leakage, the model parameters are highly uncertain and poor interpretability, resulting in low detection accuracy.
Combining fluid dynamics models with particle swarm-radial basis neural networks, a hybrid model is established, and pipeline flow is described through flow, momentum and energy equations, and radial basis neural network parameters are optimized using particle swarms, and model training and verification is combined with experimental data sets to detect pipeline leakage in real time.
It improves the accuracy and real-timeness of pipeline model solving, solves the inaccurate results caused by ignoring energy equations in traditional methods, and the problem of insufficient labeled sample data in data-driven methods, achieving higher detection accuracy and real-time response capabilities.
Smart Images

Figure CN120449380A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of pipeline leakage detection methods, and in particular to a real-time detection method and system for oil and gas transportation pipelines based on data-model joint drive. Background Art
[0002] Leaks in oil and gas pipelines not only result in a huge waste of energy, but also pose a serious threat to safety, further damaging human health and property. Therefore, pipeline fault detection is crucial to ensuring safe pipeline operation. Pipeline leak detection methods can be broadly categorized as non-technical, hardware-based, and software-based. Non-technical methods primarily involve visual inspection, the use of tracer elements, and special sound screening methods. However, these methods are difficult to control in terms of detection frequency, and detection accuracy depends on the experience and skills of the inspector. Hardware-based methods are costly and cannot be easily and economically installed in existing underground pipelines.
[0003] Software-based methods can be broadly categorized into two categories: model-based and data-driven. Model-based methods are simple and low-cost, but their performance depends heavily on model parameters and sensor accuracy. Model parameters are subject to uncertainty due to inaccurate information such as changes in fluid properties, the environment, process conditions, and pipeline characteristics. Existing data-driven methods, on the other hand, are highly data-dependent, requiring a large amount of labeled and balanced data types and exhibiting poor interpretability. This is due to the low transparency of deep learning models, which often lack the trust of field personnel. Summary of the Invention
[0004] The technical problems to be solved by the present invention are:
[0005] In order to solve the problem of high uncertainty of model parameters and poor interpretability when using a single model or data method to detect pipeline leakage, resulting in low detection accuracy.
[0006] The present invention is to solve the above technical problems using the following technical solutions:
[0007] The present invention provides a real-time detection method for oil and gas transportation pipelines based on data-model joint drive, comprising the following steps:
[0008] S100, establishing a fluid dynamics model of the pipeline and setting relevant parameters of the pipeline;
[0009] S200, establishing the pipeline model involved in step S100 in the software, and setting the same internal boundary conditions and initial conditions of the pipeline as those of the actual pipeline;
[0010] S300, constructing a hybrid model based on the particle swarm-radial basis function neural network and the pipeline model obtained in step S200, including training the particle swarm-radial basis function neural network model parameters, and then using a test data set to verify the pipeline outlet pressure output by the hybrid model to evaluate the generalization ability of the hybrid model;
[0011] S400. Use the actual pipeline inlet pressure data as the input parameter of the hybrid model built in step S300, and the output parameter is the predicted pipeline outlet pressure. The pipeline condition is judged according to the difference between the predicted pipeline outlet pressure and the actual pipeline outlet pressure. When the difference exceeds the set threshold and the frequency of occurrence is higher than the set threshold, the system outputs a leakage warning; otherwise, the system outputs a normal instruction.
[0012] Furthermore, in step S100, the fluid dynamics model includes a flow equation, a momentum equation, and an energy equation.
[0013] The flow equation is:
[0014]
[0015] Where v is the flow velocity of the fluid in the pipe, t is the sampling time, x is the position variable of the pipe, A is the cross-sectional area of the pipe, and ρ is the density of the fluid in the pipe;
[0016] The momentum equation is:
[0017]
[0018] Where D is the inner diameter of the pipe, θ is the angle between the pipe and the horizontal plane, and f is the friction coefficient of the pipe;
[0019] The energy equation is:
[0020]
[0021] Where H is enthalpy, e is internal energy, g is acceleration due to gravity, Δh is the pipe height, and Q is the heat exchange rate between unit mass of gas and the surrounding environment.
[0022] Furthermore, in step S200, it specifically includes:
[0023] First, a visual pipeline geometry consistent with the set parameters is constructed according to the dynamic equation provided in step S100;
[0024] Then, define the various parts of this geometry, including the pipe inlet, pipe outlet, pipe wall, fluid inside the pipe, adaptive meshing, and setting boundary conditions;
[0025] Finally, the pressure value at the pipeline outlet is calculated using the simulation software solver.
[0026] Furthermore, in step S300, specifically, when constructing the hybrid model, it is necessary to prepare an experimental data set to obtain an experimental data set of negative pressure wave signals under normal and leakage conditions, and the experimental data set includes a training data set, a verification data set, a test data set and a simulated actual data set.
[0027] Furthermore, when training the parameters of the particle swarm-radial basis function neural network model, the training dataset is input into the constructed radial basis function neural network, and the particle swarm algorithm is used to optimize the radial basis function neural network structural parameters, including the neuron connection weights, the center and width of the radial basis function; then the verification dataset is sent to the hybrid model, the parameters of the particle swarm-optimized radial basis function neural network are adjusted, and finally the test dataset is input into the hybrid model to evaluate the generalization ability of the hybrid model.
[0028] Furthermore, in step S400, the set value includes a threshold value of a difference between the predicted outlet pressure and the actual outlet pressure and a frequency threshold value.
[0029] Furthermore, when the difference P2 between the predicted outlet pressure P1 and the actual outlet pressure meets the following conditions: P1(1-5%)≤P2≤P1(1+5%), a normal signal is output; when P1(1-5%)>P2 or P2>P1(1+5%), a leakage alarm signal is output.
[0030] A real-time detection system for oil and gas transportation pipelines based on data-model joint drive is provided. The system has program modules corresponding to the above steps and executes the steps in the above-mentioned real-time detection method for oil and gas transportation pipelines based on data-model joint drive during operation.
[0031] A computer-readable storage medium stores a computer program configured to implement the steps of a real-time detection method for oil and gas transportation pipelines based on data-model joint drive when called by a processor.
[0032] Compared with the prior art, the present invention has the following beneficial effects:
[0033] The present invention provides a real-time detection method and system for oil and gas transportation pipelines based on data-model joint drive. The method detects pipeline leaks by combining a pipeline fluid dynamics model with a particle swarm-radial basis function neural network. The method solves the problem of ignoring the energy equation in traditional mathematical modeling methods based on the fluid dynamics model, thereby improving the accuracy of pipeline model solution. In order to solve the problem of unreasonable grid when calculating the fluid dynamics model on the simulation software Ansys Fluent platform, a particle swarm-radial basis function neural network model is introduced to process the solution of the fluid dynamics model, making it more accurate. The present invention also conducted experimental verification, and the results showed that compared with traditional methods, this method has better accuracy and real-time performance. The hybrid model studied not only solves the problem of inaccurate results caused by ignoring the energy equation in the traditional model method, but also solves the problem of insufficient labeled sample data and long labeling time in the traditional artificial intelligence method. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 This is a flow chart of a real-time detection method for oil and gas transportation pipelines based on data-model joint drive in an embodiment of the present invention;
[0035] Figure 2 A pipeline model diagram constructed based on computational fluid dynamics in an embodiment of the present invention;
[0036] Figure 3 Schematic diagram of a pipeline leakage detection process based on a model-data joint driven method in an embodiment of the present invention;
[0037] Figure 4 Schematic diagram of the application process of leak detection based on the hybrid model in an embodiment of the present invention;
[0038] Figure 5 1 is a comparison chart of the outlet pressure prediction results when the pipeline is in a normal state under different algorithms in an embodiment of the present invention;
[0039] Figure 6 This is a comparison chart of the outlet pressure prediction results when a pipeline leaks under different algorithms in an embodiment of the present invention. DETAILED DESCRIPTION
[0040] In the description of the present invention, it should be noted that the terminology in each embodiment, such as "up", "down", "front", "back", "left", "right", etc., which indicate directions, are only for simplifying the description of the positional relationship based on the drawings in the specification, and do not mean that the referred elements and devices must be operated in accordance with the specific directions and defined operations and methods and structures in the specification. Such directional nouns do not constitute a limitation to the present invention.
[0041] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0042] Specific implementation plan 1: Combined Figures 1 to 4 As shown, the present invention provides a real-time detection method for oil and gas transportation pipelines based on data-model joint drive, comprising the following steps:
[0043] S100: Establish a fluid dynamics model of the pipeline and set relevant parameters of the pipeline, including:
[0044] The fluid dynamics model includes flow equation, momentum equation and energy equation.
[0045] The flow equation is:
[0046]
[0047] Where v is the flow velocity of the fluid in the pipe, t is the sampling time, x is the position variable of the pipe, A is the cross-sectional area of the pipe, and ρ is the density of the fluid in the pipe;
[0048] The momentum equation is:
[0049]
[0050] Where D is the inner diameter of the pipe, θ is the angle between the pipe and the horizontal plane, and f is the friction coefficient of the pipe;
[0051] The energy equation is:
[0052]
[0053] Where H is enthalpy, e is internal energy, g is acceleration due to gravity, Δh is the pipe height, and Q is the heat exchange rate between unit mass of gas and the surrounding environment;
[0054] S200: Establish the pipeline model involved in step S100 and set the same internal boundary conditions and initial conditions as the actual pipeline, specifically including:
[0055] First, a visual pipeline geometry consistent with the set parameters is constructed according to the dynamic equation provided in step S100;
[0056] Then, define the parts of this geometry, combining Figure 2 As shown, it includes the pipe inlet, pipe outlet, pipe wall, fluid in the pipe, adaptive meshing and setting boundary conditions;
[0057] Adaptive meshing here means dynamically changing the mesh structure within the computational area based on the actual computational needs and the characteristics of the problem. In computational areas where physical quantities vary dramatically, fine meshes with smaller spatial scales are used for computation; in areas where physical quantities vary slowly, coarse meshes with larger spatial scales are used for computation, thereby improving computational efficiency.
[0058] Boundary conditions refer to the need to define points, surfaces, or volumes after building the geometric model of the pipeline. In this embodiment, the geometric model defines the pipeline wall as aluminum, the fluid area of the geometric model as air, and defines the inlet and outlet locations and the value of the inlet pressure.
[0059] Finally, the solver calculates the pressure value at the pipe outlet;
[0060] S300: Build a hybrid model based on a particle swarm-radial basis function neural network and train the particle swarm-radial basis function neural network model parameters. Then, use a test dataset to verify the pipeline outlet pressure output by the hybrid model and evaluate the generalization ability of the model. Specifically,
[0061] After building a natural gas pipeline CFD model, when an inappropriate grid factor is used to mesh the natural gas pipeline CFD model, the output results will produce small errors. That is, the quality of the grid affects the numerical calculation results of the pipeline model. Even if adaptive meshing is performed within the software, errors may occur in the results due to the poor quality of individual grids. Therefore, the PSO-RBF model is introduced to improve it. The PSO-RBF model is a particle swarm-radial basis function neural network model. Specifically,
[0062] S310. Prepare an experimental data set to obtain an experimental data set of negative pressure wave signals under normal and leakage conditions. The experimental data set is divided into a training data set, a validation data set, a test data set, and a simulated actual data set. The training data set and the validation data set are both composed of a large number of normal negative pressure wave signals, which are used to train the parameters in the PSO-RBF model and check the status of the model. The test data set is composed of some standard signals and leakage signals, which are used to evaluate the generalization ability of the model and avoid overfitting. The simulated actual data set simulating real scenes contains a large number of standard signals and leakage signals, which are used to evaluate the application effect of the model.
[0063] S320, in the training and validation process, including: sending the training data set to the hybrid model to train the PSO-RBF neural network parameters, including width, weight value and center of mass; then sending the validation data set to the CFD-PSO-RBF model to adjust some inappropriate parameters in the network, such as the number of neurons; finally, inputting the test data set into the hybrid model to evaluate the generalization ability of the hybrid model;
[0064] Combine Figure 1The model training process is as follows: first, the inlet pressure value under the specified working conditions is input into the inlet end of the established pipeline model, and the iterative calculation is performed until the pipeline flow model tends to be stable; secondly, the inlet pressure of the natural gas pipeline model is set to a variable function that conforms to the inlet pressure change law of the training data set; then, the outlet pressure value generated after the iterative convergence of the transient model and the outlet pressure value in the training data set are sent to the PSO-RBF neural network to train its parameters; the training process is as follows: first, the parameters in the PSO-RBF neural network model are trained using the training data set, wherein some parameters in the neural network (for example, the number of neurons) need to be adjusted according to experience; then, the inappropriate parameters in the neural network (including the number of neurons) are adjusted using the validation data set to avoid overfitting; finally, the generalization ability of the model is evaluated using the test data set. The evaluation process is to select a small amount of data to experiment with the trained model to test the prediction effect of the trained hybrid model;
[0065] S400, combined Figure 1 In the model application process, the actual pipeline inlet pressure data is used as the input parameter of the hybrid model built in step S320 to predict the pipeline outlet pressure. The pipeline condition is judged based on the difference between the predicted outlet pressure and the actual outlet pressure. When the difference exceeds the set threshold and the occurrence frequency is higher than the set value, the system outputs a leakage warning; otherwise, the system outputs a normal instruction.
[0066] The set values here include the difference threshold between the predicted outlet pressure and the actual outlet pressure and the frequency threshold. When the difference between the predicted outlet pressure and the actual outlet pressure exceeds the preset threshold and the frequency of occurrence is also higher than the frequency threshold, it is determined that the pipeline has a leak; otherwise, the pipeline is determined to be normal;
[0067] Combine Figure 4 As shown, when the difference P2 between the predicted outlet pressure P1 and the actual outlet pressure meets P1(1-5%)≤P2≤P1(1+5%), a normal signal is output; when P1(1-5%)>P2 or P2>P1(1+5%), a leakage alarm signal is output.
[0068] Specific implementation scheme 2: The present invention provides a real-time detection system for oil and gas transportation pipelines based on data-model joint drive. The system has a program module corresponding to the above steps, and executes the steps in the above-mentioned real-time detection method for oil and gas transportation pipelines based on data-model joint drive during operation.
[0069] The other combinations and connection relationships of this embodiment are the same as those of the first embodiment.
[0070] Specific implementation scheme three: The present invention provides a computer-readable storage medium, which stores a computer program. The computer program is configured to implement the steps of a real-time detection method for oil and gas transportation pipelines based on data-model joint drive when called by a processor.
[0071] The other combinations and connection relationships of this embodiment are the same as those of the first embodiment.
[0072] Simulation experiment
[0073] The oil and gas pipeline laboratory platform of the Artificial Intelligence Energy Research Institute of Northeast Petroleum University was used to collect 3,900 sets of data. Each set of data was 1,024 characters long, including 3,200 sets of normal data and 700 sets of leakage data. The platform was built to simulate the natural gas pipeline in the laboratory and establish a PSO-RBF model.
[0074] The performance of the CFD-PSO-RBF model proposed in this invention was evaluated by comparing it with the standard RBF model, the CFD-RBF model, and the PSO-RBF model. The CFD-PSO-RBF model is a hybrid model. When the network parameters remain the same, two groups of test data (normal group and leakage group) are taken out to compare different algorithms. Figure 5 and Figure 6 As can be seen, the CFD-PSO-RBF model demonstrates relatively stable and accurate results compared to other algorithms. Error analysis was performed on 400 data sets using different algorithms. The comparative experimental results of the different algorithms are shown in Table 1. The smaller the MAE value, the more accurately the model reflects the actual error in the predicted values and the more accurately the prediction model describes the experimental data. Table 1 clearly shows that the hybrid model performs well across the 400 test data sets.
[0075] Table I: Comparative experimental results
[0076]
[0077] Under the same criteria, the runtimes of the 1DCNN, CPSO-RBF, PSO-RBF, and CFD-PSO-RBF models were verified. It is noteworthy that the outlet pressure of the pipeline fluid dynamics model is predicted based on the changes in the preset inlet pressure value before the operating conditions. Therefore, the runtime of the hybrid model (CFD-PSO-RBF) of the present invention does not include the time spent running within the pipeline fluid dynamics model. The results are shown in Table 2, showing that the hybrid model (CFD-PSO-RBF) also runs in a shorter time than other conventional models.
[0078] Table 2 Running time of different models
[0079]
[0080] Although the present invention is disclosed as above, the scope of protection disclosed by the present invention is not limited thereto. Those skilled in the art of the present invention may make various changes and modifications without departing from the spirit and scope of the present invention, and these changes and modifications will fall within the scope of protection of the present invention.
Claims
1. A real-time detection method for oil and gas transportation pipelines based on data-model joint drive, characterized in that: The following steps are involved: S100, establishing a fluid dynamics model of the pipeline and setting relevant parameters of the pipeline; S200, establishing the pipeline model involved in step S100 in the software, and setting the same internal boundary conditions and initial conditions of the pipeline as those of the actual pipeline; S300, constructing a hybrid model based on the particle swarm-radial basis function neural network and the pipeline model obtained in step S200, including training the particle swarm-radial basis function neural network model parameters, and then using a test data set to verify the pipeline outlet pressure output by the hybrid model to evaluate the generalization ability of the hybrid model; S400. Use the actual pipeline inlet pressure data as the input parameter of the hybrid model built in step S300, and the output parameter is the predicted pipeline outlet pressure. The pipeline condition is judged according to the difference between the predicted pipeline outlet pressure and the actual pipeline outlet pressure. When the difference exceeds the set threshold and the frequency of occurrence is higher than the set threshold, the system outputs a leakage warning; otherwise, the system outputs a normal instruction.
2. The method for real-time detection of oil and gas pipelines based on data-model joint drive according to claim 1 is characterized by: In step S100, the fluid dynamics model includes a flow equation, a momentum equation, and an energy equation. The flow equation is: Where v is the flow velocity of the fluid in the pipe, t is the sampling time, x is the position variable of the pipe, A is the cross-sectional area of the pipe, and ρ is the density of the fluid in the pipe; The momentum equation is: Where D is the inner diameter of the pipe, θ is the angle between the pipe and the horizontal plane, and f is the friction coefficient of the pipe; The energy equation is: Where H is enthalpy, e is internal energy, g is acceleration due to gravity, Δh is the pipe height, and Q is the heat exchange rate between unit mass of gas and the surrounding environment.
3. The method for real-time detection of oil and gas pipelines based on data-model joint drive according to claim 2 is characterized by: In step S200, specifically including: First, a visual pipeline geometry consistent with the set parameters is constructed according to the dynamic equation provided in step S100; Then, define the various parts of this geometry, including the pipe inlet, pipe outlet, pipe wall, fluid inside the pipe, adaptive meshing, and setting boundary conditions; Finally, the pressure value at the pipeline outlet is calculated using the simulation software solver.
4. The method for real-time detection of oil and gas pipelines based on data-model joint drive according to claim 3 is characterized by: In step S300, specifically, when constructing the hybrid model, it is necessary to prepare an experimental data set to obtain an experimental data set of negative pressure wave signals under normal and leakage conditions, and the experimental data set includes a training data set, a verification data set, a test data set and a simulated actual data set.
5. The method for real-time detection of oil and gas pipelines based on data-model joint drive according to claim 4 is characterized by: When training the parameters of the particle swarm-radial basis function neural network model, the training dataset is input into the constructed radial basis function neural network, and the particle swarm algorithm is used to optimize the radial basis function neural network structural parameters, including the neuron connection weights, the center and width of the radial basis function; then the verification dataset is sent to the hybrid model, the parameters of the particle swarm-optimized radial basis function neural network are adjusted, and finally the test dataset is input into the hybrid model to evaluate the generalization ability of the hybrid model.
6. The method for real-time detection of oil and gas pipelines based on data-model joint drive according to claim 5 is characterized by: In step S400, the set value includes a threshold value of a difference between the predicted outlet pressure and the actual outlet pressure and a frequency threshold value.
7. The method for real-time detection of oil and gas pipelines based on data-model joint drive according to claim 6 is characterized by: When the difference P2 between the predicted outlet pressure P1 and the actual outlet pressure meets the following conditions: P1(1-5%)≤P2≤P1(1+5%), a normal signal is output; when P1(1-5%)>P2 or P2>P1(1+5%), a leakage alarm signal is output.
8. A real-time detection system for oil and gas pipelines based on data-model joint drive, characterized by: The system has a program module corresponding to the steps of any one of claims 1 to 7, and executes the steps of the above-mentioned data-model jointly driven oil and gas pipeline real-time detection method when running.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is configured to implement the steps of the real-time detection method for oil and gas transportation pipelines based on data-model joint drive according to any one of claims 1 to 7 when called by a processor.
Citation Information
Patent Citations
Gas pipeline leakage rate prediction method based on physical model driven machine learning
CN115164115A
Improved 1DCNN oil and gas pipeline information physical fusion system leakage detection method
CN116659767A
Artificial intelligence assisted production advisory system and method
US20210222552A1