Background
In order to satisfy the use of flow meters for any fluid, any range, any flow state and any use condition, the flow measuring methods and meters are various, and the classification methods are also various, so that the types of flow meters available for industry up to now are hundreds. Among them, the most widely used flow rate measurement methods include a differential pressure type flow meter, a float type flow meter, a positive displacement type flow meter, a fluid vibration type flow meter, and the like.
However, the flow measurement methods have certain defects, so that the final result of flow measurement is inaccurate, time and labor are wasted, and the use of subsequent flow data is affected.
Disclosure of Invention
In view of this, embodiments of the present invention provide a flow measurement method and an apparatus, so as to solve the problems that the flow measurement methods in the prior art all have certain defects, so that the final result of flow measurement is inaccurate, time and labor are wasted, and the use of subsequent flow data is affected.
A first aspect of an embodiment of the present invention provides a flow measurement method, including:
acquiring a first pressure value of a first pressure transmitter and a second pressure value of a second pressure transmitter, wherein the first pressure transmitter and the second pressure transmitter are arranged on the outer wall of a pipeline to be tested;
acquiring a first temperature value of a first temperature transmitter and a second temperature value of a second temperature transmitter, wherein the first temperature transmitter is arranged at one end of the outer side of the outer wall of the pipeline to be detected where the first pressure transmitter and the second pressure transmitter are located, and the second temperature transmitter is arranged at the other end of the outer side of the outer wall of the pipeline to be detected where the first pressure transmitter and the second pressure transmitter are located;
and determining the flow of the pipeline to be tested according to the first pressure value, the second pressure value, the first temperature value, the second temperature value and the trained flow measurement model.
As a further technical solution, the determining the flow rate of the pipeline to be tested according to the first pressure value, the second pressure value, the first temperature value, the second temperature value and the trained flow measurement model includes:
according to the expression:
determining an expression
Wherein v is the flow velocity of the liquid in the pipeline to be tested, and lambda is the friction coefficient; l is the length of the pipeline to be measured along the way resistance measurement, and d is the inner diameter of the pipeline to be measured; ρ is the fluid density; v is the average flow velocity of the pipeline to be measured; delta P is the hydrostatic head pressure difference of two sections of the upstream and downstream of the length of the pipe section to be measured; η is the hydrodynamic viscosity; re is Reynolds number.
As a further technical solution, the method further comprises:
according to the fluid densities at different temperatures, performing second-order fitting by a least square method, and determining a fitting expression of the fluid density rho to be measured: ρ ═ 0.0045 (t × t) -0.032 × t +1000.6, where t is a different temperature value;
according to the hydrodynamic viscosity at different temperatures, performing second-order fitting by a least square method, and determining a fitting expression of the to-be-measured hydrodynamic viscosity eta:
η, 1.5819 × exp (-0.0228 × t) × 0.001, where t is a different temperature value.
As a further technical solution, the method further comprises:
acquiring an experimental temperature value, a pressure value and an experimental flow determined according to the temperature value and the pressure value;
taking the obtained temperature value and pressure value in the preset range and the experimental flow determined according to the temperature value and the pressure value as the input of a support vector machine, taking the standard flow as the output of the support vector machine as a training sample, and carrying out flow measurement model training through the support vector machine;
judging whether the error between the output flow of the trained flow measurement model and the experimental flow is within a preset error threshold range or not;
if the error between the output flow and the experimental flow is judged to be within the preset error threshold value range, testing the trained flow measurement model by using the acquired temperature value and pressure value which are not within the preset range and the experimental flow determined according to the temperature value and the pressure value;
and if the error between the output flow of the tested flow measurement model and the experimental flow is within the preset error threshold range, finishing the training of the flow measurement model.
As a further technical solution, the method further comprises:
and if the error between the output flow and the experimental flow is judged not to be in the preset error threshold range, adjusting the flow measurement model, and re-executing the steps of taking the obtained temperature value and pressure value in the preset range and the experimental flow determined according to the temperature value and the pressure value as the input of the support vector machine, taking the standard flow as the output of the support vector machine as a training sample, and performing flow measurement model training through the support vector machine and then.
A second aspect of an embodiment of the present invention provides a flow rate measurement device including:
the pressure value acquisition module is used for acquiring a first pressure value of a first pressure transmitter and a second pressure value of a second pressure transmitter, wherein the first pressure transmitter and the second pressure transmitter are arranged on the outer wall of the pipeline to be detected;
the temperature value acquisition module is used for acquiring a first temperature value of a first temperature transmitter and a second temperature value of a second temperature transmitter, wherein the first temperature transmitter is arranged at one end of the outer side of the outer wall of the pipeline to be detected where the first pressure transmitter and the second pressure transmitter are positioned, and the second temperature transmitter is arranged at the other end of the outer side of the outer wall of the pipeline to be detected where the first pressure transmitter and the second pressure transmitter are positioned;
and the flow obtaining module is used for determining the flow of the pipeline to be tested according to the first pressure value, the second pressure value, the first temperature value, the second temperature value and the trained flow measurement model.
As a further technical solution, the traffic obtaining module is further configured to:
according to the expression:
determining an expression
Wherein v is the flow velocity of the liquid in the pipeline to be tested, and lambda is the friction coefficient; l is the length of the pipeline to be measured along the way resistance measurement, and d is the inner diameter of the pipeline to be measured; ρ is the fluid density; v is the average flow velocity of the pipeline to be measured; delta P is the hydrostatic head pressure difference of two sections of the upstream and downstream of the length of the pipe section to be measured; η is the hydrodynamic viscosity; re is Reynolds number.
As a further technical solution, the apparatus further includes:
the density expression determining module is used for performing second-order fitting by a least square method according to the fluid densities at different temperatures to determine a fitting expression of the fluid density rho to be measured: ρ ═ 0.0045 (t × t) -0.032 × t +1000.6, where t is a different temperature value;
the viscosity expression determination module is used for performing second-order fitting by a least square method according to the hydrodynamic viscosity at different temperatures to determine a fitting expression of the to-be-measured hydrodynamic viscosity eta:
η, 1.5819 × exp (-0.0228 × t) × 0.001, where t is a different temperature value.
A third aspect of an embodiment of the present invention provides a flow rate measurement system, including:
the first pressure transmitter is arranged on the outer wall of the pipeline to be detected;
the second pressure transmitter is arranged on the outer wall of the pipeline to be detected;
the first temperature transmitter is arranged at one end of the outer side of the outer wall of the pipeline to be detected, where the first pressure transmitter and the second pressure transmitter are located;
the second temperature transmitter is arranged at the other end of the outer side of the outer wall of the pipeline to be detected, where the first pressure transmitter and the second pressure transmitter are positioned;
the data controller is used for acquiring a first pressure value of the first pressure transmitter and a second pressure value of the second pressure transmitter; acquiring a first temperature value of a first temperature transmitter and a second temperature value of a second temperature transmitter; and determining the flow of the pipeline to be tested according to the first pressure value, the second pressure value, the first temperature value, the second temperature value and the trained flow measurement model.
A fourth aspect of embodiments of the present invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the method according to the first aspect.
Compared with the prior art, the embodiment of the invention has the following beneficial effects: after the scheme is adopted, the flow in the pipeline to be measured can be determined according to the acquired pressure value of the first pressure transmitter, the acquired pressure value of the second pressure transmitter, the acquired temperature value of the first temperature transmitter and the acquired temperature value of the second temperature transmitter, the accuracy and the precision of flow measurement are improved, time and labor are saved, and a guarantee is provided for the use of subsequent flow data.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
In order to explain the technical means of the present invention, the following description will be given by way of specific examples.
As shown in fig. 1, a flow measurement method according to an embodiment of the present invention includes steps of:
step S101, a first pressure value of a first pressure transmitter and a second pressure value of a second pressure transmitter are obtained, wherein the first pressure transmitter and the second pressure transmitter are arranged on the outer wall of the pipeline to be detected.
Step S102, a first temperature value of a first temperature transmitter and a second temperature value of a second temperature transmitter are obtained, wherein the first temperature transmitter is arranged at one end of the outer side of the outer wall of the pipeline to be detected where the first pressure transmitter and the second pressure transmitter are located, and the second temperature transmitter is arranged at the other end of the outer side of the outer wall of the pipeline to be detected where the first pressure transmitter and the second pressure transmitter are located.
Step S103, determining the flow of the pipeline to be measured according to the first pressure value, the second pressure value, the first temperature value, the second temperature value and the trained flow measurement model.
After the scheme is adopted, the flow in the pipeline to be measured can be determined according to the acquired pressure value of the first pressure transmitter, the acquired pressure value of the second pressure transmitter, the acquired temperature value of the first temperature transmitter and the acquired temperature value of the second temperature transmitter, the accuracy and the precision of flow measurement are improved, time and labor are saved, and a guarantee is provided for the use of subsequent flow data.
In addition, in a specific embodiment, the determining the flow rate of the pipe to be measured according to the first pressure value, the second pressure value, the first temperature value, the second temperature value, and the trained flow rate measurement model includes:
according to the expression:
determining an expression
Wherein v is the flow velocity of the liquid in the pipeline to be tested, and lambda is the friction coefficient; l is the length of the pipeline to be measured along the way resistance measurement, and d is the inner diameter of the pipeline to be measured; ρ is the fluid density; v is the average flow velocity of the pipeline to be measured; delta P is the hydrostatic head pressure difference of two sections of the upstream and downstream of the length of the pipe section to be measured; η is the hydrodynamic viscosity; re is Reynolds number. In addition, Re has a value in the range of more than 10
5。
Further, in a particular embodiment, the method further comprises:
according to the fluid densities at different temperatures, performing second-order fitting by a least square method, and determining a fitting expression of the fluid density rho to be measured: ρ ═ 0.0045 ═ 0.032 × (t × t) — 0.032 × t +1000.6, where t is a different temperature value.
According to the hydrodynamic viscosity at different temperatures, performing second-order fitting by a least square method, and determining a fitting expression of the to-be-measured hydrodynamic viscosity eta:
η, 1.5819 × exp (-0.0228 × t) × 0.001, where t is a different temperature value.
Specifically, in order to reduce errors caused by theoretical formula calculation, compensation correction is carried out on the hydrodynamic viscosity and the density in formula calculation, the fluid density and the hydrodynamic viscosity are measured according to viscosity and density data at different temperatures, then the data are programmed by a least square method through matlab, the temperature is used as an abscissa, the viscosity and the density are used as an ordinate, the least square method second-order fitting is carried out, and then a fitted curve is used as a calculation formula of the density and the viscosity at different temperatures.
Further, in a particular embodiment, the method further comprises:
and acquiring an experimental temperature value, a pressure value and an experimental flow determined according to the temperature value and the pressure value.
And taking the obtained temperature value and pressure value in the preset range and the experimental flow determined according to the temperature value and the pressure value as the input of the support vector machine, taking the standard flow as the output of the support vector machine as a training sample, and performing flow measurement model training through the support vector machine.
And judging whether the error between the output flow of the trained flow measurement model and the experimental flow is within a preset error threshold range.
And if the error between the output flow and the experimental flow is judged to be within the preset error threshold range, testing the trained flow measurement model by using the acquired temperature value and pressure value which are not within the preset range and the experimental flow determined according to the temperature value and the pressure value.
And if the error between the output flow of the tested flow measurement model and the experimental flow is within the preset error threshold range, finishing the training of the flow measurement model.
Specifically, the basic idea of the support vector machine method is to specifically aim at a learning machine for limited sample cases, and the structural risk minimization is achieved: a compromise is sought between the accuracy of the approximation for a given data and the complexity of the approximation function in order to obtain the best generalization ability; the method finally solves the problem of convex quadratic programming, theoretically, the obtained solution is a global optimal solution, and the problem of local extremum which cannot be avoided in a neural network method is solved; the method converts the practical problem into a high-dimensional characteristic space through nonlinear transformation, constructs a linear decision function in the high-dimensional space to realize the nonlinear decision function in the original space, skillfully solves the dimension problem, ensures better popularization capability, and has irrelevant algorithm complexity to the dimension of a sample.
The support vector regression algorithm is mainly to construct a linear decision function in a high-dimensional space to realize linear regression after dimension rising, and when an e-insensitive function is used, the basis is mainly an e-insensitive function and a kernel function algorithm. If the fitted mathematical model is to represent a curve in a multidimensional space, the result from the e-insensitive function is the "e-pipe" comprising the curve and the training points. Of all the sample points, only the part of the sample points distributed on the "pipe wall" determines the position of the pipe. This portion of the training sample is referred to as the "support vector". To accommodate the non-linearity of the training sample set, conventional fitting methods typically add higher order terms after the linear equation. This approach works well, but the adjustable parameters thus added do not increase the risk of overfitting. The support vector regression algorithm adopts a kernel function to solve the contradiction. The kernel function is used for replacing a linear term in a linear equation, so that the original linear algorithm can be subjected to nonlinear regression. Meanwhile, the kernel function is introduced to achieve the purpose of 'dimension increasing', and the added adjustable parameters can still be controlled by overfitting. In addition, a part of data can be randomly selected as a training sample to carry out multiple times of data model training through a support vector machine to obtain a training model with a training error always smaller than 1%, then the rest part of data is used as a test sample to test the training model with the training error smaller than 1%, whether the error of the test sample is always smaller than 1% is checked, if so, the flow measurement model is corrected effectively, the flow measurement model is obtained, and if not, the steps are repeated by continuously selecting sample data until the error of the corrected model is smaller than 1%.
Further, in a particular embodiment, the method further comprises:
and if the error between the output flow and the experimental flow is judged not to be in the preset error threshold range, adjusting the flow measurement model, and re-executing the steps of taking the obtained temperature value and pressure value in the preset range and the experimental flow determined according to the temperature value and the pressure value as the input of the support vector machine, taking the standard flow as the output of the support vector machine as a training sample, and performing flow measurement model training through the support vector machine and then.
As shown in fig. 2, a schematic structural diagram of a flow rate measurement device provided in an embodiment of the present invention includes:
the pressure value obtaining module 201 is configured to obtain a first pressure value of the first pressure transmitter and a second pressure value of the second pressure transmitter, where the first pressure transmitter and the second pressure transmitter are disposed on an outer wall of the pipe to be tested.
A temperature value acquisition module 202 for acquire the first temperature value of first temperature transmitter and the second temperature value of second temperature transmitter, wherein, first temperature transmitter sets up first pressure transmitter with the one end in the pipeline outer wall outside that awaits measuring that second pressure transmitter place, second temperature transmitter sets up first pressure transmitter with the other end in the pipeline outer wall outside that awaits measuring that second pressure transmitter place.
And a flow obtaining module 203, configured to determine a flow of the pipeline to be measured according to the first pressure value, the second pressure value, the first temperature value, the second temperature value, and the trained flow measurement model.
After the scheme is adopted, the flow in the pipeline to be measured can be determined according to the acquired pressure value of the first pressure transmitter, the acquired pressure value of the second pressure transmitter, the acquired temperature value of the first temperature transmitter and the acquired temperature value of the second temperature transmitter, the accuracy and the precision of flow measurement are improved, time and labor are saved, and a guarantee is provided for the use of subsequent flow data.
In addition, in a specific embodiment, the traffic obtaining module is further configured to:
according to the expression:
determining an expression
Wherein v is the flow velocity of the liquid in the pipeline to be tested, and lambda is the friction coefficient; l is the length of the pipeline to be measured along the way resistance measurement, and d is the inner diameter of the pipeline to be measured; ρ is the fluid density; v is the average flow velocity of the pipeline to be measured; delta P is the hydrostatic head pressure difference of two sections of the upstream and downstream of the length of the pipe section to be measured; η is the hydrodynamic viscosity; re is Reynolds number.
Furthermore, in a specific embodiment, the apparatus further comprises:
and the density expression determining module is used for performing second-order fitting by a least square method according to the fluid densities at different temperatures to determine a fitting expression of the fluid density rho to be measured. ρ ═ 0.0045 ═ 0.032 × (t × t) — 0.032 × t +1000.6, where t is a different temperature value.
The viscosity expression determination module is used for performing second-order fitting by a least square method according to the hydrodynamic viscosity at different temperatures to determine a fitting expression of the to-be-measured hydrodynamic viscosity eta:
η, 1.5819 × exp (-0.0228 × t) × 0.001, where t is a different temperature value.
Furthermore, in a specific embodiment, the apparatus further comprises:
the experimental flow acquisition module is used for acquiring an experimental temperature value, a pressure value and experimental flow determined according to the temperature value and the pressure value;
and the flow measurement model training module is used for taking the acquired temperature value and pressure value in the preset range and the experimental flow determined according to the temperature value and the pressure value as the input of the support vector machine, taking the standard flow as the output of the support vector machine as a training sample, and performing flow measurement model training through the support vector machine.
And the flow measurement model judging module is used for judging whether the error between the output flow of the trained flow measurement model and the experimental flow is within a preset error threshold range.
And the measurement model test module is used for testing the trained flow measurement model by using the acquired temperature value and pressure value which are not in the preset range and the experimental flow determined according to the temperature value and the pressure value if the error between the output flow and the experimental flow is judged to be in the preset error threshold range.
And the flow measurement model training completion module is used for completing the flow measurement model training if the error between the output flow of the tested flow measurement model and the experimental flow is within a preset error threshold range.
Furthermore, in a specific embodiment, the apparatus further comprises:
and the flow measurement model adjusting module is used for adjusting the flow measurement model if the error between the output flow and the experimental flow is judged not to be within the preset error threshold range, and re-executing the steps of taking the acquired temperature value and pressure value within the preset range and the experimental flow determined according to the temperature value and the pressure value as the input of the support vector machine, taking the standard flow as the output of the support vector machine as a training sample, and performing flow measurement model training and the subsequent steps through the support vector machine.
As shown in fig. 3, a schematic structural diagram of a flow measurement system provided in an embodiment of the present invention includes:
the first pressure transmitter 301 is arranged on the outer wall of the pipeline to be tested.
And a second pressure transmitter 302, which is arranged on the outer wall of the pipeline to be tested.
The first temperature transmitter 303 is arranged at one end of the outer side of the outer wall of the pipeline to be detected where the first pressure transmitter and the second pressure transmitter are located.
And the second temperature transmitter 304 is arranged at the other end of the outer side of the outer wall of the pipeline to be detected where the first pressure transmitter and the second pressure transmitter are positioned.
A controller 305 for obtaining a first pressure value of the first pressure transmitter and a second pressure value of the second pressure transmitter; acquiring a first temperature value of a first temperature transmitter and a second temperature value of a second temperature transmitter; and determining the flow of the pipeline to be tested according to the first pressure value, the second pressure value, the first temperature value, the second temperature value and the trained flow measurement model.
Specifically, the external device is used for storing liquid passing through the pipeline to be tested, after a valve is opened, the liquid flows out of the external device and passes through the pipeline to be tested, the first pressure transmitter, the second pressure transmitter, the first temperature transmitter and the second temperature transmitter which are positioned on the outer wall of the pipeline to be tested measure current data values, then the current data values are transmitted to the processor for data mode conversion, analog data are converted into digital data, then testing is carried out according to a pre-stored flow testing method, the flow in the pipeline to be tested is determined, the other end of the pipeline to be tested is further connected with a standard container, and the liquid in the pipeline to be tested finally flows into the standard container for collection and processing.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal device are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain other components which may be suitably increased or decreased as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media which may not include electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.