Pipeline gas pressure and flow measurement method and system based on big data
The machine learning method to establish a gas pressure model in a clamped ultrasonic flowmeter solves the problem that the prior art cannot perform pressure measurement without destroying the pipeline, realizes accurate measurement of gas pressure and flow, and reduces installation time and testing costs.
Patent Information
- Application Number
- CN202411668816.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-03-07
AI Technical Summary
The existing clamped ultrasonic flowmeters cannot perform pressure measurement without destroying the pipeline, and cannot effectively obtain the pressure of gas in the pipeline, resulting in difficulties in obtaining pressure parameters.
Through machine learning methods, the temperature, signal-to-noise ratio, gain and signal strength of the sensor are used to establish a connection with gas pressure, thereby indirectly obtaining gas pressure and fitting using a polynomial regression model to achieve accurate measurement of gas pressure and flow.
It realizes non-invasive pipeline gas pressure and flow measurement, avoids pipeline damage, can accurately measure gas flow and pressure, reduces installation time and testing costs, and improves measurement efficiency and accuracy.
Smart Images

Figure CN119573801A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of pipeline pressure measurement, and in particular to a pipeline gas pressure and flow measurement method and system based on big data. Background Art
[0002] Clamp-on ultrasonic flowmeters do not need to damage the pipeline during measurement, so they are widely used in measuring corrosive fluids and high pressure, and have been well developed in industrial flow measurement. However, existing pressure measurement requires the sensor to be installed inside the pipeline, so clamp-on ultrasonic flowmeters cannot measure pressure without damaging the pipeline.
[0003] The standard flow rate calculation of existing flow meters is converted from the working flow rate. According to the ideal gas state equation PV=nRT, it can be known that the conversion of flow rate requires knowing the temperature and pressure of the gas in the pipeline. The temperature is obtained by placing a temperature sensor inside the ultrasonic sensor, but the pressure of the gas is related to the gas volume, temperature, and the amount of gas substance, so the existing flow meter cannot obtain the gas pressure. The present invention uses a machine learning method to establish a connection between the temperature, signal-to-noise ratio, gain, and signal strength of the sensor and the pressure, thereby indirectly obtaining the gas pressure. The traditional method cannot establish a more effective connection, so the clamp-type flow meter has difficulty in obtaining pressure parameters; the clamp-type ultrasonic probe needs to measure the installation distance when installing, and the probe distance corresponding to different pipe diameters and wall thicknesses is also different. Manual installation is prone to errors and low efficiency. Summary of the invention
[0004] The present invention provides a pipeline gas pressure and flow measurement method and system based on big data, which can realize pipeline gas pressure and flow measurement, avoid pipeline damage, and realize accurate measurement of gas flow and pressure.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions:
[0006] A pipeline gas pressure and flow measurement method based on big data includes the following steps:
[0007] S1. Obtaining a training sample set: The data acquisition module records the temperature, signal-to-noise ratio, signal gain and signal strength of the flow meter sensor at different temperatures and different flow rates, and establishes a database to form a training sample set;
[0008] S2. Model definition: The data processing module defines the pipeline gas pressure model, which is a second-order polynomial regression model:
[0009]
[0010] Among them, y is the pressure value, ε is the error term, x1 is the signal-to-noise ratio, x2 is the signal gain, x3 is the signal strength, x4 is the temperature value, β0, β1, β2, β3, β4, β5, β6, β7, β8, β9, β 10 , β 11 , β 12 , β 13 , β 14 is the regression coefficient, i.e. the parameter required by the model;
[0011] S3, polynomial fitting: Substitute the training sample set into the model for fitting and solve the regression coefficient;
[0012] S4, calculate pressure: apply the regression coefficient obtained in step S3 to the pipeline gas pressure model, substitute the data different from the training data into the fitting equation group, and obtain the fitted pressure value. When the error is greater than 1.5%, readjust the model order and refit;
[0013] S5. Flow calculation:
[0014] Instantaneous flow calculation under working conditions: Q w =v·πr 2 (2)
[0015] Where v is the fluid velocity and r is the inner radius of the pipe;
[0016] Calculation of instantaneous flow rate under standard conditions:
[0017]
[0018] Among them, P1, T1, and Q1 are the pressure, temperature, and volume flow rate under the working conditions, and P, T, and Q s are the pressure, temperature and volume flow rate under standard conditions.
[0019] Furthermore, the regression coefficient is solved by solving the sum of squares of errors to minimize the sum of squares of errors. The regression coefficient at this time is the regression coefficient to be solved, and the formula for the sum of squares of errors is:
[0020]
[0021] Where E is the square sum of the errors of pipeline gas pressure, is the predicted value of the i-th data point of pipeline gas pressure, y i is the measured value of the i-th data point, and m is the number of training samples;
[0022] Take the partial derivative of the error sum of squares and set it equal to 0:
[0023]
[0024] By solving the equations, we can get the regression parameters β0~β 14 The value of .
[0025] Furthermore, the re-adjustment of the model order is performed by adjusting the mean absolute error value, and the formula is:
[0026]
[0027] Among them, MAE is the mean absolute error.
[0028] A pipeline gas pressure and flow measurement device based on big data, comprising an ultrasonic flowmeter, a drive system, a motor rail, a support seat, a fixture, an electromagnet, an electromagnet control circuit, a field effect tube, an optocoupler and a photoelectric switch, wherein the motor rail is arranged in the support seat, the drive system is slidably connected to the motor rail, the fixture is fixedly arranged at the bottom of the drive system, the drive system and the fixture are symmetrically arranged on the motor rail, the ultrasonic flowmeter comprises a flowmeter body and a probe, the probe signal line is connected to the flowmeter body, the probe is clamped at the bottom of the clamp by a fixture, the electromagnet is arranged at both ends of the support seat, the support seat is adsorbed on the pipeline by the electromagnet, the photoelectric switch is symmetrically arranged at both ends of the motor rail and the respective detection directions are consistent with the movement direction of the drive system, and the photoelectric switch is connected to the drive system;
[0029] The output end of the electromagnet control circuit is connected to the drain pin of the field effect tube, the source of the field effect tube is connected to an external power supply, the judgment gate of the field effect tube is connected to an optocoupler, the control port of the optocoupler is connected to a drive system, and the 24V output end of the optocoupler is electromagnetically connected to the electromagnet.
[0030] Furthermore, the driving system includes a driving housing, a stepper motor, a microcontroller and a light shield, the control end of the stepper motor is connected to the IO pin of the microcontroller, the signal line of the photoelectric switch is connected to the input pin of the microcontroller, and the light shield is arranged outside the driving housing and blocks the light signal emitted by the photoelectric switch.
[0031] Furthermore, it also includes an indicator light belt, which is arranged on the top of the support base and is connected to the microcontroller of the drive system.
[0032] Furthermore, a server is included, and the ultrasonic flowmeter is connected to the server.
[0033] Compared with the prior art, the present invention has the following beneficial effects:
[0034] 1) Non-intrusive measurement ensures the integrity of the pipeline structure;
[0035] 2) Temperature and pressure compensation of the fluid inside the pipeline can be performed without additional test instruments;
[0036] 3) Through machine learning methods, the collected temperature, signal-to-noise ratio, gain, and signal strength data are fitted with polynomial regression to establish a connection with pressure, thereby indirectly obtaining gas pressure. The pressure required for flow conversion is obtained through big data methods, solving the difficulty of clamp-on flowmeters in obtaining pressure parameters.
[0037] 4) Reduce costs and increase efficiency, providing a way to quickly measure pipeline gas pressure and flow, saving a lot of installation time and reducing testing costs;
[0038] 5) The clamp-on flowmeter is limited by the way the probe is installed, and the accuracy of the flow calculation result is not as good as that of the pipe-type flowmeter. However, by accurately controlling the installation distance of the probe through a stepper motor, accurate flow measurement can be achieved;
[0039] 6) The pipe is adsorbed by magnets, and the adsorption of the magnets is ensured by optical coupling, which enables convenient installation and disassembly and improves installation efficiency;
[0040] 7) Use photoelectric switches and light shields to limit the travel limit of the probe to prevent the stepper motor from continuing to run and being damaged when the probe reaches the limit position without stopping;
[0041] 8) The microcontroller can be used to precisely control the moving distance of the stepper motor, so that the probe can be accurately installed, avoiding human uncertainty factors and improving installation efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 It is a structural block diagram of the present invention.
[0043] Figure 2 It is a flow chart of the method of the present invention.
[0044] Figure 3 It is a structural schematic diagram of the device of the present invention.
[0045] Figure 4 This is the stepping motor control circuit diagram of the present invention.
[0046] Figure 5 This is the electromagnet control circuit diagram of the present invention.
[0047] Figure 6 The present invention is a photoelectric switch control circuit diagram at one end of the motor guide rail.
[0048] Figure 7 It is a control circuit diagram of the photoelectric switch at the other end of the motor guide rail of the present invention.
[0049] Figure 8 This is the indicator light belt control circuit diagram of the present invention.
[0050] In the figure: 1. Support seat 2. Photoelectric switch 3. Motor guide rail 4. Light shield 5. Indicator light belt 6. Clamp 7. Probe 8. Electromagnet DETAILED DESCRIPTION
[0051] The specific implementation of the present invention will be further described below in conjunction with the accompanying drawings:
[0052] See Figure 1 , is a schematic diagram of the structure of the present invention. The present invention is a pipeline gas pressure and flow measurement method based on big data, the data acquisition part is completed by the ultrasonic flowmeter, and the sensor temperature data, signal-to-noise ratio data, signal strength data, and signal gain data are collected. The data processing part is performed by the server. The ultrasonic flowmeter training sample set is established through the four independent variables of signal-to-noise ratio, signal quality, temperature, and signal gain. The polynomial regression equation is used to fit the data in the training sample set to form a fitting formula. The ultrasonic flowmeter and the server communicate with each other, and the server updates the fitting formula to the ultrasonic flowmeter. The ultrasonic flowmeter provides the collected data to the server. The stepper motor accurately controls the installation distance of the probe 7. The tooling is adsorbed by a magnet and controlled by a microcontroller. Finally, the flow calculation is realized; see Figure 2 , specifically including the following steps:
[0053] S1. Obtain a training sample set: start the flow meter, record the temperature, signal-to-noise ratio, signal gain and signal strength of the flow meter sensor at different temperatures and different flow rates, and establish a database to form a training sample set.
[0054] S2. Model definition: The multivariate polynomial regression model is:
[0055]
[0056] Among them, y is the pressure value, ε is the error term, x1 is the signal-to-noise ratio, x2 is the signal gain, x3 is the signal strength, x4 is the temperature value, β abcd is the regression coefficient, i.e. the parameter required by the model, a, b, c, d are non-negative integers, and their sum is equal to the degree k of the current polynomial;
[0057] The order of the model is determined according to the distribution of actual data. Since the four variable parameters collected are signal-to-noise ratio, signal quality, temperature and signal gain, and too high an order is likely to cause overfitting, the model of the present invention is a second-order polynomial regression model:
[0058]
[0059] Since there are 15 combinations of a, b, c, and d when n = 2, we use β0 to β 14 express.
[0060] S3, polynomial fitting: Substitute the training sample set into the model for fitting, and solve the above regression coefficient. By solving the sum of squared errors and minimizing the sum of squared errors, the regression coefficient at this time is the regression coefficient to be solved, and the formula for the sum of squared errors is:
[0061]
[0062] Where E is the square sum of the errors of pipeline gas pressure, is the predicted value of the i-th data point of pipeline gas pressure, y i is the measured value of the i-th data point, and m is the number of training samples;
[0063] Take the partial derivative of the error sum of squares and set it equal to 0:
[0064]
[0065] By solving the equations, we can get the regression parameters β0~β 14 The value of .
[0066] S4. Calculate pressure: The regression coefficient can be obtained through the above equations. Finally, the data different from the training data is substituted into the fitting equations to obtain the fitted pressure value. If the error is large, it is necessary to readjust the model order and refit. The model order is adjusted by the mean absolute error value. The formula is:
[0067]
[0068] Among them, MAE is the mean absolute error.
[0069] S5. Flow calculation:
[0070] Instantaneous flow calculation under working conditions: Q w =v·πr 2 (12)
[0071] Where v is the fluid velocity and r is the inner radius of the pipe;
[0072] Calculation of instantaneous flow rate under standard conditions:
[0073]
[0074] Among them, P1, T1, and Q1 are the pressure, temperature, and volume flow rate under the working conditions, and P, T, and Q s are the pressure, temperature and volume flow rate under standard conditions.
[0075] See Figure 3, a pipeline gas pressure and flow measurement system based on big data, including an ultrasonic flowmeter, a drive system, a motor guide rail 3, a support seat 1, a fixture 6, an electromagnet 8, an electromagnet control circuit, a field effect tube, an optocoupler, a photoelectric switch 2, an indicator light strip 5 and a server, wherein the motor guide rail 3 is arranged in the support seat 1, the drive system is slidably connected to the motor guide rail 3, the fixture 6 is fixedly arranged at the bottom of the drive system, the drive system and the fixture 6 are symmetrically arranged on the motor guide rail 3, the ultrasonic flowmeter includes a flowmeter body and a probe 7, the probe 7 signal line is connected to the flowmeter body, the probe 7 is clamped at the bottom of the clamp 6 by the fixture 6, the electromagnet 8 is arranged at both ends of the support seat 1, the support seat 1 is adsorbed on the pipeline by the electromagnet 8, the photoelectric switch 2 is symmetrically arranged at both ends of the motor guide rail 3 and each detection direction is consistent with the movement direction of the drive system, the photoelectric switch 2 is connected to the drive system, the indicator light strip 5 is arranged on the top of the support seat 1, the indicator light strip 5 is connected to the microcontroller of the drive system, and the ultrasonic flowmeter is connected to the server.
[0076] See Figure 5 The output end of the electromagnet control circuit is connected to the drain pin D of the field effect tube through the connector pin, the source of the field effect tube is connected to the external power supply S, the judgment gate of the field effect tube is connected to the optocoupler G connected to the optocoupler, the control port of the optocoupler is connected to the drive system MAGNET pin, the 24V output end of the optocoupler is electromagnetically connected to the electromagnet 8, the optocoupler effectively isolates the external electrical connection, is compatible with any level detection and improves reliability, its 1 pin is connected to the microcontroller IO port, and its on and off is controlled by the microcontroller, and the 24V high voltage is output through the field effect tube to control the electromagnet 8.
[0077] See Figure 3-4 The driving system includes a driving housing, a stepper motor, a microcontroller and a light shield 4. The control terminals A+, A- and B+, B- of the stepper motor are connected to the AOUT1, AOUT2, BOUT1, and BOUT2 pins of the microcontroller. The pins 5, 8, 9, and 12 of the microcontroller are connected to the stepper motor. The microcontroller outputs a PWM waveform at pin 22 to drive the stepper motor to move. The microcontroller outputs a high and low level at pin 21 to control the moving direction of the stepper motor. Through this circuit, the microcontroller can accurately control the moving distance of the probe 7, which is convenient and quick, and does not require a lot of time to install and adjust the probe 7, which helps to improve the accuracy of flow calculation.
[0078] See Figure 6-7The signal lines of the two photoelectric switches 2 are connected to connectors P3 and P4 respectively. The resistors R39 and R45 are connected in series to the pin 2 of the connector P3. The signal line between the two resistors is connected to the LOC1 pin of the microcontroller. The resistors R40 and R46 are connected in series to the pin 2 of the connector P4. The signal line between the two resistors is connected to the LOC2 pin of the microcontroller. The pin 1 of the connector P3 is connected to the capacitor C45, and the capacitor C45 is grounded. The pin 1 of the connector P3 is also connected to the fuse F2, and the fuse F2 is connected to the 24V power supply. The pin 1 of the connector P4 is connected to the capacitor C46, and the capacitor C46 is grounded. The pin 1 of the connector P4 is also connected to the fuse F3, and the fuse F3 is connected to the 24V power supply. The light shielding sheet 4 is arranged outside the drive housing and blocks the light signal emitted by the photoelectric switch 2. The photoelectric switch 2 is connected to the input pin of the microcontroller, and the high and low levels are read to determine whether the probe 7 reaches the limit position to prevent the probe 7 from reaching the limit position without stopping the action, causing the stepper motor to continue to run and be damaged.
[0079] See Figure 8 The signal line of the indicator light strip 5 is connected to the connector P2, the pin 1 of the P2 is connected to the resistor R29, the resistor R28, the capacitor C39 and the capacitor C40, the resistor R29 is connected to the 24V power supply, the resistor R28 is connected to the 5V power supply, the capacitors C40 and C39 are grounded and connected to the 3 pin of the connector, the pin 2 of the connector P2 is connected to the resistor R30, the resistor R30 is connected to the LEDDIO pin of the microcontroller, the indicator light strip 5 is connected to the output pin of the microcontroller, and is used to control the flow direction, speed and on and off of the indicator light strip 5. The flow direction of the indicator light strip 5 follows the moving direction of the probe 7. When the probe 7 moves to the specified position, the indicator light strip 5 stops flowing and is always on.
[0080] The above embodiments are implemented based on the technical solution of the present invention, and detailed implementation methods and specific operation processes are given, but the protection scope of the present invention is not limited to the above embodiments. The methods used in the above embodiments are conventional methods unless otherwise specified.
Claims
1. A pipeline gas pressure and flow measurement method based on big data, characterized in that: The steps include: S1. Obtaining a training sample set: The data acquisition module records the temperature, signal-to-noise ratio, signal gain and signal strength of the flow meter sensor at different temperatures and different flow rates, and establishes a database to form a training sample set; S2. Define the model: The data processing module defines the pipeline gas pressure model, which is a second-order polynomial regression model: Among them, y is the pressure value, ε is the error term, x1 is the signal-to-noise ratio, x2 is the signal gain, x3 is the signal strength, x4 is the temperature value, β0, β1, β2, β3, β4, β5, β6, β7, β8, β9, β 10 , β 11 , β 12 , β 13 , β 14 is the regression coefficient, i.e. the parameter required by the model; S3, polynomial fitting: Substitute the training sample set into the model for fitting and solve the regression coefficient; S4, calculate pressure: apply the regression coefficient obtained in step S3 to the pipeline gas pressure model, substitute the data different from the training data into the fitted model, and obtain the fitted pressure value. When the error is greater than 1.5%, readjust the model order and refit; S5. Flow calculation: Instantaneous flow calculation under working conditions: Q w =v·πr 2 (2)Where v is the fluid velocity and r is the inner radius of the pipe; Calculation of instantaneous flow rate under standard conditions: Among them, P1, T1, and Q1 are the pressure, temperature, and volume flow rate under the working conditions, and P, T, and Q s are the pressure, temperature and volume flow rate under standard conditions.
2. According to the big data based pipeline gas pressure and flow measurement method of claim 1, it is characterized in that: The regression coefficient is solved by solving the error sum of squares to minimize the error sum of squares. The regression coefficient at this time is the regression coefficient to be solved, and the error sum of squares formula is: Where E is the square sum of the errors of pipeline gas pressure, is the predicted value of the i-th data point of pipeline gas pressure, y i is the measured value of the i-th data point, and m is the number of training samples; Take the partial derivative of the error sum of squares and set it equal to 0: By solving the equations, we can get the regression parameters β0~β 14 The value of .
3. According to the big data-based pipeline gas pressure and flow measurement method of claim 1, it is characterized in that: The re-adjusted model order is adjusted by the mean absolute error value, and the formula is: Among them, MAE is the mean absolute error.
4. A measurement system for pipeline gas pressure and flow measurement method based on big data according to any one of claims 1 to 3, characterized in that: It includes an ultrasonic flowmeter, a drive system, a motor guide rail, a support seat, a fixture, an electromagnet, an electromagnet control circuit, a field effect tube, an optocoupler and a photoelectric switch, wherein the motor guide rail is arranged in the support seat, the drive system is slidably connected to the motor guide rail, the fixture is fixedly arranged at the bottom of the drive system, the drive system and the fixture are symmetrically arranged on the motor guide rail, the ultrasonic flowmeter includes a flowmeter body and a probe, the probe signal line is connected to the flowmeter body, the probe is clamped at the bottom of the clamp by the fixture, the electromagnet is arranged at both ends of the support seat, the support seat is adsorbed on the pipeline by the electromagnet, the photoelectric switch is symmetrically arranged at both ends of the motor guide rail, and the respective detection directions are consistent with the movement direction of the drive system, and the photoelectric switch is connected to the drive system; The output end of the electromagnet control circuit is connected to the drain pin of the field effect tube, the source of the field effect tube is connected to an external power supply, the judgment gate of the field effect tube is connected to an optocoupler, the control port of the optocoupler is connected to a drive system, and the 24V output end of the optocoupler is electromagnetically connected to the electromagnet.
5. The pipeline gas pressure and flow measurement system based on big data according to claim 4 is characterized in that: The driving system includes a driving housing, a stepper motor, a microcontroller and a light shield. The control end of the stepper motor is connected to the IO pin of the microcontroller, the signal line of the photoelectric switch is connected to the input pin of the microcontroller, and the light shield is arranged outside the driving housing and blocks the light signal emitted by the photoelectric switch.
6. The pipeline gas pressure and flow measurement system based on big data according to claim 5 is characterized in that: It also includes an indicator light belt, which is arranged on the top of the support seat and is connected to the microcontroller of the drive system.
7. The pipeline gas pressure and flow measurement system based on big data according to claim 4 is characterized in that: A server is also included, and the ultrasonic flow meter is connected to the server.