Flow measurement method based on support vector machine and electromagnetic flowmeter

By combining support vector machines with electromagnetic flow meters, a training dataset is constructed and the model is optimized to achieve adaptive compensation for fluid characteristics and environmental disturbances. This solves the problem of low measurement accuracy of electromagnetic flow meters and improves the accuracy and stability of flow measurement.

CN121140887APending Publication Date: 2025-12-16SHENZHEN ZHONGKE YUNCHI ENVIRONMENTAL TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202511660388.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-13
Publication Date
2025-12-16

AI Technical Summary

Technical Problem

Electromagnetic flowmeters have low accuracy in flow measurement and are easily affected by the ideality of the flow field distribution and time-varying interference factors, lacking adaptive compensation capabilities.

Method used

By combining support vector machines with electromagnetic flowmeters, and by constructing a training dataset and optimizing the support vector machine model, online adaptive compensation for changes in fluid characteristics and environmental disturbances can be achieved, combining data-driven and physical principle-based intelligent sensing.

Benefits of technology

It significantly improves the long-term accuracy and stability of flow measurement, and enhances the precision and reliability of flow measurement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121140887A_ABST
    Figure CN121140887A_ABST
Patent Text Reader

Abstract

The invention relates to an artificial intelligence technology, and discloses a flow measurement method based on a support vector machine and an electromagnetic flowmeter, which comprises the following steps: measuring original flow data of a target fluid by using the electromagnetic flowmeter, and recording interference factor parameters of the target fluid in a target working state; acquiring real flow data, calculating a deviation value between the original flow data and the real flow data, and constructing a training data set of a support vector machine according to the interference factor parameters, the original flow data and the deviation value; optimizing the support vector machine by using the training set to obtain an optimized support vector machine; initial flow data and actual interference parameters of the target fluid in the actual working state are collected; generating a flow deviation value by using the optimized support vector machine; and correcting the initial traffic data to obtain final traffic data. According to the invention, the flow measurement accuracy can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to a flow measurement method based on support vector machine and electromagnetic flowmeter. Background Technology

[0002] Electromagnetic flowmeters measure flow rate by directly calculating the fluid velocity and flow rate based on Faraday's law of electromagnetic induction by measuring the induced electromotive force generated by the movement of a conductive fluid in a magnetic field.

[0003] However, this method of flow measurement by electromagnetic flowmeters has significant shortcomings in practical industrial applications. The measurement accuracy is heavily dependent on the ideality and stability of the flow field distribution, and the measurement results are easily affected by various time-varying interference factors. The traditional method is essentially an open-loop measurement, lacking the ability to perceive and adaptively compensate for changes in its own measurement state and external environment, which results in low accuracy of electromagnetic flowmeters when measuring flow. Summary of the Invention

[0004] This invention provides a flow measurement method based on support vector machine and electromagnetic flow meter, the main purpose of which is to solve the problem of low accuracy when using electromagnetic flow meter for flow measurement.

[0005] To achieve the above objectives, the present invention provides a flow measurement method based on support vector machine and electromagnetic flowmeter, comprising:

[0006] The raw flow rate data of the target fluid under the target operating condition is measured using a preset electromagnetic flow meter, and the interference factor parameters of the target fluid under the target operating condition are recorded.

[0007] Obtain the actual flow rate data of the target fluid under the target working state, calculate the deviation value between the original flow rate data and the actual flow rate data, and construct a training dataset for a preset support vector machine based on the interference factor parameters, the original flow rate data and the deviation value;

[0008] The support vector machine is optimized using the training set to obtain an optimized support vector machine;

[0009] The electromagnetic flowmeter is used to collect the initial flow rate data and actual interference parameters of the target fluid under actual working conditions;

[0010] The optimized support vector machine is used to generate the flow deviation value of the target fluid corresponding to the initial flow data and the actual disturbance parameters;

[0011] The initial flow rate data is corrected based on the flow rate deviation value to obtain the final flow rate data of the target fluid.

[0012] This invention constructs a high-precision training set by systematically collecting raw flow rate, interference factors, and actual deviation data covering various interfering target operating states. It then trains an optimized support vector machine model capable of deeply understanding complex nonlinear error patterns. Its core advantage lies in achieving online, adaptive, and precise compensation for systematic errors caused by complex factors such as fluid characteristic changes and environmental interference in actual operation of electromagnetic flowmeters. This upgrades traditional single measurement relying on physical models to intelligent sensing that integrates data-driven approaches with physical principles, ultimately significantly improving the long-term accuracy, stability, and reliability of flow measurement. Therefore, the flow measurement method based on support vector machines and electromagnetic flowmeters proposed in this invention can solve the problem of low accuracy when using electromagnetic flowmeters for flow measurement. Attached Figure Description

[0013] Figure 1 This is a flowchart illustrating a flow measurement method based on a support vector machine and an electromagnetic flowmeter, according to an embodiment of the present invention.

[0014] Figure 2 This is a schematic diagram of the process for measuring raw flow data according to an embodiment of the present invention;

[0015] Figure 3 This is a schematic diagram of the process for updating model parameters according to an embodiment of the present invention;

[0016] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0017] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0018] This application provides a flow measurement method based on support vector machines and electromagnetic flowmeters. The execution entity of the flow measurement method based on support vector machines and electromagnetic flowmeters includes, but is not limited to, at least one of the following electronic devices that can be configured to execute the method provided in this application: a server, a terminal, etc. In other words, the flow measurement method based on support vector machines and electromagnetic flowmeters can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes, but is not limited to, a single server, a server cluster, a cloud server, or a cloud server cluster. The server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0019] Reference Figure 1 The diagram shown is a flowchart illustrating a flow measurement method based on a support vector machine and an electromagnetic flowmeter according to an embodiment of the present invention. In this embodiment, the flow measurement method based on a support vector machine and an electromagnetic flowmeter includes:

[0020] S1. Measure the original flow rate data of the target fluid under the target working condition using a preset electromagnetic flow meter, and record the interference factor parameters of the target fluid under the target working condition.

[0021] In this embodiment of the invention, the preset electromagnetic flowmeter is a flow measurement device based on Faraday's law of electromagnetic induction. Its hardware core includes an excitation coil for generating a stable magnetic field, one or more pairs of measuring electrodes for detecting induced electromotive force, and a signal processing and conversion module containing a microprocessor unit. The device is pre-installed on the pipeline to be measured.

[0022] The target fluid refers to a fluid medium with a certain conductivity that is to be measured, including but not limited to industrial circulating water, medical saline, and financial data center coolant. The target operating state refers to the range of fluid operating parameters that are pre-set for training the support vector machine and cover subsequent actual application scenarios, specifically including fluid velocity, temperature, pressure, and surrounding electromagnetic environment. The interference factor parameters refer to those that will cause measurement errors of the electromagnetic flowmeter under the target operating state, including fluid temperature, electromagnetic interference intensity around the pipeline, fluid conductivity, and fluid pressure inside the pipeline.

[0023] In the embodiments of the present invention, see Figure 2 As shown, the method of measuring the raw flow data of the target fluid under the target operating state using a preset electromagnetic flowmeter includes:

[0024] S21. Use a preset electromagnetic flowmeter to read the induced voltage and current signals of the target fluid in real time under the target working state;

[0025] S22. Convert the induced voltage signal and the current signal into digital voltage signal and digital current signal, respectively;

[0026] S23. Calculate the original flow rate data of the target fluid under the target working state based on the digital voltage signal and the digital current signal.

[0027] In detail, the induced voltage signal is a microvolt-level analog potential difference signal induced on a pair of measuring electrodes and proportional to the average flow velocity of the fluid; the current signal refers to the analog electrical signal corresponding to the excitation current flowing through the excitation coil to maintain the stability of the magnetic field.

[0028] In this embodiment of the invention, the step of using a preset electromagnetic flowmeter to read the induced voltage and current signals of the target fluid in real time under the target operating state includes:

[0029] The electromagnetic flowmeter is used to obtain the induced electromotive force when the target fluid cuts the magnetic lines of force, and the excitation current signal is obtained according to the sampling resistor in the electromagnetic flowmeter.

[0030] The induced electromotive force and the excitation current signal are amplified to obtain the amplified induced electromotive force and amplified current signal of the target fluid.

[0031] The amplified induced electromotive force and the amplified current signal are denoised to obtain the induced voltage signal and current signal of the target fluid.

[0032] In detail, the induced electromotive force and excitation current signals are sent to a high-precision instrumentation amplifier for differential amplification. The induced electromotive force channel uses a programmable gain amplifier to adapt to different flow rate ranges, while the excitation current signal is conditioned by an isolation operational amplifier to ensure that the signal amplitude is linearly amplified to the volt level to meet the requirements of subsequent processing.

[0033] Specifically, the amplified signal input consists of a multi-stage denoising process composed of analog and digital filtering. First, it is filtered by a hardware anti-aliasing filter to suppress high-frequency interference, and then it is processed by an adaptive filtering process using a digital filter based on a field-programmable gate array. Finally, the output voltage and current signals have a significantly improved signal-to-noise ratio and can be used for accurate calculation.

[0034] In this embodiment of the invention, the digital voltage signal and the digital current signal refer to discrete-time digital sequences formed by quantizing, encoding, and anti-aliasing the analog electrical signal through a high-precision analog-to-digital converter.

[0035] In this embodiment of the invention, the step of converting the induced voltage signal and the current signal into digital voltage signals and digital current signals respectively includes:

[0036] The induced voltage signal and the current signal are quantized to obtain a quantized voltage signal and a quantized current signal.

[0037] The quantized voltage signal and the quantized current signal are digitally filtered to obtain a filtered voltage signal and a filtered current signal.

[0038] The filtered voltage signal and the filtered current signal are processed to obtain digital voltage signal and digital current signal.

[0039] In detail, the built-in A / D conversion module is called to convert the continuous analog signal into discrete digital integer values ​​according to the preset range (such as 0-65535 for voltage 0-5V and 8192-32768 for current 4-20mA), so as to obtain quantized voltage signal and quantized current signal.

[0040] Specifically, a digital filtering algorithm (such as moving average filtering with a window size of 5) is applied to the quantized digital signal sequence to smooth the data and suppress transient pulse interference, thereby obtaining filtered voltage and current signals. The filtered integer data is then converted into standard formats such as IEEE 754 single-precision floating-point numbers to generate standard digital voltage and current signals that can be directly processed by the support vector machine model.

[0041] Further, the filtered digital voltage and current values ​​are read. First, the digital voltage value is used to deduce the actual induced voltage value (through a preset "digital value-voltage value" calibration curve, such as digital value 32768 corresponding to 2.5V). Then, according to the electromagnetic flowmeter's measurement formula Q=K×B×D×V (where Q is the volumetric flow rate, K is the instrument constant, B is the magnetic field strength, D is the pipe inner diameter, and V is the average fluid velocity, and V is proportional to the induced voltage value), the preset hardware parameters (such as K=0.1m³ / (h・V), B=0.5T, D=0.1m) are substituted to calculate the original flow data (unit: m³ / h), and the result is stored in association with the corresponding timestamp.

[0042] Furthermore, by connecting a temperature sensor (platinum resistance thermometer), an electromagnetic interference detector, a conductivity meter, and a pressure transmitter via a multi-channel data acquisition card, and setting the same sampling frequency (1Hz) as the flow data, the analog signals output by each sensor (e.g., 0-10V for temperature, 0-5V for electromagnetic interference) are received in real time. These signals are then converted into digital signals using the same A / D conversion and filtering process as the flow signal, and the actual parameter values ​​are derived (e.g., the digital value of temperature 32768 corresponds to 50℃). This yields parameters for interference factors such as temperature, electromagnetic interference intensity, conductivity, and pressure.

[0043] In this embodiment of the invention, high-quality raw data relating traffic and interference are obtained to provide accurate input features for subsequent support vector machine training.

[0044] S2. Obtain the actual flow rate data of the target fluid under the target working state, calculate the deviation value between the original flow rate data and the actual flow rate data, and construct a training dataset for a preset support vector machine based on the interference factor parameters, the original flow rate data and the deviation value.

[0045] In this embodiment of the invention, the real flow data refers to the flow data that can be used as a benchmark, measured by static weighing or volumetric method under the same target working conditions as the original flow data; the preset support vector machine refers to a machine learning model with pre-set model type (Support Vector Regression Machine SVR), kernel function (Radial Basis Function RBF), and initial parameters (penalty coefficient C=1, kernel parameter γ=0.1, error tolerance ε=0.01).

[0046] In detail, a static weighing standard device (including a metrological electronic scale or a fluid collection tank) is connected. Under the same target working conditions as the original flow rate data, the target fluid is controlled to flow into the collection tank through a valve. Fluid mass data is read in real time (sampling frequency 1Hz), and the collection time is recorded. After the collection is completed, the actual flow rate data is calculated.

[0047] In this embodiment of the invention, the deviation value is a quantitative index of the inherent error of the system with confidence evaluation obtained by a dynamic weighted evaluation algorithm, which reflects the degree of error of the original data.

[0048] In this embodiment of the invention, calculating the deviation between the original traffic data and the actual traffic data includes:

[0049] The original traffic data and the actual traffic data are time-series aligned to obtain time-series traffic data.

[0050] Calculate the probability distributions of the original traffic data and the actual traffic data in the time-series traffic data respectively to obtain the original traffic distribution and the actual traffic distribution;

[0051] Calculate the statistical distance between the original flow distribution and the actual flow distribution;

[0052] The deviation between the original traffic data and the actual traffic data is calculated based on the statistical distance.

[0053] In detail, dynamic time warping is performed on the original traffic data sequence and the real traffic data sequence to eliminate the phase difference caused by the asynchronous system response time and complete the time alignment. Based on the aligned time series data, kernel density estimation probability distribution models of the original traffic data and the real traffic data are constructed respectively.

[0054] Next, the overall statistical difference between the two probability distributions is quantified by calculating the Wasserstein distance between them, and this distance is used as a baseline deviation. The confidence weight is generated by combining the signal-to-noise ratio of the signal during the calculation period. The baseline deviation is multiplied by the confidence weight to output a weighted final deviation value that more accurately reflects the inherent measurement error of the system.

[0055] In this embodiment of the invention, the training dataset refers to a structured dataset composed of interference factor parameters, original traffic data, and deviation values.

[0056] In this embodiment of the invention, constructing a training dataset for a preset support vector machine based on the interference factor parameters, the original traffic data, and the deviation value includes:

[0057] The interference factor parameters and the original traffic data are normalized to obtain normalized traffic data and normalized interference parameters;

[0058] The normalized interference parameters, the normalized flow data, and the deviation values ​​are arranged in a preset order to obtain flow arrangement data;

[0059] The traffic flow arrangement data is divided into data segments to generate a training dataset for a preset support vector machine.

[0060] In detail, the parameters of the interference factors (such as temperature 20-80℃, electromagnetic interference 0-50mV) and the original flow data (such as 0.5-10m³ / h) are processed separately. The calculation formula is "normalized value = (original value - minimum parameter value) / (maximum parameter value - minimum parameter value)". For example, if the temperature is 30℃, the minimum value is 20℃, and the maximum value is 80℃, then the normalized temperature is (30-20) / (80-20) ≈ 0.167. The normalized value range of all parameters is [0,1].

[0061] Specifically, following a preset fixed order (such as "normalized temperature → normalized electromagnetic interference intensity → normalized conductivity → normalized pressure → normalized raw flow data → deviation value"), each group of "normalized interference parameters + normalized raw flow data + deviation value" is integrated into a one-dimensional data vector through data splicing, for example, "[0.167,0.2,0.3,0.1,0.5,+0.2]". Each vector corresponds to a sample, and all samples are arranged in rows to generate flow arrangement data.

[0062] Furthermore, a random sampling algorithm (such as the train_test_split function in the sklearn library) is called, and the split ratio is set to 7:3. The traffic flow data is randomly divided into a training set and a validation set. The training set is used for parameter learning of the support vector machine, and the validation set is used for preliminary evaluation of model performance. When splitting, it is ensured that the working conditions distribution of the two sets of data are consistent (such as the same proportion of samples under high temperature and high interference conditions).

[0063] In this embodiment of the invention, training samples with precise labels are provided to the support vector machine to ensure that the model can learn the mapping relationship between interference factors and traffic errors, and to avoid prediction deviations caused by inaccurate data.

[0064] S3. Optimize the support vector machine using the training set to obtain an optimized support vector machine.

[0065] In this embodiment of the invention, the optimized support vector machine refers to a support vector regression machine that repeatedly adjusts the model parameters (penalty coefficient C, kernel parameter γ, error tolerance ε) on the training set so that the prediction error (e.g., mean absolute error MAE) of the model on the validation set is less than a preset threshold (e.g., 0.05 m³ / h).

[0066] In this embodiment of the invention, optimizing the support vector machine using the training set to obtain an optimized support vector machine includes:

[0067] The training bias value of the target fluid is calculated based on the normalized interference parameters and normalized flow data in the training set.

[0068] The error value of the target fluid is calculated based on the training deviation value and the deviation value in the training set;

[0069] Determine whether the error value is less than a preset threshold. If the error value is less than the preset threshold, optimize the preset model parameters in the support vector machine based on the error value to obtain optimized model parameters.

[0070] The optimized model parameters are used to update the model parameters in the support vector machine to obtain the optimized support vector machine.

[0071] If the error value is greater than or equal to a preset threshold, the preset model parameters in the support vector machine are updated according to the error value to obtain updated model parameters, and the model parameters in the updated support vector machine are replaced according to the updated model parameters to obtain the updated support vector machine.

[0072] The update error value is determined using the updated support vector machine, and the process returns to the step of determining whether the error value is less than a preset threshold, until the update error value is less than the preset threshold.

[0073] In detail, a preset support vector machine model is loaded (initial parameters C=1, γ=0.1, ε=0.01), and normalized interference parameters and normalized traffic data are extracted from the training set as input feature matrices (dimension is n×m, where n is the number of samples and m is the number of features). The model's decision function (support vector regression formula based on RBF kernel) is used to predict each sample, generating the corresponding training bias value (i.e. the bias value predicted by the model).

[0074] In this embodiment of the invention, calculating the training bias value of the target fluid based on the normalized interference parameters and normalized flow data in the training set includes:

[0075] The normalized interference parameters and normalized traffic data in the training set are subjected to feature transformation to obtain a combined feature vector;

[0076] Calculate the similarity between the combined feature vector and all support vectors in the support vector machine to obtain the kernel function vector;

[0077] The training bias value of the target fluid is obtained by weighted fusion of the kernel function value vector.

[0078] In detail, the normalized interference parameters and normalized flow data of each sample in the training set are concatenated into a complete combined feature vector in a preset order. The similarity between this combined feature vector and all support vectors in the support vector machine model in the high-dimensional feature space is calculated using a preset radial basis kernel function. A kernel function vector consisting of multiple kernel function values ​​is generated. The kernel function vector is then multiplied by the Lagrange multiplier weight vector obtained from the support vector machine training. The result is then added with a bias term, and the training bias value corresponding to the sample is finally output.

[0079] Next, the mean absolute error (MAE) is used as the evaluation index. The calculation formula is "MAE = (1 / n) × Σ|training bias value - true bias value|" (n is the number of training set samples). For example, if n = 100, the sum of the absolute values ​​of the errors of all samples is 5, then MAE = 0.05m³ / h. The computer uses the calculated MAE as the error value of the current model and compares it with the preset threshold (such as 0.05m³ / h).

[0080] Specifically, it is determined whether the error value is less than a preset threshold. If the error value is less than the preset threshold, the current model parameters are considered to be close to the optimal value. The parameters are fine-tuned by a grid search algorithm (e.g., C traverses within the range of 4-6 and γ within the range of 0.4-0.6). After each fine-tuning, the training set MAE is recalculated. The parameter combination corresponding to the smallest MAE (e.g., 0.04 m³ / h) (e.g., C=5, γ=0.5, ε=0.01) is selected as the optimized model parameters. The computer stores this parameter combination in the configuration file.

[0081] Furthermore, the optimized model parameters (C=5, γ=0.5, ε=0.01) in the configuration file are used to replace the initial parameters in the preset support vector machine to obtain the optimized support vector machine.

[0082] In this embodiment of the invention, the preset model parameters specifically include the penalty coefficient C, the kernel function type and its corresponding parameters (such as the width parameter γ of the radial basis kernel function).

[0083] In the embodiments of the present invention, see Figure 3 As shown, updating the preset model parameters in the support vector machine based on the error value to obtain updated model parameters includes:

[0084] S31. Calculate the parameter gradient vector of the preset model parameters in the support vector machine based on the error value;

[0085] S32. Generate parameter update amount based on the parameter gradient vector and the adaptive learning rate in the support vector machine;

[0086] S33. The model parameters and the parameter update amount are superimposed to obtain the updated model parameters.

[0087] In detail, the backpropagation algorithm is implemented starting from the error value of the output layer. The partial derivatives of the error with respect to the kernel function parameter γ and the penalty coefficient C are calculated sequentially along the calculation path. The gradient calculation of γ involves chain differentiation of the kernel matrix derivative and the Lagrange multiplier, while the gradient of C needs to consider its sensitivity analysis on the constraint boundary of the optimization problem. Finally, a high-dimensional parameter gradient vector containing the gradient components of each parameter is generated.

[0088] Next, the adaptive learning rate optimizer is invoked to perform bias correction based on the first-order moment estimation and second-order moment estimation of the parameter gradient vector. Combined with the dynamically adjusted learning rate coefficient, the update step size and direction of each parameter dimension are calculated to generate a parameter update vector with adaptive characteristics.

[0089] Specifically, the current model parameter vector and the parameter update vector are superimposed element by element through the vector operation unit. For example, the initial parameters are updated by a fixed step size (e.g., C increases by 1 each time and γ increases by 0.1 each time). In this process, a momentum term is introduced to smooth the update trajectory and accelerate convergence. At the same time, boundary constraints are applied to the updated parameters, and finally the updated model parameters that meet the optimization objective are output.

[0090] Furthermore, the training set MAE of the updated support vector machine is used as the update error value, and the conditional statement (if error value < threshold) is substituted again. If the update error value is still greater than the threshold (e.g., 0.08 m³ / h), the loop of "parameter update → generate updated support vector machine → calculate update error value" is repeated until the error value drops below 0.05 m³ / h (e.g., 0.045 m³ / h) after a certain update. The loop is then stopped, and the model parameters at this time are used as the optimized model parameters to generate an optimized support vector machine.

[0091] In this embodiment of the invention, the model prediction error is reduced by repeatedly adjusting the parameters, ensuring that the optimized model can accurately capture the relationship between interference factors and flow deviation, and providing a reliable basis for subsequent actual flow correction.

[0092] S4. Use the electromagnetic flowmeter to collect the initial flow rate data and actual interference parameters of the target fluid under actual working conditions.

[0093] In this embodiment of the invention, the actual working state refers to the real fluid operation scenario in which the method is finally applied, and its parameter range is consistent with or partially overlaps with the target working state, including the actual flow velocity, temperature, pressure and surrounding electromagnetic environment of the fluid in the field; the initial flow data refers to the original flow data directly measured and output by the electromagnetic flowmeter in the actual working state without deviation correction, and its error source is consistent with the original flow data in the target working state; the actual interference parameters refer to the interference factor parameters that affect the accuracy of the initial flow data and are collected in real time on site in the actual working state, including the on-site fluid temperature, the actual electromagnetic interference intensity around the pipeline, the on-site fluid conductivity, etc., which are consistent with the interference factor parameter types in the target working state.

[0094] In detail, real-time communication is established with the electromagnetic flowmeter and its supporting sensors (temperature, electromagnetic interference detectors, etc.) installed on the pipeline in the field via industrial Ethernet. The data acquisition frequency is set to 1Hz. The electromagnetic flowmeter outputs an analog signal (4-20mA) of the initial flow rate in real time. After being converted into a digital signal by an A / D converter, it is transmitted to the computer. At the same time, the supporting sensors convert the analog signals of the actual interference parameters into digital signals and upload them synchronously. The computer performs real-time preprocessing on the received data (using a median filtering algorithm to remove instantaneous pulse interference, and filling the missing data caused by sensor disconnection with the average value of the first 5 seconds), and stores it in the format of "timestamp + initial flow data + actual interference parameters (temperature, electromagnetic interference, conductivity, pressure)".

[0095] In this embodiment of the invention, real-time on-site data is acquired to provide input that conforms to the actual scenario for optimizing the support vector machine, thus avoiding correction deviations caused by differences between laboratory and on-site working conditions.

[0096] S5. Use the optimized support vector machine to generate the flow deviation value of the target fluid corresponding to the initial flow data and the actual disturbance parameters.

[0097] In this embodiment of the invention, the flow deviation value refers to the error value predicted by the optimized support vector machine based on "initial flow data + actual interference parameters" under actual working conditions, which is used to correct the initial flow data. Its magnitude and sign reflect the degree of deviation between the initial flow data and the actual flow data.

[0098] In this embodiment of the invention, generating the flow deviation value of the target fluid corresponding to the initial flow data and the actual disturbance parameters using the optimized support vector machine includes:

[0099] The initial traffic data and the actual interference parameters are converted into a fused feature vector;

[0100] Calculate the similarity between the fused feature vector and all support vectors in the optimized support vector machine to obtain a similarity vector;

[0101] The similarity vectors are weighted and fused to obtain the flow deviation value of the target fluid.

[0102] In detail, the initial flow rate data and actual interference parameters (temperature, electromagnetic interference intensity, conductivity, pressure) at the same timestamp are read and normalized. For example, if the initial flow rate is 5 m³ / h (the maximum value in the training set is 0.5-10 m³ / h), the normalized value is (5-0.5) / (10-0.5)≈0.474. Then, these normalized parameters are integrated into a one-dimensional feature vector (such as "[0.2,0.3,0.4,0.2,0.474]") according to the preset feature order ("normalized temperature → normalized electromagnetic interference → normalized conductivity → normalized pressure → normalized initial flow rate") to ensure that the dimension of the feature vector is consistent with the input features of the training set.

[0103] Specifically, the fused feature vectors are input into the optimized support vector machine. The model calculates the flow deviation value (e.g., +0.15 m³ / h) corresponding to the feature vector using a preset decision function (based on the optimized parameters C=5 and γ=0.5). If multiple sets of feature vectors are input simultaneously (e.g., 10 sets of consecutive timestamp data), the model generates the corresponding flow deviation vector (e.g., "[+0.15,+0.14,+0.16,...]") and associates the flow deviation value (or vector) with the initial flow data of the corresponding timestamp.

[0104] In this embodiment of the invention, the flow error under actual working conditions can be predicted quickly and accurately without the need to use a standard device to measure the actual flow rate again, thus reducing the cost of on-site application.

[0105] S6. Correct the initial flow rate data according to the flow rate deviation value to obtain the final flow rate data of the target fluid.

[0106] In this embodiment of the invention, the final flow data refers to accurate flow data that is close to the actual flow data obtained after correcting the initial flow data with the flow deviation value, and its error range is much smaller than that of the initial flow data.

[0107] In detail, the system reads the initial flow data and corresponding flow deviation value at the same timestamp, and calculates the final flow data as the sum of the initial flow data and the flow deviation value. For example, if the initial flow data is 49.85 m³ / h and the flow deviation value is +0.15 m³ / h, then the final flow data is 50 m³ / h. After correction, the computer performs a range check on the final flow data (determining whether it is within the effective range of the electromagnetic flowmeter, such as 0.5-10 m³ / h). If it exceeds the range, it is marked as invalid data and an alarm is triggered. If it is within the range, the final flow data is stored in the format of "timestamp + final flow" and simultaneously pushed to the on-site monitoring system (such as SCADA) for real-time viewing or control.

[0108] In this embodiment of the invention, by correcting the initial flow rate data, accurate final flow rate data is output, thus solving the measurement error problem caused by interference in the electromagnetic flow meter and meeting the flow accuracy requirements of practical applications.

[0109] It should be understood that the embodiments described are for illustrative purposes only and are not limited to this structure in the scope of the patent application.

[0110] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0111] Therefore, the embodiments should be regarded as exemplary and non-limiting in all respects. The scope of the invention is not limited to the foregoing description, and all variations within the meaning and scope of equivalents falling within the protection scope are intended to be included in the invention.

[0112] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.

[0113] Furthermore, it is clear that the word "including" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices described in the system can also be implemented by a single unit or device through software or hardware. Terms such as "first," "second," etc., are used to indicate names and do not indicate any specific order.

[0114] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A flow measurement method based on support vector machine and electromagnetic flowmeter, characterized in that, The method includes: The raw flow rate data of the target fluid under the target operating condition is measured using a preset electromagnetic flow meter, and the interference factor parameters of the target fluid under the target operating condition are recorded. Obtain the actual flow rate data of the target fluid under the target working state, calculate the deviation value between the original flow rate data and the actual flow rate data, and construct a training dataset for a preset support vector machine based on the interference factor parameters, the original flow rate data and the deviation value; The support vector machine is optimized using the training set to obtain an optimized support vector machine; The electromagnetic flowmeter is used to collect the initial flow rate data and actual interference parameters of the target fluid under actual working conditions; The optimized support vector machine is used to generate the flow deviation value of the target fluid corresponding to the initial flow data and the actual disturbance parameters; The initial flow rate data is corrected based on the flow rate deviation value to obtain the final flow rate data of the target fluid.

2. The flow measurement method based on support vector machine and electromagnetic flowmeter as described in claim 1, characterized in that, The method of measuring the raw flow data of the target fluid under the target operating condition using a preset electromagnetic flowmeter includes: The induced voltage and current signals of the target fluid under the target working state are read in real time using a preset electromagnetic flow meter. The induced voltage signal and the current signal are respectively converted into digital voltage signals and digital current signals; The original flow rate data of the target fluid under the target operating condition is calculated based on the digital voltage signal and the digital current signal.

3. The flow measurement method based on support vector machine and electromagnetic flowmeter as described in claim 2, characterized in that, The method of using a preset electromagnetic flowmeter to read the induced voltage and current signals of the target fluid in real time under the target operating state includes: The electromagnetic flowmeter is used to obtain the induced electromotive force when the target fluid cuts the magnetic lines of force, and the excitation current signal is obtained according to the sampling resistor in the electromagnetic flowmeter. The induced electromotive force and the excitation current signal are amplified to obtain the amplified induced electromotive force and amplified current signal of the target fluid. The amplified induced electromotive force and the amplified current signal are denoised to obtain the induced voltage signal and current signal of the target fluid.

4. The flow measurement method based on support vector machine and electromagnetic flowmeter as described in claim 2, characterized in that, The step of converting the induced voltage signal and the current signal into digital voltage signals and digital current signals, respectively, includes: The induced voltage signal and the current signal are quantized to obtain a quantized voltage signal and a quantized current signal. The quantized voltage signal and the quantized current signal are digitally filtered to obtain a filtered voltage signal and a filtered current signal. The filtered voltage signal and the filtered current signal are processed to obtain digital voltage signal and digital current signal.

5. The flow measurement method based on support vector machine and electromagnetic flowmeter as described in claim 1, characterized in that, The calculation of the deviation between the original traffic data and the actual traffic data includes: The original traffic data and the actual traffic data are time-series aligned to obtain time-series traffic data. Calculate the probability distributions of the original traffic data and the actual traffic data in the time-series traffic data respectively to obtain the original traffic distribution and the actual traffic distribution; Calculate the statistical distance between the original flow distribution and the actual flow distribution; The deviation between the original traffic data and the actual traffic data is calculated based on the statistical distance.

6. The flow measurement method based on support vector machine and electromagnetic flowmeter as described in claim 1, characterized in that, The step of constructing a training dataset for a preset support vector machine based on the interference factor parameters, the original traffic data, and the deviation value includes: The interference factor parameters and the original traffic data are normalized to obtain normalized traffic data and normalized interference parameters; The normalized interference parameters, the normalized flow data, and the deviation values ​​are arranged in a preset order to obtain flow arrangement data; The traffic flow arrangement data is divided into data segments to generate a training dataset for a preset support vector machine.

7. The flow measurement method based on support vector machine and electromagnetic flowmeter as described in claim 1, characterized in that, The step of optimizing the support vector machine using the training set to obtain an optimized support vector machine includes: The training bias value of the target fluid is calculated based on the normalized interference parameters and normalized flow data in the training set. The error value of the target fluid is calculated based on the training deviation value and the deviation value in the training set; Determine whether the error value is less than a preset threshold. If the error value is less than the preset threshold, optimize the preset model parameters in the support vector machine based on the error value to obtain optimized model parameters. The optimized model parameters are used to update the model parameters in the support vector machine to obtain the optimized support vector machine. If the error value is greater than or equal to a preset threshold, the preset model parameters in the support vector machine are updated according to the error value to obtain updated model parameters, and the model parameters in the updated support vector machine are replaced according to the updated model parameters to obtain the updated support vector machine. The update error value is determined using the updated support vector machine, and the process returns to the step of determining whether the error value is less than a preset threshold, until the update error value is less than the preset threshold.

8. The flow measurement method based on support vector machine and electromagnetic flowmeter as described in claim 7, characterized in that, The step of calculating the training bias value of the target fluid based on the normalized interference parameters and normalized flow data in the training set includes: The normalized interference parameters and normalized traffic data in the training set are subjected to feature transformation to obtain a combined feature vector; Calculate the similarity between the combined feature vector and all support vectors in the support vector machine to obtain the kernel function vector; The training bias value of the target fluid is obtained by weighted fusion of the kernel function value vector.

9. The flow measurement method based on support vector machine and electromagnetic flowmeter as described in claim 7, characterized in that, The step of updating the preset model parameters in the support vector machine based on the error value to obtain updated model parameters includes: Calculate the parameter gradient vector of the preset model parameters in the support vector machine based on the error value; The parameter update amount is generated based on the parameter gradient vector and the adaptive learning rate in the support vector machine; The updated model parameters are obtained by superimposing the model parameters and the parameter update amount.

10. The flow measurement method based on support vector machine and electromagnetic flowmeter as described in claim 1, characterized in that, The step of generating the flow deviation value of the target fluid corresponding to the initial flow data and the actual disturbance parameters using the optimized support vector machine includes: The initial traffic data and the actual interference parameters are converted into a fused feature vector; Calculate the similarity between the fused feature vector and all support vectors in the optimized support vector machine to obtain a similarity vector; The similarity vectors are weighted and fused to obtain the flow deviation value of the target fluid.

Citation Information

Patent Citations

  • Artificial intelligence-based accurate metering method and device for fluid conveying system

    CN111504366A

  • Method for compensating disturbance variable caused by magnetic field when measuring flow rate of liquid by means of magnetic-inductive flow meter

    CN117716213A

  • Electromagnetic flowmeter flow prediction method based on artificial intelligence

    CN119290117A

  • Flowmeter on-line calibration system and calibration method

    CN119860829A

  • Ultrasonic water meter zero flow detection method and device based on machine learning

    CN120403815A