Converter system for low-gas-content gas-liquid two-phase flow Coriolis flowmeter

By adopting the AMP dual-core operating architecture and the Stacking integration model, the measurement accuracy problem of Coriolis flowmeter under gas-liquid two-phase flow conditions was solved, achieving high real-time and high-precision flow measurement and optimizing system resource utilization.

CN121521214APending Publication Date: 2026-02-13TIANJIN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511761762.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-27
Publication Date
2026-02-13

AI Technical Summary

Technical Problem

In gas-liquid two-phase flow conditions, the measurement accuracy of Coriolis flowmeters drops significantly. Existing data-driven modeling methods are difficult to implement in converter systems with high real-time performance and high accuracy of flow measurement, and traditional embedded development board resources are insufficient to support the deployment of complex algorithms.

Method used

The system adopts an AMP dual-core operating architecture. The real-time operating system is responsible for signal acquisition and preprocessing, while the time-sharing operating system performs gas-liquid two-phase flow correction tasks. The Stacking integrated model structure is used to improve measurement accuracy. The real-time operating system performs signal processing and PI control through the dual-core processor, while the time-sharing operating system performs data-driven flow correction.

Benefits of technology

The Coriolis flowmeter achieves high real-time performance and high accuracy measurement under low gas content gas-liquid two-phase flow conditions, optimizes system resource utilization efficiency, and significantly improves measurement accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121521214A_ABST
    Figure CN121521214A_ABST
Patent Text Reader

Abstract

The invention provides a converter system for a low-gas-content gas-liquid two-phase flow Coriolis flowmeter. The converter system comprises two treatment processes of a real-time operation system and a time-sharing operation system. The real-time operation system comprises the following steps that signal collection is conducted on a Coriolis flowmeter sensor, and two paths of vibration sensor signals from a primary instrument of the Coriolis flowmeter are obtained and used for obtaining fluid flow information; the two paths of vibration sensor signals are preprocessed, and amplitude information and phase information are calculated; the phase difference and the signal time difference of the two paths of vibration sensor signals are obtained; calculating the density and the flow; the density and mass flow information is transmitted to a time-sharing operation system kernel; a time-sharing operation system executes a gas-liquid two-phase flow correction task, and a Stacking integrated model structure is adopted to obtain a mass flow correction model through training.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of Coriolis flow meter flow measurement under low gas content gas-liquid two-phase flow conditions, specifically a Coriolis flow converter system. Background Technology

[0002] The Coriolis mass flow meter (or Coriolis flow meter for short) is a flow meter developed based on the Coriolis force principle. It is widely used due to its high accuracy, good repeatability, and ability to directly measure the mass flow rate of fluids. Under single-phase flow conditions, the Coriolis flow meter exhibits high measurement performance, achieving accuracy of 0.1% or even higher. However, under gas-liquid two-phase flow conditions, the measurement accuracy of the Coriolis flow meter drops significantly. Taking low gas content (0~30%) gas-liquid two-phase flow as an example, when the gas content is high, the error of the Coriolis flow meter can reach 20% or even higher. To address this issue, researchers have established a gas-liquid two-phase flow correction model using data-driven and mechanistic methods, thereby improving the measurement accuracy of the Coriolis flow meter under gas-liquid two-phase flow conditions.

[0003] The advantage of establishing a calibration model based on the vibration mechanism of the Coriolis flowmeter measuring tube is its strong interpretability, but it also has certain limitations. First, mechanism modeling requires the use of equipment such as sound velocity meters and density meters to measure relevant parameters of two-phase flow, but practical applications can only support integrated measurements. Second, mechanism modeling has poor generalization ability, with high requirements for gas content, measuring tube direction, and density drop, and the measurement accuracy after calibration remains low. With the continuous maturation of machine learning and neural network models, numerous data-driven two-phase flow measurement models for Coriolis flowmeters have been proposed. Compared with mechanism modeling methods, data-driven modeling is simpler, and the applicability of the model is closely related to the scope of the dataset used; expanding the dataset can broaden the applicability of the model. Therefore, data-driven modeling is of great significance for improving the measurement accuracy of Coriolis flowmeters, expanding their applicability, and meeting the measurement needs of two-phase flow conditions.

[0004] Currently, most studies on data-driven two-phase flow measurement models only conduct offline testing using test sets within the dataset, without deploying them in converter systems for real-world testing. The few studies that do conduct real-world testing utilize high-performance PCs or servers. The main technical challenges contributing to this situation are twofold: 1. Coriolis flowmeter converter systems require highly real-time algorithms for signal processing and drive control, which are difficult to implement in parallel once deployed, given the time-consuming nature of machine learning and neural network models; 2. Traditional Coriolis flowmeter converters typically use low-performance embedded development boards. Machine learning requires advanced algorithm libraries, and the forward derivation process is difficult to implement directly in C language. Furthermore, the limited memory of the development board makes it difficult to store the weight parameters of the neural network. Summary of the Invention

[0005] The purpose of this invention is to provide a Coriolis flowmeter converter system suitable for gas-liquid two-phase flow, the method of which is as follows: A Coriolis flowmeter converter system for low gas content gas-liquid two-phase flow is proposed. Based on the dual-core operating architecture of AMP, it utilizes a dual-core processor. One core deploys a real-time operating system to run real-time tasks, while the other core deploys a time-sharing operating system to run time-consuming tasks. The system includes processing flows for both the real-time operating system and the time-sharing operating system. The real-time operating system includes the following steps: Signal acquisition is performed on the Coriolis flow meter sensor to obtain two vibration sensor signals from the primary instrument of the Coriolis flow meter for acquiring fluid flow information; The two vibration sensor signals are preprocessed to calculate amplitude and phase information; Based on the obtained amplitude and phase information, the driving frequency and driving amplitude are output based on PI control, and the driving signal is synthesized by digital signal synthesis to make the Coriolis flowmeter measuring tube work at the optimal vibration frequency and amplitude. The two vibration sensor signals are processed a second time to obtain the phase difference and signal time difference between the two vibration sensor signals; Perform density and flow rate calculations; The density and mass flow rate information are transmitted to the time-sharing operating system kernel. The time-sharing operating system performs the gas-liquid two-phase flow correction task, adopts a stacking ensemble model structure, and obtains a mass flow correction model after training.

[0006] Furthermore, in the real-time operating system, the process of acquiring signals from the Coriolis flowmeter sensor to obtain two vibration sensor signals from the primary instrument of the Coriolis flowmeter for acquiring fluid flow information includes: Initialize the selected analog-to-digital converter chip, setting the sampling frequency and channel number initialization information; Two vibration sensor signals from the primary instrument of the Coriolis flowmeter are captured to obtain fluid flow information.

[0007] Furthermore, in the real-time operating system, the method for preprocessing the two vibration sensor signals and calculating the amplitude and phase information is as follows: Different algorithms are selected according to the requirements to process the two vibration sensor signals and calculate the amplitude and phase information. Two algorithms are selected: one is the quadrature demodulation algorithm and the other is the complex coefficient bandpass filter algorithm. If the quadrature demodulation algorithm is chosen, the following signal preprocessing method is used: The frequency at the current moment is estimated based on the frequency of the two vibration sensor signals at past moments, and two orthogonal sine and cosine reference signals of the same frequency are generated accordingly. The two vibration sensor signals acquired are multiplied by two orthogonal sine and cosine reference signals of the same frequency, and the multiplication results in two sets of second harmonic signals and DC signals. The second harmonic component and interference signal are filtered out by a low-pass filter to obtain the DC signal; Calculate the amplitude and phase information of the two vibration sensor signals after low-pass filtering; If the user selects the complex coefficient bandpass filter algorithm, the following signal preprocessing method is used: The frequency at the current moment is estimated based on the frequency of the two vibration sensor signals at past moments, and two orthogonal sine and cosine reference signals of the same frequency are generated accordingly. The two vibration sensor signals and two sinusoidal reference signals of the same frequency are input into a complex coefficient bandpass filter to obtain the phase difference between the two signals of the Coriolis flowmeter. Furthermore, the method for obtaining the DC signal by filtering out the second harmonic component and interference signals using a low-pass filter is as follows: Four cascaded IIR low-pass filters are used for filtering; the first two filters perform coarse filtering, and the cutoff frequency is selected as [value missing]. , It is the sensor signal frequency; the latter two filters perform fine filtering, with a cutoff frequency of... .

[0008] Furthermore, the design steps for the complex coefficient bandpass filter are as follows: S1: Determine the design specifications, design a real-number filter based on the elliptic filter, and obtain the filter coefficients; S2: Based on the resonant frequency of the Coriolis flowmeter in single-phase flow and the signal sampling frequency, determine the conversion factor of the complex coefficient bandpass filter. The values ​​are obtained by combining the filter coefficients designed in S1 with... Multiply them to obtain the final complex coefficient bandpass filter coefficients; S3: Transfer the signals from the two vibration sensors , and two sinusoidal reference signals of the same frequency. , The inputs are fed into a complex coefficient bandpass filter, and the outputs are respectively... , , , ; The reference signal output by the complex coefficient bandpass filter , The conjugate of, and then with, respectively , Multiplication decomposes the real and imaginary parts of the signal to calculate the vibration amplitude and phase information.

[0009] Furthermore, in the real-time operating system, the method for performing secondary processing on the two vibration sensor signals to obtain the phase difference and signal time difference between the two vibration sensor signals is as follows: The phase information and PI control output drive frequency obtained by preprocessing the step signals from the two vibration sensors are low-pass filtered. The phase difference between the two vibration sensor signals is calculated using the phase information after low-pass filtering; The signal time difference between the two vibration sensor signals is calculated based on the phase difference between the two vibration sensor signals and the driving frequency after low-pass filtering.

[0010] Furthermore, in the real-time operating system, the method for calculating density and flow is as follows: The instantaneous mass flow rate of the fluid is calculated based on the time difference between the signals from the two vibration sensors. The specific calculation formula is as follows: In the above formula, The time difference between the two vibration sensor signals is given. The signal time difference when the mass flow rate is 0. The instrument coefficient refers to the "conversion coefficient" obtained by calibrating each flow meter through a standard device. It is used to convert the physical quantity detected by the sensor into the engineering unit value of mass flow rate, reflecting the quantitative relationship between the sensor output signal and the actual mass flow rate. The density of the fluid is calculated based on the driving frequency, using the following formula: in, , It is the instrument coefficient for density calculation; For driving frequency; The cumulative flow is calculated based on the instantaneous mass flow rate and the current timestamp.

[0011] Furthermore, in the real-time operating system, transmitting density and mass flow rate information to the time-sharing operating system kernel specifically includes transmitting the density, mass flow rate, driving frequency, driving amplitude, phase of the two vibration sensor signals, and vibration amplitude information of the two vibration sensor signals to the time-sharing operating system kernel.

[0012] Furthermore, in the time-sharing operating system, the stacking ensemble model structure is adopted, and after training, a quality flow correction model is obtained. This includes: its first layer consists of multiple differentiated base models, which are different types of learning models or similar models with different parameter settings; its second layer meta-model uses the support vector machine regression algorithm (SVR) to model the output of the base models, and after training, a quality flow correction model is obtained.

[0013] Furthermore, the time-sharing operating system executes the gas-liquid two-phase flow correction task, employing a stacking ensemble model structure. After training, the mass flow correction model is obtained, specifically including: A dataset was established through experiments. The data collected in the experiments were mainly obtained by the real-time operating system, including the density, mass flow rate, driving frequency, driving amplitude, phase of the two vibration sensor signals, and vibration amplitude information of the two vibration sensor signals. The data collected in the experiment were preprocessed, and the time and frequency domain characteristics of the signal were analyzed. The mean and variance of the signal were calculated in the time domain, and the wavelet packet decomposition results of the original signal were calculated in the frequency domain. The lowest frequency band energy of the wavelet packet decomposition of different original signals of the Coriolis flowmeter was selected as the frequency domain feature value. Feature engineering is performed on the internal signals of the Coriolis flowmeter and the time-domain and frequency-domain analysis results based on the random search method: the time-domain and frequency-domain features of multi-dimensional signals such as mass flow rate, drive frequency, vibration phase and vibration amplitude of two vibration sensor signals are used as initial features, and an extended feature set is constructed by combining basic mathematical operations and function transformations to form a feature pool; feature selection and combination operations are performed in the feature pool using the random search method: multiple feature combinations are randomly generated according to the preset base model parameters and the number of input features, and several base models are determined as components of the Stacking ensemble learning structure by evaluating the root mean square error and mean absolute percentage error; The metamodel of the Stacking ensemble model uses the Support Vector Machine Regression (SVR) algorithm to fuse the outputs of each base model and the unused features in the feature pool. After training, a mass flow correction model is obtained.

[0014] This solution employs an AMP dual-core architecture to effectively partition and isolate system tasks. One core deploys a real-time operating system dedicated to the real-time acquisition and preprocessing of Coriolis flowmeter sensor signals, as well as high-precision calculation of the amplitude and phase characteristics of the two sensor signals. The other core deploys a time-sharing operating system responsible for executing measurement correction tasks based on a Stacking ensemble learning model, improving the measurement accuracy of the Coriolis mass flowmeter under gas-liquid two-phase flow conditions. This architecture isolates high-real-time core measurement tasks from high-complexity non-real-time computational tasks, ensuring both the real-time performance and accuracy of gas-liquid two-phase flow measurements under low gas content conditions, while significantly optimizing system resource utilization efficiency. Detailed Implementation

[0015] The following describes the embodiments, which are implemented based on the present technical solution. Obviously, these embodiments are only some, not all, of the present invention, and the scope of protection of the present invention is not limited to the following embodiments.

[0016] This invention discloses a solution for a Coriolis flow meter converter for low gas content gas-liquid two-phase flow. It is based on the dual-core operating architecture of AMP, which utilizes a dual-core processor. One core deploys a real-time operating system to run real-time tasks, while the other core deploys a time-sharing operating system to run time-consuming tasks.

[0017] Real-time operating system architecture diagram as follows Figure 1 The specific steps are as follows: Step 1: Acquire signals from the Coriolis flow meter sensor.

[0018] Step 2: Preprocess the acquired signals according to the signal processing algorithm selected by the user on the host computer in the time-sharing operating system.

[0019] Step 3: Perform secondary processing on the preprocessed signal.

[0020] Step 4: Calculate density and flow rate using the signal after secondary processing.

[0021] Step 5: Transmit density and mass flow rate information to the time-sharing operating system kernel.

[0022] In step 1, the Coriolis flow meter sensor is acquiring signals. Step 1.1: Initialize the selected analog-to-digital converter chip by setting the sampling frequency, number of channels, and other initialization information.

[0023] Step 1.2: Capture the raw electrical signal from the primary instrument of the Coriolis flow meter to obtain fluid flow information.

[0024] Step 2 involves preprocessing the acquired signals according to the signal processing algorithm selected by the user on the host computer in the time-sharing operating system: Step 2.1: In the Coriolis mass flow meter, the quadrature demodulation algorithm and the complex coefficient bandpass filter algorithm are used to calculate the phase difference between the two sensors. Depending on the application scenario, the user will choose different signal processing algorithms. If the user's application requirement is noise reduction, the quadrature demodulation algorithm is selected; if the user's application requirement is to improve response speed, the complex coefficient bandpass filter algorithm is selected. Specifically, the quadrature demodulation algorithm first multiplies the two acquired vibration sensor signals by sine and cosine signals of the same frequency (also called reference signals), generating a second harmonic signal and a DC signal. Then, a low-pass filter is used to filter out the second harmonic component, leaving the phase and amplitude information of the sensor signals in the remaining DC component. Finally, through a series of mathematical calculations, the amplitude and phase difference information of the sensor signals can be obtained.

[0025] When the vibrating tube of the Coriolis flowmeter is working, the signal detected by the sensor will change according to a sinusoidal law, using a sinusoidal signal. , This represents the signals from the two vibration sensors, where: (1) In equation (1), , It is the amplitude of the signal; , It is the frequency of the signal; , It is the phase of the signal; This is an interference signal. The reference signal is as follows: (2) in, , The frequency of the reference signal is the same as the frequency of the two vibration sensor signals. Multiplying the two vibration sensor signals by the reference sine and cosine signals of the same frequency, respectively, and then transforming them using trigonometric function induction formulas, yields equations (3) and (4): (3) (4) As can be seen, the mixed signal consists of three parts, namely the DC signal... Second harmonic signal and interference signals The multiplied signals are then passed through a low-pass filter to remove the second harmonic signal and interference, yielding the DC signal. and ,in represent , That is, the amplitude information of the two signals. represent , That is, the phase information of the two signals. represent , This refers to interference signals.

[0026] In this scheme, multiple IIR filters are cascaded for the low-pass filter. The filtering process of a single IIR filter will be used as an example. Let the IIR filter be at the... During the next sampling, the input is Output The calculation method is as follows: (5) in, , For the filter coefficients, the filter is at the th... The output at the next sampling is The filter can be calculated in the following way: (6) (7) in This is the filter cutoff frequency. This refers to the signal sampling frequency. Frequency higher than [the specified frequency]... The signal will be significantly attenuated when it passes through this filter. Cutoff frequency This will affect the calculation accuracy. This scheme uses four cascaded IIR low-pass filters for filtering; the first two filters perform coarse filtering, and the cutoff frequency is selected as [value missing]. , This is the frequency of the sensor signal. The last two filters perform fine filtering, with a cutoff frequency of... .

[0027] The amplitude and phase information of the two vibration sensor signals can be obtained from the filtered DC signal. The amplitude can be calculated using formula (8): (8) The phase can be calculated using formula (9): (9) The implementation process of the complex coefficient bandpass filter algorithm differs from that of the orthogonal demodulation algorithm. This algorithm inputs two vibration sensor signals and a reference signal into the complex coefficient bandpass filter. The complex coefficient bandpass filter can be derived from a real coefficient filter by multiplying the filter parameters by a complex transformation factor. In the spectrum diagram, this is represented by shifting the spectrum of the real coefficient filter to the right, forming a bandpass filter whose spectral response is not symmetrical about zero frequency. When the real signal passes through the complex coefficient bandpass filter, it is analyzed into a signal with orthogonal real and imaginary parts. Using trigonometric transformations, the phase difference between the two signals from the Coriolis flowmeter can be obtained.

[0028] Suppose the transfer function of a real filter is , and Variable multiplied by a transformation factor Transformed into a complex coefficient bandpass filter As shown in equation (10): (10) According to Euler's formula, a standard sine wave signal can be expressed in the following form: (11) Equation (11) shows that any positive signal in the real number domain consists of both positive and negative frequency components. Therefore, when a real signal passes through a complex filter, the negative frequency components of the real signal will be filtered out, leaving only the positive frequencies. Using the retained positive frequencies, an orthogonal pair can be constructed, and the phase difference between the two vibration sensor signals can then be solved.

[0029] The quality of the design of a complex coefficient bandpass filter directly determines the accuracy of the phase solution. The specific design steps are as follows: S1: An elliptic filter is a type of IIR filter. At the same order, an elliptic filter has a narrower transition band, meaning that the attenuation from the passband to the stopband is faster. This scheme designs a real-valued filter based on an elliptic filter, with the following specifications: passband frequency of 35Hz, stopband frequency of 180Hz, passband attenuation of 0.1dB, and stopband attenuation of 80dB.

[0030] S2: The Coriolis flowmeter used in this scheme has a resonant frequency of around 215Hz in single-phase flow, therefore the conversion factor is... The value is taken from equation (12). This represents the signal sampling frequency.

[0031] (12) The filter coefficients designed in S1 and The final complex filter coefficients are shown in Table 1 after multiplication. Table 1. Coefficients of Complex Coefficient Bandpass Filter

[0032] S3: The difference equation for an IIR digital filter is: (13) in, This indicates the nth sampling time. This represents the output signal at the current moment. This represents the output signal at a past time. This represents the input signal at a past or current moment. Indicates the output feedback coefficient. This represents the input feedforward coefficient.

[0033] When the sensor signal and a sinusoidal reference signal of the same frequency are input into a complex coefficient bandpass filter, the following result is obtained: (14) Take the reference signal that has passed through the complex coefficient bandpass filter , The conjugate of, and then with, respectively , Multiplication: (15) The real and imaginary parts of the signal are decomposed, and the amplitude and phase can be calculated using formulas (8) and (9).

[0034] Since both algorithms require generating sine and cosine signals of the same frequency as the two vibration sensor signals during operation, the reference signal in the system can be obtained by the following formula: (16) (17) In the formula , , The frequency and other values ​​of the vibration of the measuring tube in the Coriolis flowmeter detected by the sensor are in Nearby fluctuations, It is the sampling frequency, which is [frequency] in this system. High-speed sampling. Since the operating frequency of the vibrating tube is a relatively continuous process, the vibration frequency at the current moment is related to the vibration frequency at the previous moment. Therefore, the reference signal is described in the form of "accumulation." During the operation of the flowmeter, It is a continuously accumulating process, and its value will become larger and larger. The period of both sine and cosine signals is 2. Therefore, the value is greater than 2. At that time, it should be controlled by the program to subtract 2. .

[0035] Step 2.2: Since the Coriolis flowmeter measuring tube needs to be vibrated during measurement, based on the phase and amplitude information obtained in Step 2.1, the driving frequency and driving amplitude are output based on PI control, and the driving signal is synthesized through digital signal synthesis to make the Coriolis flowmeter measuring tube work at the optimal vibration frequency and amplitude. In amplitude control, the sensor vibration amplitude is set at 0.08V. After initial sinusoidal vibration, the signal amplitude is calculated by quadrature demodulation, compared with the set value, and the amplitude increment is calculated using PI control. The increment and the current signal amplitude together generate a new driving amplitude, controlling the vibration of the measuring tube within the set amplitude. Frequency control is similar in principle to amplitude control, except that the target value of frequency control is the resonant frequency of the system composed of the measuring tube and the fluid. According to the phase-locked loop principle, when the system operates at the resonant frequency, the phase difference is 0. Therefore, in frequency control, the phase target value is set to 0 degrees. The calculated sensor signal phase is compared with the set value, the control increment is calculated by PI control, and it is accumulated on the current driving frequency to generate a new driving frequency. It is this control process that locks the sensor signal phase at 0 degrees and converts the phase increment into a frequency increment, driving the sensor measuring tube to vibrate at the resonant frequency.

[0036] In step 3, the preprocessed signal undergoes secondary processing: Step 3.1: Perform low-pass filtering on the phase calculated in Step 2.1 and the driving frequency calculated in Step 2.2. The filter is composed of four IIR filters connected in series, and the filter principle is the same as described above.

[0037] Step 3.2: Calculate the phase difference between the two signals using the phase after low-pass filtering.

[0038] Step 3.3: Calculate the time difference between the two signals based on their phase difference and the low-pass filtered drive frequency. The formula for calculating the time difference is: (18) in, It is the driving frequency.

[0039] In step 4, the density and flow rate are calculated using the signal after secondary processing.

[0040] Step 4.1: Calculate the instantaneous mass flow rate of the fluid based on the time difference between the two signals in Step 3.2. The specific calculation formula is as follows: (19) In the above formula The time difference when the mass flow rate is 0. This refers to the time difference calculated in step 3. The instrument coefficient refers to the "conversion coefficient" obtained by calibrating each flow meter using a standard device. It is used to convert the physical quantity detected by the sensor into an engineering unit value of mass flow rate, reflecting the quantitative relationship between the sensor output signal and the actual mass flow rate. In this embodiment... =264664000.

[0041] Step 4.2: Calculate the fluid density based on the driving frequency. The specific calculation formula is as follows: (20) in, , It is the instrument coefficient for density calculation, which is obtained by calibrating the flow meter with standard density liquid before it leaves the factory; As mentioned above, this represents the driving frequency.

[0042] Step 4.3: Calculate the cumulative flow based on the instantaneous mass flow rate and the current timestamp.

[0043] In step 5, the density, mass flow rate, driving frequency, driving amplitude, phase of the two vibration sensor signals, and vibration amplitude information of the gas-liquid mixture are transmitted to the time-sharing operating system kernel. In this embodiment, data interaction is performed by combining inter-core interrupts with shared memory. Regardless of whether it is the time-sharing operating system kernel or the real-time operating system kernel, when data needs to be sent to another kernel, an interrupt command is sent to the other kernel, the flag bit is updated in the interrupt service function, and then the data in the shared memory is received in the subsequent process or task and cached in the array.

[0044] The time-sharing operating system primarily performs gas-liquid two-phase flow correction tasks, running in parallel with real-time operating system tasks to improve system efficiency. The specific steps for the time-sharing operating system to implement gas-liquid two-phase flow correction are as follows: Step 1: Before designing the gas-liquid two-phase flow correction process, it is necessary to establish a dataset through experiments. The experimental data is mainly collected and calculated by the real-time operating system, and mainly includes information such as the density of the gas-liquid mixture, mass flow rate, driving frequency, driving amplitude, phase of the two vibration sensor signals, and vibration amplitude of the two vibration sensor signals.

[0045] Step 2: Preprocess the data collected in Step 1, analyze the time and frequency domain characteristics of the signal, calculate the mean and variance of the signal in the time domain, and calculate the wavelet packet decomposition result of the original signal in the frequency domain.

[0046] Wavelet packet decomposition, based on the small packet transform, decomposes both the low-frequency and high-frequency subbands at each signal level. The mathematical expression for wavelet transform is: (twenty one) In the formula, Scaling factor This is the translation parameter. For the signal... The mathematical expression for wavelet transform is: (twenty two) By minimizing the cost function, the optimal signal decomposition path is calculated, and the original signal is decomposed according to the path. In this embodiment, the cost function is information entropy, and the calculation formula is as follows: (twenty three) in, Represents information entropy. This represents the probability of each amplitude value occurring. A schematic diagram of the wavelet packet decomposition principle in this embodiment is shown below. Figure 2 As shown. The number of wavelet packet decomposition levels determines the resolution of each decomposed part, and the resolution is exponentially related to the number of wavelet decomposition levels. For the original signal of the Coriolis flowmeter, this embodiment uses 3 levels of wavelet packet decomposition to reconstruct the waveform, obtaining 4 sets of reconstructed waveforms and calculating the density of the reconstructed signal. The calculation formula is as follows: (twenty four) This represents the amplitude at each point in the signal. In this embodiment, the lowest frequency energy of the wavelet packet decomposition of different original signals from the Coriolis flowmeter is selected as the feature value input to the neural network.

[0047] Step 3: Feature engineering is performed on the internal signals of the Coriolis flowmeter obtained in Step 1 and the time-domain and frequency-domain analysis results obtained in Step 2 based on the random search method. Since the prediction accuracy, robustness, and generalization ability of a single prediction model cannot meet practical needs, this solution uses a Stacking ensemble learning model to correct the gas-liquid two-phase flow measurement results of the Coriolis mass flowmeter. The Stacking model consists of two layers. The first layer consists of various base models, which may be the same learning model with different parameters or different learning models. The second layer is a meta-model, which is trained using the output of the first-layer base models as input variables, integrating the learning characteristics of each base model. K-fold cross-validation is used to prevent overfitting in the base models. K-fold cross-validation is a common technique in machine learning for evaluating the generalization ability of a model. It involves dividing the dataset into K parts, using one part as the validation set each time, and the remaining K-1 parts as the training set, repeating this process K times, and finally taking the average performance as the evaluation result. In the training and validation of this model, the model score is measured using mean squared error (MSE) and mean absolute percentage error (MAPE), calculated using the following formulas: (25) (26) in, It is the true value of the i-th sample. is the model's predicted value for the i-th sample, and n is the total number of samples.

[0048] This embodiment selects feature engineering based on a random search method. First, it performs basic mathematical transformations on the original features, such as the driving frequency, vibration phase of the two vibration sensor signals, vibration amplitude of the two vibration sensor signals, and phase difference between the two sensors. These transformations include multiplication, division, exponential and logarithmic operations to construct new features. A feature pool of 1050 features, including the original and new features, is then formed. The feature engineering flowchart is shown below. Figure 4 As shown, firstly, the base model type and the number of features are determined. Then, a random search is performed k times in the feature pool based on the number of input features. Finally, the k new feature sets searched are evaluated based on the determined base model parameters, and the optimal set is selected to obtain the base model. The above steps are repeated to select a total of n base models for ensemble learning.

[0049] The mass flow correction model in this embodiment consists of 8 base models. The base models of the same type differ in the number of input features or hyperparameters. Specifically, the models are: Bayesian regression with 15 feature inputs, Bayesian regression with 10 feature inputs, Bayesian regression with 20 feature inputs, Gaussian kernel support vector machine with 10 feature inputs, Gaussian kernel support vector machine with 10 feature inputs, linear support vector machine with 12 feature inputs, linear support vector machine with 12 feature inputs, and multiple linear regression with 15 feature inputs.

[0050] Step 4: The meta-model uses Support Vector Machine Regression (SVR) to model the output of the base models and adds unused features from the feature pool using a random search method. This means the meta-model's input includes not only the output of the base models but also unused features from the feature pool. While this reduces the interpretability of the model, it increases the information the meta-model can learn.

[0051] Step 4: Detailed structural diagram as follows Figure 3 As shown, this embodiment uses a grid search method to optimize the parameters of the SVR algorithm. Hyperparameters are selected based on the MSE (Mean Squared Error) of the test and training sets and the number of predicted points exceeding the prediction error threshold (relative error 2%). MSE measures the overall accuracy of the model's correction, while the number of predicted points exceeding the prediction error threshold measures the number of outliers the model may generate. By adjusting the hyperparameters of the meta-model, the model's correction performance can be further improved, and the risk of overfitting can be effectively reduced.

Claims

1. A Coriolis flowmeter converter system for low gas content gas-liquid two-phase flow, based on the dual-core operating architecture of AMP, utilizing a dual-core processor, deploying a real-time operating system on one core to run real-time tasks, and deploying a time-sharing operating system on the other core to run time-consuming tasks, including processing flows of both real-time operating system and time-sharing operating system; The real-time operating system includes the following steps: Signal acquisition is performed on the Coriolis flow meter sensor to obtain two vibration sensor signals from the primary instrument of the Coriolis flow meter for acquiring fluid flow information; The two vibration sensor signals are preprocessed to calculate amplitude and phase information; Based on the obtained amplitude and phase information, the driving frequency and driving amplitude are output based on PI control, and the driving signal is synthesized by digital signal synthesis to make the Coriolis flowmeter measuring tube work at the optimal vibration frequency and amplitude. The two vibration sensor signals are processed a second time to obtain the phase difference and signal time difference between the two vibration sensor signals; Perform density and flow rate calculations; The density and mass flow rate information are transmitted to the time-sharing operating system kernel. The time-sharing operating system performs the gas-liquid two-phase flow correction task, adopts a stacking ensemble model structure, and obtains a mass flow correction model after training.

2. The Coriolis flowmeter converter system for low gas content gas-liquid two-phase flow according to claim 1, characterized in that, In the real-time operating system, the step of acquiring signals from the Coriolis flowmeter sensor to obtain two vibration sensor signals from the primary instrument of the Coriolis flowmeter for acquiring fluid flow information includes: Initialize the selected analog-to-digital converter chip, setting the sampling frequency and channel number initialization information; Two vibration sensor signals from the primary instrument of the Coriolis flowmeter are captured to obtain fluid flow information.

3. The Coriolis flowmeter converter system for low gas content gas-liquid two-phase flow according to claim 1, characterized in that, In a real-time operating system, the method for preprocessing the two vibration sensor signals and calculating the amplitude and phase information is as follows: Different algorithms are selected according to the requirements to process the two vibration sensor signals and calculate the amplitude and phase information. Two algorithms are selected: one is the quadrature demodulation algorithm and the other is the complex coefficient bandpass filter algorithm. If the quadrature demodulation algorithm is chosen, the following signal preprocessing method is used: The frequency at the current moment is estimated based on the frequency of the two vibration sensor signals at past moments, and two orthogonal sine and cosine reference signals of the same frequency are generated accordingly. The two vibration sensor signals acquired are multiplied by two orthogonal sine and cosine reference signals of the same frequency, and the multiplication results in two sets of second harmonic signals and DC signals. The second harmonic component and interference signal are filtered out by a low-pass filter to obtain the DC signal; Calculate the amplitude and phase information of the two vibration sensor signals after low-pass filtering; If the user selects the complex coefficient bandpass filter algorithm, the following signal preprocessing method is used: The frequency at the current moment is estimated based on the frequency of the two vibration sensor signals at past moments, and two orthogonal sine and cosine reference signals of the same frequency are generated accordingly. The two vibration sensor signals and two sinusoidal reference signals of the same frequency are input into a complex coefficient bandpass filter to obtain the phase difference between the two signals of the Coriolis flowmeter.

4. The Coriolis flowmeter converter system for low gas content gas-liquid two-phase flow according to claim 3, characterized in that, The method for obtaining the DC signal by filtering out the second harmonic component and interference signal using a low-pass filter is as follows: Four IIR low-pass filters are cascaded for filtering. The first two filters perform coarse filtering, and the cutoff frequency is selected as [value missing]. , It is the sensor signal frequency; the latter two filters perform fine filtering, with a cutoff frequency of... .

5. The Coriolis flowmeter converter system for low gas content gas-liquid two-phase flow according to claim 3, characterized in that, The design steps for the complex coefficient bandpass filter are as follows: S1: Determine the design specifications, design a real-number filter based on the elliptic filter, and obtain the filter coefficients; S2: Based on the resonant frequency of the Coriolis flowmeter in single-phase flow and the signal sampling frequency, determine the conversion factor of the complex coefficient bandpass filter. The values ​​are obtained by combining the filter coefficients designed in S1 with... Multiply them to obtain the final complex coefficient bandpass filter coefficients; S3: Transfer the signals from the two vibration sensors , and two sinusoidal reference signals of the same frequency. , The inputs are fed into a complex coefficient bandpass filter, and the outputs are respectively... , , , ; The reference signal output by the complex coefficient bandpass filter , The conjugate of, and then with, respectively , Multiplication decomposes the real and imaginary parts of the signal to calculate the vibration amplitude and phase information.

6. The Coriolis flowmeter converter system for low gas content gas-liquid two-phase flow according to claim 1, characterized in that, In a real-time operating system, the method for performing secondary processing on two vibration sensor signals to obtain the phase difference and signal time difference between the two vibration sensor signals is as follows: The phase information and PI control output drive frequency obtained by preprocessing the step signals from the two vibration sensors are low-pass filtered. The phase difference between the two vibration sensor signals is calculated using the phase information after low-pass filtering; The signal time difference between the two vibration sensor signals is calculated based on the phase difference between the two vibration sensor signals and the driving frequency after low-pass filtering.

7. The Coriolis flowmeter converter system for low gas content gas-liquid two-phase flow according to claim 1, characterized in that, In a real-time operating system, the method for calculating density and flow is as follows: The instantaneous mass flow rate of the fluid is calculated based on the time difference between the signals from the two vibration sensors. The specific calculation formula is as follows: In the above formula, The time difference between the two vibration sensor signals is given. The signal time difference when the mass flow rate is 0. The instrument coefficient refers to the "conversion coefficient" obtained by calibrating each flow meter through a standard device. It is used to convert the physical quantity detected by the sensor into the engineering unit value of mass flow rate, reflecting the quantitative relationship between the sensor output signal and the actual mass flow rate. The density of the fluid is calculated based on the driving frequency, using the following formula: in, , It is the instrument coefficient for density calculation; For driving frequency; The cumulative flow is calculated based on the instantaneous mass flow rate and the current timestamp.

8. The Coriolis flowmeter converter system for low gas content gas-liquid two-phase flow according to claim 1, characterized in that, In a real-time operating system, transmitting density and mass flow rate information to the time-sharing operating system kernel specifically includes transmitting the density, mass flow rate, driving frequency, driving amplitude, phase of two vibration sensor signals, and vibration amplitude information of two vibration sensor signals to the time-sharing operating system kernel.

9. The Coriolis flowmeter converter system for low gas content gas-liquid two-phase flow according to claim 1, characterized in that, In the time-sharing operating system, the stacking ensemble model structure is adopted. After training, a quality flow correction model is obtained, which includes: its first layer consists of multiple differentiated base models, which are different types of learning models or similar models with different parameter settings; its second layer meta-model selects the support vector machine regression algorithm (SVR) to model the output of the base models. After training, a quality flow correction model is obtained.

10. The Coriolis flowmeter converter system for low gas content gas-liquid two-phase flow according to claim 1, characterized in that, The time-sharing operating system executes the gas-liquid two-phase flow correction task, employing a stacking ensemble model structure. After training, the mass flow correction model is obtained, specifically including: A dataset was established through experiments. The data collected in the experiments were mainly obtained by the real-time operating system, including the density, mass flow rate, driving frequency, driving amplitude, phase of the two vibration sensor signals, and vibration amplitude information of the two vibration sensor signals. The data collected in the experiment were preprocessed, and the time and frequency domain characteristics of the signal were analyzed. The mean and variance of the signal were calculated in the time domain, and the wavelet packet decomposition results of the original signal were calculated in the frequency domain. The lowest frequency band energy of the wavelet packet decomposition of different original signals of the Coriolis flowmeter was selected as the frequency domain feature value. Feature engineering is performed on the internal signals of the Coriolis flowmeter and the time-domain and frequency-domain analysis results based on the random search method: the time-domain and frequency-domain features of multi-dimensional signals such as mass flow rate, drive frequency, vibration phase and vibration amplitude of two vibration sensor signals are used as initial features, and an extended feature set is constructed by combining basic mathematical operations and function transformations to form a feature pool; feature selection and combination operations are performed in the feature pool using the random search method: multiple feature combinations are randomly generated according to the preset base model parameters and the number of input features, and several base models are determined as components of the Stacking ensemble learning structure by evaluating the root mean square error and mean absolute percentage error; The meta-model of the Stacking ensemble model uses the Support Vector Machine Regression (SVR) algorithm to fuse the outputs of each base model and the unused features in the feature pool. After training, a mass flow correction model is obtained.