Disclosure of Invention
In order to solve the technical problem of lower installation inclination angle measurement precision, the application provides an accurate detection method for the installation inclination angle of a rotameter, which adopts the following technical scheme:
The application provides an accurate detection method for the installation inclination angle of a rotameter, which comprises the following steps:
collecting the flow value and the installation inclination angle at each moment;
Respectively forming a flow sequence and an installation dip sequence by the flow value and the installation dip, and smoothing the installation dip sequence by a preset smoothing factor in the installation dip sequence to obtain an installation dip after the data point is smoothed;
obtaining a neighborhood data point of each data point, and obtaining the interference degree of the data point according to the difference of the installation inclination angle of the data point and the neighborhood data point and the difference of the deviation degree of the data point and the average value of the deviation degree of the neighborhood data point; in the flow sequence, the interference degree of the data points in the flow sequence is obtained according to the deviation degree of the data points and the neighborhood data points and the difference of the flow values;
In the installation dip sequence, comparing the smoothness of the data points with the optimized interference degree and the smoothness of the rest data points in the installation dip sequence with the optimized interference degree to obtain a processing effect value of the smoothing factor;
And smoothing the installation dip angle according to the regulated smoothing factor, and accurately detecting the installation dip angle.
In the scheme, the smoothness of the installation dip angle data point is built through the deviation degree of the data points in the installation dip angle sequence under the action of the smoothing factor and the change of the installation dip angle, meanwhile, the interference degree of the installation dip angle data point is built through the local data change of the installation dip angle data point and the deviation degree distribution characteristics, the flow influence degree of the installation dip angle data point and the flow data is built based on the influence of the fluid flow data measured by the rotameter on the installation dip angle, the interference degree is optimized based on the flow influence degree, the processing effect value of the smoothing factor is built in a self-adaptive mode based on the optimized interference degree and the smoothness, the acquisition of the optimal smoothing factor is completed based on the processing effect value, the optimized interference degree and the smoothness self-adaptive mode, the filtering effect of the exponentially weighted moving average filter is improved, and the detection precision and the efficiency of the installation dip angle of the rotameter are further improved.
In one embodiment, the method for obtaining the smoothness of each data point under different smoothness factors according to the difference of the front-back installation inclination angles and the difference of the deviation degree of the same data point is as follows:
Calculating the Z fraction difference of each data point before and after smoothing in the installation dip sequence as the difference of the deviation degree of the installation dip sequence;
Acquiring the smoothness of the data points under a smoothing factor according to the Z fraction difference before and after smoothing and the installation inclination difference before and after smoothing;
The smoothness of the data points under the smoothing factor is positively correlated with the Z-score difference before and after smoothing and the installation inclination angle difference before and after smoothing respectively, and is negatively correlated with the Z-score after smoothing.
In one embodiment, the method for obtaining the interference degree of each data point according to the difference of the installation inclination angle of the data point and the neighborhood data point and the difference of the deviation degree of the data point and the mean value of the deviation degree of the neighborhood data point is as follows:
In the installation dip sequence, selecting a plurality of data points closest to the data point as neighborhood data points of the data point;
Obtaining the interference degree of the data points according to the difference of the mean values of the Z scores of the data points and the Z scores of the neighborhood data points and the difference of the installation inclination angles of the data points and the neighborhood data points;
The disturbance degree of the data points is positively correlated with the difference of the installation inclination angles, and the difference of the mean values of the Z scores of the data points in the neighborhood is negatively correlated.
In one embodiment, the method for obtaining the flow influence degree of the data points according to the interference degree difference of the same data point in different sequences and the difference of the installation inclination angle and the flow value is as follows:
, indicating the degree of interference of the q-th data point in the installation dip sequence, Indicating the degree of interference of the q-th data point in the traffic sequence,The normalized value of the mounting tilt for the q-th data point in the mounting tilt sequence is shown,Represents the normalized value of the flow value for the q-th data point in the flow sequence,Represents an exponential function with a base of a natural constant,The flow effect of the qth data point is shown.
In one embodiment, in the installation inclination sequence, the method for optimizing the interference degree according to the influence of the flow to obtain the optimized interference degree is as follows:
, Indicating the degree of interference of the q-th data point of the installation dip sequence after optimization, Indicating the flow effect of the qth data point,The degree of interference of the q-th data point of the installation dip sequence is shown.
In one embodiment, the method for comparing the smoothness of the data point with the optimized disturbance degree and the smoothness of the rest data points in the installation inclination angle sequence with the optimized disturbance degree to obtain the processing effect value of the smoothing factor is as follows:
, A smoothing effect value representing the q-th data point of the installation dip sequence, Representing the maximum value of the processing effect of all data points in the installation dip sequence at the smoothing factor,Representing the minimum value of the processing effect of all data points in the installation dip sequence at the smoothing factor,A linear normalization function is represented and,The treatment effect value of the q-th data point of the installation dip sequence under the smoothing factor is represented.
In one embodiment, the method for adjusting the smoothing factor according to the processing effect value, the smoothness and the optimized interference degree to obtain the adjusted smoothing factor includes:
In the formula, Representing the smoothness of the q-th data point of the installation dip sequence at the current smoothing factor,Indicating the degree of interference of the q-th data point in the installation dip sequence after optimization,Representing the effect of processing the qth data point in the installation dip sequence at the current smoothing factor,As the current smoothing factor is used,Is the adjusted smoothing factor.
In one embodiment, the method for smoothing the installation inclination angle according to the adjusted smoothing factor is as follows:
Obtaining the installation inclination angle after the smoothing treatment by an exponential moving weighted average method;
The algorithm is input into the adjusted smoothing factors, the collected installation inclination angle and the installation inclination angle after the previous data point smoothing treatment.
In one embodiment, the method for obtaining the smoothness of the data points under the smoothing factor according to the Z-score difference before and after smoothing and the installation inclination angle difference before and after smoothing is as follows:
g represents a data point before smoothing, E represents a data point after smoothing, Representing the Z-score of the data point before smoothing,Representing the Z-score of the smoothed data point,Representing the installation tilt of the data point before smoothing,Representing the installation tilt angle of the smoothed data point,Representing the smoothness of the data point at the current smoothing factor.
In one embodiment, the method for obtaining the interference degree of the data points according to the difference of the mean values of the Z scores of the data points and the Z scores of the neighborhood data points and the difference of the installation inclination angles of the data points and the neighborhood data points is as follows:
, The Z-score representing the q-th data point, The mean of the Z-scores of all neighbor data points representing the qth data point,Represents the mounting tilt of the q-th data point,Representing the mounting inclination of the ith neighbor data point of the qth data point,Representing the number of data points of the field,The degree of interference of the q-th data point is shown.
The method has the advantages that the smoothness of the installation dip data point is built through the deviation degree of the data points in the installation dip sequence under the action of the smoothness factor and the change of the installation dip, meanwhile, the interference degree of the installation dip data point is built through the local data change of the installation dip data point and the deviation degree distribution characteristics, the flow influence degree of the installation dip data point and the flow data is built based on the influence of the fluid flow data measured by the rotameter on the installation dip, the interference degree is optimized based on the flow influence degree, the processing effect value of the smoothness factor is built in a self-adaptive mode based on the optimized interference degree and the smoothness, the acquisition of the optimal smoothness factor is completed in a self-adaptive mode based on the processing effect value, the optimized interference degree and the smoothness degree, the filtering effect of the exponentially weighted moving average filter is improved, and the detection accuracy and the detection efficiency of the installation dip of the rotameter are further improved.
Detailed Description
In order to further describe the technical means and effects adopted by the present application to achieve the preset purpose, the following detailed description refers to the specific implementation, structure, characteristics and effects of the accurate detection method for the installation inclination angle of the rotameter according to the present application, which is provided by the present application, with reference to the accompanying drawings and the preferred embodiments. In the following description, different "one embodiment" or "another embodiment" means that the embodiments are not necessarily the same. Furthermore, the particular features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.
An embodiment of a precise detection method for the installation inclination angle of a rotameter:
The following specifically describes a specific scheme of the accurate detection method for the installation inclination angle of the rotameter provided by the application with reference to the accompanying drawings.
Referring to fig. 1, a flowchart of a method for precisely detecting a mounting inclination angle of a rotameter according to an embodiment of the present application is shown, and the method includes the following steps:
and S001, collecting the flow value and the installation inclination angle at each moment.
The rotor flowmeter is placed in a conical tube universal to the rotor flowmeter, a horizontal sensor is prevented from being arranged on the bottom surface of the conical tube, the center of gravity direction of the rotor flowmeter is coincident with the tube axis direction of the conical tube, as shown in fig. 2, 1 in fig. 2 is the rotor universal to the rotor flowmeter, 2 is the horizontal sensor, and 3 is the conical tube universal to the rotor flowmeter. The installation inclination angle of the rotameter can be obtained through the horizontal sensor, and the flow value is obtained in real time through the rotameter. Wherein the flow value at this time is an uncompensated flow value. The installation tilt angle and flow rate values are collected every five seconds.
So far, the flow value and the installation inclination angle at each moment are obtained.
Step S002, the flow value and the installation dip angle respectively form a flow sequence and an installation dip angle sequence, the installation dip angle sequence is smoothed by a preset smoothing factor to obtain the smoothed installation dip angles of the data points in the installation dip angle sequence, and the smoothness of each data point in the installation dip angle sequence under different smoothing factors is obtained according to the difference of the installation dip angles before and after the same data point in the installation dip angle sequence is smoothed and the difference of the deviation degree.
And for the collected installation dip angle and flow rate values, taking one day as a period, so that all the installation dip angle and flow rate values collected from the starting time of each day to the current moment respectively form a sequence, and respectively recording the sequence as an installation dip angle sequence and a flow rate sequence.
Because the fluid flow is overlarge, the pipeline pressure is overlarge and local deformation or pipeline vibration is caused, the installation dip angle can fluctuate near a certain fixed value, the collected installation dip angle is inaccurate, the installation dip angle needs to be smoothed, the corresponding smoothness can be adaptively constructed through the change of the installation dip angle before and after the smoothing of the installation dip angle to represent the change of the installation dip angle under the action of the filter, and the smoothing factor parameters are regulated and controlled based on the smoothness.
Because the installation dip angle sequence and the flow sequence are both time sequences, an initial smoothing factor of the exponentially weighted moving average filter is set first, and in this embodiment, the value of the initial smoothing factor is 0.3, and the initial smoothing factor is the smoothing factor of the first data point of the sequence, and the smoothing factor of each data point is obtained by adjusting the smoothing factor of the last data point. The installation dip sequence is smoothed by an exponential weighted moving average method, and the smoothed installation dip of each data point in the installation dip sequence is obtained after the smoothing, wherein the exponential weighted moving average method is a known technology and the application is not described in detail.
The Z fraction of each data point before and after the smoothing in the installation dip sequence is calculated, the calculation of the Z fraction is a known technology, the Z fraction is used for obtaining the deviation degree of each data point relative to the average value, the greater the deviation degree difference before and after the smoothing is, the more the installation dip with larger fluctuation is described to be corrected, the better the smoothing effect is, and the greater the installation dip difference before and after the smoothing is, the greater the smoothing effect is described. Based on this, the smoothness of each data point under the smoothing factor is obtained.
The smoothness of the data points under the smoothing factor is positively correlated with the Z-score difference before and after smoothing and the installation inclination angle difference before and after smoothing respectively, and is negatively correlated with the Z-score after smoothing.
It should be noted that positive correlation indicates that one variable grows and the other variable also grows, and that the directions of the two variables change are the same, and that when one variable changes from large to small or from small to large, the other variable also changes from large to small or from small to large, and the specific relation is determined by practical application, and the application is not limited in particular.
It should be noted that, the negative correlation indicates that one variable increases and the other variable decreases, and the directions of the two variable changes are opposite, when one variable changes from large to small or from small to large, the other variable also changes from small to large or from large to small, and the specific relation is determined by practical application, and the application is not limited in particular.
Preferably, in the present embodiment, the expression of the smoothness under the current smoothing factor is:
Where G represents the data point before smoothing, E represents the data point after smoothing, Representing the Z-score of the data point before smoothing,Representing the Z-score of the smoothed data point,Representing the installation tilt of the data point before smoothing,Representing the installation tilt angle of the smoothed data point,Representing the smoothness of the data point at the current smoothing factor.
Preferably, in another embodiment of the present application, the expression of the smoothness under the current smoothing factor is:。
The larger the Z fraction of the smoothed data point in the installation dip sequence, the farther the deviation degree of the smoothed data point is, the worse the smoothing effect is, the larger the Z fraction difference of the smoothed data point is, the better the smoothing effect of the installation dip under the current smoothing factor is, the larger the difference of the installation dip is, the larger the change of the smoothed data point is, and the better the smoothing effect is.
Thus, the smoothness of each data point under the current smoothing factor is obtained.
Step S003, obtaining a neighborhood data point of each data point, obtaining the interference degree of the data point according to the difference of the installation inclination angle of the data point and the neighborhood data point and the difference of the deviation degree of the data point and the deviation degree mean value of the neighborhood data point, obtaining the interference degree of the data point in the flow sequence according to the deviation degree of the data point and the neighborhood data point and the difference of the flow value in the flow sequence, obtaining the flow influence degree of the data point according to the interference degree difference of the same data point in different sequences and the difference of the installation inclination angle and the flow value, and obtaining the optimized interference degree according to the flow influence degree in the installation inclination angle sequence.
The smoothness of each data point in the installation dip sequence under the current smoothing factor is obtained through the steps. Since the smoothness is not as high as better for different data points, when the data points in the installation dip sequence are normal data points (i.e. data points with smaller interference), the greater the smoothness is, the greater the influence weight of the historical data in the current filter is indicated, and the current normal data points are excessively smoothed, and when the data points in the installation dip sequence are abnormal data points (i.e. data points with larger interference), the greater the smoothness is, the better the noise removal effect of the current filter is indicated.
Therefore, data points in the installation dip sequence need to be analyzed, and the interference degree of each data point in the installation dip sequence is obtained according to the difference of the installation dip of the data point and the data point in the neighborhood of the data point and the Z fraction difference.
For each data point in the installation dip sequence, selecting M data points closest to the data point in the installation dip sequence as neighborhood data points, and if M data points do not exist in the installation dip sequence, taking all the data points, wherein the value of M is 11.
The degree of disturbance of the data points is positively correlated with the difference in the mounting inclination angles and with the difference in the Z fractions, respectively.
Preferably, in this embodiment, the interference of the data points in the installation dip sequence is:
, The Z-score representing the q-th data point, The mean of the Z-scores of all neighbor data points representing the qth data point,Represents the mounting tilt of the q-th data point,Representing the mounting inclination of the ith neighbor data point of the qth data point,Representing the number of data points of the field,The degree of interference of the q-th data point is shown.
Preferably, in another embodiment of the present application, the degree of interference of the data points in the installation dip sequence is:
。
The larger the Z score of the data point is, the smaller the average value of the Z scores of all the neighborhood data points is, namely, the larger the difference between the Z scores of the data point and the neighborhood data point is, the larger the deviation of the data point relative to the neighborhood data point is, namely, the larger the independence of the data point is, the more likely the change of the installation inclination angle of the data point is an independent change, and the larger the disturbance degree of the data point is. The larger the difference between the installation inclination angle of the data point and the installation inclination angle of the neighborhood data point is, the abrupt change of the installation inclination angle of the data point is indicated, the larger the installation inclination angle is compared with the normal fluctuation difference, and the interference degree of the data point is larger.
The interference degree of each data point in the installation dip angle sequence is obtained through the steps, and then for each flow sequence, the interference degree of each data point in the flow sequence is obtained through the differences of the Z fraction and the flow value of the data point in the flow sequence and the flow value and the Z fraction average value of the neighborhood data point.
Because the installation inclination can receive the influence of the flow of fluid when gathering, when the flow is too big, the pressure of fluid to the pipeline changes, and then leads to the local load of pipeline too big, appears the phenomenon of local deformation, so when the flow is too big, can make the installation inclination take place great change, and then appear the too big phenomenon of interference degree of data point in the installation inclination sequence.
Based on the analysis, the flow value acquired by the rotameter is further analyzed, and because the flow value and the installation dip angle are acquired at each moment, the data points of the installation dip angle sequence and the data points in the flow sequence are in one-to-one correspondence at the same moment, so that the flow influence degree of each data point is acquired according to the interference degree difference of the corresponding data points of different sequences and the difference of the installation dip angle and the flow value of the data points.
Preferably, in this embodiment, first, a normalized value of the installation inclination angle and the flow rate value of each data point is obtained, and the flow rate influence is expressed as follows:
, indicating the degree of interference of the q-th data point in the installation dip sequence, Indicating the degree of interference of the q-th data point in the traffic sequence,The normalized value of the mounting tilt for the q-th data point in the mounting tilt sequence is shown,Represents the normalized value of the flow value for the q-th data point in the flow sequence,Represents an exponential function with a base of a natural constant,The flow effect of the qth data point is shown.
When the flow data is too large, the installation inclination angle can be changed due to local deformation caused by the excessive local load of the pipeline, so that the flow influence degree reflects the possibility that the abnormality of the installation inclination angle is influenced by the flow data. If the difference between the disturbance degrees of the data points corresponding to the installation inclination angle sequence and the flow sequence is smaller, the flow influence degree is larger, the change of the installation inclination angle and the flow value is reflected on the whole, the change of the numerical value is ignored, and therefore the flow influence degree of the data points is obtained by combining the difference of the numerical values.
Optimizing the interference degree of the data points in the installation dip angle sequence through the flow influence of the data points, and obtaining the optimized interference degree, wherein the expression is as follows:, the disturbance degree after the q-th data point of the installation dip sequence is optimized is shown.
So far, the interference degree of each data point in the installation dip sequence after optimization is obtained.
And S004, comparing the smoothness of the data points with the optimized interference degree and the smoothness of the rest data points in the installation dip angle sequence with the optimized interference degree in the installation dip angle sequence to obtain a processing effect value of the smoothing factor, and adjusting the smoothing factor according to the processing effect value, the smoothness and the optimized interference degree to obtain the adjusted smoothing factor.
Through the steps, the smoothness of the data points and the optimized interference degree are obtained, and the processing effect of the smoothing factor is constructed based on the smoothness and the optimized interference degree.
For each data point, the smoothness of the data point indicates that the data point has larger change under the action of the smoothness factor, the optimized interference degree of the data point indicates that the data point is more likely to be a data point acquired for receiving interference, the product of the smoothness of each data point and the optimized interference degree is calculated and recorded as a smoothness effect value, the smoothness effect value characterizes the processing effect of the smoothness factor, when the smoothness effect value is larger, the smoothness effect of the installation dip angle data point is larger when the smoothness effect value is larger, and when the smoothness effect value is smaller, the smoothness effect of the installation dip angle is smaller when the smoothness effect value is not received, and the content remained after the smoothness is more.
And obtaining the processing effect value of the smoothing factor by installing the smoothing effect value of each data point in the dip angle sequence.
Preferably, in the present embodiment, the expression of the processing effect value of the smoothing factor is:
, A smoothing effect value representing the q-th data point of the installation dip sequence, Representing the maximum value of the processing effect of all data points in the installation dip sequence at the smoothing factor,Representing the minimum value of the processing effect of all data points in the installation dip sequence at the smoothing factor,A linear normalization function is represented and,The treatment effect value of the q-th data point of the installation dip sequence under the smoothing factor is represented.
The processing effect value of each data point of the installation dip angle sequence under the smoothing factor is obtained through the steps, and the smoothing factor is adaptively adjusted based on the processing effect value, and the adjustment mode is as follows:
In the formula, Representing the smoothness of the q-th data point of the installation dip sequence at the current smoothing factor,Indicating the degree of interference of the q-th data point in the installation dip sequence after optimization,Representing the effect of processing the qth data point in the installation dip sequence at the current smoothing factor,As the current smoothing factor is used,Is the adjusted smoothing factor.
When the processing effect of the data point under the smoothing factor is weaker, the smoothing factor is corrected, and when the interference degree after optimization is greater than or equal to the smoothness, the interference suffered by the data point in the installation dip angle sequence is larger, and at the moment, the installation dip angle after the adjustment of the last data point is more important, and the current smoothing factor needs to be reduced. And when the interference degree after optimization is smaller than the smoothness, the data points in the current installation dip sequence are excessively smoothed, and more attention is needed to be paid to the installation dip acquired by the data points, so that the smoothing factor is needed to be increased.
Thus, the adjusted smoothing factor is obtained.
And step S005, smoothing the installation inclination angle according to the regulated smoothing factor, and accurately detecting the installation inclination angle.
For each data point in the installation dip angle sequence, the smoothing factor of the previous data point is used as the current smoothing factor, the current smoothing factor is regulated through the steps, the installation dip angle after the smoothing treatment is obtained through the regulated smoothing factor through an exponential moving weighted average method, and the accurate detection of the installation dip angle is completed. The input is the adjusted smoothing factor, the collected installation inclination angle and the installation inclination angle after the previous data point smoothing treatment. Unfiltered mounting angles, original filtered mounting angles and optimized filtered mounting angles of the present application are shown in fig. 3.
It should be noted that the foregoing embodiments are merely illustrative of the technical solutions of the present application, and not restrictive, and although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those skilled in the art that the technical solutions described in the foregoing embodiments may be modified or some of the technical features may be replaced equivalently, and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application and are included in the protection scope of the present application.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments.