A valve flow monitoring method and system

By capturing pseudo-pressure difference and temperature drift errors in the transportation of high-viscosity media and natural gas using LSTM and XGBoost models, and combining GPR and attention network models for error separation, the error problem in flow monitoring is solved, and the accuracy of flow rate values ​​is achieved.

CN121980248BActive Publication Date: 2026-06-19DALIAN JINLI FLUID EQUIP DEV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
DALIAN JINLI FLUID EQUIP DEV
Filing Date
2026-04-08
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

In the transportation of high-viscosity media and natural gas, existing technologies are susceptible to flow monitoring results from residual liquid films, equipment temperature drift, and viscous temperature sensitivity errors, leading to inaccurate flow measurements.

Method used

The LSTM and XGBoost models are used to capture the dynamic temporal dependence and static multi-factor coupling relationship. The total temperature drift is fitted by combining the GPR model and the contribution weight of temperature to viscous error is automatically learned by the attention network model, so as to achieve independent separation of error and finally obtain accurate flow rate value.

Benefits of technology

Accurate prediction of pseudo-pressure difference and temperature drift error, separation of equipment temperature drift error and viscous temperature sensitivity error, and realization of accurate flow monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121980248B_ABST
    Figure CN121980248B_ABST
Patent Text Reader

Abstract

This invention discloses a valve flow monitoring method and system, belonging to the field of flow monitoring technology. The key technical points include: acquiring characteristic data corresponding to the current moment, including temperature and pressure signals; preprocessing the characteristic data to obtain standardized features; obtaining viscous pseudo-pressure difference, viscous temperature sensitivity error, and net temperature drift error based on the standardized features and preset model units; obtaining the effective pressure difference based on the viscous pseudo-pressure difference and net temperature drift error; and obtaining the flow rate corresponding to the current moment based on the effective pressure difference and the current viscosity. This invention uses LSTM and XGBoost models to capture the dynamic time-series dependence and static multi-factor coupling relationship, improving the accuracy of pseudo-pressure difference prediction. It also uses a GPR model to fit the total temperature drift and combines an attention network model to automatically learn the contribution weight of temperature to the viscous error, achieving independent separation of the two types of errors and ultimately obtaining an accurate flow rate value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of flow monitoring technology, and more specifically to a valve flow monitoring method and system. Background Technology

[0002] In industries such as petrochemicals and coal chemicals, monitoring the flow rate of high-viscosity media (such as oil), natural gas, and steam in pipelines is a core aspect of production process control, energy consumption measurement, and process optimization. Currently, the industry commonly uses orifice plate flowmeters combined with differential pressure transmitters for flow monitoring. The basic principle is to utilize the throttling effect of fluid passing through the orifice plate to generate a pressure difference, and then derive the actual flow rate through the correlation between the pressure difference and the flow rate. However, high-viscosity media inherently possess strong viscosity and poor fluidity, easily forming residual liquid films in valve chambers and on sensor surfaces. During natural gas transportation, small amounts of heavy hydrocarbons, moisture, sulfides, and other impurities easily adsorb or condense in dead corners of valve chambers and on the surface of transmitter diaphragms, forming micro-residual layers. Steam and hot water are prone to condensation due to temperature changes. Existing technologies can only address these issues through manual disassembly and cleaning, periodic purging, or fixed threshold compensation, failing to accurately predict and eliminate the interference caused by these problems. Ultimately, this leads to distorted flow measurement results, making it difficult to obtain accurate flow values. Therefore, existing technologies have shortcomings. Summary of the Invention

[0003] To address the shortcomings of existing technologies, the present invention aims to provide a valve flow monitoring method and system. By using LSTM and XGBoost models, the dynamic time-series dependence and static multi-factor coupling relationship are captured, improving the accuracy of pseudo-differential pressure prediction. The total temperature drift is fitted by GPR model, and the contribution weight of temperature to viscous error is automatically learned by attention network model, achieving independent separation of the two types of errors and finally obtaining accurate flow values.

[0004] To achieve the above objectives, the present invention provides the following technical solution:

[0005] This invention provides a valve flow monitoring method, comprising:

[0006] Acquire the feature data corresponding to the current moment, the feature data including temperature signal and pressure signal;

[0007] The feature data is preprocessed to obtain standardized features;

[0008] Based on the standardized features and preset model units, the viscous pseudo-pressure difference, viscous temperature sensitivity error, and net temperature drift error are obtained.

[0009] The effective pressure difference is obtained based on the viscous pseudo-pressure difference and the net temperature drift error;

[0010] Based on the effective pressure difference and the current viscosity, the flow rate at the current moment is obtained.

[0011] As a further improvement of the present invention, the preprocessing of the feature data to obtain standardized features includes:

[0012] The feature data is decomposed by wavelet to obtain a denoised signal;

[0013] The current viscosity is obtained based on the denoised signal and the Arrhenius formula;

[0014] Multiple standardized features are obtained based on the denoised signal, and each standardized feature corresponds to a model in the preset model unit.

[0015] As a further improvement of the present invention, the preset model unit includes an LSTM model, an XGBoost model, a GPR model, and an attention network model. The step of obtaining the viscous pseudo-pressure difference, viscous temperature sensitivity error, and net temperature drift error based on the standardized features and the preset model unit includes:

[0016] The viscous pseudo-pressure difference is obtained based on the standardized features, the LSTM model, and the XGBoost model.

[0017] Based on the standardized features and the GPR model, the total temperature drift prediction results are obtained;

[0018] Based on the standardized features, the viscous pseudo-pressure difference, and the attention network model, the viscous temperature-sensitive error is obtained.

[0019] The net temperature drift error is obtained based on the viscous temperature sensitivity error and the total temperature drift prediction result.

[0020] As a further improvement of the present invention, obtaining the viscous pseudo-pressure difference based on the standardized features, the LSTM model, and the XGBoost model includes:

[0021] Based on the standardized features, the LSTM model, and the XGBoost model, the first error standard deviation, the second error standard deviation, the first predicted pressure difference, and the second predicted pressure difference are obtained.

[0022] Based on the first error standard deviation, the second error standard deviation, and Bayes' theorem, the posterior weights are obtained;

[0023] The viscous pseudo-pressure difference is obtained based on the posterior weight, the first predicted pressure difference, and the second predicted pressure difference.

[0024] As a further improvement of the present invention, obtaining the total temperature drift prediction result based on the standardized features and the GPR model includes:

[0025] Based on the standardized features and training set samples, a similarity vector is obtained;

[0026] Obtain the labels corresponding to the training set samples, and the kernel matrix between the training set samples;

[0027] The total temperature drift prediction result is obtained by weighting the labels according to the kernel matrix and the similarity vector.

[0028] As a further improvement of the present invention, the step of obtaining the viscous temperature-sensitive error based on the standardized features, the viscous pseudo-pressure difference, and the attention network model includes:

[0029] Based on the standardized features and the attention network model, the attention weights are obtained;

[0030] The viscous temperature sensitivity error is obtained based on the attention weight and the viscous pseudo-pressure difference.

[0031] As a further improvement of the present invention, the step of obtaining the effective pressure difference based on the viscous pseudo-pressure difference and the net temperature drift error includes:

[0032] The feature data is decomposed by wavelet to obtain a denoised signal;

[0033] The initial pressure difference is obtained based on the denoised signal, the viscous pseudo-pressure difference, and the net temperature drift error;

[0034] The effective pressure difference is obtained based on the initial pressure difference and the preset validity verification rules.

[0035] As a further improvement of the present invention, the step of obtaining the flow rate corresponding to the current moment based on the effective pressure difference and the current viscosity includes:

[0036] Based on the current viscosity and correction factor, the corrected discharge coefficient is obtained;

[0037] The flow rate at the current moment is obtained based on the corrected outflow coefficient, the orifice area, and the effective pressure difference.

[0038] As a further improvement of the present invention, the steps for training the GPR model include:

[0039] Construct kernel functions, including squared exponential kernels, Matern kernels, periodic kernels, and white noise kernels;

[0040] High-confidence pseudo-labels were selected from the original labeled data and the initial GPR model to obtain an expanded training set;

[0041] The hyperparameters are obtained based on the Gaussian process and a preset acquisition function, wherein the preset acquisition function is determined according to the desired improvement.

[0042] The trained GPR model is obtained based on the kernel function, the expanded training set, and the hyperparameters.

[0043] This invention provides a valve flow monitoring system, comprising:

[0044] The acquisition module is used to acquire the feature data corresponding to the current moment, including temperature signals and pressure signals;

[0045] The preprocessing module is used to preprocess the feature data to obtain standardized features;

[0046] The error calculation module is used to obtain the viscous pseudo-pressure difference, viscous temperature sensitivity error, and net temperature drift error based on the standardized features and preset model units.

[0047] The differential pressure calculation module is used to obtain the effective differential pressure based on the viscous pseudo-differential pressure and the net temperature drift error;

[0048] The flow calculation module is used to obtain the flow rate at the current moment based on the effective pressure difference and the current viscosity.

[0049] This invention uses LSTM and XGBoost models to capture the coupling relationship between dynamic time-series dependencies and static multi-factors, accurately predicting the pseudo-pressure difference caused by the residual liquid film of high-viscosity media. Then, it uses GPR model to fit the total temperature drift and combines attention network model to automatically learn the contribution weight of temperature to viscous error, realizing the independent separation of the two types of errors: equipment temperature drift error and viscous temperature sensitive error, and finally obtaining accurate flow rate values. Attached Figure Description

[0050] Figure 1 This is a schematic diagram illustrating the steps of a valve flow monitoring method according to the present invention;

[0051] Figure 2 A schematic diagram of the steps to obtain the viscous temperature sensitive error. Detailed Implementation

[0052] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present invention and the specific features in the embodiments are detailed descriptions of the technical solution of the present invention, rather than limitations thereof.

[0053] The term "and / or" in the following text is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. Additionally, the character " / " generally indicates that the preceding and following related objects have an "or" relationship.

[0054] like Figure 1 As shown in the figure, this application provides a valve flow monitoring method, including:

[0055] Acquire the feature data corresponding to the current moment, including temperature and pressure signals;

[0056] The feature data is preprocessed to obtain standardized features;

[0057] Based on standardized features and preset model units, viscous pseudo-pressure difference, viscous temperature sensitivity error, and net temperature drift error are obtained.

[0058] The effective pressure difference is obtained based on the viscous pseudo-pressure difference and the net temperature drift error;

[0059] The flow rate at the current moment is obtained based on the effective pressure difference and the current viscosity.

[0060] This embodiment reveals that when transporting high-viscosity media such as oil through pipelines, the high-viscosity media easily adheres to dead corners of the valve cavity and forms a stable residual liquid film on the surface of the transmitter diaphragm. This liquid film generates a false differential pressure signal. For example, assuming an ideal state with no temperature drift in the equipment, the actual differential pressure is 10 kPa. The residual liquid film in the valve cavity will crowd out the space for differential pressure detection, causing the transmitter to detect a differential pressure of 15 kPa. The extra 5 kPa is the false differential pressure. The source of the false differential pressure is the physical interference of the residual liquid film itself, where the thickness of the liquid film dynamically changes with the duration of shutdown, temperature, and pressure. Existing technologies only rely on manual disassembly and cleaning to remove residues or fixed threshold compensation, which cannot accurately predict false differential pressure, leading to distortion of the differential pressure signal. Furthermore, when the temperature inside the pipeline changes, the first issue is the temperature drift error caused by the temperature affecting the transmitter's electronic components or diaphragm material. For example, when the temperature rises, the metal sensing diaphragm of the transmitter expands thermally, and the conductivity of the semiconductor electronic components changes, easily resulting in a positive temperature drift error. When the temperature drops, the sensing diaphragm contracts, and the operating parameters of the electronic components shift with the low temperature, resulting in a negative temperature drift error. Simultaneously, temperature fluctuations also cause changes in the viscosity of the residual liquid film, leading to viscous temperature sensitivity errors. Specifically, when the temperature rises, the molecular thermal motion within the liquid film intensifies dramatically. At this time, the fluidity of the residual liquid film improves, and the thin liquid layer that was originally attached to the dead corners of the equipment becomes even thinner, and may even partially drift away with minute airflows / As the liquid diffuses, the interference of the liquid film on differential pressure detection decreases, and the resulting temperature-sensitive error correspondingly decreases. Conversely, when the temperature decreases, the fluidity of the residual liquid film deteriorates, making it easier for it to accumulate in the valve cavity and on the diaphragm surface, forming a thicker, more stable liquid layer. This results in a corresponding increase in the temperature-sensitive error. For example, assuming we disregard equipment temperature drift error, the pseudo-differential pressure caused by the liquid film itself at the reference temperature is 5 kPa. As the temperature decreases, the liquid film thickens, and the differential pressure detected by the transmitter becomes 18 kPa. Of this, 3 kPa is the viscous temperature-sensitive error. Since the pseudo-differential pressure is 5 kPa, the viscous pseudo-differential pressure is 8 kPa. Therefore, the viscous pseudo-differential pressure is the sum of the viscous temperature-sensitive error and the pseudo-differential pressure. Thus, the existence of the pseudo-differential pressure, equipment temperature drift error, and viscous temperature-sensitive error leads to errors in the actual monitored flow rate. The method provided in this embodiment accurately predicts the pseudo-differential pressure and separates the equipment temperature drift error and the viscous temperature-sensitive error to obtain an accurate flow rate value.

[0061] Specifically, the process first acquires the characteristic data corresponding to the current moment. For example, it obtains the differential pressure signal through a differential pressure transmitter, the temperature signal through a temperature sensor, and the pressure signal through a pressure transmitter. Then, the acquired signals are preprocessed to obtain standardized features. There are multiple standardized features, each corresponding to a model in a preset model unit. Through model processing, the viscous pseudo-differential pressure, viscous temperature sensitivity error, and net temperature drift error are obtained, thus yielding an accurate flow rate value. This embodiment does not limit the specific valve type.

[0062] In addition to transporting oil, pipelines typically transport natural gas, liquefied petroleum gas, and other gases (such as hydrogen). Therefore, the method provided in this embodiment can also be applied to the transport of other substances.

[0063] Specifically, when natural gas is transported through pipelines, trace amounts of heavy hydrocarbons, moisture, and sulfides in the natural gas can easily adsorb or condense in dead zones of valve chambers and on the surface of transmitter diaphragms, forming a micro-residual layer. This residual layer generates a weak pseudo-differential pressure signal, and its residual state dynamically changes with transmission pressure, temperature, and downtime. Current technologies only rely on periodic purging to remove the residue or fixed threshold compensation, which cannot accurately predict the pseudo-differential pressure, leading to distortion of the differential pressure signal. Furthermore, when the temperature inside the pipeline changes, equipment temperature drift errors occur due to the influence of temperature on transmitter electronic components or diaphragm materials. Temperature fluctuations also alter the condensation state of heavy hydrocarbons, further affecting the equivalent pseudo-differential pressure of the residual layer. Therefore, the presence of adsorbed residual pseudo-differential pressure and equipment temperature drift errors results in errors in the actual monitored flow rate. However, compared to the oil transportation mentioned above, the residue of natural gas is not a viscous liquid film, but a thin liquid layer formed by the condensation of a small amount of heavy hydrocarbons (such as ethane), or a thin solid layer adsorbed by sulfides. The state of this type of residue is only related to whether the temperature reaches the freezing point and whether the pressure is high enough, rather than the viscosity changing with temperature. Therefore, when transporting natural gas, the viscosity temperature sensitivity error is not considered. Instead, the accurate flow rate value is obtained by accurately predicting the pseudo pressure difference of the adsorbed residue and correcting the temperature drift error.

[0064] In addition, when transmitting easily condensable gases such as liquefied petroleum gas and propane, they are gaseous at normal temperature and pressure, but condense into a liquid film under high pressure or low temperature conditions, remaining in the valve cavity and sensor surface and generating a pseudo-pressure difference. This residual state changes dynamically with temperature and pressure. At the same time, temperature changes will cause transmitter temperature drift, and the pseudo-pressure difference interference from the condensation residue will further affect the flow accuracy. Similarly, by accurately predicting the pseudo-pressure difference of the phase change condensation residue and correcting the temperature drift error, accurate flow monitoring can be achieved in the scenario of easily condensable gases. When transmitting pure low-viscosity gases such as hydrogen, oxygen and steam through pipelines, their viscosity is extremely low, they are difficult to condense and have no adsorption properties, and almost no residual pseudo-pressure difference is generated. Only the transmitter temperature drift error caused by temperature changes and the signal noise caused by pressure fluctuations need to be dealt with. Therefore, compared with the method provided in this embodiment, only the temperature drift error needs to be retained to adapt to the transmission and monitoring requirements of pure low-viscosity gases.

[0065] This application embodiment uses LSTM and XGBoost models to capture the dynamic time-series dependence and static multi-factor coupling relationship, accurately predicts the pseudo pressure difference caused by the liquid film remaining in the high-viscosity medium, then fits the total temperature drift using the GPR model, and automatically learns the contribution weight of temperature to viscous error using the attention network model, so as to achieve independent separation of the two types of errors: equipment temperature drift error and viscous temperature sensitive error, and finally obtain accurate flow rate values.

[0066] Furthermore, this embodiment provides a step for preprocessing feature data to obtain standardized features, including:

[0067] Wavelet decomposition is performed on the feature data to obtain the denoised signal;

[0068] The current viscosity is obtained based on the denoised signal and the Arrhenius equation;

[0069] Multiple standardized features are obtained from the denoised signal, and each standardized feature corresponds to a model in the preset model unit.

[0070] Specifically, firstly, wavelet decomposition is performed on each signal in the feature data to obtain a denoised signal. Then, using the Arrhenius formula, the viscosity inside the pipe is obtained from the denoised temperature signal. For example, the Arrhenius formula is expressed as:

[0071]

[0072] in, The absolute temperature is obtained by converting the Celsius temperature corresponding to the denoised temperature signal. This represents the viscosity that needs to be determined. This represents the reference viscosity, which is the limiting viscosity as the absolute temperature approaches infinity. The viscosity activation energy represents the sensitivity of viscosity to temperature. Reference viscosity and viscosity activation energy can be obtained by fitting experimental data. For example, for a specific medium inside a pipe, its corresponding viscosity value can be measured at different temperatures to obtain multiple sets of experimental data. Each set of experimental data includes a Celsius temperature and its corresponding viscosity value. Then, the set temperature is converted to an absolute temperature, and the natural logarithm of both sides of the Arrhenius equation is taken to transform it into a linear equation. ,make , , , Then the equation becomes At this time As the x-axis, with Linear regression was performed on the experimental data with the ordinate as the ordinate to obtain the coefficients. and And then calculate , , , is a known gas constant.

[0073] Next, standardized features are generated for each model. Each standardized feature undergoes standardization processing. For example, since the LSTM model is used to capture time-dimensional dependencies, it requires sequential features. The XGBoost, GPR, and attention network models are static feature models used to fit the nonlinear relationships of multiple factors under the current state, thus requiring single-valued features. Specifically, the LSTM model's task objective is to predict the temporal cumulative trend of viscous pseudo-pressure difference, so its corresponding standardized feature is a time-series vector of viscous pseudo-pressure difference within a preset time period. Each element in the vector corresponds to the standardized viscous pseudo-pressure difference at a given moment. The XGBoost model is used to predict the influence of static and spatial factors on viscous pseudo-pressure difference under the current operating conditions, so its corresponding standardized features include standardized temperature, downtime, temperature, and spatial sensitivity coefficients. The downtime refers to the length of time the differential pressure transmitter remains inactive after switching from its previous normal operating state to a downtime state. The longer the downtime, the easier it is for the medium to deposit and solidify in the dead corners of the equipment, resulting in more severe viscous residue. This leads to an increase in pseudo-pressure difference. The downtime can be obtained from the equipment operation log. The spatial sensitivity coefficient is used to quantify the influence of the geometry of the pipeline / valve cavity (pipe diameter, length, dead angle shape, etc.) on the viscous pseudo-pressure difference. For example, under the same medium, the same temperature, and the same downtime, experiments can be conducted on pipelines with different pipe diameters and valve cavity structures to measure the corresponding viscous pseudo-pressure difference. Then, with geometric parameters such as valve cavity dead angle depth / pipe length as independent variables and pseudo-pressure difference as dependent variable, the spatial sensitivity coefficient is obtained through linear regression fitting. For example, if the viscous pseudo-pressure difference increases by 0.02 kPa for every 1 mm increase in the dead angle depth of a valve cavity, then the spatial sensitivity coefficient is 0.02 kPa / mm.

[0074] The GPR model is used to predict temperature drift error. Factors influencing temperature drift include the difference between the actual temperature and the calibration temperature, equipment aging (usage time), and power supply voltage fluctuations. Therefore, its standardized features include the standardized temperature difference, the transmitter's cumulative usage time, and power supply voltage fluctuations. Power supply voltage fluctuations refer to the difference between the transmitter's power supply voltage and its rated voltage, which can be represented by the difference between the real-time voltage and the rated voltage. The attention network model is used to separate the temperature-dominated portion of the viscous pseudo-pressure differential. Temperature affects viscosity, which in turn affects the equivalent pressure of the viscous residue. Therefore, its standardized features include the standardized current temperature, current viscosity, and the predicted value of the viscous temperature-sensitive error from the previous time step.

[0075] Furthermore, this embodiment provides a method for obtaining viscous pseudo-pressure difference, viscous temperature sensitivity error, and net temperature drift error based on standardized features and preset model units, including:

[0076] Based on the standardized features, LSTM model, and XGBoost model, the viscous pseudo-pressure difference is obtained;

[0077] Based on the standardized characteristics and the GPR model, the total temperature drift prediction results are obtained;

[0078] Based on the standardized characteristics, viscous pseudo-pressure difference, and attention network model, the viscous temperature sensitivity error is obtained;

[0079] The net temperature drift error is obtained based on the viscous temperature sensitivity error and the total temperature drift prediction results.

[0080] Among them, such as Figure 2 As shown, the preset model units include an LSTM model, an XGBoost model, a GPR model, and an attention network model, each of which has been trained.

[0081] Model training is a technical means that can be implemented by those skilled in the art. For example, when training an LSTM model, the temporal feature data is first divided into a training set, a validation set, and a test set according to time order, for example, in a 7:2:1 ratio. The temporal feature data is specifically a time series vector of viscous pseudo-pressure difference within a preset time period. Each element in the vector corresponds to the standardized viscous pseudo-pressure difference data at a certain moment. This data is collected under actual working conditions where viscous residue exists. In this embodiment, the specific length of the preset time period is not limited. Then, a network structure adapted to the temporal features is built, such as setting the dimension of the input layer. The model is 300-dimensional. The input layer receives temporal features corresponding to the corresponding dimension and inputs them to the hidden layer. The hidden layer can contain 128 neurons and uses a hyperbolic tangent activation function. The hidden layer outputs the 128-dimensional hidden state corresponding to each time step and inputs it to a random deactivation layer to prevent overfitting. The deactivation rate of the random deactivation layer can be set to 0.2. The output of the random deactivation layer is then fed into a fully connected layer to extract features. Finally, the prediction result is obtained through the output layer, which contains one neuron and uses a linear activation function. The optimizer can be an adaptive moment estimation optimizer, and the loss function is the mean squared error. During training, samples are processed in fixed batches and iterated for a specified number of rounds (e.g., 50 times). An early stopping mechanism is enabled; if the mean squared error of the validation set does not decrease for several consecutive rounds (e.g., 10 rounds), training is terminated early to further avoid overfitting. During the testing phase, Monte Carlo random inactivation was enabled, and forward propagation was performed multiple times (e.g., 50 times) on the test set. The standard deviation of the output results was calculated as the uncertainty parameter of the model. Finally, the trained network weight file was saved, and the uncertainty parameter was recorded. The role of this model is to capture the temporal cumulative trend of pseudo-pressure difference and provide temporal dimension support for the subsequent prediction of viscous pseudo-pressure difference.

[0082] The XGBoost model uses the same dataset partitioning method as the LSTM model (training:validation:test = 7:2:1) to ensure consistency and fairness in training conditions. During model initialization, core parameters are configured, including the learning rate (e.g., 0.05), the number of decision trees (e.g., 300), the maximum tree depth (e.g., 6), the minimum weight of leaf nodes (e.g., 5), and the regularization coefficient (e.g., L1 regularization coefficient 0.1). The minimum weight of a leaf node represents the minimum sample weight and threshold at which a leaf node is allowed to be further split. If the sum of the weights of all samples in a leaf node is less than this threshold, the splitting of that node stops. The loss function also uses mean squared error. The training data consists of static feature data under current operating conditions (including temperature, downtime, temperature and spatial sensitivity coefficients, etc.). This data is collected synchronously under actual operating conditions with viscous residue. While collecting viscous pseudo-pressure difference time-series data, ambient temperature, continuous equipment downtime, and pipeline spatial sensitivity coefficients are recorded simultaneously. These data are then standardized, scaling the values ​​to the 0-1 range. During the training phase, the model is fitted based on the training set, and parameters are dynamically adjusted based on the model's performance on the validation set to balance the model's fitting and generalization abilities. To evaluate the reliability of the model's predictions, a 5-fold cross-validation method is used, and the standard deviation of the prediction error at each fold is calculated as the model's uncertainty parameter, reflecting the model's predictive stability on different subsets of data. After training, the model file is saved, and the corresponding uncertainty parameters are recorded. The model's function is to fit the influence of static and spatial factors on the viscous pseudo-pressure difference under the current operating conditions, and it is combined with the LSTM model to obtain the final viscous pseudo-pressure difference.

[0083] The GPR model training begins with defining kernel functions. A composite kernel function, including the squared exponential kernel, Matern kernel, periodic kernel, and white noise kernel, is used. The kernel function measures the similarity between features of different samples. A white noise term is added to fit the measurement noise generated during the monitoring process, making the model more closely resemble the monitoring data in actual industrial scenarios. For example, the initial values ​​of the kernel function parameters can be set as follows: squared exponential kernel: length scale 1.2, amplitude 0.8; Matern kernel: length scale 0.8, smoothness 1.5, amplitude 0.5; periodic kernel: period 50s, length scale 0.5, amplitude 0.3; white noise kernel: variance 0.01. The training data consisted of temperature drift-related feature data (including the difference between the actual temperature and the calibration temperature, the cumulative operating time of the equipment, and power supply voltage fluctuations). This data was collected under calibration conditions free of viscous residue: first, the viscous residue in the valve cavity / diaphragm was thoroughly removed manually; then, the difference between the transmitter's real-time temperature and the calibration temperature (e.g., the preset calibration temperature is 25℃), the cumulative operating time of the equipment, and the voltage fluctuations of the power supply system were continuously collected at a sampling frequency of 1Hz. After standardization, the feature data was obtained, and the error caused solely by temperature drift was experimentally calibrated as a label. Subsequently, the hyperparameters of the kernel function were optimized using maximum likelihood estimation. Multiple iterative searches were performed using a specified algorithm, such as 50 iterations using the L-BFGS algorithm, to find the hyperparameter combination that optimally fits the training data. Based on the optimized hyperparameters, the entire GPR model was fitted and trained using the training set data. Finally, the model's hyperparameters and the corresponding kernel matrix of the training set were saved as a model file for direct loading and use in the subsequent online prediction stage. The model's function is to predict temperature drift error, providing a foundation for the subsequent calculation of net temperature drift error.

[0084] During the training of the attention network model, the feature data and corresponding labels are first divided into training and validation sets, such as an 8:2 ratio. The feature data includes the current temperature, current viscosity, and the predicted value of the viscous pseudo-pressure difference at the previous moment. Then, the feature data and corresponding labels (the true value of the viscous temperature sensitivity error) are divided into training and validation sets. These data are collected under the condition of viscous residue and dynamic temperature change: the temperature inside the pipeline is controlled to change dynamically within a preset range (such as 10℃-50℃), and the real-time temperature and real-time viscosity of the high-viscosity medium are collected simultaneously. The predicted value of the viscous pseudo-pressure difference at the previous moment is combined with the output of the LSTM and XGBoost models as features. At the same time, the pseudo-pressure difference caused by the change of viscosity of the viscous liquid film at different temperatures is measured through a standard pressure source experiment, which serves as the true label of the viscous temperature sensitivity error.

[0085] Next, a network structure adapted to the feature dimensions was built. For example, the input layer was set to 3D. After receiving feature data of a specified dimension, the input layer first connects to a hidden layer, which consists of 16 neurons and uses a hyperbolic tangent activation function to map the received data to a 16-dimensional hidden feature space. Then, an attention layer is connected and uses a sigmoid activation function. The attention layer automatically learns the contribution weights of different input features to the model output, accurately capturing the influence of core features. The attention layer consists of one neuron and is used to output attention weights. Finally, the prediction result is obtained through the output layer, which consists of one neuron and uses a linear activation function. An adaptive moment estimation optimizer is used, with the mean squared error as the loss function. During training, samples are processed in fixed batches and a specified number of iterations are completed. After training, the network weight file is saved. The purpose of this model is to separate the temperature-dominated part of the viscous pseudo-pressure difference, obtain the viscous temperature-sensitive error, and provide data for the calculation of net temperature drift error.

[0086] This embodiment employs a fusion model of LSTM and XGBoost for accurate prediction of viscous residue. LSTM captures the temporal cumulative characteristics of medium residue, while XGBoost performs nonlinear fitting on multi-dimensional operating conditions. The combination of the two improves the prediction accuracy of viscous residue. A GPR model is used to predict the total temperature drift error. Relying on the composite kernel function, it can flexibly adapt to the fitting requirements of multi-cause temperature drift, and at the same time, it quantifies the uncertainty of the prediction results through probability output. An attention network is used to dynamically weight the viscous residue-related features to improve the prediction accuracy of viscous temperature-sensitive errors. The four models each perform their respective functions and work together to support the accurate stripping of effective pressure difference and subsequent flow calculation.

[0087] Furthermore, this embodiment provides a step for obtaining viscous pseudo-pressure difference based on standardized features, an LSTM model, and an XGBoost model, including:

[0088] Based on the standardized features, LSTM model and XGBoost model, the first error standard deviation, the second error standard deviation, the first predicted pressure difference and the second predicted pressure difference are obtained;

[0089] Based on the first error standard deviation, the second error standard deviation, and Bayes' theorem, the posterior weights are obtained;

[0090] Based on the posterior weights, the first predicted pressure difference, and the second predicted pressure difference, the viscous pseudo-pressure difference is obtained.

[0091] Specifically, the corresponding standardized features are input into the LSTM and XGBoost models respectively. Through model inference, the predicted value and standard deviation of the LSTM model for the pseudo-pressure difference can be obtained, denoted as the first predicted pressure difference and the first error standard deviation. Similarly, the predicted value and standard deviation of the XGBoost model for the pseudo-pressure difference can be obtained, denoted as the second predicted pressure difference and the second error standard deviation. For example, 300-dimensional time-series features are input into the LSTM model, and the predicted distribution is obtained through Monte Carlo Dropout (50 forward propagations). The mean is taken as the first predicted pressure difference, and the standard deviation is taken as the first error standard deviation. 4-dimensional static features are input into the XGBoost model to obtain the predicted distribution. The mean is taken as the second predicted pressure difference, and the standard deviation is taken as the second error standard deviation. The core of this step is to simultaneously obtain the prediction result and the reliability of the prediction. The larger the first and second error standard deviations, the more obvious the fluctuation in the model's current prediction of the pseudo-pressure difference and the lower the reliability; conversely, the higher the reliability. These two indicators are the key basis for subsequent dynamic weight allocation, avoiding the use of only the predicted value while ignoring the model's current adaptability.

[0092] Next, the fusion weights are calculated using Bayes' theorem. The first and second predicted pressure differences are then weighted and fused according to the fusion weights to obtain the viscous pseudo-pressure difference. Specifically, the principle of obtaining the fusion weights based on Bayes' theorem is that the prediction error of LSTM / XGBoost is treated as a random variable. The posterior probability of the weights is derived based on prior knowledge and real-time likelihood, and the fusion weights are assigned using the posterior probability, rather than relying solely on the inverse algebraic proportion of uncertainty.

[0093] When calculating the fusion weights, the prior distribution of the weights is first defined based on the training accuracy of the LSTM and XGBoost models. Specifically, the average error of the validation sets of the LSTM and XGBoost models during training can be obtained separately. The prior distribution of the weights based on the average error is a Beta distribution. For example, assuming the average error of the LSTM validation set is 0.08 kPa and that of XGBoost is 0.12 kPa, the prior weights are defined as follows. (The weights of the LSTM follow a Beta distribution:) , , The mean of this distribution is In other words, the prior weights of LSTM are approximately 60% and XGBoost is 40%, reflecting the prior knowledge that LSTM has higher historical accuracy. Here, the prior distribution is used to set the initial capability weights for the two models. The reason for choosing the Beta distribution is that it is suitable for describing the distribution of probability parameters and can reasonably reflect the fluctuation range of model accuracy.

[0094] Then, the real-time predictions of the LSTM and XGBoost models are treated as normally distributed random variables, and the likelihood function is estimated based on the real-time prediction results. The likelihood function represents the probability that the current predicted value matches the true value. Specifically, a reference value for the viscous pseudo-pressure difference can be obtained from the mean of the offline labels during model training, and an uncertainty index for the model's real-time prediction is estimated using difference validation. Finally, based on the reference value, the uncertainty index, and the predicted value, the likelihood functions corresponding to the two models are obtained. For example, for the LSTM model, the likelihood function is expressed as... For the XGBoost model, the likelihood function is expressed as: ,in, Indicates a normal distribution. This indicates the first predicted pressure difference. This represents the offline label mean. Indicates the first standard deviation of error. This indicates the second predicted pressure difference. The second standard deviation of the error is represented by the first predicted pressure difference, the second predicted pressure difference, the first standard deviation of the error, and the second standard deviation of the error. Substituting these into the corresponding likelihood functions yields the likelihood values ​​for the two models. Mathematically, the likelihood function represents the probability of the model's current predicted value when the true value is referenced. In engineering applications, it is equivalent to a quantitative score of the model's performance under current operating conditions. For example, if the real-time predicted value of LSTM deviates very little from the reference value and has a low standard deviation of error, its likelihood function value will be large, indicating that the LSTM's prediction is more reliable under the current operating conditions. Conversely, if the predicted value of XGBoost deviates significantly from the reference value, its likelihood function value will be small.

[0095] Finally, based on Bayes' theorem, the fusion weights are calculated using the prior distribution and likelihood function, and then weighted using these fusion weights to obtain the viscous pseudo-pressure difference. For example, for the posterior weights of LSTM... , Prior weights By substituting the two likelihood values, we can obtain the specific numerical values. Similarly, we can obtain the posterior weights of XGBoost. After that and As a fusion weight, the viscous pseudo-pressure difference is obtained. The posterior weights are a combination of the prior initial capabilities and the current actual performance. This ensures that the weights neither completely discard the model's historical capabilities nor ignore the actual adaptability to the current working conditions. The resulting weighted viscous pseudo-pressure difference will take into account both the effects of time-series trends and static factors, resulting in higher accuracy and greater stability.

[0096] This embodiment defines the prior distribution of branch weights as a Beta distribution, using the error of the offline validation set as a parameter. This makes the initial weights fit the difference in offline accuracy between LSTM and XGBoost, avoiding the subjectivity of empirical weight allocation from a probabilistic perspective. This makes the initial weight allocation more in line with the capability boundary of the model itself. Then, the real-time prediction error is modeled as a likelihood function of a normal distribution, incorporating both the deviation between the predicted value and the reference value and the prediction uncertainty. This allows the weights to dynamically adapt to the fluctuations of the current operating conditions. If the real-time prediction deviation of a certain branch increases or the uncertainty increases, its likelihood will decrease synchronously, and the posterior weight will also shrink automatically. Finally, the posterior weights derived based on Bayes' theorem are the probabilistically optimal solution under offline prior knowledge and real-time observation information. This reduces the bias propagation of a single branch under extreme operating conditions (such as abrupt changes in time series or abnormal static features), and can also assist real-time prediction with offline priors in small sample or operating condition change scenarios. This improves the accuracy and robustness of real-time pseudo-pressure difference prediction from a probabilistic modeling perspective.

[0097] Furthermore, this embodiment provides a step for obtaining the total temperature drift prediction result based on standardized features and the GPR model, including:

[0098] Based on standardized features and training set samples, a similarity vector is obtained;

[0099] Obtain the labels corresponding to the training set samples, and the kernel matrix between the training set samples;

[0100] The total temperature drift prediction result is obtained by weighting the labels based on the kernel matrix and similarity vector.

[0101] The prediction principle of the GPR model is to measure the similarity between the standardized features of the input and the training set through a kernel function, and to obtain the predicted value by weighting the training set labels. The kernel function is a composite kernel function composed of the squared exponential kernel, the Matern kernel, the periodic kernel and the white noise kernel.

[0102] Specifically, firstly, the similarity between the standardized features of the current input and each sample in the training set is calculated using the kernel function in the GPR model, resulting in a similarity vector. Each element in the vector corresponds to a sample in the training set. The kernel function is a tool for measuring the similarity between the standardized features of the current input, such as temperature difference or equipment aging time, and the features of each sample in the training set. The larger the element in the similarity vector, the closer the current feature is to the feature of that training set sample. The similarity between all samples within the training set is then calculated using the kernel function, resulting in a kernel matrix between the training set samples. The kernel matrix is ​​a pairwise similarity matrix between training set samples, reflecting the distribution relationship of samples within the training set. For example, if two training set samples have very similar features, the corresponding element in the kernel matrix will be larger. Next, the white noise variance obtained during offline training is obtained, multiplied by the identity matrix, and the result is added to the kernel matrix. The purpose of adding this to the kernel matrix is ​​to make the kernel matrix invertible, avoid the singularity of the kernel matrix when the training set samples are completely identical, and incorporate the influence of measurement noise. The dimension of the identity matrix is ​​the same as that of the kernel matrix. The principle behind this step is to solve the mathematical problem of the irreversibility of the kernel matrix. If there are completely identical samples in the training set, the kernel matrix will exhibit singularities. However, the combination of the identity matrix and the white noise variance can ensure that the kernel matrix is ​​invertible. At the same time, the white noise variance corresponds to the random error in the measurement process. This step is equivalent to incorporating the influence of measurement noise into the model, making the prediction results more consistent with the signal fluctuations in actual monitoring.

[0103] The result of the summation is then inverted to obtain the inverse matrix of the training set kernel matrix. The inverse matrix is ​​used to adjust the similarity weights, giving higher weights to training set samples that are more similar to the standardized features. Mathematically, the inverse matrix performs a weighted correction on similarity; it amplifies the weights of training set samples more similar to the current features while reducing the weights of dissimilar samples, thus avoiding interference from irrelevant samples in the prediction results.

[0104] Finally, the similarity vector, inverse matrix, and labels corresponding to the training set samples are multiplied to obtain the total temperature drift prediction result corresponding to the standardized features. The labels corresponding to the training set samples are the true total temperature drift values ​​under historical residue-free operating conditions. The total temperature drift prediction result is essentially a weighted average of the true temperature drift values ​​of the samples in the training set most similar to the current operating condition. Using the true total temperature drift values ​​under residue-free operating conditions as the training set labels ensures that the GPR model only learns temperature drift errors, avoiding interference from residual pseudo-pressure differences, and guaranteeing that the prediction result is purely due to temperature drift errors.

[0105] This embodiment replaces the traditional single-factor temperature drift model with the GPR model. By integrating the coupling relationship between temperature difference, equipment aging, and voltage fluctuation, it accurately fits the nonlinear and non-smooth temperature drift law in industrial scenarios. This solves the problem that the traditional model is not suitable for complex operating conditions such as sudden changes in equipment aging and periodic voltage fluctuations, ensuring the accuracy of the total temperature drift, and thus ensuring the accuracy of the actual pressure difference and flow rate.

[0106] Furthermore, this embodiment provides a step for obtaining the viscous temperature-sensitive error based on standardized features, viscous pseudo-pressure difference, and attention network model, including:

[0107] The attention weights are obtained based on the standardized features and the attention network model.

[0108] Based on attention weights and viscous pseudo-pressure difference, the viscous temperature sensitivity error is obtained.

[0109] Specifically, the core function of the attention network is to automatically learn the relationship between the current temperature, viscosity, and the viscous pseudo-pressure difference at the previous moment, dynamically calculate the contribution ratio of temperature to the current viscous pseudo-pressure difference, i.e., the attention weight, and then multiply this weight by the viscous pseudo-pressure difference to obtain the error dominated solely by temperature, i.e., the viscous temperature sensitive error.

[0110] In this embodiment, standardized features are input into the trained attention network model to obtain attention weights. The attention weights are then multiplied by the viscous pseudo-pressure difference to obtain the viscous temperature-sensitive error. The attention weights are not fixed values ​​preset by experience, but rather dynamic results obtained by the attention network through learning the real-time features of the current temperature, viscosity, and viscous pseudo-pressure difference. This allows the network to automatically adapt to the differences in the contribution of temperature to the viscous error under different operating conditions (for example, the weight of the influence of temperature fluctuations will be significantly increased in the high viscosity range and correspondingly decreased in the low viscosity range), thereby improving the separation accuracy of the viscous temperature-sensitive error.

[0111] Furthermore, this embodiment provides a step for obtaining the effective pressure difference based on the viscous pseudo-pressure difference and the net temperature drift error, including:

[0112] Wavelet decomposition is performed on the feature data to obtain the denoised signal;

[0113] The initial pressure difference is obtained based on the denoised signal, viscous pseudo-pressure difference, and net temperature drift error;

[0114] The effective pressure difference is obtained based on the initial pressure difference and the preset validity verification rules.

[0115] Specifically, since the viscous pseudo-pressure difference and net temperature drift error are interference terms independent of the real throttling pressure difference, and these interference terms are not strongly nonlinearly coupled with the real pressure difference in industrial scenarios, the denoised pressure difference is actually a linear superposition of the real pressure difference generated by orifice plate throttling, the viscous residual pseudo-pressure difference, and the equipment net temperature drift error. Therefore, if the denoised signal is known, a smooth denoised pressure difference can be obtained. Subtracting the viscous pseudo-pressure difference and net temperature drift error from this pressure difference will yield the initial pressure difference.

[0116] The validity verification is to ensure that the initial pressure difference after stripping conforms to physical laws and data reliability. The preset validity verification rules are based on physical logic and signal reliability constraints, specifically including physical rationality verification rules and uncertainty verification rules. The physical rationality verification rule is that the real pressure difference generated by orifice plate throttling cannot be negative physically. If the initial pressure difference is negative, it indicates that there is a deviation in the prediction of the preceding error. At this time, the initial pressure difference needs to be set to zero to prevent non-physical data from entering the subsequent process. An alarm log of "physical rationality abnormality" can be generated, recording the timestamp, initial pressure difference, net temperature drift error and zeroing operation, etc., for post-event traceability and model tuning. If this situation occurs for three consecutive sampling cycles, a level two warning is triggered, prompting the operation and maintenance personnel to check the prediction accuracy of the preceding model (LSTM / XGBoost / GPR / attention network) or the abnormal on-site operating conditions. The uncertainty verification rule is as follows: First, obtain the uncertainty index of the true differential pressure. If this index exceeds a threshold (e.g., 0.5 kPa), it means that the accuracy of the preceding viscous pseudo-differential pressure and temperature drift error stripping is insufficient. The effective differential pressure of the previous cycle can be used for interpolation as a temporary input. If this continues for more than a preset time, an alarm is triggered, and manual intervention is recommended to check the transmitter status, medium characteristics, or recalibrate the model to avoid the impact of unreliable data on flow calculation. If both verifications fail, the input features, weights, and prediction biases of each preceding model need to be checked to pinpoint the root cause of the problem.

[0117] This embodiment uses linear superposition to remove independent interference, transforming the mixed pseudo-pressure difference and temperature drift pressure values ​​into effective pressure differences that only reflect the true throttling effect. This provides accurate core input for subsequent flow calculation. At the same time, the effectiveness verification filters data from the dimensions of physical rationality and uncertainty to avoid the downward transmission of erroneous signals, ultimately improving the accuracy and stability of flow monitoring.

[0118] Furthermore, this embodiment provides a step for obtaining the flow rate at the current moment based on the effective pressure difference and the current viscosity, including:

[0119] The corrected discharge coefficient is obtained based on the current viscosity and the correction factor;

[0120] The flow rate at the current moment is obtained by using the corrected outflow coefficient, the orifice area, and the effective pressure difference.

[0121] Based on the fundamental principle of orifice plate flow meters, the flow rate is directly proportional to the discharge coefficient, the orifice area, and the pressure difference is proportional to the square root of the medium density. The formula is:

[0122]

[0123] in, Indicates flow rate. Represents the standard outflow coefficient. This indicates the area of ​​the perforated plate opening. This represents the coefficient of thermal expansion. Since liquid media can be considered incompressible, we can take 1 / 2. , Indicates the density of the medium. The discharge coefficient represents the effective pressure difference. However, the conventional discharge coefficient is obtained based on the standard value of low viscosity, high Reynolds number fluids. High viscosity media (such as oil) have low Reynolds number and thick boundary layer, which will weaken the actual throttling effect of the orifice plate. Therefore, this embodiment modifies the discharge coefficient to match the flow characteristics of the medium under high viscosity conditions. Finally, the flow rate corresponding to the current moment is obtained by combining the modified discharge coefficient, the orifice plate opening area and the effective pressure difference.

[0124] Specifically, the standard discharge coefficient of the orifice plate is first obtained. The current viscosity calculated above and viscosity correction coefficient obtained from offline experimental fitting and ,in This represents the factory calibration value of the orifice plate under standard operating conditions of low viscosity and high Reynolds number. The viscosity correction factor can be obtained through offline calibration experiments. For example, by selecting a target high-viscosity medium, at least 15 sets of experimental data are collected within the commonly used industrial temperature range of 10℃-80℃. The actual flow rate at different viscosities is measured, and the theoretical flow rate is calculated in conjunction with the standard discharge coefficient. The ratio of the actual flow rate to the theoretical flow rate is recorded as the discharge coefficient correction ratio. With the standardized viscosity as the independent variable and the discharge coefficient correction ratio as the dependent variable, the result is finally obtained through linear fitting using the least squares method. For example, the linear fitting model is as follows: ,in The outflow coefficient is adjusted by the following ratio. The viscosity is the standardized value. Then, based on the standardized viscosity and the viscosity correction factor, the corrected discharge coefficient is obtained. for:

[0125]

[0126] Then, by substituting the corrected outflow coefficient into the basic principle formula of the orifice plate flowmeter, the flow rate at the current moment can be obtained.

[0127] This embodiment compensates for the error of conventional orifice plate flow formulas in high-viscosity conditions by using high viscosity correction of the discharge coefficient. Based on the correlation between viscosity and discharge coefficient calibrated by offline experiments, the fixed standard discharge coefficient is upgraded to a corrected discharge coefficient that dynamically changes with the current viscosity, making it accurately adapt to the flow characteristics of the medium under high viscosity conditions and making the flow calculation more consistent with the actual flow state in industrial sites. Finally, combined with the effective pressure difference extracted in the previous steps, it accurately reflects the actual transport flow of high-viscosity media, solving the core problem of inaccurate flow monitoring of high-viscosity media in petrochemical and other fields.

[0128] Further steps in training the GPR model include:

[0129] Construct kernel functions, including squared exponential kernel, Matern kernel, periodic kernel, and white noise kernel;

[0130] High-confidence pseudo-labels were selected from the original labeled data and the initial GPR model to obtain an expanded training set;

[0131] The hyperparameters are obtained based on the Gaussian process and the preset acquisition function, which is determined based on the desired improvement.

[0132] The trained GPR model is obtained based on the kernel function, expanded training set, and hyperparameters.

[0133] The model training process provided in this embodiment is a further improvement on the GPR model training process provided above. The improvements are only made to the training set construction and hyperparameter optimization. The kernel function definition rules, feature / label acquisition methods, and basic model fitting logic are all the same as those above. The purpose of the improvement is to solve the problems of scarce residual labeled data and easy getting trapped in local optima when optimizing hyperparameters alone in the basic training process.

[0134] Specifically, the input data during training consists of three categories: first, three-dimensional features, including standardized temperature difference, transmitter cumulative usage time, and voltage fluctuation; second, total temperature drift labels, which are derived from records under originally residue-free operating conditions. After the viscous residue in the valve cavity / diaphragm is thoroughly removed by manual disassembly and cleaning, the experimental measurement error caused only by temperature drift is used as the true label; and third, low-residue operating condition data, such as temperature difference, transmitter cumulative usage time, and voltage fluctuation data collected under conditions where the viscous residue is less than 0.1 mm, which are used to generate pseudo labels later.

[0135] The kernel function is composed of a combination of the square exponential kernel, the Matern kernel, the periodic kernel, and the white noise kernel, and can be called a composite kernel function. Among them, the square exponential kernel is used to fit the smoothly changing temperature drift; the Matern kernel is used to fit the non-smooth temperature drift (such as the temperature drift abrupt change caused by equipment aging); the periodic kernel is specifically used to fit the periodic temperature drift caused by voltage fluctuations, and only acts on the characteristic of voltage fluctuation; the white noise kernel is responsible for fitting the measurement noise generated during the monitoring process. The combination of the four types of kernel functions can cover the fitting needs of multiple types of temperature drift. The calculation logic of the composite kernel function is to directly sum the output values ​​of each sub-kernel function. The role of this kernel function is to accurately adapt to the temperature drift changes caused by different reasons and improve the prediction accuracy of the GPR model for temperature drift error.

[0136] When expanding the training set, an initial GPR model is first trained using the existing labeled data. This model is then used to predict the pseudo-labels corresponding to the low residual working conditions, and the standard deviation of these pseudo-labels is calculated. The training method for the initial GPR model is the same as the training method described above, such as using maximum likelihood estimation combined with the L-BFGS algorithm to optimize hyperparameters. For example, the specific training details are as follows: the size of the original labeled data is set to... (like =50), then a 50×50 dimensional training set kernel matrix is ​​constructed based on the composite kernel function, and the hyperparameters are optimized through 50 iterations using the L-BFGS algorithm. The objective function of maximum likelihood estimation is then determined. for:

[0137]

[0138] in, Represents the kernel matrix of the training set. This represents a 50-dimensional column vector of temperature drift labels, where each element is the total temperature drift label corresponding to a single set of original labeled data. It is a 50th order identity matrix. For white noise kernel variance, This indicates transpose.

[0139] After completing the initial GPR model training, pseudo-labels and standard deviations were calculated for the low-residual unlabeled data. The size of the low-residual unlabeled data was set to... (like =500), the calculation process follows the online prediction principle of the GPR model, calculating the pseudo-label and prediction standard deviation for each sample, with the formula as follows:

[0140]

[0141]

[0142] in, For the first Temperature drift pseudo-labels for samples under low residual operating conditions. The standard deviation of the prediction for this pseudo-label. This is a 50-dimensional similarity vector between the current sample and 50 sets of original labeled samples. For the first The composite kernel function of a low-residue, label-free sample was calculated. For the first A 3D feature vector of a low-residue working condition sample.

[0143] Next, a fixed screening threshold of 0.1 kPa is set. This threshold is only an example and is not a limitation in this embodiment. High-confidence pseudo-labels with a standard deviation less than 0.1 kPa are selected. These labels and their corresponding low-residual data are added to the original label set to obtain an updated label set. For example, 100 high-confidence samples are selected from 500 sets of low-residual data. These 100 high-confidence pseudo-labels and their corresponding low-residual feature data are added to the original 50-set label set to obtain an updated 150-set label set. Finally, the process of training the model, predicting pseudo-labels, selecting high-confidence labels, and expanding the label set is repeated. For example, it can be iterated for 3 rounds to expand the size of the label set to several times its original size. For example, 100 new high-confidence pseudo-labels are added in each round, eventually expanding the size of the label set from the original 50 sets to 350 sets (7 times), resulting in an expanded training set. By "training the initial model with real data, predicting pseudo-labels for low-residual data with the model, and selecting high-confidence pseudo-labels to expand the data", the size of the training set is expanded while ensuring data reliability, thereby improving the generalization ability of the GPR model.

[0144] When optimizing hyperparameters using Bayesian methods, a Gaussian process is first used to fit the mapping relationship between the hyperparameter combination and the likelihood function, where the hyperparameter combination... This includes the hyperparameters corresponding to each kernel function, specifically the quadratic exponential kernel length scale / amplitude, Matern kernel length scale / amplitude, periodic kernel period / length scale / amplitude, and white noise kernel variance, totaling eight hyperparameters. Specifically, when constructing the Gaussian process surrogate model, these eight hyperparameters are combined. Using the negative log-likelihood (NLL) of the model on the validation set as input and the squared exponential kernel as output, a Gaussian process surrogate model is obtained by fitting the nonlinear mapping relationship between hyperparameters and model performance using the squared exponential kernel as the kernel function of the surrogate model. This model can quickly predict the model performance corresponding to any combination of hyperparameters. Then, the expected improvement is used as the acquisition function, as shown in the formula:

[0145]

[0146] in, express Expected improvement value Expressing expectations, This indicates that the Gaussian process surrogate model has high sensitivity to hyperparameters. The predicted values ​​of the corresponding model performance are measured using the negative log-likelihood. This represents the minimum NLL value obtained among all hyperparameters. The function calculates the expected improvement between the current hyperparameter's likelihood value and the existing optimal likelihood value. Through multiple rounds of search iterations, the optimal hyperparameters that improve model performance are ultimately determined. Specifically, the initial search space for Bayesian optimization follows the value range of each kernel function hyperparameter from the previous training process, and the number of iterations is still set to 50 rounds. For example, the specific steps are as follows: First, 10 initial hyperparameter combinations are randomly sampled within the hyperparameter search space. The GPR model is trained on each combination, and the validation set NLL value is calculated to form the initial observation set. Then, the Gaussian process surrogate model is trained using the initial observation set, and the acquisition function is maximized using the gradient ascent method to obtain the next hyperparameter combination to be evaluated. Using hyperparameter combinations In practice, the GPR model is trained, and the true NLL values ​​on the validation set are calculated. The model is updated with the optimal NLL value and the true NLL value is added to the observation set. The process of training the Gaussian process surrogate model with the initial observation set is then repeated until 50 iterations are completed. Finally, the combination with the smallest NLL value in the validation set is selected from all the hyperparameter combinations in the 50 iterations as the optimal hyperparameter combination. Through the above Bayesian optimization process, global intelligent search of hyperparameters can be achieved. Compared with the single maximum likelihood estimation in the basic training process, it effectively avoids the problem of hyperparameter optimization getting trapped in local optima, while improving the efficiency of hyperparameter search and accurately matching the multi-parameter combination requirements of composite kernel functions.

[0147] The GPR model training is based on the expanded label set and the optimal hyperparameters obtained in the above steps. Specifically, firstly, the similarity between each sample is calculated using a composite kernel function on a sample-by-sample basis using the expanded label set to construct the training set kernel matrix. Then, the product of the white noise kernel variance and the identity matrix is ​​added to obtain an invertible covariance matrix, avoiding singularity in the kernel matrix. Next, the optimal hyperparameter combination is used as the kernel function parameters. Based on the covariance matrix and combined with the temperature drift labels from the expanded label set, the full fit of the GPR model is completed. After training, the optimal hyperparameter combination, covariance matrix, and kernel function calculation template are saved as a model file for subsequent online prediction of temperature drift error. The purpose of the trained GPR model is to accurately predict temperature drift error, providing reliable temperature drift interference data for subsequent calculation of net temperature drift error and stripping of effective pressure difference.

[0148] This embodiment overcomes the limitation of traditional single kernels, which can only fit smooth temperature drift, by combining composite kernel functions. It adapts smooth, non-smooth, and periodic temperature drifts by using squared exponential kernels, Matern kernels, and periodic kernels, respectively, and combines them with white noise kernels to remove measurement noise. This enables the model to accurately cover complex temperature drift patterns in industrial scenarios, such as sudden changes in equipment aging and periodic voltage fluctuations. On the other hand, semi-supervised learning uses low-residual unlabeled data to expand the training set, which not only solves the problem of scarce unlabeled data, but also ensures data quality through high-confidence pseudo-label screening. At the same time, Bayesian optimization of hyperparameters replaces manual parameter tuning with Gaussian process surrogate models and expectation improvement functions, which not only improves the efficiency of hyperparameter search, but also accurately matches the multi-parameter combination of composite kernels, further enhancing the model's fitting accuracy.

[0149] This application provides a valve flow monitoring system, including:

[0150] The acquisition module is used to acquire the feature data corresponding to the current moment, including temperature and pressure signals;

[0151] The preprocessing module is used to preprocess the feature data to obtain standardized features;

[0152] The error calculation module is used to obtain viscous pseudo-pressure difference, viscous temperature sensitivity error and net temperature drift error based on standardized features and preset model units;

[0153] The differential pressure calculation module is used to obtain the effective differential pressure based on the viscous pseudo-differential pressure and net temperature drift error;

[0154] The flow calculation module is used to obtain the flow rate at the current moment based on the effective pressure difference and the current viscosity.

[0155] This application embodiment uses LSTM and XGBoost models to capture the dynamic time-series dependence and static multi-factor coupling relationship, accurately predicts the pseudo pressure difference caused by the liquid film remaining in the high-viscosity medium, then fits the total temperature drift using the GPR model, and automatically learns the contribution weight of temperature to viscous error using the attention network model, so as to achieve independent separation of the two types of errors: equipment temperature drift error and viscous temperature sensitive error, and finally obtain accurate flow rate values.

[0156] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0157] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0158] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0159] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.

Claims

1. A method of monitoring the flow of a valve, characterized by, include: Acquire the feature data corresponding to the current moment, the feature data including temperature signal and pressure signal; The feature data is preprocessed to obtain standardized features; Based on the standardized features and preset model units, the viscous pseudo-pressure difference, viscous temperature sensitivity error, and net temperature drift error are obtained. The effective pressure difference is obtained based on the viscous pseudo-pressure difference and the net temperature drift error; Based on the effective pressure difference and the current viscosity, the flow rate at the current moment is obtained; The preset model units include LSTM, XGBoost, GPR, and attention network models. Based on the standardized features and the preset model units, the viscous pseudo-pressure difference, viscous temperature sensitivity error, and net temperature drift error are obtained, including: The viscous pseudo-pressure difference is obtained based on the standardized features, the LSTM model, and the XGBoost model. Based on the standardized features and the GPR model, the total temperature drift prediction results are obtained; Based on the standardized features, the viscous pseudo-pressure difference, and the attention network model, the viscous temperature-sensitive error is obtained. The net temperature drift error is obtained based on the viscous temperature sensitivity error and the total temperature drift prediction result; Based on the standardized features, the LSTM model, and the XGBoost model, the viscous pseudo-pressure difference is obtained, including: Based on the standardized features, the LSTM model, and the XGBoost model, the first error standard deviation, the second error standard deviation, the first predicted pressure difference, and the second predicted pressure difference are obtained. Based on the first error standard deviation, the second error standard deviation, and Bayes' theorem, the posterior weights are obtained; The viscous pseudo-pressure difference is obtained based on the posterior weight, the first predicted pressure difference, and the second predicted pressure difference; The step of obtaining the viscous temperature-sensitive error based on the standardized features, the viscous pseudo-pressure difference, and the attention network model includes: Based on the standardized features and the attention network model, the attention weights are obtained; The viscous temperature sensitivity error is obtained based on the attention weight and the viscous pseudo-pressure difference.

2. The method of claim 1, wherein, The preprocessing of the feature data to obtain standardized features includes: The feature data is decomposed by wavelet to obtain a denoised signal; The current viscosity is obtained based on the denoised signal and the Arrhenius formula; Multiple standardized features are obtained based on the denoised signal, and each standardized feature corresponds to a model in the preset model unit.

3. The method of claim 1, wherein, The process of obtaining the total temperature drift prediction result based on the standardized features and the GPR model includes: Based on the standardized features and training set samples, a similarity vector is obtained; Obtain the labels corresponding to the training set samples, and the kernel matrix between the training set samples; The total temperature drift prediction result is obtained by weighting the labels according to the kernel matrix and the similarity vector.

4. The method of claim 1, wherein, The process of obtaining the effective pressure difference based on the viscous pseudo-pressure difference and the net temperature drift error includes: The feature data is decomposed by wavelet to obtain a denoised signal; The initial pressure difference is obtained based on the denoised signal, the viscous pseudo-pressure difference, and the net temperature drift error; The effective pressure difference is obtained based on the initial pressure difference and the preset validity verification rules.

5. The method of claim 1, wherein, The step of obtaining the flow rate at the current moment based on the effective pressure difference and the current viscosity includes: Based on the current viscosity and correction factor, the corrected discharge coefficient is obtained; The flow rate at the current moment is obtained based on the corrected outflow coefficient, the orifice area, and the effective pressure difference.

6. The method of claim 3, wherein, The steps for training the GPR model include: Construct kernel functions, including squared exponential kernels, Matern kernels, periodic kernels, and white noise kernels; High-confidence pseudo-labels were selected from the original labeled data and the initial GPR model to obtain an expanded training set; The hyperparameters are obtained based on the Gaussian process and a preset acquisition function, wherein the preset acquisition function is determined according to the desired improvement. The trained GPR model is obtained based on the kernel function, the expanded training set, and the hyperparameters.

7. A valve flow monitoring system for implementing the valve flow monitoring method as described in any one of claims 1-6, characterized in that, include: The acquisition module is used to acquire the feature data corresponding to the current moment, including temperature signals and pressure signals; The preprocessing module is used to preprocess the feature data to obtain standardized features; The error calculation module is used to obtain the viscous pseudo-pressure difference, viscous temperature sensitivity error, and net temperature drift error based on the standardized features and preset model units. The differential pressure calculation module is used to obtain the effective differential pressure based on the viscous pseudo-differential pressure and the net temperature drift error; The flow calculation module is used to obtain the flow rate at the current moment based on the effective pressure difference and the current viscosity.