A machine learning based gas release valve flow prediction method and system

By employing machine learning methods and a distributed architecture, the problem of real-time accuracy in monitoring the flow of gas vent valves was solved, achieving high-precision flow prediction and accumulation, thereby improving the safety and energy efficiency of the gas transmission system.

CN123049534APending Publication Date: 2026-11-06SHANGHAI FIORENTINI GAS EQUIP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611300069.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-26
Publication Date
2026-11-06

AI Technical Summary

Technical Problem

Existing gas vent valve flow monitoring methods are difficult to achieve real-time and accurate monitoring under complex operating conditions, resulting in the inability to quantify vent flow, lack of data support for supply and demand difference analysis, and difficulty in tracing abnormal vents, which makes it difficult to meet the requirements of refined operation and safety management.

Method used

A machine learning-based method for predicting the flow of gas vent valves is adopted. Through data acquisition, preprocessing, feature extraction, construction of basic prediction models, and incremental learning mechanisms, the method achieves high-precision real-time prediction of instantaneous flow and accurate accumulation of total flow. Combined with a distributed architecture, it enables automated monitoring and early warning of anomalies throughout the entire process.

Benefits of technology

It achieves high-precision real-time prediction and accumulation of gas vent valve flow, reduces vent waste, improves energy utilization, reduces the accident rate, enhances system safety, and provides a replicable intelligent upgrade solution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123049534A_ABST
    Figure CN123049534A_ABST
Patent Text Reader

Abstract

The application discloses a kind of gas diffusion valve flow prediction method and system based on machine learning, it is related to gas intelligent monitoring field.The method includes: deploying differential pressure sensor in diffusion valve pipeline, collecting pressure difference and flow sample;Sample is executed abnormal filtering, robust standardization and feature extraction;Compare a variety of regression algorithms, select gradient boosting tree and optimize hyperparameter, build basic prediction model;Configure hierarchical incremental learning mechanism, automatically carry out incremental training or full amount retraining according to intelligent trigger logic;Real-time pressure difference is input into updated model, and instantaneous flow is output, and total flow is accumulated based on sliding time window.The system adopts edge-model-cloud three-level architecture, realizes data acquisition, real-time inference, total amount statistics and abnormal early warning.The application has high prediction accuracy, fast response, can adapt to dynamic working condition, effectively solves the problem that diffusion flow is difficult to accurately measure.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent monitoring and machine learning application technology for gas equipment, specifically to a method and system for predicting the flow of gas vent valves based on machine learning, which is applicable to real-time flow prediction, total flow statistics, and anomaly warning of gas vent valves in gas transmission systems in the chemical and energy industries. Background Technology

[0002] In gas transmission systems, gas venting valves are core equipment ensuring the safe and stable operation of the system, undertaking the crucial functions of overpressure relief and system pressure stabilization. Accurate monitoring of their instantaneous flow rate and cumulative total flow rate directly affects gas energy utilization and system operational safety. However, due to the special operating conditions, the industry has long lacked suitable flow metering equipment, resulting in a management blind spot of "not counting venting flow." Even if flow meters could be installed on the gas venting pipe, practical engineering projects would face issues related to accuracy and maintenance.

[0003] Traditional methods for monitoring the flow of gas vent valves primarily rely on physical measuring devices such as flow meters. However, the accuracy of these devices in complex flow fields is easily affected by fluid disturbances and equipment aging, and they also suffer from response lag, making it difficult to meet the demands for real-time and accurate flow monitoring under complex operating conditions. Therefore, existing technologies have the following problems:

[0004] 1) Installation conditions are limited, making it impossible to install a flow meter:

[0005] Insufficient straight pipe section: The vent pipe is usually short and compact, making it difficult to meet the requirements of vortex flow meters, orifice plates and other flow meters for straight pipe sections before and after the pipe, resulting in unstable flow field and decreased measurement accuracy.

[0006] Limited installation space: The vent pipe is usually located at the top or side of the pressure regulating station, where the space is small, which makes the installation, wiring and maintenance of the flow meter difficult.

[0007] 2) Disadvantages of installing a flow meter:

[0008] Intermittent, pulsating flow: The vent valve does not release continuously, but rather releases instantaneously after the pressure accumulates to a threshold. Each discharge is small and lasts for a very short time. This pulsating flow poses a severe challenge to the response speed and low flow detection capabilities of many flow meters, easily leading to "missed readings" or "no readings".

[0009] Low medium pressure: The pressure at the end of the vent pipe is close to atmospheric pressure, which is far below the rated operating pressure of the flow meter. When the operating pressure is lower than the lower limit pressure range of the flow meter, there may be flow but no metering.

[0010] 3) Maintenance costs: Regular cleaning of accumulated fluid inside the meter, replacement of worn parts, and regular calibration are required, resulting in high maintenance costs.

[0011] Therefore, developing a gas vent valve flow prediction method and system with high prediction accuracy, adaptability to dynamic operating conditions, and high degree of integration has become the key to solving existing technical problems. Summary of the Invention

[0012] This invention addresses the aforementioned problems with existing gas venting valves. Under complex operating conditions such as overpressure relief, maintenance venting, and abnormal leakage, existing valves commonly suffer from issues such as the inability to accurately monitor venting flow in real time and the difficulty in automatically calculating cumulative venting volume. This results in unquantifiable venting losses, a lack of data support for supply and demand analysis, and difficulties in tracing the source of abnormal venting, ultimately failing to meet the requirements of refined operation and safety management. This invention provides a machine learning-based method and system for predicting gas venting valve flow. It achieves high-precision real-time prediction of instantaneous flow and accurate accumulation of total venting flow. Simultaneously, the model can continuously absorb new data and adapt to changes in operating conditions, maintaining long-term prediction accuracy. Furthermore, through an integrated system, it enables fully automated monitoring and anomaly early warning throughout the entire process.

[0013] This invention provides a machine learning-based method for predicting the flow rate of a gas vent valve, comprising the following steps:

[0014] Step S1, Data Acquisition and Dataset Construction: Differential pressure sensors (with a measurement range of 0-160 kPa and an operating temperature of -40 ℃ to 85 ℃, suitable for complex industrial environments) are deployed in flange-type on the inlet and outlet pipelines of the gas vent valve. At the same time, high-precision standard flow meters are used to collect the true flow values ​​under different operating conditions, and a sample dataset containing more than 10,000 sets of pressure differences and corresponding flow values ​​is constructed.

[0015] Step S2, data preprocessing and feature extraction: The median absolute deviation method is used to detect and filter outliers in the sample dataset, remove noise data such as jump values ​​caused by instantaneous sensor failures, and supplement missing values ​​to ensure data quality; and robust standardization feature scaling is performed, and the pressure difference change rate ΔP / Δt is extracted as the core feature to obtain a standardized, high-quality training dataset.

[0016] Step S3, Basic Prediction Model Construction: Based on the standardized training dataset, construct a pressure difference-flow basic prediction model with gradient boosting tree as the basic algorithm; systematically test different network structure parameters by traversing predefined parameter combinations through grid search, automatically determine the optimal number of nodes configuration, optimize the algorithm hyperparameters and network structure, and combine cross-validation to optimize the hyperparameters of gradient boosting tree to construct the pressure difference-flow basic prediction model.

[0017] Step S4, Incremental Learning Mechanism Deployment: Configure a hierarchical incremental learning mechanism for the basic prediction model. The hierarchical incremental learning mechanism includes an incremental training strategy and a full retraining strategy. Incremental training only trains a small number of newly added decision trees, which is time-efficient and can well retain historical knowledge. It is suitable for situations where the amount of new data is small and the model needs to be updated frequently. Full retraining retrains all decision trees, which is suitable for situations where the amount of new data is extremely large and the data distribution changes significantly. The incremental learning mechanism is configured with intelligent triggering logic. When the newly added valid sample data meets the preset triggering conditions, it automatically selects and executes the corresponding training strategy to update the basic prediction model, ensuring that the model continuously absorbs new data and adapts to changes in operating conditions, avoiding "catastrophic forgetting".

[0018] Step S5, Real-time Prediction and Flow Accumulation: Input the pre-processed pressure difference data collected in real time into the updated prediction model. The model infers in real time and outputs the instantaneous flow prediction value of the gas vent valve (unit: m³ / h). Based on the sliding time window mechanism, the instantaneous flow prediction value is accumulated and calculated to obtain the total gas vent flow.

[0019] Preferably, in step S2, outlier filtering includes: removing samples with pressure difference and flow rate values ​​less than or equal to 0 based on physical business constraints; removing outlier samples with flow rate values ​​outside a reasonable range based on the interquartile range method; and removing outlier samples with an absolute Z-score value greater than or equal to 3 for any feature based on the Z-score statistical method.

[0020] Preferably, the interquartile range method is as follows: calculate the 25th percentile Q1 and 75th percentile Q3 of the flow rate value, and remove samples that exceed the interval [Q1-1.5×IQR, Q3+1.5×IQR], where IQR=Q3-Q1.

[0021] Preferably, in step S2, robust normalization feature scaling is performed based on the median and quartiles of the sample data, and robust normalization and the basic prediction model are encapsulated in the same machine learning pipeline. The same set of feature scaling rules is reused in the training and prediction phases to avoid data leakage.

[0022] Preferably, in step S3, before constructing the basic prediction model, the performance of various regression algorithms is compared to select the gradient boosting tree algorithm, which combines high prediction accuracy with incremental training support. The various regression algorithms include random forest, gradient boosting tree, support vector machine regression, and ridge regression. The performance evaluation metrics include root mean square error (RMSE), coefficient of determination R², and training time. Based on the performance comparison results, the gradient boosting tree algorithm is selected as the basic algorithm. Cross-validation is K-fold cross-validation, with K set to 5. After optimization, the model's RMSE decreases to 0.1710, and R² reaches 0.9998, demonstrating extremely strong fitting ability.

[0023] Preferably, in step S4, the preset trigger condition is that the cumulative amount of newly added valid sample data reaches a preset trigger amount; automatically selecting and executing the corresponding training strategy includes: when the amount of newly added valid sample data is less than a preset threshold, an incremental training strategy is adopted; when the amount of newly added valid sample data is greater than or equal to the preset threshold, a full retraining strategy is adopted.

[0024] Preferably, the preset threshold is 500 data points; the incremental training strategy is implemented based on the warm_start parameter of the gradient boosting tree, which fine-tunes the original model; while random forest and support vector machine are retrained by merging new and old data to balance model performance and update efficiency.

[0025] Preferably, in step S5, the real-time prediction is performed at a frequency of 5 seconds / time; the method also includes an abnormal warning step: abnormal monitoring of real-time pressure difference, instantaneous flow rate, and cumulative total flow rate, and triggering an abnormal warning when the instantaneous flow rate prediction value or the total gas venting flow rate exceeds the preset normal operating range.

[0026] This invention provides a gas vent valve flow prediction system based on machine learning, employing the method provided by this invention, including:

[0027] The edge layer, deployed at the gas vent valve site, includes a differential pressure sensor, an embedded acquisition terminal, and a local display module. The embedded acquisition terminal supports 4G / Ethernet dual communication modes, reads real-time data from the differential pressure sensor at a set frequency via the Modbus RTU protocol, first collects and preprocesses the data (removing obvious outliers), and then reports it to the platform layer at a configurable frequency (default 60 seconds / time). The local display module is used to display the instantaneous flow prediction value, total gas vent flow, and real-time pressure difference data locally, providing direct reference data for on-site operators.

[0028] The model layer, after developing AI machine learning algorithm programs, will generate AI model files and develop the model call as a PI interface, which is used to call the gradient boosting tree prediction model updated by the incremental learning mechanism. It is also encapsulated as a prediction interface, which receives the pressure difference data reported by the edge layer and inputs it into the prediction model. After inference calculation, it outputs the instantaneous flow prediction value.

[0029] At the platform layer, the web platform calls the API prediction interface, including a flow accumulation calculation engine, a data storage module, and a remote monitoring backend. The flow accumulation calculation engine accumulates the instantaneous flow prediction value based on a sliding time window mechanism to obtain the total gas venting flow. The data storage module is used to persistently store the collected raw pressure difference data, flow true value data, instantaneous flow prediction data, cumulative total flow data, and model metadata (model name, feature information, normalizer parameters, etc.), providing data support for incremental model learning and historical data tracing. The remote monitoring backend provides a visual operation and display interface, supports historical data query, flow dynamic trend analysis, abnormal early warning information display, and model training parameter configuration, realizing remote monitoring of the gas venting valve's operating status.

[0030] Preferably, the edge layer is also equipped with a field anomaly early warning module, which is used to receive abnormal signals sent from the platform layer and provide field early warning through prompts from the local display module and an audible and visual alarm.

[0031] The overall architecture of the gas vent valve flow prediction system based on machine learning provided by this invention constructs an automated data flow of "collection → prediction → feedback". The instantaneous flow prediction value obtained by inference at the platform layer and the calculated cumulative total flow data are sent down to the intelligent controller at the edge layer to complete the real-time display on site. At the same time, the newly collected and pre-processed pressure difference-flow sample data at the edge layer are stored in the data storage module of the platform layer, providing continuous new data support for the incremental learning and full retraining of the model, realizing the closed-loop flow of data and dynamic updating of the model.

[0032] Technical effect

[0033] Compared with the prior art, the present invention has the following beneficial effects:

[0034] 1. High prediction accuracy and strong adaptability

[0035] This invention selects gradient boosting tree as the basic algorithm. After hyperparameter optimization through grid search, the model achieves an RMSE as low as 0.1710 and an R² of 0.9998. When the pressure difference is higher than 3 kPa, the instantaneous flow prediction error is stable within 5%, and the proportion of samples with an error ≤ 5% exceeds 99%, which is an order of magnitude improvement over traditional flowmeters. At the same time, a hierarchical incremental learning mechanism and intelligent triggering logic are designed to achieve adaptive updates of incremental training and full retraining of the model. The accuracy decay rate after 30 days is only 8.2%, which is far lower than that of traditional static models. This effectively solves the problem of "catastrophic forgetting" of the model under dynamic working conditions, and takes into account both "new knowledge learning" and "old knowledge retention", adapting to the characteristics of continuous data generation and dynamic changes in working conditions in industrial scenarios.

[0036] 2. High degree of system integration and fast response speed.

[0037] This invention constructs a three-tiered distributed architecture of "edge-model-cloud" to automate the entire process of data acquisition, real-time prediction, traffic accumulation, result display, model update, and anomaly warning. The system is deployed based on Docker containerization technology, uses the Modbus RTU protocol to collect data, and the TFLite framework to achieve lightweight inference. The default data reporting and prediction frequency is 5 seconds / time, the overall system response latency is ≤5 seconds, and the continuous operation failure rate is <0.1%, meeting the application requirements of high reliability and low latency in industrial sites. At the same time, the edge layer and platform layer respectively realize dual display and dual warning for on-site and remote use, improving the practicality of the system.

[0038] 3. Energy efficiency and system security have been significantly improved.

[0039] This invention achieves accurate monitoring of gas venting flow through high-precision instantaneous flow prediction and cumulative total flow calculation, effectively reducing gas venting waste and improving energy utilization. The abnormal warning function can detect overpressure release risks 10 to 30 seconds in advance, which is expected to reduce the safety accident rate of gas venting systems by more than 60%, significantly reduce equipment damage and safety accident rates, and improve the operational safety of gas transmission systems.

[0040] 4. The technology is highly replicable and has high industry value.

[0041] This invention provides a complete and replicable technical solution for the intelligent upgrading of traditional gas equipment. It deeply integrates machine learning and industrial IoT technology into the field of gas equipment, promotes the application of AI technology in gas transmission systems in the energy and chemical industries, and provides reference and guidance for the intelligent monitoring of similar industrial equipment. Attached Figure Description

[0042] Figure 1 This is a flowchart of the gas vent valve flow prediction method based on machine learning in Embodiment 1 of the present invention;

[0043] Figure 2 This is a flowchart illustrating the incremental learning mechanism in Embodiment 1 of the present invention;

[0044] Figure 3 This is a pressure difference-flow rate trend diagram from Embodiment 1 of the present invention;

[0045] Figure 4 This is a residual analysis diagram of the prediction model in Embodiment 1 of the present invention;

[0046] Figure 5 This is a schematic diagram of the three-level distributed architecture and data flow of the gas vent valve flow prediction system based on machine learning in Embodiment 2.

[0047] Figure 6This is a schematic diagram of the equipment installation for the gas vent valve flow prediction system in Embodiment 2 of the present invention;

[0048] Figure 7 This is a visual interface diagram of the system remote monitoring backend in Embodiment 2 of the present invention. Detailed Implementation

[0049] To make the technical means, creative features, objectives and effects of this invention easy to understand, the following embodiments, in conjunction with the accompanying drawings, specifically illustrate a method and system for predicting the flow rate of a gas vent valve based on machine learning.

[0050] Example 1

[0051] This embodiment provides a method for predicting the flow rate of a gas vent valve based on machine learning.

[0052] Figure 1 This is a flowchart of a gas vent valve flow prediction method based on machine learning in an embodiment of the present invention.

[0053] like Figure 1 As shown, the machine learning-based gas vent valve flow prediction method in this embodiment includes the following steps:

[0054] Step S1, Data Acquisition and Dataset Construction: Differential pressure sensors (measurement range 0-10 kPa, accuracy ±0.1% FS, operating temperature -40 ℃~85 ℃, suitable for complex industrial environments) are deployed in flange type on the inlet and outlet pipelines of the gas vent valve. At the same time, high-precision standard flow meters (accuracy ±0.2%) are used to collect the true values ​​of pressure difference and flow rate under different pressure and flow conditions. A sample dataset containing 10,000 sets of pressure difference and corresponding flow rate values ​​is constructed to cover typical operating conditions such as normal operation and overpressure relief of the gas vent valve.

[0055] Step S2, Data Preprocessing and Feature Extraction: Outliers are detected and filtered using the median absolute deviation method on the sample dataset. Noisy data, such as jump values ​​caused by instantaneous sensor malfunctions, are removed in 32 groups, while 18 groups of missing values ​​are added to ensure data quality. Robust standardization and feature scaling are then performed, and the pressure difference change rate ΔP / Δt is extracted as the core feature, resulting in a standardized, high-quality training dataset. In this embodiment, the specific preprocessing and feature extraction process includes:

[0056] Step S2-1, Data Source Loading and Field Compatibility Handling: First, read the raw data, adding exception handling and logging; if file reading fails, an error log will be printed. Second, perform core field validation: enforce validation of the required business fields "Pressure Difference (Kpa)" and "Flow Rate (m³ / h)"; if the original file is missing a specified field, automatic compatibility degradation processing is performed: if there are ≥2 data columns, the first two columns are truncated and renamed to the target field; if the number of columns is insufficient, a runtime exception is thrown directly. Finally, perform basic cleaning of missing values: directly delete samples containing null values ​​to eliminate the interference of null values ​​on model training.

[0057] Step S2-2, multi-layer joint outlier filtering (business rules + statistical algorithms), the filtering rules simultaneously screen valid samples and remove invalid data from abnormal collection and extreme operating conditions. This strategy specifically includes:

[0058] Step S2-2-1, Physical Business Constraint Filtering: Based on the physical logic of the gas venting industry, the differential pressure and flow rate values ​​must be greater than 0, and all dirty data with values ​​≤0 are filtered out.

[0059] Step S2-2-2, IQR quartile filtering (only for traffic label y): Calculate the 25th percentile Q1 and 75th percentile Q3 of the traffic. The interquartile range IQR = Q3 - Q1. The reasonable traffic range is [Q1 - 1.5 × IQR, Q3 + 1.5 × IQR]. Values ​​outside the range are judged as extreme traffic anomalies.

[0060] Step S2-2-3, Z-score 3σ statistical filtering: The pressure difference and flow rate are concatenated into a two-dimensional matrix to calculate the Z score uniformly. The rule is that if the absolute value of the Z score of any feature is ≥3, it is judged as an anomaly, and only samples with two feature Z values ​​less than 3 are retained.

[0061] Step S2-2-4, Multi-condition merging and filtering: The three-layer filtering conditions are executed with a logical AND operation, and only samples that simultaneously meet the conditions of physical rationality, normal Z value, and flow rate within the quartile range are retained; the number of abnormal samples removed is automatically counted and logged, and the total number of samples, pressure difference, and flow rate value distribution range before and after cleaning are printed.

[0062] Step S2-2, Robust Normalization Feature Scaling: In this embodiment, for the selection of scaling algorithm, the conventional Standard Scaler is abandoned and the Robust Scaler robust normalization tool is selected. The scaling is completed based on the median and quartiles, which is not affected by residual extreme outliers and is suitable for data features with large fluctuations in gas operating conditions.

[0063] In addition, pipeline binding steps to prevent data leakage are included: RobustScaler and regression model are encapsulated in the same pipeline, and the same scaling rules are reused throughout training, testing and incremental prediction to avoid the problem of inconsistent training / test distribution caused by separate scaling; the scaling logic is bound to the model for persistence, and incremental training does not require saving the scaler separately.

[0064] Step S2-3, Dataset Splitting: The training set accounts for 80% and the test set accounts for 20%; the random seed random_state=42 is fixed to ensure the reproducibility of experimental results; shuffle is enabled to shuffle the original sample order and avoid data distribution shift caused by the collection time sequence.

[0065] Step S3, Construction of the Basic Prediction Model: Based on the standardized training dataset, 5-fold cross-validation was used to compare the performance of four algorithms: Random Forest, Gradient Boosting Tree, Support Vector Machine Regression, and Ridge Regression. The results showed that the Gradient Boosting Tree algorithm had an RMSE of 0.2870 and an R² of 0.9985, and supported incremental training, exhibiting the best overall performance. Therefore, a pressure difference-flow basic prediction model based on the Gradient Boosting Tree algorithm was constructed. A grid search method was used to systematically test different network structure parameters, including learning rate, number of decision trees, and node depth, to automatically determine the optimal node configuration, optimize the algorithm's hyperparameters and network structure, and further optimize the hyperparameters of the Gradient Boosting Tree algorithm using cross-validation. The optimized Gradient Boosting Tree basic prediction model achieved an RMSE of 0.1710 and an R² of 0.9998. The specific process includes:

[0066] Step S3-1, Automatic Comparison and Selection of Multiple Regression Models: In this embodiment, four types of regression algorithms are trained in parallel, and the optimal model is automatically selected to fit the nonlinear mapping relationship between pressure difference and flow rate.

[0067] 1. Random Forest Regressor: A tree ensemble algorithm that fits nonlinear relationships and has strong resistance to data acquisition noise;

[0068] 2. Gradient Boosting Regressor: Iterative fitting of residuals, higher upper limit of prediction accuracy, and support for hot-start incremental training;

[0069] 3. SVR (Support Vector Regression): Suitable for small to medium-sized datasets and fitting complex nonlinear operating conditions;

[0070] 4. Ridge regression: A linear baseline model used to compare the fitting effect of nonlinear models.

[0071] Step S3-2, GridSearch CV global hyperparameter optimization: Configure multiple sets of candidate hyperparameter values ​​for each model type, and automatically traverse and match the optimal parameter combination. The specific process is as follows:

[0072] Step S3-2-1, Pipeline parameter naming rules: The pipeline is divided into two layers: scaler and model. Model hyperparameters are uniformly prefixed with model__.

[0073] Step S3-2-2, Cross-validation strategy: Use 5-fold cross-validation with cv=5.

[0074] Step S3-2-3, Optimization objective: Minimize the prediction error using negative mean squared error as the scoring criterion.

[0075] Step S3-2-4, performance acceleration: n_jobs=-1 calls all CPUs of the device to search in parallel, and disables redundant training logs to reduce output.

[0076] Step S3-2-5, Output Results: Record the optimal hyperparameters, test set RMSE, 5-fold cross-validation RMSE, and R² goodness of fit for each model class.

[0077] Step S3-3, double-layer cross-validation generalization ability verification: After selecting the optimal parameters of a single model using grid search, cross_val_score is used to perform 5-fold cross-validation to distinguish between test set error and training set cross-validation error, which is used to judge the risk of model overfitting: if the test RMSE is much smaller than the cross-validation RMSE, it means that the model is overfitting.

[0078] Step S3-4, Automatic global optimal model selection: Traverse all four types of models, use the minimum mean square error as the sole criterion, automatically save the global optimal model and record the corresponding model name; if all four types of models fail to train, throw an exception and terminate the program.

[0079] Step S3-5, Multi-dimensional quantitative evaluation index system: Calculate a complete set of regression model evaluation indicators based on the test set to fully quantify the fitting effect:

[0080] RMSE (Root Mean Square Error): Reflects the magnitude of the absolute error in prediction;

[0081] Mean Absolute Error (MAE): A direct reflection of the average prediction deviation;

[0082] R² coefficient of determination: goodness of fit, with a value range of 0 to 1. The closer the value is to 1, the better the fit.

[0083] MAPE (Mean Absolute Percentage Error): Characterizes relative error, adds division by zero protection logic for y=0 to avoid calculation errors.

[0084] Figure 2 This is a flowchart illustrating the incremental learning mechanism in this embodiment.

[0085] like Figure 2 As shown, step S4, incremental learning mechanism deployment: A hierarchical incremental learning mechanism is configured for the basic prediction model. Incremental training is implemented through the `warm_start` parameter. The hierarchical incremental learning mechanism includes an incremental training strategy and a full retraining strategy. Incremental training only trains a small number of newly added decision trees, which is time-efficient and retains historical knowledge well, suitable for situations where the amount of new data is small and frequent model updates are required. Full retraining retrains all decision trees, suitable for situations where the amount of new data is extremely large and the data distribution changes significantly. The incremental learning mechanism is configured with intelligent triggering logic. When the cumulative number of newly added valid sample data reaches 500, the corresponding training strategy is automatically selected and executed to update the basic prediction model, ensuring that the model continuously absorbs new data and adapts to changes in operating conditions, avoiding "catastrophic forgetting." In this embodiment, incremental training is used when the amount of new data is <500, and full retraining is used when the amount of new data is ≥500.

[0086] Step S5, Real-time Prediction and Flow Accumulation: The pre-processed pressure difference data collected in real time is input into the updated prediction model at a frequency of 5 seconds / time. The model infers in real time and outputs the instantaneous flow prediction value of the gas vent valve (unit: m³ / h). Based on the sliding time window mechanism, the instantaneous flow prediction value is accumulated and calculated to obtain the total gas vent flow. At the same time, anomaly analysis is performed on the monitoring data, and an early warning is triggered when the flow deviates from the normal range by ±10%.

[0087] Figure 3 This is a pressure difference-flow rate trend diagram in this embodiment.

[0088] Figure 4 This is a residual analysis diagram of the prediction model in an embodiment of the present invention.

[0089] like Figures 3-4 As shown in this embodiment, when the pressure difference is higher than 3 kPa, the instantaneous flow prediction error is within 5%. Specifically, when the pressure difference is 7.23 kPa, the model predicts an instantaneous flow of 38.25 m³ / h, while the flow meter actually measures 37.4 m³ / h, with an error of only 2.27%. When the pressure difference is 8.01 kPa, the model predicts an instantaneous flow of 41.10 m³ / h, while the flow meter actually measures 40.8 m³ / h, with an error of only 0.74%, verifying the high accuracy of the method.

[0090] Example 2

[0091] This embodiment provides a gas vent valve flow prediction system based on machine learning, used to implement the method in Embodiment 1. Applied to a test pipeline at a gas transmission station, the system adopts a three-tiered distributed architecture of "edge-model-cloud".

[0092] Figure 5 This is a schematic diagram of the three-level distributed architecture and data flow of the gas vent valve flow prediction system based on machine learning in this embodiment.

[0093] Figure 6 This is a schematic diagram of the equipment installation for the gas vent valve flow prediction system in this embodiment.

[0094] like Figure 5 As shown, the specific implementation of the machine learning-based gas vent valve flow prediction system in this embodiment is as follows:

[0095] 1. Edge layer deployment: such as Figure 6 As shown, a regulating valve is installed before the vent valve in the test pipeline, a standard flow meter is installed between the regulating valve and the vent valve, and a differential pressure sensor is installed on the flange of the vent valve outlet pipeline, forming the hardware data acquisition foundation. An intelligent controller is deployed at the gas vent valve site in the test pipeline, integrating a differential pressure sensor, an embedded acquisition terminal, and a local LED display. The embedded acquisition terminal supports 4G communication, reads sensor data via the Modbus RTU protocol, and reports it to the platform layer. The local display shows the instantaneous flow rate, total vent flow rate, and real-time differential pressure in real time.

[0096] 2. Platform Layer Deployment: A platform server is deployed in the central control room of the gas transmission station, integrating an AI prediction interface (RESTful API), a total flow calculation engine, a data storage module, and a remote monitoring backend based on Docker containerization technology. The model inference module uses the TFLite framework to achieve lightweight inference of the gradient boosting tree model. The remote monitoring backend provides a visual interface, supporting historical data queries, flow trend curve display, and anomaly warning push notifications. The specific interface is shown below. Figure 7 As shown.

[0097] Figure 7 This is a visual interface diagram of the system's remote monitoring backend in this embodiment.

[0098] 3. Closed-loop data flow: The platform layer distributes the instantaneous flow prediction value and the cumulative total flow to the local display screen of the edge layer, and at the same time stores the newly collected pressure difference-flow data into the data storage module; when the new data accumulates to 500 records, the system automatically starts incremental training, updates the model parameters, and realizes dynamic optimization of the model.

[0099] In this embodiment, the overall system response delay is ≤5 seconds, the failure rate is 0 after 30 days of continuous operation, and the model accuracy decay rate is only 8.2%. When overpressure release of the vent valve is detected, the system triggers on-site audible and visual alarms and remote platform warnings, promptly notifying staff to handle the situation and effectively preventing safety accidents.

[0100] The above embodiments are preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention.

Claims

1. A method for predicting the flow rate of a gas vent valve based on machine learning, characterized in that, Includes the following steps: Step S1, Data Acquisition and Dataset Construction: Deploy differential pressure sensors on the inlet and outlet pipelines of the gas vent valve, and simultaneously use standard flow meters to collect the true flow values ​​under different operating conditions, and construct a sample dataset containing pressure difference and corresponding flow values. Step S2, Data preprocessing and feature extraction: Perform outlier filtering and robust normalized feature scaling on the sample dataset, and extract the pressure difference change rate as the core feature to form a standardized training dataset; Step S3, Basic Prediction Model Construction: Based on the standardized training dataset, construct a pressure difference-flow basic prediction model using gradient boosting tree as the basic algorithm; optimize the hyperparameters of the gradient boosting tree through grid search combined with cross-validation to construct the pressure difference-flow basic prediction model. Step S4, Incremental learning mechanism deployment: Configure a hierarchical incremental learning mechanism for the basic prediction model. The hierarchical incremental learning mechanism includes an incremental training strategy and a full retraining strategy. The incremental learning mechanism is configured with intelligent triggering logic. When newly added valid sample data meets the preset triggering conditions, the corresponding training strategy is automatically selected and executed to update the basic prediction model. Step S5, Real-time Prediction and Flow Accumulation: Input the pre-processed pressure difference data collected in real time into the updated prediction model and output the instantaneous flow prediction value; accumulate the instantaneous flow prediction value based on the sliding time window mechanism to obtain the total gas venting flow.

2. The gas vent valve flow prediction method based on machine learning according to claim 1, characterized in that: In step S2, the outlier filtering includes: removing samples with pressure difference and flow rate values ​​less than or equal to 0 based on physical service constraints; removing outlier samples with flow rate values ​​outside the reasonable range based on the interquartile range method; and removing outlier samples with an absolute Z-score value greater than or equal to 3 based on the Z-score statistical method.

3. The gas vent valve flow prediction method based on machine learning according to claim 2, characterized in that: The interquartile range method is as follows: calculate the 25th percentile Q1 and 75th percentile Q3 of the flow rate value, and remove samples that exceed the interval [Q1-1.5×IQR, Q3+1.5×IQR], where IQR=Q3-Q1.

4. The gas vent valve flow prediction method based on machine learning according to claim 1, characterized in that: In step S2, the robust normalization feature scaling is based on the median and quartiles of the sample data. The robust normalization and the basic prediction model are encapsulated in the same machine learning pipeline. The same set of feature scaling rules is reused in the training and prediction phases to avoid data leakage.

5. The gas vent valve flow prediction method based on machine learning according to claim 1, characterized in that: In step S3, before constructing the basic prediction model, the performance of various regression algorithms is compared to select the gradient boosting tree; the various regression algorithms include random forest algorithm, gradient boosting tree algorithm, support vector machine regression algorithm and ridge regression algorithm; the evaluation indicators for the performance comparison include root mean square error, coefficient of determination R² and training time; based on the performance comparison results, the gradient boosting tree is selected as the basic algorithm; the cross-validation is K-fold cross-validation, where K is 5.

6. The gas vent valve flow prediction method based on machine learning according to claim 1, characterized in that: In step S4, the preset triggering condition is that the cumulative amount of newly added valid sample data reaches a preset triggering amount; The automatic selection and execution of the corresponding training strategy includes: when the amount of newly added effective sample data is less than a preset threshold, the incremental training strategy is adopted; When the amount of newly added valid sample data is greater than or equal to the preset threshold, the full retraining strategy is adopted.

7. The gas vent valve flow prediction method based on machine learning according to claim 6, characterized in that: The preset threshold is 500; the incremental training strategy is implemented based on the warm_start parameter of the gradient boosting tree.

8. The gas vent valve flow prediction method based on machine learning according to claim 1, characterized in that: In step S5, the real-time prediction is performed at a frequency of 5 seconds / time; the method also includes an abnormal warning step: when the instantaneous flow prediction value or the total gas venting flow exceeds the preset normal operating range, an abnormal warning is triggered.

9. A gas vent valve flow prediction system based on machine learning, characterized in that, The system comprising the method as described in any one of claims 1 to 7, wherein the system includes: The edge layer, deployed at the gas venting valve site, includes a differential pressure sensor, an embedded acquisition terminal, and a local display module. The embedded acquisition terminal is used to read real-time data from the differential pressure sensor at a set frequency, preprocess the data, and then report it to the platform layer. The local display module is used to display the instantaneous flow prediction value, the total gas venting flow, and the real-time pressure difference data. The model layer deploys a gradient boosting tree prediction model updated by an incremental learning mechanism and encapsulates it as a prediction interface. The model layer is used to receive the pressure difference data reported by the edge layer and input it into the prediction model. After inference calculation, it outputs the instantaneous flow prediction value. The platform layer includes a flow accumulation calculation engine, a data storage module, and a remote monitoring backend. The flow accumulation calculation engine accumulates and calculates the instantaneous flow prediction value based on a sliding time window mechanism to obtain the total gas venting flow. The remote monitoring backend is used to provide data visualization, historical data query, and abnormal early warning push.

10. The gas vent valve flow prediction system based on machine learning according to claim 9, characterized in that: The edge layer is also equipped with a field anomaly early warning module, which is used to receive abnormal signals sent by the platform layer and provide field early warning through prompts from the local display module and audible and visual alarms.