A machine learning based ultrasonic flow meter verification method and system
By using a machine learning-based ultrasonic flowmeter testing method, signal quality, flow parameters, and metering performance data are collected and analyzed in real time. The random forest model is used to predict the indication error, which solves the problem of the difficulty in ensuring the accuracy of flow measurement in ultrasonic flowmeters during use, and realizes real-time accuracy monitoring and safety improvement of flowmeters.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NATIONAL INSTITUTE OF METROLOGY CHINA
- Filing Date
- 2023-08-11
- Publication Date
- 2026-06-09
AI Technical Summary
The lack of real-time verification methods for existing ultrasonic flow meters makes it difficult to guarantee the accuracy of flow measurement, and poses safety hazards during disassembly and installation, affecting production operations.
An ultrasonic flowmeter testing method based on machine learning is adopted. By collecting signal quality, flow index and metering performance data in real time, the indication error is predicted by a random forest model and verified by a high-pressure loop gas flow standard device, so as to realize the real-time accuracy monitoring of the flowmeter.
It enables real-time accuracy monitoring of flow measurement by ultrasonic flow meters, reduces manpower and financial resources, lowers safety hazards, and improves the stability of production operations.
Smart Images

Figure CN117029971B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of flow meter testing technology, and more specifically to a machine learning-based ultrasonic flow meter testing method and system. Background Technology
[0002] Currently, there are two main methods for inspecting ultrasonic flow meters during use: the standard gauge series method and the sound velocity test method. However, due to limitations imposed by on-site equipment and installation pipelines, the standard gauge series method is less commonly used, so the sound velocity test method is more frequently employed. GB / T 30500-2014, "In-use Inspection of Gas Ultrasonic Flow Meters - Sound Velocity Test Method," specifies the evaluation methods and indicators for the sound velocity test method: The average sound velocity under operating conditions is calculated based on the sound velocity measurement results from different channels of the ultrasonic flow meter; the theoretical sound velocity under operating conditions is calculated based on thermodynamic relationships; and the difference between the average sound velocity and the theoretical sound velocity is used as the verification parameter for the ultrasonic flow meter, thus determining its condition. Therefore, while the sound velocity test method can ensure the accuracy of flow velocity measurement, it is difficult to guarantee the accuracy of flow rate measurement. Due to the lack of specific and implementable in-use inspection methods, the calibration cycle for ultrasonic flow meters is generally two years. The natural gas trade handover site involves high pressure, and natural gas is a flammable gas. The disassembly and installation of ultrasonic flow meters consumes a lot of manpower and financial resources and poses safety hazards. In addition, due to the limited testing capabilities of natural gas metering stations, the current testing time for ultrasonic flow meters is long, which seriously affects production operations.
[0003] Therefore, how to clarify the indicative significance of each variable for the accuracy of flow measurement, realize the real-time prediction of the indication error of ultrasonic flow meter, and ensure the accuracy of flow measurement of ultrasonic flow meter in use is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0004] In view of this, the present invention provides a machine learning-based ultrasonic flow meter testing method and system, which is used to at least solve some of the technical problems existing in the background art.
[0005] To achieve the above objectives, the present invention adopts the following technical solution:
[0006] This invention first discloses a machine learning-based ultrasonic flow meter testing method, comprising the following steps:
[0007] Real-time acquisition of operational data from the ultrasonic flow meter, including signal quality data, flow regime data, and metering performance data;
[0008] The operational data is preprocessed to obtain ultrasonic flow meter inspection characteristic data;
[0009] The ultrasonic flow meter inspection feature data is input into a trained random forest model to obtain the predicted value of the ultrasonic flow meter indication error.
[0010] Preferably, the above method further includes storing the predicted values of the ultrasonic flow meter indication error in chronological order.
[0011] Preferably, the above method further includes:
[0012] The actual value of the indication error of the ultrasonic flow meter was obtained using a high-pressure loop gas flow standard device.
[0013] The predicted value of the ultrasonic flow meter's indication error is verified based on the actual value of the indication error.
[0014] Preferably, the operational data is preprocessed to obtain the ultrasonic flowmeter's inspection characteristic data, specifically including:
[0015] Extracting feature variables:
[0016] Based on the signal quality data, extract the signal gain, signal-to-noise ratio, and signal reception quality of each channel of the ultrasonic flow meter;
[0017] Based on the flow regime data, the channel velocity, average flow velocity, profile coefficient, and symmetry index of each channel of the ultrasonic flowmeter are extracted.
[0018] Based on the metrological performance data, extract the channel sound velocity, measured average sound velocity, theoretical sound velocity, sound velocity deviation, and measured flow rate of each channel of the ultrasonic flow meter.
[0019] Data filtering:
[0020] The feature variables are filtered according to the set threshold to obtain the filtered feature variables, which are the ultrasonic flow meter test feature data.
[0021] Preferably, the ultrasonic flowmeter inspection feature data is input into a trained random forest model to obtain the predicted value of the ultrasonic flowmeter indication error, specifically including the following steps:
[0022] The ultrasonic flowmeter test feature data is used as input to the random forest model;
[0023] The random forest model outputs a predicted value for the ultrasonic flow meter reading error.
[0024] Secondly, this invention also discloses a machine learning-based ultrasonic flowmeter testing system, comprising:
[0025] The data acquisition module is used to acquire the operating data of the ultrasonic flow meter in real time. The operating data includes signal quality data, flow index data, and metering performance data.
[0026] The data preprocessing module is used to preprocess the reported operating data and obtain the test characteristic data of the ultrasonic flowmeter.
[0027] The machine learning model calling module is used to call the random forest model to process the acquired ultrasonic flow meter inspection feature data and output the predicted value of the ultrasonic flow meter indication error.
[0028] Preferably, the system further includes a data storage module for storing the predicted values of the ultrasonic flow meter indication error in a database according to time.
[0029] Preferably, the system further includes a data verification module, which is used to verify the predicted value of the ultrasonic flow meter indication error based on the actual value of the ultrasonic flow meter indication error.
[0030] Preferably, the data preprocessing module preprocesses the running data, specifically including:
[0031] Extracting feature variables:
[0032] Based on the signal quality data, extract the signal gain, signal-to-noise ratio, and signal reception quality of each channel of the ultrasonic flow meter;
[0033] Based on the flow regime data, the channel velocity, average flow velocity, profile coefficient, and symmetry index of each channel of the ultrasonic flowmeter are extracted.
[0034] Based on the metrological performance data, extract the channel sound velocity, measured average sound velocity, theoretical sound velocity, sound velocity deviation, and measured flow rate of each channel of the ultrasonic flow meter.
[0035] Data filtering:
[0036] The feature variables are filtered according to the set threshold to obtain the filtered feature variables, which are the ultrasonic flow meter test feature data.
[0037] Preferably, the machine learning module obtains the predicted value of the ultrasonic flow meter indication error, specifically including the following steps:
[0038] The ultrasonic flowmeter test feature data is used as input to the random forest model;
[0039] The random forest model outputs a predicted value for the ultrasonic flow meter reading error.
[0040] As can be seen from the above technical solution, compared with the prior art, the present invention discloses a machine learning-based ultrasonic flowmeter testing method and system, which has the following beneficial effects:
[0041] This invention employs a random forest algorithm to establish a flow indication error prediction model for ultrasonic flow meters. This system monitors and analyzes all variables affecting the measurement accuracy of the ultrasonic flow meter, clarifies the indicative significance of each variable for flow measurement accuracy, achieves real-time prediction of the ultrasonic flow meter's indication error, and verifies the model using a high-pressure loop gas flow standard device, thereby ensuring the accuracy of ultrasonic flow meter flow measurement in use. Attached Figure Description
[0042] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0043] Figure 1 This is a schematic diagram of the overall process of the ultrasonic flowmeter testing method based on machine learning provided in an embodiment of the present invention.
[0044] Figure 2 This is a schematic diagram of the installation structure of the high-pressure loop gas flow standard device provided in an embodiment of the present invention.
[0045] Figure 3 This is a schematic diagram of the overall structure of the ultrasonic flowmeter testing system based on machine learning provided in an embodiment of the present invention.
[0046] Figure 4 This is a schematic diagram of the real-time communication structure between LabVIEW and the machine learning model module provided in an embodiment of the present invention. Detailed Implementation
[0047] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0048] Example 1
[0049] like Figure 1 As shown in the figure, this invention discloses a machine learning-based ultrasonic flow meter inspection method for data inspection during the use of ultrasonic flow meters, including the following steps:
[0050] The ultrasonic flow meter's operating data is collected in real time. In this embodiment, the ultrasonic flow meter's operating data includes three categories: signal quality data, flow regime index data, and metering performance data.
[0051] The operational data is preprocessed to obtain the ultrasonic flow meter inspection characteristic data.
[0052] Input the ultrasonic flow meter inspection feature data into a random forest model to obtain the predicted value of the ultrasonic flow meter indication error.
[0053] The following provides a detailed explanation and description of each step of the above method.
[0054] The ultrasonic flow meter's operating data is collected in real time. In this embodiment, three types of operating data from the ultrasonic flow meter are collected in real time: signal quality data, flow state index data, and metering performance data.
[0055] The steps for preprocessing the collected operational data to obtain the ultrasonic flowmeter inspection characteristic data mainly include the following methods: extracting characteristic variables and filtering the characteristic variables according to the set threshold to obtain the filtered characteristic variables, which are the preprocessed data.
[0056] Feature variable extraction mainly involves extracting multiple feature variables based on the three types of operational data. The feature variables extracted for each type of operational data are as follows:
[0057] Extractable characteristic variables from signal quality data include signal gain, signal-to-noise ratio, and signal reception quality.
[0058] The extractable characteristic variables from the flow regime data include the flow velocity of each channel of the ultrasonic flow meter, the average flow velocity, the profile coefficient, and the symmetry index. In this embodiment, the flow regime data used are the flow velocity of each channel, the average flow velocity, the profile coefficient, and the symmetry index. The above flow regime data can be directly read from the ultrasonic flow meter.
[0059] The extractable characteristic variables from the metrological performance data include sound velocity test data and measured flow rate data. The sound velocity test data includes the sound velocity of each channel, the measured average sound velocity, and the theoretical sound velocity calculated based on the operating temperature, pressure, and composition data at the ultrasonic flow meter. The sound velocity deviation is calculated using the theoretical sound velocity and the measured average sound velocity. The measured flow rate data is the measured flow rate of the ultrasonic flow meter.
[0060] In this embodiment, the theoretical sound velocity C can be calculated based on the temperature, pressure, and gas composition data collected at the ultrasonic flow meter. The theoretical sound velocity C is calculated using the following formula:
[0061]
[0062] Among them, c v c represents the specific heat capacity at constant volume of a gas; pR represents the specific heat capacity at constant pressure of the gas; T represents the thermodynamic temperature of the gas; M represents the molar mass of the gas; Z represents the compressibility factor of the gas; ρ represents the molar density of the gas. This represents the first-order partial derivative.
[0063] The sound speed deviation can be calculated using the following formula:
[0064]
[0065] Where C is the theoretical speed of sound. Measuring the average sound velocity with an ultrasonic flow meter
[0066] By measuring the temperature, pressure, and gas composition of the fluid, the theoretical sound velocity is calculated using the sound velocity calculation formula. This theoretical velocity is then compared with the average sound velocity measured by the flow meter under the same conditions to verify the accuracy of the flow meter's average sound velocity measurement. This verifies the sound wave propagation time measured by the flow meter and evaluates the flow meter's performance.
[0067] In the pretreatment step, the threshold setting is related to the specifications of the ultrasonic flow meter. The corresponding threshold is set according to the operating range of each variable in the ultrasonic flow meter's instruction manual. Specifically, the sound velocity deviation threshold can be set according to the specifications in GB / T 30500-2014.
[0068] The ultrasonic flowmeter test feature data (i.e., the preprocessed feature variables) is input into the trained random forest prediction model, and the predicted value of the flow indication error is output.
[0069] In this embodiment, the variables related to sound speed testing, namely theoretical sound speed, measured average sound speed, and sound speed deviation, are used as feature variables of the machine learning prediction model. The feature variables of the random forest model can be represented by Table 1.
[0070]
[0071] Table 1 Feature variables of the prediction model
[0072] The Random Forest algorithm uses decision trees as base learners to construct an autonomous sampling ensemble. It builds several decision trees through sampling with replacement and then integrates the results from multiple decision trees for regression prediction. The Random Forest algorithm performs well in regression prediction. In its implementation, it introduces randomness in both subsample selection and feature selection, increasing the diversity of the decision trees and giving it a strong ability to prevent overfitting. In the prediction phase, the Random Forest averages the predictions from its multiple decision trees to obtain the final regression result.
[0073] These data are all used as input variables for the model. The output variable is the predicted value of the model's indication error.
[0074] The training of the random forest model is based on the true value of the indication error, and the text describes it as a "trained random forest model".
[0075] The extracted signal quality, flow regime parameters, and metrological performance are used as input variables for the random forest model. Data sets of these three variables were collected based on an experiment using a loop gas flow meter. The actual flow rate Q was obtained from the standard table in the loop meter. r The measured flow rate Q of the ultrasonic flow meter can be used to calculate the actual indication error e of the ultrasonic flow meter, which serves as the data label (reference value of the output result) during the model training phase. This results in a sample set used for training the random forest prediction model.
[0076] Formula for calculating the indication error of an ultrasonic flow meter:
[0077]
[0078] Based on the trained random forest model, experimental data is collected as validation samples (ensuring sample independence). The input variables are input into the trained model as required, and the model outputs the predicted value of the indication error. The deviation between this predicted value and the true value can be used to evaluate the performance of the model.
[0079] Random Forest (RF) algorithm constructs an autonomous sampling ensemble using decision trees as base learners and introduces random attribute selection during decision tree training. In the model training phase, Random Forest uses bootstrapping to collect multiple different sub-training datasets from the input training dataset to sequentially train multiple different decision trees. In this embodiment, approximately 36.8% of the data in the training set is not used for fitting the training set model during each round of random sampling, but is instead used to calculate the out-of-bag error (OOB). In the prediction phase, Random Forest averages the predictions from multiple internal decision trees to obtain the final result, achieving the regression result.
[0080] To ensure the metrological performance of ultrasonic flowmeters after actual flow calibration, a multivariate, high-dimensional data prediction model can be established to accurately predict measurement deviations during use. Random forest machine learning algorithms have certain advantages in solving this type of problem.
[0081] First, ensure the accuracy of flow deviation prediction for ultrasonic flow meters. Random forests employ an ensemble algorithm, which inherently boasts higher prediction accuracy than most algorithms. The introduction of randomness in samples and features during training provides strong resistance to overfitting, and the presence of out-of-bounds (OOB) error allows for an unbiased estimate of the true error during model generation.
[0082] Secondly, it can quickly respond to high-dimensional variables that affect the accuracy of ultrasonic flow meters. Random forests are simple to implement, computationally inexpensive, fast to train, and highly adaptable to datasets, making them extremely advantageous in processing high-dimensional data with multiple features.
[0083] Furthermore, it can provide a basis and verification for analyzing the significance of various variables affecting the accuracy of ultrasonic flowmeters during use. During training, random forests can detect the interactions between feature variables and thereby rank the importance of features, demonstrating powerful performance in real-world tasks.
[0084] In this embodiment, the output value of the random forest model is the predicted value of the flow indication error of the ultrasonic flow meter. The predicted value can be returned to the client for display, and the obtained prediction results are stored in chronological order.
[0085] Example 2
[0086] This embodiment discloses a machine learning-based ultrasonic flowmeter testing system, including:
[0087] The data acquisition module is used to collect the operating data of the ultrasonic flow meter in real time. The operating data of the ultrasonic flow meter includes signal quality data, flow index data, and metering performance data.
[0088] The data preprocessing module is used to preprocess the collected operational data to obtain the test characteristic data of the ultrasonic flowmeter.
[0089] Specifically, the data preprocessing module extracts feature variables from three types of operational data. Specifically, based on signal quality data, it extracts the signal gain, signal-to-noise ratio, and signal reception quality of each channel of the ultrasonic flowmeter; based on flow regime data, it extracts the flow velocity, average measured flow velocity, profile coefficient, and symmetry index of each channel of the ultrasonic flowmeter; and based on metrological performance data, it extracts the sound velocity, average measured sound velocity, theoretical sound velocity, sound velocity deviation, and measured flow rate of each channel of the ultrasonic flowmeter.
[0090] Then, the extracted feature variables are filtered according to the set threshold to obtain the filtered feature variables, which are the ultrasonic flowmeter test feature data.
[0091] The machine learning model invocation module is used to invoke a random forest model to predict the preprocessed running data and obtain the predicted value of the flow rate indication error. The random forest model in this module is a pre-trained random forest model.
[0092] As a preferred embodiment, the system further includes a data verification module, which is used to verify the predicted value of the ultrasonic flow meter indication error based on the actual value of the ultrasonic flow meter indication error.
[0093] The actual value of the indication error of an ultrasonic flow meter can be obtained from a high-pressure loop gas flow standard device. For example... Figure 2 As shown, this high-pressure loop-type gas flow standard device mainly consists of a gas source section, a power section, a heat exchange section, and a working section. The standard device uses four DN100 turbine flow meters as standard gauges, with a maximum pressure of 2.5 MPa and a maximum flow rate of 1400 m³ / h. 3 / h, with an expanded uncertainty of 0.18% (k=2).
[0094] like Figure 3 As shown, in one specific implementation, the system as a whole can use LabVIEW as the software development platform, leveraging the monitoring (DSC) module to extend the advantages of graphical programming to the development of monitoring and data acquisition. The programmable logic controller (PLC) records data to the database, thereby realizing real-time automatic acquisition and processing of data such as pulse signals from standard meters and ultrasonic flow meters, analog signals (characteristics), pressure and temperature parameters; and creating a graphical user interface (GUI) to realize the analysis and display of system results.
[0095] In this embodiment, the system uses graphical programming to integrate the display (Windows), icons, menus, and pointing devices into a single desktop. This approach allows for the simultaneous display of different types of information, enabling users to switch between several work environments without losing connection between them. Users can easily perform control-oriented and dialogic tasks via drop-down menus. The introduction of icons, buttons, and scrollbars significantly reduces keyboard input, undoubtedly improving interaction efficiency for users with slow typing speeds.
[0096] Python can be chosen as the implementation tool for the random forest algorithm, used for data preprocessing and prediction result analysis in the system. Real-time communication between LabVIEW and the machine learning model module is achieved through a built-in Python node module in LabVIEW, the structure of which is illustrated below. Figure 4 As shown
[0097] As an improved embodiment, the system further includes a data storage module for storing the predicted values of the ultrasonic flowmeter indication error in a database according to time.
[0098] The system in this embodiment will be further described below.
[0099] The data acquisition module can operate by controlling the acquisition module, assigning a serial port number, and selecting the ultrasonic flow meter model to obtain data from both the ultrasonic flow meter and the gas flow standard device. Specifically:
[0100] (1) Ultrasonic flow meter data: The collected operating data of the ultrasonic flow meter can be transmitted through the RS485 communication module. The ultrasonic operating data of the ultrasonic flow meter mainly consists of three categories: signal quality data, flow state index data, and metering performance data.
[0101] (2) Temperature and pressure data: Temperature and pressure data are collected using sensors. Pressure data is obtained through pressure measuring instruments used for absolute pressure measurement and pressure measuring instruments used for differential pressure measurement. Temperature data is obtained through a PT100 platinum resistance temperature sensor.
[0102] The data preprocessing module may include a feature variable monitoring unit, which is used to dynamically display the changes in the feature variable values of the ultrasonic flow meter and determine whether they are within the threshold range.
[0103] The machine learning model calling module is used to call the random forest model and input the obtained ultrasonic flow meter feature variable set as the input dataset to the random forest model to realize the prediction of ultrasonic flow meter indication error.
[0104] The machine learning model calling module may include a data input unit and a result output unit. The data input unit inputs the characteristic variables of the ultrasonic flow meter, and the result output unit outputs the predicted value of the flow indication error of the ultrasonic flow meter, and can dynamically display the predicted value of the indication error.
[0105] In addition, the system includes a data storage module. The collected data and data processing results are stored in the database according to time.
[0106] In this embodiment, the ultrasonic flow meter data, as well as the temperature and pressure data, are preprocessed and then passed to the random forest machine learning model to obtain the predicted value of the flow indication error. The result is returned to the client for display, and the corresponding feature signals and prediction results are archived and stored.
[0107] The in-use verification system monitors the operation status of the data acquisition module and the machine learning model calling module through the main control program, and displays the flow meter's operating data and the predicted indication error in real time.
[0108] In this embodiment, the system uses LabVIEW and Python as the client and server, respectively. The server receives real-time data sent by the system.
[0109] The data collected in real time includes:
[0110] (1) Ultrasonic flow meter data: The system collects various operating data of the ultrasonic flow meter through RS485 communication. There are three main types: signal quality data, flow index data, and metering performance data.
[0111] (2) Temperature and Pressure Data: The system requires data collected by sensors for temperature and pressure measurements. The standard device uses an "absolute pressure + differential pressure" measurement method to improve pressure measurement accuracy. A pressure measuring instrument (Fluke: RPM4) with a range of (0.2~3.5) MPa is used for absolute pressure measurement, and a pressure measuring instrument (Rosemount: 3051S) with a range of (0~0.1) MPa is used for differential pressure measurement. The standard device uses a PT100 platinum resistance temperature sensor for temperature measurement, with a temperature measurement range of (-30~50)℃.
[0112] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.
[0113] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A machine learning-based testing method for ultrasonic flow meters, characterized in that, Includes the following steps: The ultrasonic flow meter's operating data is acquired in real time, including signal quality data, flow regime data, and metering performance data; the ultrasonic flow meter is a gas ultrasonic flow meter. The operational data is preprocessed to obtain ultrasonic flowmeter inspection characteristic data; specifically including: Based on the signal quality data, extract the signal gain, signal-to-noise ratio, and signal reception quality of each channel of the ultrasonic flow meter; Based on the flow regime data, the channel velocity, average flow velocity, profile coefficient, and symmetry index of each channel of the ultrasonic flowmeter are extracted. Based on the metrological performance data, extract the channel sound velocity, measured average sound velocity, theoretical sound velocity, sound velocity deviation, and measured flow rate of each channel of the ultrasonic flow meter. The theoretical speed of sound is calculated using the following formula: ; Among them, c v c represents the specific heat capacity at constant volume of a gas; p R represents the specific heat capacity at constant pressure of the gas; T represents the thermodynamic temperature of the gas; M represents the molar mass of the gas; Z represents the compressibility factor of the gas; ρ represents the molar density of the gas. This represents the first partial derivative; The sound speed deviation is calculated using the following formula: ; Where C is the theoretical speed of sound. To measure the average sound velocity for an ultrasonic flow meter; The feature variables are then filtered according to the set threshold, and the filtered feature variables are the ultrasonic flowmeter test feature data. The ultrasonic flow meter test feature data is input into a trained random forest model to obtain the predicted value of the ultrasonic flow meter indication error. The random forest model uses decision trees as base learners to construct an autonomous sampling ensemble and introduces random attribute selection during the decision tree training process. In the model training phase, the random forest model uses a bootstrap sampling method to collect multiple different sub-training datasets from the input training dataset to train multiple different decision trees sequentially. In the prediction phase, the random forest model averages the prediction results of multiple internal decision trees to obtain the final predicted value of the ultrasonic flow meter indication error. The predicted value is returned to the client for display and stored in chronological order. The ultrasonic flow meter testing method monitors and analyzes all variables affecting the measurement accuracy of the ultrasonic flow meter, clarifies the indicative significance of each variable for the accuracy of flow measurement, realizes real-time prediction of the indication error of the ultrasonic flow meter, and verifies it through a high-pressure loop gas flow standard device, thereby ensuring the accuracy of the ultrasonic flow meter flow measurement in use.
2. The ultrasonic flowmeter testing method based on machine learning according to claim 1, characterized in that, The method further includes storing the predicted values of the ultrasonic flow meter reading errors in chronological order.
3. The ultrasonic flow meter testing method based on machine learning according to claim 1, characterized in that, The method further includes: The actual value of the indication error of the ultrasonic flow meter was obtained using a high-pressure loop gas flow standard device. The predicted value of the ultrasonic flow meter's indication error is verified based on the actual value of the indication error.
4. The ultrasonic flow meter testing method based on machine learning according to claim 1, characterized in that, The ultrasonic flow meter inspection feature data is input into a trained random forest model to obtain the predicted value of the ultrasonic flow meter indication error. This process includes the following steps: The ultrasonic flowmeter test feature data is used as input to the random forest model; The random forest model outputs a predicted value for the ultrasonic flow meter reading error.
5. A machine learning-based ultrasonic flowmeter testing system, characterized in that, include: The data acquisition module is used to acquire the operating data of the ultrasonic flow meter in real time. The operating data includes signal quality data, flow index data, and metering performance data. The ultrasonic flow meter is a gas ultrasonic flow meter. The data preprocessing module is used to preprocess the reported operational data to obtain the ultrasonic flowmeter's inspection characteristic data; specifically, it includes: Based on the signal quality data, extract the signal gain, signal-to-noise ratio, and signal reception quality of each channel of the ultrasonic flow meter; Based on the flow regime data, the channel velocity, average flow velocity, profile coefficient, and symmetry index of each channel of the ultrasonic flowmeter are extracted. Based on the metrological performance data, extract the channel sound velocity, measured average sound velocity, theoretical sound velocity, sound velocity deviation, and measured flow rate of each channel of the ultrasonic flow meter. The theoretical speed of sound is calculated using the following formula: ; Among them, c v c represents the specific heat capacity at constant volume of a gas; p R represents the specific heat capacity at constant pressure of the gas; T represents the thermodynamic temperature of the gas; M represents the molar mass of the gas; Z represents the compressibility factor of the gas; ρ represents the molar density of the gas. This represents the first partial derivative; The sound speed deviation is calculated using the following formula: ; Where C is the theoretical speed of sound. To measure the average sound velocity for an ultrasonic flow meter; The feature variables are then filtered according to the set threshold, and the filtered feature variables are the ultrasonic flowmeter test feature data. The machine learning model invocation module is used to invoke the random forest model to process the acquired ultrasonic flowmeter inspection feature data and output the predicted value of the ultrasonic flowmeter indication error. The random forest model constructs an autonomous sampling ensemble using decision trees as base learners and introduces random attribute selection during the decision tree training process. In the model training phase, the random forest model uses a bootstrap sampling method to collect multiple different sub-training datasets from the input training dataset to train multiple different decision trees in sequence. In the prediction phase, the random forest model averages the prediction results of multiple internal decision trees to obtain the final predicted value of the ultrasonic flowmeter indication error. The machine learning model calling module includes a data input unit and a result output unit. The data input unit inputs the characteristic variables of the ultrasonic flow meter, and the result output unit outputs the predicted value of the flow indication error of the ultrasonic flow meter, and can dynamically display the predicted value of the indication error. The system also includes a data storage module for storing the predicted values of the ultrasonic flow meter indication error in a database according to time. The ultrasonic flowmeter testing system monitors and analyzes all variables affecting the accuracy of ultrasonic flowmeter measurements, clarifies the indicative significance of each variable for flow measurement accuracy, enables real-time prediction of the ultrasonic flowmeter's indication error, and verifies it through a high-pressure loop gas flow standard device, thereby ensuring the accuracy of ultrasonic flowmeter flow measurement in use.
6. The ultrasonic flowmeter testing system based on machine learning according to claim 5, characterized in that, The system also includes a data verification module, which is used to verify the predicted value of the ultrasonic flow meter indication error based on the actual value of the ultrasonic flow meter indication error.
7. The ultrasonic flowmeter testing system based on machine learning according to claim 5, characterized in that, The machine learning module obtains the predicted value of the ultrasonic flow meter indication error, specifically including the following steps: The ultrasonic flowmeter test feature data is used as input to the random forest model; The random forest model outputs a predicted value for the ultrasonic flow meter reading error.