Pipeline medium leakage detection method, device and equipment, storage medium and product
By constructing a pipeline leakage detection mechanism model and data-driven model, combined with the Navi-Stokes equation, the problem of small leakage in the existing technology cannot be detected under variable working conditions, and high-precision and low-cost pipelines are achieved Minimal leak detection.
Patent Information
- Application Number
- CN202411266462.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2024-12-13
AI Technical Summary
The prior art cannot effectively detect tiny leakage of pipelines under variable operating conditions, resulting in insufficient detection accuracy.
By constructing a pipeline leakage detection mechanism model and data-driven model, using flow historical monitoring data and pipeline exit and inlet pressure data, combined with the Navi-Stokes equation, a medium dynamic relationship is constructed to realize the micropipe under variable operating conditions Leak detection.
It realizes high-precision detection of tiny pipeline leakage, reduces detection costs, is suitable for multi-working conditions, and does not require a large amount of computing resources.
Smart Images

Figure CN119123334A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of pipeline medium leakage detection, and in particular to a pipeline medium leakage detection method, device, electronic equipment, non-volatile storage medium and computer program product. Background Art
[0002] Pipelines are widely used in the transportation of gaseous and liquid media such as oil and natural gas due to their advantages of economy, safety, high efficiency and high reliability. During the use of pipelines, it is inevitable that the medium in the pipeline will leak due to its own material defects, welding defects or external reasons such as corrosion, fatigue, landslides and earthquakes. When the leakage of the medium reaches a certain level, it will not only cause economic losses, but also some transportation media such as natural gas will seriously affect the safety of life and property. This requires real-time monitoring of the pipeline status to detect pipeline medium leakage in time.
[0003] The pipeline medium leakage method in the current related technology cannot detect small leaks under certain working conditions, that is, it is impossible to achieve high-precision detection of pipeline medium leakage under variable working conditions. In view of this, in the case of variable pipeline operating environment, it is a technical problem that technicians in this field need to solve to achieve effective detection of small pipeline leaks. It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of this application, and therefore may include information that does not constitute prior art known to ordinary technicians in this field. Summary of the invention
[0004] The present application provides a pipeline medium leakage detection method, device, electronic equipment, non-volatile storage medium and computer program product, which can effectively detect small pipeline leaks under variable working conditions.
[0005] In order to solve the above technical problems, this application provides the following technical solutions:
[0006] On one hand, the present application provides a pipeline medium leakage detection method, comprising:
[0007] Based on the historical flow monitoring data and pipeline outlet pressure historical data as model feature values and the historical pipeline inlet pressure monitoring data as label values, a driving model training data set and a leak detection fine-tuning data set are constructed in advance, and a pipeline leak detection mechanism model is constructed according to the movement and stress conditions of the medium in the pipeline.
[0008] The pipeline leakage detection mechanism model is trained by using the driving model training data set to obtain a pipeline leakage detection data-driven model, and the medium leakage threshold is determined based on the difference between the inlet predicted historical pressure value of the pipeline leakage detection data-driven model and the corresponding pipeline inlet pressure historical monitoring data; and the pipeline leakage detection data-driven model is fine-tuned by using the leakage detection fine-tuning data set to obtain a pipeline medium leakage detection model under variable working conditions;
[0009] Obtain flow monitoring data of the inlet and outlet of the pipeline to be tested, pipeline outlet pressure monitoring data and pipeline inlet pressure monitoring data;
[0010] Inputting the flow monitoring data and the pipeline outlet pressure monitoring data into the pipeline medium leakage detection model under the variable working conditions to obtain the pipeline inlet predicted pressure value, and determining the difference between the pipeline inlet predicted pressure value and the pipeline inlet pressure monitoring data as the actual difference;
[0011] By comparing the actual difference value with the medium leakage threshold, it is determined whether there is leakage in the pipeline medium to be tested.
[0012] Exemplarily, the pipeline leakage detection mechanism model is constructed according to the movement and stress conditions of the medium in the pipeline, including:
[0013] The original motion relationship of the pipeline medium is determined by using the Navier-Stokes equation, and the medium dynamic relationship is obtained by integrating the original motion relationship along the medium flow direction;
[0014] Based on taking the pipeline pressure drop value as the mechanical energy loss caused by the pipeline medium overcoming the resistance and doing work in the medium dynamics relationship, and ignoring the pipeline medium flow velocity loss, a pipeline leakage detection mechanism model for representing the relationship between the pipeline inlet and outlet pressures and the medium mass flow rate is obtained.
[0015] Exemplarily, the step of using the driving model training data set to train the pipeline leakage detection mechanism model to obtain the pipeline leakage detection data driving model includes:
[0016] Dividing the driving model training data set into a driving model training sample set and a driving model test sample set according to a preset ratio;
[0017] Using the driving model training sample set to perform regression analysis on the pipeline leakage detection mechanism model, determine the model parameter values of the pipeline leakage detection mechanism model, and use it as the initially trained pipeline leakage detection data driving model;
[0018] The initially trained pipeline leakage detection data-driven model is tested using the driving model test sample set. If a comparison curve and a mean square error value of an output prediction value and a label value of the pipeline leakage detection data-driven model do not satisfy a first preset model iteration stop condition, the pipeline leakage detection mechanism model is repeatedly subjected to regression analysis until a comparison curve and a mean square error value of an output prediction value and a label value of the pipeline leakage detection data-driven model satisfy a first preset model iteration stop condition, thereby obtaining a trained pipeline leakage detection data-driven model.
[0019] Exemplarily, the method of constructing a driving model training data set and a leak detection fine-tuning data set based on flow history monitoring data and pipeline outlet pressure history data as model feature values and pipeline inlet pressure history monitoring data as label values in advance includes:
[0020] Determine a smoothing processing relationship according to the current data value to be processed, the last processed data value and a smoothing parameter; the smoothing parameter is a constant between 0±▽1 and 1±▽2;
[0021] Based on the smoothing processing relational expression, the flow rate historical monitoring data, the pipeline outlet pressure historical data, and the pipeline inlet pressure historical monitoring data are smoothed;
[0022] The driving model training dataset and the leak detection fine-tuning dataset are constructed using the smoothed flow historical monitoring data, the smoothed pipeline outlet pressure historical monitoring data, and the smoothed pipeline inlet pressure historical monitoring data.
[0023] Exemplarily, the method of fine-tuning the pipeline leakage detection data-driven model using the leakage detection fine-tuning data set to obtain a pipeline medium leakage detection model under variable working conditions includes:
[0024] Using the pipeline leakage detection data-driven model as a pre-trained model in transfer learning to obtain an initial pipeline medium leakage detection model;
[0025] Dividing the leak detection fine-tuning dataset into a leak detection fine-tuning training set and a leak detection fine-tuning test set;
[0026] Based on the fact that the test error of the initial pipeline medium leakage detection model remains unchanged during the fine-tuning process, the initial pipeline medium leakage detection model is fine-tuned using a leakage detection fine-tuning training set to obtain an initially fine-tuned pipeline medium leakage detection model;
[0027] The initially fine-tuned pipeline medium leakage detection model is tested using the driving model test sample set. If a comparison curve and a mean square error value of an output prediction value and a label value of the pipeline medium leakage detection model do not satisfy a second preset model iteration stop condition, the pipeline medium leakage detection model is repeatedly fine-tuned until a comparison curve and a mean square error value of an output prediction value and a label value of the pipeline medium leakage detection model satisfy a second preset model iteration stop condition, thereby obtaining a trained pipeline medium leakage detection model under variable working conditions.
[0028] Exemplarily, the method of determining the medium leakage threshold value based on the difference between the inlet predicted historical pressure value of the pipeline leakage detection data-driven model and the corresponding pipeline inlet pressure historical monitoring data includes:
[0029] Obtain multiple sets of flow rate historical monitoring data, pipeline outlet pressure historical data, pipeline inlet pressure historical monitoring data and actual leakage conditions under different historical working conditions;
[0030] Inputting the flow rate historical monitoring data and pipeline outlet pressure historical data under various historical working conditions into the pipeline leakage detection data-driven model to obtain the corresponding inlet predicted historical pressure value;
[0031] Based on the preset multiple sets of leakage prediction thresholds, determining whether leakage occurs according to the difference between the predicted historical pressure value of the inlet and the corresponding historical monitoring data of the pipeline inlet pressure, and obtaining a leakage prediction signal; the leakage prediction signal includes a leakage warning signal and a normal signal;
[0032] According to each leakage prediction signal and the corresponding actual leakage situation, the leakage detection rate value, leakage false alarm rate value and accuracy value under multiple sets of leakage prediction thresholds are statistically analyzed, and a threshold-false alarm rate / missing alarm rate curve is generated;
[0033] Based on the detection probability allowed interval, the detection probability allowed threshold interval is determined in the threshold-false alarm rate / missing alarm rate curve; based on the false alarm rate allowed interval, the false alarm allowed threshold interval is determined in the threshold-false alarm rate / missing alarm rate curve; the overlapping threshold interval of the detection probability allowed threshold interval and the false alarm allowed threshold interval is used as the medium leakage threshold interval, and the medium leakage threshold is determined according to the medium leakage threshold interval.
[0034] On the other hand, the present application provides a pipeline medium leakage detection device, including an inlet pressure sensor, an inlet flow sensor, an outlet pressure sensor, an outlet flow sensor, and a processor deployed on a computing device, which are deployed at both ends of the pipeline to be tested;
[0035] Wherein, the inlet pressure sensor, the inlet flow sensor, the outlet pressure sensor, and the outlet flow sensor are all connected to the processor, and are used to send the monitored pipeline inlet flow monitoring data, pipeline inlet pressure monitoring data, pipeline outlet flow monitoring data, and pipeline outlet pressure monitoring data to the processor;
[0036] The processor is used to implement the steps of the pipeline medium leakage detection method as described in any of the above items when executing the computer program stored in the memory.
[0037] The present application also provides an electronic device, comprising a processor, wherein the processor is configured to implement the steps of the pipeline medium leakage detection method as described in any of the preceding items when executing a computer program stored in a memory.
[0038] The present application also provides a non-volatile storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the pipeline medium leakage detection method as described in any of the preceding items are implemented.
[0039] Finally, the present application also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the pipeline medium leakage detection method as described in any of the preceding items.
[0040] The advantage of the technical solution provided by the present application is that the historical pressure and flow data collected at both ends of the pipeline are used to train the real-time transient mechanism model of the pipeline that describes the dynamic relationship of the pipeline medium, and a data-driven model is obtained to achieve the fusion of the mechanism and data-driven model. In order to make the model have a better leakage detection effect under variable working conditions of the pipeline, the data-driven model is used as a pre-training model and fine-tuned using fine-tuning samples, so as to obtain a model that can effectively detect small leaks in the pipeline under variable working conditions. The whole process only requires the arrangement of common pressure and flow sensors at the inlet and outlet of the pipeline, and the detection cost is low, which can achieve low-cost and high-precision pipeline small leak detection with multiple working conditions and few leakage samples.
[0041] In addition, the present application also provides corresponding implementation devices, electronic devices, non-volatile storage media and computer program products for the pipeline medium leakage detection method, which further makes the method more practical, and the devices, electronic devices, non-volatile storage media and computer program products have corresponding advantages.
[0042] The technical features mentioned above, the technical features to be mentioned below, and the technical features shown separately in the drawings can be combined with each other arbitrarily, as long as the combined technical features are not contradictory. All feasible feature combinations are technical contents clearly recorded in this application. Any of the multiple sub-features contained in the same sentence can be applied independently, and does not have to be applied together with other sub-features.
[0043] It should be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0045] Figure 1 A schematic diagram of a pipeline medium leakage detection method provided in this application;
[0046] Figure 2 A schematic diagram of a pipeline medium leakage detection model training process under variable working conditions in an exemplary application scenario provided in this application;
[0047] Figure 3 A schematic diagram of difference statistics in an exemplary application scenario provided by this application;
[0048] Figure 4 A statistical diagram of alarm signals in an exemplary application scenario provided by this application;
[0049] Figure 5 A schematic diagram of a flow chart for determining a medium leakage threshold in an exemplary application scenario provided by the present application;
[0050] Figure 6 A schematic diagram of another pipeline medium leakage detection method provided in this application;
[0051] Figure 7 A structural diagram of a specific implementation of the pipeline medium leakage detection device provided in this application;
[0052] Figure 8 A structural diagram of another specific implementation of the pipeline medium leakage detection device provided in the present application;
[0053] Fig. 9 A structural diagram of a specific implementation of the electronic device provided in this application. DETAILED DESCRIPTION
[0054] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below in conjunction with the accompanying drawings and specific embodiments. Among them, the terms "first" and "second" in the specification and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations of the two are intended to cover non-exclusive inclusions. The term "exemplary" means "used as an example, embodiment or illustrative". Any embodiment described here as "exemplary" is not necessarily interpreted as being superior or better than other embodiments.
[0055] Given that the pipeline medium leakage methods in the current related technologies cannot detect tiny leaks under certain working conditions, for example, the hardware-based leakage detection methods detect leaks through the sensor itself, such as the optical fiber method, acoustic method, thermal imaging method, magnetic flux leakage detection method, ultrasonic method, etc. Although there is no need to process and analyze the sensor data, the detection cost is often high and many methods cannot achieve real-time monitoring of the pipeline. Software-based pipeline leakage detection relies on computer systems to monitor changes in physical parameters such as flow, pressure, and temperature to determine the occurrence of leakage, such as model-based leakage detection methods and data-driven leakage detection methods. Among them, the real-time transient method predicts pipeline pressure and flow data through a model, and determines the occurrence of leakage by comparing with the measured values. This method has good tiny leak detection capabilities, but the complex real-time transient model usually brings a long response time, which seriously affects the efficiency of leak detection. For working conditions with high requirements for leak detection efficiency, this type of method is also not applicable.
[0056] Therefore, in order to solve the above problems, the present invention collects relevant monitoring data of the pipeline in real time under the condition of changeable pipeline operating environment, and trains a data-driven model according to the health monitoring data; a model capable of detecting small leaks in the pipeline under changeable working conditions is trained according to the data-driven model, and the relationship between the model-predicted inlet pressure value, the field-measured inlet pressure value and the optimal threshold value can be judged to achieve effective detection of small leaks in the pipeline. After introducing the technical scheme of the present application, various non-limiting embodiments of the present application are described in detail below. In order to better illustrate the present application, numerous specific details are given in the specific embodiments below. Those skilled in the art should understand that the present application can also be implemented without these specific details. In other examples, methods, means, components and circuits well known to technicians in the relevant field are not described in detail in order to highlight the main purpose of the present application.
[0057] See first Figure 1 , Figure 1A flow chart of a pipeline medium leakage detection method provided in this application, which may include the following contents:
[0058] S101: Preliminarily build a driving model training data set and a leak detection fine-tuning data set based on flow rate historical monitoring data and pipeline outlet pressure historical data as model feature values and pipeline inlet pressure historical monitoring data as label values, and build a pipeline leak detection mechanism model based on the movement and stress conditions of the medium in the pipeline.
[0059] In this step, the flow history monitoring data includes the pipeline inlet flow history monitoring data and the pipeline outlet flow history monitoring data. The flow history monitoring data, pipeline outlet pressure history data, and pipeline inlet pressure history monitoring data are historical pressure data and historical flow data collected by sensors deployed at the inlet and outlet of the pipeline to be tested. Of course, in order to obtain a high-precision and high-performance model, the more model training sample data sets within a certain range, the better. If the historical data of the pipeline to be tested cannot meet the scale of the model training data, historical data of pipelines with the same material, geometric parameters, deployment location, and transmission medium as the pipeline can also be collected. The driving model training data set is the training sample used to train the pipeline leakage detection mechanism model, and the leakage detection fine-tuning data set is the training sample for fine-tuning the pipeline leakage detection data-driven model. As for the number of samples contained in the two data sets and the division ratio of the training set, test set, and verification set during the model training process, it can be determined according to actual conditions, and the present invention does not impose any restrictions on this.
[0060] Among them, the pipeline leakage detection mechanism model is a real-time transient mechanism model of the pipeline, that is, it describes the relationship between various parameters of the pipeline. The parameters include but are not limited to the motion parameters and force parameters of the transported medium in the pipeline, which determines the characteristic values and label values required for the pipeline leakage detection data-driven model.
[0061] S102: Use the driving model training data set to train the pipeline leakage detection mechanism model to obtain the pipeline leakage detection data-driven model, and determine the medium leakage threshold based on the difference between the inlet predicted historical pressure value of the pipeline leakage detection data-driven model and the corresponding pipeline inlet pressure historical monitoring data; and use the leakage detection fine-tuning data set to fine-tune the pipeline leakage detection data-driven model to obtain the pipeline medium leakage detection model under variable working conditions.
[0062] In this step, any model training method can be used to train the model using training samples, which does not affect the implementation of the present invention. The pipeline leakage detection data-driven model is a trained pipeline leakage detection mechanism model, which is used to predict the pipeline inlet pressure value. For the convenience of description, the pipeline leakage detection data-driven model is defined as the inlet predicted historical pressure value after processing the historical data. The pipeline inlet pressure historical monitoring data is the pressure data at the pipeline inlet collected by the sensor at the same time as the input historical data. The medium leakage threshold of this step is a reference value for judging whether the pipeline medium is leaking. It can be the minimum value for measuring pipeline medium leakage, that is, if the difference between the predicted pressure value and the actual measured pressure value is greater than the pipeline medium leakage, then leakage occurs. Of course, it can be the maximum value for measuring that the pipeline medium has no leakage. If the difference between the predicted pressure value and the actual measured pressure value is less than the pipeline medium leakage, then no leakage occurs. The trained pipeline leakage detection data-driven model is used as a pre-training model. It only takes a small time cost and resource cost to use the fine-tuning sample to obtain a fine-tuned pipeline medium leakage detection model that is more suitable for the variable working conditions of the current environment. When the pipeline changes, it is only necessary to obtain a new small-scale leakage detection fine-tuning dataset to fine-tune the pipeline leakage detection data-driven model. This is not only conducive to improving the detection accuracy of pipeline leakage under different working conditions, but also can quickly obtain the pipeline leakage detection data-driven model without a lot of computing resources.
[0063] S103: Obtain flow monitoring data of the inlet and outlet of the pipeline to be tested, pipeline outlet pressure monitoring data, and pipeline inlet pressure monitoring data.
[0064] The flow monitoring data, pipeline outlet pressure monitoring data and pipeline inlet pressure monitoring data in this step are the on-site pressure data and flow data collected by sensors deployed at the outlet and inlet of the pipeline to be tested when pipeline leakage needs to be detected. Similarly, the flow monitoring data also includes the outlet flow monitoring data of the pipeline to be tested and the inlet flow monitoring data of the pipeline to be tested.
[0065] S104: Input the flow monitoring data and the pipeline outlet pressure monitoring data into the pipeline medium leakage detection model under variable working conditions to obtain the pipeline inlet predicted pressure value, and determine the difference between the pipeline inlet predicted pressure value and the pipeline inlet pressure monitoring data as the actual difference.
[0066] After the above steps obtain the field measured data of the pipeline to be tested, the flow monitoring data and the outlet pressure monitoring data of the inlet and outlet are used as the input of the pipeline medium leakage detection model under variable working conditions. The pipeline medium leakage detection model under variable working conditions processes the flow monitoring data and the pipeline outlet pressure monitoring data, and outputs the predicted pipeline inlet pressure, which is defined as the pipeline inlet predicted pressure value. For the convenience of distinction, the difference between the pipeline inlet predicted pressure value output by the pipeline medium leakage detection model under variable working conditions and the pipeline inlet pressure monitoring data of S103 is defined as the actual difference.
[0067] S105: Determine whether there is leakage in the pipeline medium to be tested by comparing the actual difference value with the medium leakage threshold.
[0068] In this step, if the medium leakage threshold is the minimum value for measuring whether the pipeline medium is leaking, when the actual difference is greater than or equal to the medium leakage threshold, it indicates that there is a leakage problem in the pipeline medium to be tested; when the actual difference is less than the medium leakage threshold, it indicates that there is no leakage problem in the pipeline medium to be tested.
[0069] In the technical solution provided by the present application, the historical pressure and flow data collected at both ends of the pipeline are used to train the real-time transient mechanism model of the pipeline that describes the dynamic relationship of the pipeline medium, and a data-driven model is obtained to achieve the fusion of the mechanism and data-driven model. In order to make the model have a better leakage detection effect under variable working conditions of the pipeline, the data-driven model is used as a pre-training model and fine-tuned using fine-tuning samples, so as to obtain a model that can effectively detect small leaks in the pipeline under variable working conditions. The whole process only requires the arrangement of common pressure and flow sensors at the inlet and outlet of the pipeline, and the detection cost is low, which can achieve low-cost and high-precision pipeline small leak detection with multiple working conditions and few leakage samples.
[0070] In the above embodiment, there is no limitation on how to construct the pipeline leakage detection mechanism model. In this embodiment, an exemplary implementation method of constructing the pipeline leakage detection mechanism model according to the movement and force conditions of the medium in the pipeline is provided, which may include the following contents:
[0071] The original motion relationship of the pipeline medium is determined by using the Navier-Stokes equations, and the medium dynamic relationship is obtained by integrating the original motion relationship along the medium flow direction; based on taking the pipeline pressure drop value as the mechanical energy loss caused by the pipeline medium overcoming the resistance and doing work in the medium dynamic relationship, and on the basis of ignoring the pipeline medium flow velocity loss, a pipeline leakage detection mechanism model is obtained to represent the relationship between the pipeline inlet and outlet pressures and the medium mass flow rate.
[0072] In this embodiment, the Navier-Stokes equation (NS equation) is used to describe the motion equation of momentum conservation of viscous incompressible fluid. In rectangular coordinates, the component form of the NS equation can be expressed as:
[0073]
[0074] In the formula, ρ is the fluid density, is the velocity vector, u, v, w are the velocity components of the fluid at the point (x, y, z) at time t, (x, y, z) is the coordinate value of the point in the rectangular coordinate system, p is the pressure, f is the external force per unit volume of fluid, if only gravity is considered, then f = ρg; constant μ is a constant, representing dynamic viscosity. For the case of Reynolds number Re ≥ 1, the viscosity term can be ignored compared with the acceleration term. At this time, the viscosity effect is limited to the boundary layer near the surface of the object, and outside the boundary layer, the behavior of the fluid is essentially the same as that of an inviscid fluid, so its flow field can be solved using the Euler equation. The Reynolds number calculation formula is Re = ρvL / u. Integrating the NS equation along the streamline can obtain the Bernoulli equation representing the medium dynamics relationship of the viscous fluid, that is, integrating the original motion relationship along the flow direction of the medium to obtain the medium dynamics relationship. The medium dynamics relationship can be expressed as:
[0075]
[0076] In the formula, subscript 1 represents the pipeline inlet, subscript 2 represents the pipeline outlet, and ρ is the density of the gas in kg / m 3 , v is the gas velocity, in m / s, t is the time, in s; x is the length of the pipeline, in m; p is the gas pressure, in MPa; z1, z2 are the heights of the two ends of the pipeline, in m; h f It is the mechanical energy loss caused by unit mass fluid overcoming resistance and doing work. For the transportation of natural gas in pipelines, the Reynolds number Re≥1, so the Bernoulli equation of viscous fluid can be used to simply describe the relationship between the various parameters of the pipeline. Among them, h f In terms of pressure loss, the pipeline pressure drop value calculated by the pipeline pressure drop relationship in this embodiment is used as the mechanical energy loss. The pipeline pressure drop relationship can be expressed as:
[0077]
[0078] Where ρ is the density of the gas, in kg / m 3 ; D is the inner diameter of the pipe, in meters; L is the length of the pipe, in meters, and M represents the mass flow rate.
[0079] Therefore, the Bernoulli equation for viscous fluid can be approximately expressed as:
[0080]
[0081] In order to facilitate calculation, the above relationship between medium dynamics can be simplified, and the simplified process can be:
[0082] First, we can shift the terms of the above relationship to get the following relationship:
[0083]
[0084] Multiplying both sides of the above relationship by ρ1, we can get the following relationship:
[0085]
[0086] Simplify the above formula and let: in in ρ, L, D, π, λ are all constants, so θ1 and θ2 can be considered as p1 and M 2 For the case where the velocity loss in the pipeline is low, it can be considered that v0 = v1 = v in the above formula, that is, ρ1(gz2-gz1)=θ0, which is the constant term θ0. Based on this, p1=θ1p2+θ2M can be used. 2 +θ0 represents the pipeline leakage detection mechanism model. Among them, θ0 is the constant term of the mechanism model, θ1, θ2 are p1 and M 2 The weight coefficient of .
[0087] As can be seen from the above, this embodiment constructs a pipeline leakage detection mechanism model through the Bernoulli equation and the pipeline pressure drop formula, which simply and accurately describes the pipeline medium dynamic relationship, which is conducive to improving the pipeline medium leakage detection accuracy and detection efficiency.
[0088] The above embodiment does not impose any limitation on the training process of the pipeline leakage detection data-driven model. Based on the above embodiment, the present invention also provides an exemplary implementation method of using a driving model training data set to train a pipeline leakage detection mechanism model to obtain a pipeline leakage detection data-driven model, which may include the following contents:
[0089] The driving model training data set is divided into a driving model training sample set and a driving model test sample set according to a preset ratio; the driving model training sample set is used to perform regression analysis on the pipeline leakage detection mechanism model to determine the model parameter values of the pipeline leakage detection mechanism model as the initially trained pipeline leakage detection data driven model; the driving model test sample set is used to test the initially trained pipeline leakage detection data driven model, and if the comparison curve and the mean square error value of the output prediction value and the label value of the pipeline leakage detection data driven model do not meet the first preset model iteration stop condition, the pipeline leakage detection mechanism model is repeatedly subjected to regression analysis until the comparison curve and the mean square error value of the output prediction value and the label value of the pipeline leakage detection data driven model meet the first preset model iteration stop condition, thereby obtaining a trained pipeline leakage detection data driven model.
[0090] In this embodiment, the outlet pressure value and the inlet and outlet flow value of the driving model training data set are used as model feature values, respectively represented by x1 and x2, and the inlet pressure value is used as the label value, represented by y. The number of samples can be represented by i. The driving model training data set includes a model feature set X and a label set Y, which can be represented as follows:
[0091]
[0092] Y={y1,y2,…y i}.
[0093] For example, the inlet and outlet pressure and flow data in the normal operation status data of the pipeline can be divided into a training set according to a ratio of 7:3. Test Set Of course, other ratios, such as 6:4, may also be used, which will not affect the implementation of the present invention, i = 0, 1, 2, ..., I; j = 0, 1, 2, ..., J. Application training data set Compared with the simplified real-time transient model, that is, the pipeline leakage detection mechanism model P1 = θ1P2 + θ2M 2 +θ0, and perform regression analysis, wherein the regression equation can be expressed by the following relationship. After regression analysis, the specific values of θ0, θ1, and θ2 can be determined.
[0094]
[0095] In the formula, bm represents the coefficient of the mth parameter in each group of function relations, yn represents the function value of the nth group, xmn represents the mth parameter in the nth group of function relations, ε n is the test error, which is independent of each other and obeys N(0,δ 2 ) distribution, m<n.
[0096] For example, in the process of training the pipeline leakage detection data-driven model of the present invention, the mean square error (MSE) can be used as the loss function, and the loss function relationship can be expressed as:
[0097]
[0098] In the formula, y i is the true value of the i-th sample, is the corresponding predicted value, and m is the total number of samples.
[0099] The first preset model iteration stop condition is a preset model training stop condition, for example, the number of iterations reaches a preset value or the model converges or the prediction accuracy reaches a preset accuracy threshold, which does not affect the implementation of the present invention. The trained pipeline leakage detection mechanism model is used as the pipeline leakage detection data driving model, that is, the parameter values θ0, θ1, θ2 determined when the first preset model iteration stop condition is met are substituted into P1=θ1P2+θ2M 2 +θ0, as the pipeline leakage detection data-driven model, in order to facilitate distinction, f(x1,x2) is used to represent P1, b1 represents θ1, b2 represents θ2, x1 represents P2, x2 represents M, and ε represents θ0, thereby obtaining the pipeline leakage detection data-driven model, which can be expressed as f(x1,x2)=x1b1+x2b2+ε.
[0100] From the above, it can be seen that this embodiment uses a multivariate regression algorithm to fit the mechanism model in combination with monitoring pressure and flow data to obtain a pipeline leakage detection data-driven model, thereby realizing the fusion of the mechanism and data-driven models, which is beneficial to improving the accuracy and efficiency of pipeline medium leakage detection.
[0101] In order to further improve the pipeline medium leakage detection accuracy, this embodiment also preprocesses the data collected by the sensor to minimize the model training problem caused by the sensor data error. The preprocessing process may include the following contents:
[0102] According to the current data value to be processed, the last processed data value and the smoothing parameter, the smoothing processing relation is determined. Based on the smoothing processing relation, the flow historical monitoring data, the pipeline outlet pressure historical data, and the pipeline inlet pressure historical monitoring data are smoothed; the driving model training data set and the leak detection fine-tuning data set are constructed using the smoothed flow historical monitoring data, the smoothed pipeline outlet pressure historical data, and the smoothed pipeline inlet pressure historical monitoring data.
[0103] In this embodiment, the smoothing parameter is a constant between 0±▽1 and 1±▽2. For example, any value between 0 and 1 can be selected. ▽1 and ▽2 are small fluctuation values, that is, they fluctuate between 0 and 1. For example, the relationship f can be used. i =αp i +(1-α)f i-1 , where α is the smoothing parameter, p t Indicates that the i-th data needs to be processed, f i Represents the data value after processing, f i-1 Represents the data value after the i-1th data is processed. The inlet and outlet pressure and flow data collected by the sensor under normal operation of the pipeline can be smoothed using the above relationship, and then the smoothed data can be used to construct a data set.
[0104] The above embodiment does not impose any limitation on the training process of the pipeline medium leakage detection model under variable working conditions. Based on the above embodiment, the present invention also provides an exemplary fine-tuning method of the pipeline medium leakage detection model under variable working conditions, which may include the following contents:
[0105] The pipeline leakage detection data-driven model is used as a pre-training model in transfer learning to obtain an initial pipeline medium leakage detection model; the leakage detection fine-tuning data set is divided into a leakage detection fine-tuning training set and a leakage detection fine-tuning test set; based on the fact that the test error of the initial pipeline medium leakage detection model remains unchanged during the fine-tuning process, the initial pipeline medium leakage detection model is fine-tuned using the leakage detection fine-tuning training set to obtain an initial fine-tuned pipeline medium leakage detection model; the initial fine-tuned pipeline medium leakage detection model is tested using the driving model test sample set, and if the comparison curve of the output prediction value and the label value of the pipeline medium leakage detection model and the mean square error value do not meet the second preset model iteration stop condition, the pipeline medium leakage detection model is repeatedly fine-tuned until the comparison curve of the output prediction value and the label value of the pipeline medium leakage detection model and the mean square error value meet the second preset model iteration stop condition, thereby obtaining a trained pipeline medium leakage detection model under variable working conditions.
[0106] In this embodiment, if Figure 2 As shown, in order to facilitate the distinction, f S (x1,x2) represents f(x1,x2), which is a pre-trained model in transfer learning, that is, the initial pipeline medium leakage detection model can be expressed as f S (x1,x2)=x1b1+x2b2+ε, the leakage detection fine-tuning dataset Divide the data into training sets according to the ratio of 3:7 or other ratios such as 4:6 With the test set The training set is used to fine-tune the initial pipeline medium leakage detection model. During the fine-tuning process, ε is frozen, that is, the ε value is not adjusted during the training process. Only b1 and b2 are fine-tuned to obtain b1 and b2 in the initial pipeline medium leakage detection model, respectively, and the ε value remains unchanged. The second preset model iteration stop condition is a preset model fine-tuning stop condition, for example, the number of iterations reaches a preset value, or the model converges, or the prediction accuracy reaches a preset accuracy threshold, which does not affect the implementation of the present invention. The fine-tuned initial pipeline medium leakage detection model is used as the pipeline medium leakage detection model, that is, the parameter values b1 and b2 determined when the second preset model iteration stop condition is met are substituted into f S (x1,x2)=x1b1+x2b2+ε, as the pipeline medium leakage detection model under variable working conditions. In order to facilitate the distinction, f T (x1,x2) represents f S (x1, x2), w1 represents b1, w2 represents b2, as a pipeline medium leakage detection model under variable working conditions, it can be expressed as f T (x1,x2)=x1w1+x2w2+ε.
[0107] From the above, it can be seen that this embodiment constructs a pipeline medium leakage detection model under variable working conditions based on a data-driven model combined with a transfer learning algorithm to realize pipeline micro leakage detection under variable working conditions, which can effectively improve the pipeline medium leakage detection accuracy and detection efficiency.
[0108] The above embodiment does not limit how to determine the medium leakage threshold. This embodiment also provides an exemplary implementation method for determining the medium leakage threshold based on the difference between the inlet predicted historical pressure value of the pipeline leakage detection data-driven model and the corresponding pipeline inlet pressure historical monitoring data, which may include the following contents:
[0109] Acquire multiple groups of flow historical monitoring data, pipeline outlet pressure historical data, pipeline inlet pressure historical monitoring data and actual leakage conditions under different historical working conditions; input the flow historical monitoring data and pipeline outlet pressure historical data under each historical working condition into the pipeline leakage detection data-driven model to obtain the corresponding inlet predicted historical pressure value; based on the preset multiple groups of leakage prediction thresholds, determine whether leakage occurs according to the difference between the inlet predicted historical pressure value and the corresponding pipeline inlet pressure historical monitoring data, and obtain a leakage prediction signal; according to each leakage prediction signal and the corresponding actual leakage condition, calculate the leakage detection rate value, leakage false alarm rate value and accuracy value under multiple groups of leakage prediction thresholds, and generate a threshold-false alarm rate / missing alarm rate curve; determine the detection probability allowed threshold interval in the threshold-false alarm rate / missing alarm rate curve based on the detection probability allowed interval, determine the false alarm allowed threshold interval in the threshold-false alarm rate / missing alarm rate curve based on the false alarm rate allowed interval, use the overlapping threshold interval of the detection probability allowed threshold interval and the false alarm allowed threshold interval as the medium leakage threshold interval, and determine the medium leakage threshold according to the medium leakage threshold interval.
[0110] In this embodiment, the leakage prediction signal includes two types: leakage warning signal and normal signal. Multiple leakage prediction thresholds can be pre-set, that is, under each leakage prediction threshold, it is judged whether the pipeline leaks or not based on the output of the pipeline leakage detection data-driven model. The difference between the historical monitoring data of the pipeline inlet pressure and the output of the pipeline leakage detection data-driven model in each group of data under each working condition is counted, such as Figure 3 As shown, the type of leakage prediction signal is calculated based on different leakage prediction thresholds, that is, whether a leakage warning signal or a normal signal is generated, such as Figure 4 As shown in the figure, according to the leakage prediction signals and the corresponding actual leakage conditions, the following situations can be divided: when the pipeline leaks, the model generates an alarm, that is, generates a leakage warning signal, which is recorded as N A ; The pipeline does not leak, and the model does not alarm, that is, it generates a normal signal, which is recorded as N B ; If the pipeline leaks and the model does not give an alarm, it is recorded as N C ; The pipeline does not leak, and the model alarm is recorded as N D For example, the relationship The leak detection rate POD can be calculated by the relationship Calculate the leakage false alarm rate value POFC, through the relationship Calculate the accuracy value. Draw the threshold-false alarm rate / missing alarm rate curve based on POD / POFC according to the analysis results, such as Figure 5As shown, the threshold-false alarm rate / missing alarm rate curve includes the POD curve and the POFC curve, and the acceptable range of POD and POFC is obtained, that is, the detection probability allowable interval and the false alarm rate allowable interval, so that the threshold range of POD in the detection probability allowable interval is the detection probability allowable threshold interval, and the threshold range of POFC in the false alarm rate allowable interval is the false alarm allowable threshold interval. The threshold interval that satisfies both the detection probability allowable threshold interval and the false alarm allowable threshold interval is selected as the optimal threshold interval, that is, the overlapping threshold interval of the detection probability allowable threshold interval and the false alarm allowable threshold interval is the medium leakage threshold interval, and any value in the optimal threshold interval is selected as the medium leakage threshold. If it is greater than the medium leakage threshold, a leakage alarm is issued.
[0111] As can be seen from the above, this embodiment fits the POD / POFC-threshold curve by determining the POD and POFC values of different thresholds under historical working conditions. According to the distribution of the curve, a threshold interval that satisfies the acceptable range of POD and POFC is selected as the optimal threshold interval, and any value in the optimal threshold interval is selected as the leakage alarm threshold, which effectively improves the leakage detection accuracy.
[0112] In order to make those skilled in the art more clearly understand the technical solution of the present invention, the present invention also provides an exemplary embodiment for realizing the detection of small leakage of pipeline medium under variable working conditions. Figure 6 , which may include the following:
[0113] Step 1: Perform data smoothing on the inlet and outlet pressure and flow rate data collected by the sensor under normal operation of the pipeline.
[0114] Step 2: Take the outlet pressure and flow rate as the model characteristic values, recorded as x1 and x2 respectively, and the inlet pressure as the label value, recorded as y.
[0115] Step 3: Divide the inlet and outlet pressure and flow data of the pipeline normal operation status data processed in step 1 into a training set in a ratio of 7:3 Test Set i=0, 1, 2,···,I; j=0,1,2,···,J.
[0116] Step 4: Apply the training dataset And the pipeline leakage detection mechanism model P0=θ1P1+θ2M 2 +θ0, perform regression analysis to determine the specific values of θ0, θ1, and θ2.
[0117] Step 5: The loss function in the training process of the pipeline leakage detection mechanism model adopts Mean Squared Error (MSE).
[0118] Step 6: Use the divided test set data to test the trained pipeline leakage detection data-driven model. The test method is to observe whether the comparison curve between the predicted value and the true value and the MSE are less than 1×10 -6 If the comparison curve between the predicted value and the true value is not ideal or the MSE value is not less than 1×10 -6 , then repeat the above steps until the ideal effect is achieved; otherwise, the training ends and the model parameters θ0, θ1, θ2 are output.
[0119] Step 7: Obtain the pipeline leakage detection data-driven model f(x1,x2)=x1b1+x2b2+ε.
[0120] Step 8: Let f(x1,x2) in step 7 above be f S (x1, x2), as the pre-trained model in transfer learning, to obtain the initial pipeline medium leakage detection model f S (x1,x2)=x1b1+x2b2+ε.
[0121] Step 9: Get new working condition data The data is divided into training sets in a ratio of 3:7. With the test set Application N T Perform training and fine-tuning on fS(x1, x2). During the fine-tuning process, ε is frozen and only b1 and b2 are fine-tuned to obtain f T b1, b2 in (x1,x2).
[0122] Step 10: The loss function in the training process of the initial pipeline medium leakage detection model adopts the mean square error.
[0123] Step 11: Apply the method shown in step 6 to determine the optimal parameters of the model and obtain the model after transfer learning, that is, the pipeline medium leakage detection model under variable working conditions f T (x1,x2)=x1w1+x2w2+ε.
[0124] Step 12: Obtain POD and POFC values under ten different thresholds under a certain working condition.
[0125] Among them, in the threshold alarm signal, the signal types can be divided into: pipeline leakage, model alarm, denoted as N A ; The pipeline does not leak and the model does not alarm, which is recorded as N B ; If the pipeline leaks and the model does not give an alarm, it is recorded as N C ; The pipeline does not leak, and the model alarm is recorded as N D The expressions of POD, POFC and accuracy are as follows:
[0126]
[0127]
[0128]
[0129] Step 13: Draw a leakage detection threshold curve based on POD / POFC according to the analysis results of step 12, and select any value in the optimal threshold range as the leakage alarm threshold.
[0130] Step 14: Predict the pipeline inlet pressure according to the pipeline medium leakage detection model of step 11, calculate the difference between the pipeline inlet pressure and the measured pressure data, and take the absolute value of the difference as the final calculation result.
[0131] Step 15: Determine the occurrence of leakage by comparing the difference in step 14 with the threshold in step 13. When the difference is greater than the threshold, it is considered that leakage has occurred.
[0132] As can be seen from the above, this embodiment collects the pressure and flow data of the pipeline inlet and outlet by deploying pressure and flow sensors at both ends of the pipeline, constructs the pipeline real-time transient mechanism model according to the Bernoulli equation, determines the characteristic values and label values required for the data-driven model, and realizes the fusion of the mechanism and data-driven model; the pipeline real-time transient mechanism model is fitted by using the data under normal working conditions of the pipeline, combined with the multivariate regression algorithm, to construct the pipeline leakage detection data-driven model. At the same time, in order to make the model still have a good leakage detection effect under variable working conditions of the pipeline, the pipeline leakage detection data-driven model is used as the pre-training model to apply the pre-training fine-tuning technology to complete the construction of the pipeline medium leakage detection model under variable working conditions. The optimal threshold interval selection method based on the leakage detection probability and the leakage false alarm rate is introduced. By determining the POD and POFC values of different thresholds under a certain working condition, the POD / POFC-threshold curve is fitted. According to the distribution of the curve, the threshold interval that satisfies the acceptable range of POD and POFC is selected. This is the optimal threshold interval of the model, and any value in the optimal threshold interval is selected as the leakage alarm threshold. Finally, by calculating the absolute value difference between the model value and the measured value and comparing it with the selected threshold, when the difference is greater than the threshold, it is considered that a leak has occurred. This method can achieve low-cost and high-precision pipeline micro-leak detection with multiple working conditions and few leakage samples by arranging common pressure and flow sensors at the inlet and outlet of the pipeline.
[0133] It should be noted that there is no strict order of execution between the steps in this application. As long as they comply with the logical order, these steps can be executed simultaneously or in a certain preset order. Figure 1 and Figure 6 This is just a schematic and does not mean that this is the only execution order.
[0134] The present application also provides a corresponding device for the pipeline medium leakage detection method, which further makes the method more practical. Among them, the device can be described from the perspective of functional modules and hardware. The pipeline medium leakage detection device provided by the present application is introduced below. The device is used to implement the pipeline medium leakage detection method provided by the present application. In this embodiment, the pipeline medium leakage detection device may include or be divided into one or more program modules, and the one or more program modules are stored in a storage medium and executed by one or more processors to complete the pipeline medium leakage detection method disclosed in Example 1. The program module referred to in this application refers to a series of computer program instruction segments that can complete specific functions, which is more suitable for describing the execution process of the pipeline medium leakage detection device in the storage medium than the program itself. The following description will specifically introduce the functions of each program module of this embodiment. The pipeline medium leakage detection device described below and the pipeline medium leakage detection method described above can be referred to in correspondence with each other.
[0135] From the perspective of functional modules, see Figure 7 , Figure 7 This is a structural diagram of a pipeline medium leakage detection device provided in the present application under a specific implementation mode, and the device may include:
[0136] The model training module 701 is used to construct a driving model training data set and a leakage detection fine-tuning data set in advance based on the flow history monitoring data and the pipeline outlet pressure history data as model feature values and the pipeline inlet pressure history monitoring data as label values, and to construct a pipeline leakage detection mechanism model according to the movement and stress conditions of the medium in the pipeline; to train the pipeline leakage detection mechanism model using the driving model training data set to obtain a pipeline leakage detection data-driven model, and to fine-tune the pipeline leakage detection data-driven model using the leakage detection fine-tuning data set to obtain a pipeline medium leakage detection model under variable working conditions.
[0137] The threshold determination module 702 is used to determine the medium leakage threshold based on the difference between the inlet predicted historical pressure value of the pipeline leakage detection data-driven model and the corresponding pipeline inlet pressure historical monitoring data.
[0138] The field data acquisition module 703 is used to obtain the flow monitoring data of the inlet and outlet of the pipeline to be tested, the pipeline outlet pressure monitoring data and the pipeline inlet pressure monitoring data.
[0139] The leakage detection module 704 is used to input the flow monitoring data and the pipeline outlet pressure monitoring data into the pipeline medium leakage detection model under variable working conditions, obtain the pipeline inlet predicted pressure value, and determine the difference between the pipeline inlet predicted pressure value and the pipeline inlet pressure monitoring data as the actual difference. By comparing the actual difference with the medium leakage threshold, it is determined whether there is leakage in the pipeline medium to be tested.
[0140] The above-mentioned pipeline medium leakage detection device is described from the perspective of functional modules. This embodiment is also based on the hardware perspective. Figure 8 , Figure 8 This is a structural diagram of a pipeline medium leakage detection device provided in the present application under a specific implementation mode, and the device may include:
[0141] The pipeline medium leakage detection device includes an inlet pressure sensor 81, an inlet flow sensor 82, an outlet pressure sensor 83, an outlet flow sensor 84 deployed at both ends of the pipeline to be tested, and a processor deployed on a computing device 85.
[0142] Among them, the inlet pressure sensor 81, the inlet flow sensor 82, the outlet pressure sensor 83, and the outlet flow sensor 84 are all connected to the processor, and are used to send the monitored pipeline inlet flow monitoring data, pipeline inlet pressure monitoring data, pipeline outlet flow monitoring data, and pipeline outlet pressure monitoring data to the processor; the inlet pressure sensor 81 and the outlet pressure sensor 83 can use any device or device that can sense the pipeline pressure signal to be tested and can convert the pressure signal into a usable output electrical signal according to a certain rule, and the inlet flow sensor 82 and the outlet flow sensor 84 can use any device that can measure the flow of the pipeline medium or fluid (usually liquid or gas) to be tested, so as to monitor the rate, volume or quality of the fluid passing through the pipeline or pipeline system. The processor is used to execute the computer program stored in the memory to implement the steps of the pipeline medium leakage detection method mentioned in any of the above embodiments.
[0143] Furthermore, the present application also provides an electronic device, which is described from a hardware perspective. Fig. 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application in one implementation manner. Fig. 9 As shown, the electronic device includes a memory 90 for storing a computer program; and a processor 91 for implementing the steps of the pipeline medium leakage detection method mentioned in any of the above embodiments when executing the computer program.
[0144] Among them, the processor 91 in this embodiment and the above-mentioned embodiment may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the processor 91 may also be a controller, a microcontroller, a microprocessor or other data processing chip. The processor 91 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 91 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 91 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 91 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0145] The memory 90 may include one or more computer-readable storage media, which may be non-transitory. The memory 90 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash storage devices. The memory 90 may be an internal storage unit of an electronic device in some embodiments, such as a hard disk of a server. The memory 90 may also be an external storage device of an electronic device in other embodiments, such as a plug-in hard disk equipped on a server, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. Further, the memory 90 may also include both an internal storage unit of an electronic device and an external storage device. The memory 90 may not only be used to store application software and various types of data installed in the electronic device, such as: the code of the program in the process of executing the pipeline medium leakage detection method, but also be used to temporarily store data that has been output or is to be output. In this embodiment, the memory 90 is at least used to store the following computer program 901, wherein, after the computer program is loaded and executed by the processor 91, the relevant steps of the pipeline medium leakage detection method disclosed in any of the aforementioned embodiments can be implemented. In addition, the resources stored in the memory 90 may also include an operating system 902 and data 903, and the storage method may be temporary storage or permanent storage. The operating system 902 may include Windows, Unix, Linux, etc. The data 903 may include but is not limited to data corresponding to the pipeline medium leakage detection result.
[0146] In some embodiments, the electronic device may further include a display screen 92, an input / output interface 93, a communication interface 94 or a network interface, a power supply 95 and a communication bus 96. Among them, the display screen 92 and the input / output interface 93 such as a keyboard belong to the user interface, and the optional user interface may also include a standard wired interface, a wireless interface, etc. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device, etc. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface. The communication interface 94 may optionally include a wired interface and / or a wireless interface, such as a WI-FI interface, a Bluetooth interface, etc., which are generally used to establish a communication connection between the electronic device and other electronic devices. The communication bus 96 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig. 9 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0147] Those skilled in the art will understand that Fig. 9 The structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, for example, it may also include a sensor 97 for realizing various functions.
[0148] It is understandable that if the pipeline medium leakage detection in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile storage medium. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the relevant technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes but is not limited to: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), electrically erasable programmable ROM, register, hard disk, multimedia card, card-type memory (such as SD or DX memory, etc.), magnetic memory, removable disk, CD-ROM, magnetic disk or optical disk, etc. Various media that can store program codes. Based on this, the present invention also provides a non-volatile storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of pipeline medium leakage detection recorded in any of the above embodiments are performed.
[0149] It is understandable that if the pipeline medium leakage detection in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, the computer software product does not need to be stored in a physical storage medium. For example, it can be directly transmitted to a computer or other device with information processing capabilities through a wired network or a wireless network to perform all or part of the steps of the methods of various embodiments of the present invention. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the relevant technology or all or part of the technical solution can be embodied in the form of a software product. Based on this, the present invention also provides a computer program product that stores a computer program. When the computer program is executed by a processor, the steps of pipeline medium leakage detection are as described in any of the above embodiments.
[0150] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the hardware disclosed in the embodiments, including devices and electronic devices, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method part.
[0151] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0152] The above is a detailed introduction to a pipeline medium leakage detection method, device, electronic device, non-volatile storage medium and computer program product provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of the present application. It should be pointed out that based on the embodiments in the present application, for ordinary technicians in this technical field, all other embodiments obtained without creative work are within the scope of protection of the present application. Without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the present application.
Claims
1. A pipeline medium leakage detection method, characterized in that: include: Based on the historical flow monitoring data and pipeline outlet pressure historical data as model feature values and the historical pipeline inlet pressure monitoring data as label values, a driving model training data set and a leak detection fine-tuning data set are constructed in advance, and a pipeline leak detection mechanism model is constructed according to the movement and stress conditions of the medium in the pipeline. The pipeline leakage detection mechanism model is trained by using the driving model training data set to obtain a pipeline leakage detection data-driven model, and the medium leakage threshold is determined based on the difference between the inlet predicted historical pressure value of the pipeline leakage detection data-driven model and the corresponding pipeline inlet pressure historical monitoring data; and the pipeline leakage detection data-driven model is fine-tuned by using the leakage detection fine-tuning data set to obtain a pipeline medium leakage detection model under variable working conditions; Obtain flow monitoring data of the inlet and outlet of the pipeline to be tested, pipeline outlet pressure monitoring data and pipeline inlet pressure monitoring data; Inputting the flow monitoring data and the pipeline outlet pressure monitoring data into the pipeline medium leakage detection model under the variable working conditions to obtain the pipeline inlet predicted pressure value, and determining the difference between the pipeline inlet predicted pressure value and the pipeline inlet pressure monitoring data as the actual difference; By comparing the actual difference value with the medium leakage threshold, it is determined whether there is leakage in the pipeline medium to be tested.
2. The pipeline medium leakage detection method according to claim 1, characterized in that: The pipeline leakage detection mechanism model is constructed according to the movement and stress conditions of the medium in the pipeline, including: The original motion relationship of the pipeline medium is determined by using the Navier-Stokes equation, and the medium dynamic relationship is obtained by integrating the original motion relationship along the medium flow direction; Based on taking the pipeline pressure drop value as the mechanical energy loss caused by the pipeline medium overcoming the resistance and doing work in the medium dynamics relationship, and ignoring the pipeline medium flow velocity loss, a pipeline leakage detection mechanism model for representing the relationship between the pipeline inlet and outlet pressures and the medium mass flow rate is obtained.
3. The pipeline medium leakage detection method according to claim 1, characterized in that: The method of using the driving model training data set to train the pipeline leakage detection mechanism model to obtain the pipeline leakage detection data driving model includes: Dividing the driving model training data set into a driving model training sample set and a driving model test sample set according to a preset ratio; Using the driving model training sample set to perform regression analysis on the pipeline leakage detection mechanism model, determine the model parameter values of the pipeline leakage detection mechanism model, and use it as the initially trained pipeline leakage detection data driving model; The initially trained pipeline leakage detection data-driven model is tested using the driving model test sample set. If a comparison curve and a mean square error value of an output prediction value and a label value of the pipeline leakage detection data-driven model do not satisfy a first preset model iteration stop condition, the pipeline leakage detection mechanism model is repeatedly subjected to regression analysis until a comparison curve and a mean square error value of an output prediction value and a label value of the pipeline leakage detection data-driven model satisfy a first preset model iteration stop condition, thereby obtaining a trained pipeline leakage detection data-driven model.
4. The pipeline medium leakage detection method according to claim 1, characterized in that: The method of constructing a driving model training dataset and a leak detection fine-tuning dataset based on flow history monitoring data and pipeline outlet pressure history data as model feature values and pipeline inlet pressure history monitoring data as label values in advance includes: Determine a smoothing processing relationship according to the current data value to be processed, the last processed data value and a smoothing parameter; the smoothing parameter is a constant between 0±▽1 and 1±▽2; Based on the smoothing processing relational expression, the flow rate historical monitoring data, the pipeline outlet pressure historical data, and the pipeline inlet pressure historical monitoring data are smoothed; The driving model training dataset and the leak detection fine-tuning dataset are constructed using the smoothed flow historical monitoring data, the smoothed pipeline outlet pressure historical monitoring data, and the smoothed pipeline inlet pressure historical monitoring data.
5. The pipeline medium leakage detection method according to claim 1, characterized in that: The method of fine-tuning the pipeline leakage detection data-driven model using the leakage detection fine-tuning data set to obtain a pipeline medium leakage detection model under variable working conditions includes: Using the pipeline leakage detection data-driven model as a pre-trained model in transfer learning to obtain an initial pipeline medium leakage detection model; Dividing the leak detection fine-tuning dataset into a leak detection fine-tuning training set and a leak detection fine-tuning test set; Based on the fact that the test error of the initial pipeline medium leakage detection model remains unchanged during the fine-tuning process, the initial pipeline medium leakage detection model is fine-tuned using a leakage detection fine-tuning training set to obtain an initially fine-tuned pipeline medium leakage detection model; The initially fine-tuned pipeline medium leakage detection model is tested using the driving model test sample set. If a comparison curve and a mean square error value of an output prediction value and a label value of the pipeline medium leakage detection model do not satisfy a second preset model iteration stop condition, the pipeline medium leakage detection model is repeatedly fine-tuned until a comparison curve and a mean square error value of an output prediction value and a label value of the pipeline medium leakage detection model satisfy a second preset model iteration stop condition, thereby obtaining a trained pipeline medium leakage detection model under variable working conditions.
6. The pipeline medium leakage detection method according to any one of claims 1 to 5, characterized in that: The method of determining the medium leakage threshold value based on the difference between the inlet predicted historical pressure value of the pipeline leakage detection data-driven model and the corresponding pipeline inlet pressure historical monitoring data includes: Obtain multiple sets of flow rate historical monitoring data, pipeline outlet pressure historical data, pipeline inlet pressure historical monitoring data and actual leakage conditions under different historical working conditions; Inputting the flow rate historical monitoring data and pipeline outlet pressure historical data under various historical working conditions into the pipeline leakage detection data-driven model to obtain the corresponding inlet predicted historical pressure value; Based on the preset multiple sets of leakage prediction thresholds, determining whether leakage occurs according to the difference between the predicted historical pressure value of the inlet and the corresponding historical monitoring data of the pipeline inlet pressure, and obtaining a leakage prediction signal; the leakage prediction signal includes a leakage warning signal and a normal signal; According to each leakage prediction signal and the corresponding actual leakage situation, the leakage detection rate value, leakage false alarm rate value and accuracy value under multiple sets of leakage prediction thresholds are statistically analyzed, and a threshold-false alarm rate / missing alarm rate curve is generated; Based on the detection probability allowed interval, the detection probability allowed threshold interval is determined in the threshold-false alarm rate / missing alarm rate curve; based on the false alarm rate allowed interval, the false alarm allowed threshold interval is determined in the threshold-false alarm rate / missing alarm rate curve; the overlapping threshold interval of the detection probability allowed threshold interval and the false alarm allowed threshold interval is used as the medium leakage threshold interval, and the medium leakage threshold is determined according to the medium leakage threshold interval.
7. A pipeline medium leakage detection device, characterized in that: It includes an inlet pressure sensor, an inlet flow sensor, an outlet pressure sensor, an outlet flow sensor, and a processor deployed on a computing device, which are deployed at both ends of the pipeline to be tested; Wherein, the inlet pressure sensor, the inlet flow sensor, the outlet pressure sensor, and the outlet flow sensor are all connected to the processor, and are used to send the monitored pipeline inlet flow monitoring data, pipeline inlet pressure monitoring data, pipeline outlet flow monitoring data, and pipeline outlet pressure monitoring data to the processor; The processor is used to implement the steps of the pipeline medium leakage detection method according to any one of claims 1 to 6 when executing the computer program stored in the memory.
8. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the processor is used to implement the steps of the pipeline medium leakage detection method according to any one of claims 1 to 6 when executing a computer program stored in the memory.
9. A non-volatile storage medium, characterized in that: The non-volatile storage medium stores a computer program, and when the computer program is executed by the processor, the steps of the pipeline medium leakage detection method according to any one of claims 1 to 6 are implemented.
10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the steps of the pipeline medium leakage detection method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Gas transmission pipeline leakage detection system and method suitable for multiple state changes
CN106015951A
Water supply network leakage alarm threshold selection method based on time sequence monitoring data analysis
CN110119853A
Heat exchanger virtual-real fusion fault diagnosis method and system
CN113158494A
Method for automatically maintaining and improving hydraulic model of water distribution network and for controlling operation of water distribution network using maintained hydraulic model
CN118056161A
Method and apparatus for detecting a leak in a double pipe
US20100126250A1
Cited By
Intelligent explosion-proof pressure-relief hydrogen storage cylinder and control method thereof
CN119755512A
Method for determining pipeline leakage point location based on dimension analysis and CFD simulation
CN119826116A
A method for determining a pipe leakage point based on dimensional analysis and CFD simulation
CN119826116B
Method for predicting natural gas flow of multiphase flow fluctuating pipeline based on dichotomy
CN120951287A
IABP safety disc diaphragm leakage detection method, device, equipment and medium
CN121117576A
