A liquid level measurement method and system based on intelligent liquid level sensor
By analyzing the characteristics of temperature and liquid level data in the intelligent liquid level sensor, evaluating and correcting the interference degree of liquid level data, and adjusting the filtering algorithm, the problem of inaccurate liquid level data in traditional algorithms is solved, and the filtering accuracy of data is improved .
Patent Information
- Application Number
- CN202410709092.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-03
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2044-06-03
AI Technical Summary
Traditional weighted smooth filtering algorithms are unreasonable in liquid level monitoring, resulting in inaccurate liquid level data, making it difficult to distinguish between temperature changes and normal water level changes, affecting monitoring accuracy.
By obtaining the temperature and liquid level data of the intelligent liquid level sensor, building a target window, analyzing the temperature fluctuation characteristics and distribution characteristics, combining linear fitting error and accuracy parameters, evaluating the initial interference degree of the liquid level data, and through the comparison window Corrected, adjust the weighted smoothing filtering algorithm to obtain denoised liquid level data.
The filtering accuracy of liquid level data is improved, and the credibility and accuracy of the data are enhanced by analyzing the impact of temperature on liquid level, accurately evaluating and correcting the degree of interference.
Smart Images

Figure CN118706227B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data acquisition of intelligent liquid level sensors, and in particular to a liquid level measurement method and system based on the intelligent liquid level sensor. Background Art
[0002] Smart level sensors are advanced devices used to measure and monitor the level of liquids. Unlike traditional level sensors, smart level sensors are usually equipped with digital signal processing, data logging, and communication functions. Since differential pressure smart level sensors have high detection accuracy, they are suitable for various scenarios and various liquids, and are widely used in various factories and businesses, such as ship draft monitoring, river and groundwater level monitoring, chemical and pharmaceutical reaction pool monitoring, etc.
[0003] The differential pressure liquid level sensor is easily affected by environmental factors, resulting in noise in the monitored data. It is also easily affected by temperature, resulting in inaccurate monitored liquid level data. When filtering the liquid level monitoring data of the liquid level sensor, the traditional weighted smoothing filter algorithm cannot accurately determine whether the change in liquid level data is due to temperature changes or normal water level changes, resulting in unreasonable setting of filtering weights, thereby affecting the accuracy of liquid level data monitoring. Summary of the invention
[0004] In order to solve the technical problem that the traditional weighted smoothing filter algorithm sets unreasonable filtering weights for liquid level monitoring data, resulting in inaccurate liquid level data, the purpose of the present invention is to provide a liquid level measurement method and system based on an intelligent liquid level sensor. The technical solutions adopted are as follows:
[0005] A liquid level measurement method based on an intelligent liquid level sensor, the method comprising:
[0006] Acquire monitoring data of the intelligent liquid level sensor; the monitoring data at least includes temperature data and liquid level data; select any of the monitoring data as target data, correspondingly including target temperature data and target liquid level data; take the target data as the center and construct a target window with preset neighborhood parameters;
[0007] According to the fluctuation characteristics of the temperature data in the target window, combined with the distribution characteristics of the target temperature data, the accuracy parameter of the target liquid level data is obtained; according to the temperature data and the liquid level data in the target window, a straight line fitting is performed to obtain a local fitting straight line of the target liquid level data; according to the fitting error between the liquid level data in the target window and the local fitting straight line, combined with the accuracy parameter, the initial interference degree of the target liquid level data is obtained;
[0008] Based on the preset neighborhood parameters, all data windows containing the target liquid level data and not centered on the target liquid level data are obtained as comparison windows; based on the similarity of the fluctuation characteristics of the initial interference degree corresponding to the liquid level data in the target window and each comparison window, combined with the initial interference degree of the target data, the corrected interference degree of the target data is obtained;
[0009] According to a preset weighted smoothing filter algorithm, combined with the corrected interference degree of each liquid level data, denoised liquid level data is obtained.
[0010] Furthermore, the method for obtaining the accuracy parameter includes:
[0011] Obtaining an accuracy weight according to a distribution position of the target temperature data compared to a preset normal temperature range;
[0012] Acquire a temperature stabilization parameter according to similar features between the target temperature data and each temperature data in the target window;
[0013] The accuracy parameter of the target liquid level data is obtained according to the accuracy weight and the temperature stability parameter; the accuracy weight and the temperature stability parameter are both positively correlated with the accuracy parameter.
[0014] Furthermore, the method for obtaining the accuracy weight includes:
[0015] When the target temperature data belongs to the preset normal temperature range, the accuracy weight is set to 1;
[0016] When the target temperature data is higher than the preset normal temperature range, a distribution high parameter is obtained according to the difference characteristics between the target temperature data and the maximum value of the preset normal temperature range, and the distribution high parameter is negatively correlated and normalized to obtain an accuracy weight;
[0017] When the target temperature data is lower than the preset normal temperature range, the low distribution parameter is obtained according to the difference characteristics between the target temperature data and the minimum value of the preset normal temperature range, and the low distribution parameter is negatively correlated mapped and normalized to obtain the accuracy weight.
[0018] Furthermore, the method for obtaining the initial interference degree includes:
[0019] According to the fitting error between the target liquid level data and the corresponding fitting value on the local fitting straight line, a first disturbed parameter of the target liquid level data is obtained after negative correlation mapping;
[0020] According to the similarity characteristics of the fitting error of the target liquid level data and the fitting error of each liquid level data in the target window, in combination with the corresponding accuracy parameter, a second disturbed parameter of the target liquid level data is obtained;
[0021] The initial interference degree of the target liquid level data is acquired according to the first interference parameter and the second interference parameter of the target liquid level data; the first interference parameter and the second interference parameter are both positively correlated with the initial interference degree.
[0022] Furthermore, the method for acquiring the second interference parameter includes:
[0023] In the target window, the sum of the accuracy parameter of the target liquid level data and the accuracy parameter of each liquid level data is used as the second interference weight of each liquid level data; the inverse of the absolute value of the difference between the fitting error of the target liquid level data and the fitting error of each liquid level data is used as the second interference sub-parameter of each liquid level data; the average of the products of the second interference weights of all liquid level data and the corresponding second interference sub-parameter is used as the second interfered parameter of the target liquid level data.
[0024] Furthermore, the method for obtaining the corrected interference degree includes:
[0025] Obtaining the mean of the initial interference degree corresponding to the liquid level data in each comparison window as a comparison mean parameter, and obtaining the standard deviation as a comparison standard deviation parameter; obtaining the standard deviation of the initial interference degree corresponding to the liquid level data in the target window as a target standard deviation parameter;
[0026] The mean of the comparison standard deviation parameters of all the comparison windows is used as the first correction sub-parameter; according to the difference characteristics between the target standard deviation parameter and each of the comparison standard deviation parameters, combined with the corresponding comparison mean parameter, the second correction sub-parameter of each comparison window is obtained;
[0027] Acquire a credibility parameter of the target window according to the first correction sub-parameter and the second correction sub-parameter of each comparison window; the first correction sub-parameter and the second correction sub-parameter of each comparison window are both negatively correlated with the credibility parameter;
[0028] Acquire the credibility parameter of each comparison window; the credibility parameter of the comparison window is acquired in the same manner as the credibility parameter of the target window;
[0029] According to the credibility parameters of all data windows containing the target liquid level data, the correction weight of the target liquid level data is obtained; according to the correction weight of the target liquid level data and the initial interference degree, the corrected interference degree of the target liquid level data is obtained; the credibility parameter is positively correlated with the correction weight; the correction weight is positively correlated with the corrected interference degree.
[0030] Furthermore, the method for calculating the credibility parameter includes:
[0031] After negative correlation mapping is performed on the mean of the second correction sub-parameter of all the comparison windows and the product of the first correction sub-parameter, the mapping result is used as the credibility parameter of the target window.
[0032] Furthermore, the method for obtaining denoised liquid level data includes:
[0033] Based on the WMA algorithm, the initial filtering weight of the liquid level data is obtained; according to the corrected interference degree and the initial filtering weight, the corrected filtering weight of the liquid level data is obtained; the corrected interference degree is negatively correlated with the corrected filtering weight; the initial filtering weight is positively correlated with the corrected filtering weight; the corrected filtering weight is normalized, and the sum of the normalized results of all liquid level data is 1;
[0034] WMA filtering is performed according to the modified filtering weights of all monitoring data to obtain denoised liquid level data.
[0035] Furthermore, the method for obtaining the local fitting straight line includes:
[0036] The temperature data in the target window is used as the explanatory variable and the liquid level data is used as the explained variable, and a least squares fitting based on a straight line is performed to obtain a local fitting straight line.
[0037] The present invention also proposes a liquid level measurement system based on an intelligent liquid level sensor, the system comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, the processor implementing any one of the steps of the liquid level measurement method based on the intelligent liquid level sensor when executing the computer program.
[0038] The present invention has the following beneficial effects:
[0039] The present invention first obtains the monitoring data of the intelligent liquid level sensor to provide a data basis for the subsequent analysis process; further selects any monitoring data as the target data and constructs a target window, which is more conducive to analyzing the local trend of the data and the influence of temperature on the liquid level; further obtains the accuracy parameter of the target liquid level data to reflect the local temperature suitability characteristics when the target liquid level data is collected, which is used to preliminarily characterize the credibility of the target liquid level data and prepare for the subsequent analysis of the interference characteristics of temperature on the liquid level; further performs linear fitting based on the temperature data and the liquid level data in the target window, and obtains the linear fitting based on the fitting error and the accuracy parameter from the liquid level data and the temperature data. The data presents a linear change relationship angle, and the initial interference degree of the target liquid level data is obtained, which preliminarily reflects the influence of temperature on the liquid level; further obtain the comparison window, and analyze the influence of temperature on the liquid level data from different window angles according to the similarity of the fluctuation characteristics of the initial interference degree corresponding to the liquid level data in the target window and each comparison window, so as to avoid bias, thereby more accurately evaluating and correcting the interference degree of the target liquid level data, obtaining the corrected interference degree of the target data, and providing a basis for the final correction filtering operation; finally, according to the preset weighted smoothing filtering algorithm, combined with the corrected interference degree of each liquid level data, the denoised liquid level data is obtained. The present invention determines the interference of the liquid level data by temperature by analyzing the fluctuation characteristics of the local temperature, combining the change relationship between temperature and liquid level, and then uses the comparison window to correct it, and finally adjusts the weighted smoothing filtering algorithm based on the corrected interference degree to improve the accuracy of the denoised liquid level data after filtering. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0041] Figure 1 A flow chart of a liquid level measurement method based on an intelligent liquid level sensor provided by an embodiment of the present invention;
[0042] Figure 2 A flowchart of a method for obtaining a corrected interference degree provided by an embodiment of the present invention;
[0043] Figure 3 A schematic diagram of a liquid level measurement system based on an intelligent liquid level sensor provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0044] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the liquid level measurement method and system based on the intelligent liquid level sensor proposed by the present invention, its specific implementation, structure, features and effects, in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0045] 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 invention belongs.
[0046] The following is a detailed description of a liquid level measurement method and system based on an intelligent liquid level sensor provided by the present invention in conjunction with the accompanying drawings.
[0047] See also Figure 1 , which shows a flow chart of a liquid level measurement method based on an intelligent liquid level sensor provided by an embodiment of the present invention, specifically comprising:
[0048] Step S1: Acquire monitoring data of the intelligent liquid level sensor; the monitoring data includes at least temperature data and liquid level data; select any monitoring data as target data, including target temperature data and target liquid level data; construct a target window with preset neighborhood parameters centered on the target data.
[0049] In an embodiment of the present invention, the monitoring data of the intelligent liquid level sensor is first obtained to provide a data basis for the subsequent analysis process; in order to analyze the influence of temperature on the liquid level data and finally obtain accurate denoised liquid level data, the monitoring data at least includes temperature data and liquid level data; since the liquid level heights at different times are different, the temperature changes are also different, and the local trend of the data is more obvious, any monitoring data is selected as the target data, including target temperature data and target liquid level data; with the target data as the center, a target window is constructed with preset neighborhood parameters, which is more adaptable to changing environmental factors and more conducive to analyzing the influence of temperature on liquid level data.
[0050] It should be noted that integrating a temperature sensor into an intelligent liquid level sensor, or arranging a temperature sensor at an adjacent position where the intelligent liquid level sensor is installed, so as to simultaneously obtain temperature data and liquid level data, are technical means well known to those skilled in the art and will not be elaborated here. In one embodiment of the present invention, the collection frequency of monitoring data is 50 Hz. In other embodiments of the present invention, the implementer can adjust it by himself.
[0051] Step S2: According to the fluctuation characteristics of the temperature data in the target window, combined with the distribution characteristics of the target temperature data, the accuracy parameters of the target liquid level data are obtained; according to the temperature data and the liquid level data in the target window, straight line fitting is performed to obtain the local fitting straight line of the target liquid level data; according to the fitting error between the liquid level data in the target window and the local fitting straight line, combined with the accuracy parameters, the initial interference degree of the target liquid level data is obtained.
[0052] Since the intelligent liquid level sensor needs to work properly under appropriate temperature conditions, the accuracy of the collected liquid level data will be more easily affected when the target temperature data deviates from the appropriate working temperature. At the same time, the more drastic the temperature change in local time, the more likely it is to affect the working state of the liquid level sensor. Therefore, we first obtain the accuracy parameters of the target liquid level data based on the fluctuation characteristics of the temperature data in the target window and the distribution characteristics of the target temperature data, so as to provide a basis for the subsequent evaluation of the interference of the target liquid level data.
[0053] Preferably, in one embodiment of the present invention, considering that the target temperature data has multiple distribution possibilities relative to the normal temperature range, the accuracy weight is obtained according to the distribution position of the target temperature data compared with the preset normal temperature range; the larger the accuracy weight, the more normal the target temperature data is, the more normal the working environment conditions of the sensor are, and the more likely the collected data is accurate, and the accuracy weight is positively correlated with the accuracy parameter;
[0054] Considering that the greater the similarity between the target temperature data and each temperature data in the window, the more constant the temperature is and the greater the stability is, the temperature stability parameter is obtained according to the similarity between the target temperature data and each temperature data in the target window; the larger the temperature stability parameter is, the more stable the temperature environment of the sensor is and the more accurate the collected data is. The temperature stability parameter is positively correlated with the accuracy parameter;
[0055] The accuracy parameter of the target liquid level data is obtained according to the accuracy weight and the temperature stability parameter.
[0056] In one embodiment of the present invention, the calculation formula of the accuracy parameter includes:
[0057]
[0058] Where pw represents the accuracy parameter of the target liquid level data; ZQ represents the accuracy weight of the target liquid level data; n represents the preset neighborhood parameter; 2n+1 represents the number of monitoring data in the target window, which is also the number of temperature data; i represents the sequence number of the temperature data in the target window; T irepresents the data value of the i-th temperature data in the target window; T represents the data value of the target temperature data; c represents the zero division parameter, c>0, to prevent the denominator from being zero; Represents the temperature stability parameter.
[0059] It should be noted that, in one embodiment of the present invention, n=50, c=0.01, and in other embodiments of the present invention, implementers may adjust them on their own.
[0060] It should be noted that in other embodiments of the present invention, other basic mathematical operations or function mappings may also be used to implement relevant mappings, such as mapping with the help of exponential functions. It represents the temperature stability parameter; the temperature stability parameter can also be obtained according to the difference between adjacent temperature data in the time series, and other statistical characteristic values of the temperature data such as the variance and range can also be obtained to obtain the temperature stability parameter, wherein the smaller the temperature variance and the smaller the temperature range, the larger the temperature stability parameter, which are all technical means well known to those skilled in the art and will not be elaborated here.
[0061] Among them, a positive correlation means that the dependent variable will increase as the independent variable increases, and the dependent variable will decrease as the independent variable decreases. The specific relationship can be a multiplication relationship, an addition relationship, or the power of an exponential function, which is determined by actual application; a negative correlation means that the dependent variable will decrease as the independent variable increases, and the dependent variable will increase as the independent variable decreases. It can be a subtraction relationship, a division relationship, etc., which is determined by actual application.
[0062] Preferably, in one embodiment of the present invention, considering that the target temperature data has three conditions relative to the preset normal temperature range, namely, it belongs to the normal temperature range, it is higher than, and it is lower than. When the target temperature data is not within the preset normal temperature range, the greater the degree of deviation, the more abnormal the working environment condition of the intelligent liquid level sensor, the easier it is for the collected data to have errors, and the lower the accuracy weight;
[0063] Based on this, when the target temperature data belongs to the preset normal temperature range, the accuracy weight is set to 1;
[0064] When the target temperature data is higher than the preset normal temperature range, the high distribution parameter is obtained according to the difference characteristics between the target temperature data and the maximum value of the preset normal temperature range, and the high distribution parameter is negatively correlated and normalized to obtain the accuracy weight;
[0065] When the target temperature data is lower than the preset normal temperature range, the low distribution parameter is obtained according to the difference characteristics between the target temperature data and the minimum value of the preset normal temperature range, and the low distribution parameter is negatively correlated and normalized to obtain the accuracy weight.
[0066] In one embodiment of the present invention, the calculation formula of the accuracy weight includes:
[0067]
[0068] Wherein, ZQ represents the accuracy weight of the target liquid level data; exp() represents the exponential function with the natural constant e as the base; T represents the data value of the target temperature data; T ll Indicates the lowest value of the preset normal temperature range; T ul Indicates the highest value of the preset normal temperature range.
[0069] It should be noted that, in one embodiment of the present invention, the preset normal temperature range is [20, 60], in degrees Celsius. In other embodiments of the present invention, implementers can adjust it by themselves.
[0070] It should be noted that, since the final weighted smoothing filter needs to be normalized according to the filter weights of all data, the absolute size of the intermediate parameters has no effect on the analysis results in the previous analysis process.
[0071] The inaccurate liquid level data monitored by the differential pressure liquid level sensor is mainly due to the change in liquid density caused by temperature changes, which affects the pressure difference. Inaccurate pressure difference leads to inaccurate liquid level measurement. In the target window with a short duration, the liquid temperature has a limited range of change, which is not enough to make the temperature and liquid level show obvious nonlinear characteristics. The relationship between the liquid temperature and the liquid level can be regarded as linear, which is similar to the curvature of the surface of a sphere that can be regarded as zero over a short distance.
[0072] Therefore, when the linear relationship between the liquid level data and the temperature data is stronger, it means that the temperature has a greater impact on the liquid level sensor. Therefore, a linear fit is performed based on the temperature data and liquid level data in the target window to obtain a local fitting line of the target liquid level data, which is convenient for the subsequent analysis of the interference characteristics of the liquid level data from the perspective of the linear relationship between the liquid level data and the temperature data.
[0073] Preferably, in one embodiment of the present invention, the temperature data in the target window is used as the explanatory variable, and the liquid level data is used as the explained variable, and a least squares fitting based on a straight line is performed to obtain a local fitting straight line.
[0074] It should be noted that in other embodiments of the present invention, the implementer may also adopt other straight line fitting methods such as the Theil-Sen estimation method to obtain the local fitting straight line, which and the least squares fitting based on the straight line are technical means well known to those skilled in the art and will not be described in detail here.
[0075] After obtaining the local fitting straight line, the fitting error can be analyzed to analyze the linear characteristics between the liquid level data and the temperature data. At the same time, the accuracy parameter characterizes the credibility of the liquid level data, and correspondingly reflects the credibility of the fitting error. Therefore, according to the fitting error between the liquid level data in the target window and the local fitting straight line, combined with the accuracy parameter, the initial interference degree of the target liquid level data is obtained.
[0076] Preferably, in one embodiment of the present invention, considering that the smaller the fitting error of the target liquid level data is, the more obvious the linear characteristics between the target liquid level data and the temperature data are, and the greater the interference degree is, the first interference parameter of the target liquid level data is obtained after negative correlation mapping based on the fitting error of the target liquid level data and the corresponding fitting value on the local fitting straight line; the first interference parameter is positively correlated with the initial interference degree;
[0077] Considering that a stable fitting error means that the straight line model can effectively capture the main trend and structure of the data, the more stable the fitting error is, the smaller the difference between the fitting errors of different liquid level data and the fitting errors of the target liquid level data is, and the more obvious the similarity characteristics are; and the larger the accuracy parameter is, the greater the credibility of the liquid level data is, which reflects the greater credibility of the fitting error. Therefore, according to the similar characteristics of the fitting error of the target liquid level data and the fitting error of each liquid level data in the target window, combined with the corresponding accuracy parameter, the second disturbed parameter of the target liquid level data is obtained; the larger the second disturbed parameter is, the better the fitting effect of the straight line model is, which means that the liquid level data is more disturbed, and the second disturbed parameter is positively correlated with the initial disturbed degree;
[0078] An initial interference degree of the target liquid level data is acquired according to the first interference parameter and the second interference parameter of the target liquid level data.
[0079] In one embodiment of the present invention, the product of the first disturbed parameter and the second disturbed parameter of the target liquid level data is used as the initial disturbed degree of the target liquid level data; the calculation formula of the initial disturbed degree includes:
[0080]
[0081] Wherein, a represents the initial interference degree of the target liquid level data; H represents the data value of the target liquid level data; Indicates the fitting value on the fitting line corresponding to the target liquid level data; c indicates the zero division parameter, c>0, to prevent the denominator from being zero; Indicates the first disturbed parameter of the target liquid level data; D2 sgr Represents the second disturbed parameter of the target liquid level data.
[0082] It should be noted that in other embodiments of the present invention, the implementer may also use function mapping such as exponential function to perform negative correlation mapping to obtain the first interfered parameter, or may use other positively correlated basic mathematical operations such as addition to fuse the first interfered parameter and the second interfered parameter, or may use S-type function to normalize the first interfered parameter or the second interfered parameter, which are all technical means well known to those skilled in the art and will not be elaborated here.
[0083] Preferably, in one embodiment of the present invention, within the target window, since a larger accuracy parameter reflects a greater credibility of the fitting error, and the accuracy parameter is positively correlated with the second interfered parameter, the sum of the accuracy parameter of the target liquid level data and the accuracy parameter of each liquid level data is used as the second interference weight of each liquid level data; and since the smaller the absolute value of the difference between the fitting error of the target liquid level data and the fitting error of each liquid level data, the smaller the difference between the fitting errors and the more stable the fitting errors, the inverse of the absolute value of the difference between the fitting error of the target liquid level data and the fitting error of each liquid level data is used as the second interference sub-parameter of each liquid level data;
[0084] The average value of the product of the second interference weight of all liquid level data and the corresponding second interference sub-parameter is used as the second interfered parameter of the target liquid level data.
[0085] The calculation formula of the second disturbed parameter includes:
[0086]
[0087] Among them, D2 sgr represents the second disturbed parameter of the target liquid level data; n represents the preset neighborhood parameter; 2n+1 represents the number of monitoring data in the target window, which is also the number of liquid level data; i represents the sequence number of the liquid level data in the target window; H i Represents the data value of the i-th liquid level data in the target window; represents the i-th liquid level data in the target window, corresponding to the fitting value on the fitting line; H represents the data value of the target liquid level data; It indicates the fitting value on the fitting line corresponding to the target liquid level data; c indicates the zero division parameter, c>0, to prevent the denominator from being zero; pw indicates the accuracy parameter of the target liquid level data; pw i Represents the accuracy parameter of the i-th liquid level data in the target window.
[0088] In the calculation formula of the second disturbed parameter, represents the fitting error of the i-th liquid level data in the target window, represents the fitting error of the target liquid level data, Represents the difference characteristics of the fitting error between the target liquid level data and the i-th liquid level data in the target window, which is obtained after negative correlation mapping As the second interfering sub-parameter, the smaller the difference, The smaller, The larger it is, the more obvious the similarity is, and the larger the second disturbed parameter is; pw+pw i It is the sum of the accuracy parameters of the target liquid level data and the i-th liquid level data in the target window, that is, the second interference weight of the i-th liquid level data. The larger the accuracy parameter, the greater the credibility of the fitting error, the larger the second interference weight, and the larger the second interfered parameter.
[0089] It should be noted that in other embodiments of the present invention, other basic mathematical operations or function mappings may be used to achieve negative correlation mapping of fitting error differences, or the similarity of fitting errors may be directly analyzed. The discreteness of the data may be analyzed through other statistical characteristics such as the variance of the fitting error of the liquid level data in the target window and the mean absolute deviation (MAD), and the similarity characteristics of the fitting errors may be analyzed. These are all technical means well known to those skilled in the art and will not be elaborated here.
[0090] Step S3: Based on the preset neighborhood parameters, all data windows containing the target liquid level data and not centered on the target liquid level data are obtained as comparison windows; according to the similarity of the fluctuation characteristics of the initial interference degree corresponding to the target window and the liquid level data in each comparison window, combined with the initial interference degree of the target data, the corrected interference degree of the target data is obtained.
[0091] Considering that there may be bias if only the data window centered on the target data is analyzed, by constructing multiple comparison windows that are not centered on the target data but contain the target data, the impact of temperature on the liquid level data can be analyzed from different angles, providing more information, so as to more accurately evaluate and correct the interference degree of the target liquid level data. Therefore, it is necessary to obtain all data windows containing the target liquid level data for analysis. Therefore, based on the preset neighborhood parameters, all data windows containing the target liquid level data and not centered on the target liquid level data are obtained as comparison windows.
[0092] For example: when the preset neighborhood parameter n is 2, 2n+1=5. Assuming that the target liquid level data is the 15th data, the target window is [13, 17], and the comparison windows are [11, 15], [12, 16], [14, 18], and [15, 19]. There are 2n=4 comparison windows in total.
[0093] In an embodiment of the present invention, the fluctuation characteristics of the initial interference degree of the liquid level data in the data window are taken into account, which reflects the interference pattern of temperature on the liquid level data. Considering the specific heat capacity of the liquid itself, the temperature change of a certain volume of liquid should be relatively smooth, and the interference pattern should also be similar. By combining the similarity between multiple windows and the target window, the interference situation of the target data is further compared and verified, the deviation is reduced, and the comprehensiveness and reliability of the analysis are improved. Therefore, according to the similarity of the fluctuation characteristics of the initial interference degree corresponding to the liquid level data in the target window and each comparison window, combined with the initial interference degree of the target data, the corrected interference degree of the target data is obtained.
[0094] Preferably, in one embodiment of the present invention, the method for obtaining the corrected interference degree includes:
[0095] See also Figure 2 , which shows a flow chart of a method for obtaining a corrected interference degree provided by an embodiment of the present invention.
[0096] Considering that the greater the interference degree of the comparison window, the greater the temperature interference degree around the target liquid level data, the more inaccurate the liquid level data, and the lower the credibility of the interference feature analyzed by this method.
[0097] If the fluctuation characteristics of the interference degree are small and stable, it means that the interference impact is small during this period and the credibility of the data is high.
[0098] Step S101: obtaining the mean of the initial interference degree corresponding to the liquid level data in each comparison window as a comparison mean parameter, and obtaining the standard deviation as a comparison standard deviation parameter; obtaining the standard deviation of the initial interference degree corresponding to the liquid level data in the target window as a target standard deviation parameter.
[0099] Considering that the mean of the initial interference degree corresponding to the liquid level data in the data window reflects the interference degree of the entire window, and the standard deviation characterizes the discrete characteristics of the data and reflects the interference pattern of temperature on the liquid level data, the mean of the initial interference degree corresponding to the liquid level data in each comparison window is first obtained as the comparison mean parameter, and the standard deviation is obtained as the comparison standard deviation parameter; the standard deviation of the initial interference degree corresponding to the liquid level data in the target window is obtained as the target standard deviation parameter, in preparation for the subsequent analysis of the similarity between the target window and the comparison window, so as to finally obtain the corrected interference degree.
[0100] It should be noted that in other embodiments of the present invention, the implementer may also perform analysis with the help of maximum and minimum values, that is, by analyzing the differences between the maximum values and combining them with the differences between the minimum values, the similar characteristics of the central trend of the initial interference degree may be evaluated; other characteristic parameters such as the mean absolute deviation may also be used to characterize the discrete characteristics of the initial interference degree.
[0101] Step S102: taking the mean of the comparison standard deviation parameters of all comparison windows as the first correction sub-parameter; obtaining the second correction sub-parameter of each comparison window according to the difference characteristics between the target standard deviation parameter and each comparison standard deviation parameter and in combination with the corresponding comparison mean parameter.
[0102] Considering that the mean of the comparison standard deviation parameters of all comparison windows reflects the overall discrete characteristics of all comparison windows, and reflects the stable characteristics of the surrounding comparison windows of the target window affected by temperature, the mean of the comparison standard deviation parameters of all comparison windows is used as the first correction sub-parameter to provide a basis for the subsequent analysis of the credibility of the target window;
[0103] Taking into account the difference characteristics between the target standard deviation parameter and each comparison standard deviation parameter, it reflects the fluctuation similarity of the initial interference degree in the target window and the comparison window; and the comparison mean parameter represents the overall interference characteristics of the liquid level data in the comparison window, and also represents the credibility of the interference characteristics. Therefore, according to the difference characteristics between the target standard deviation parameter and each comparison standard deviation parameter, combined with the corresponding comparison mean parameter, the second correction sub-parameter of each comparison window is obtained, which provides more basis for the subsequent analysis of the credibility of the target window.
[0104] In one embodiment of the present invention, the product of the absolute value of the difference between each comparison standard deviation parameter and the target standard deviation parameter and the corresponding comparison mean parameter is used as the second correction sub-parameter of each comparison window. The calculation formula of the second correction sub-parameter includes:
[0105]
[0106] Wherein, j is the serial number of the comparison window of the target liquid level data; represents the second correction sub-parameter of the jth comparison window of the target liquid level data; E j (a) represents the comparison mean parameter of the jth comparison window of the target liquid level data; D(a) represents the target standard deviation parameter of the target liquid level data; D j (a) Represents the comparison standard deviation parameter of the jth comparison window of the target liquid level data.
[0107] In the calculation formula of the second correction sub-parameter, |D(a)-D j (a) The larger | is, the more obvious the difference between the target standard deviation parameter and the comparison standard deviation parameter is, indicating that the fluctuation similarity of the initial disturbance degree in the target window and the comparison window is lower, the credibility of the target window is lower, and the second correction sub-parameter is larger; E jThe larger (a) is, the more interference the liquid level data in the comparison window is subject to, the more inaccurate the liquid level data is, the lower the credibility of the interference feature analyzed by this method is, the lower the credibility of the comparison window is, and the larger the second correction sub-parameter is.
[0108] In other embodiments of the present invention, other basic mathematical operations or function mappings may be used to implement relevant mappings, which are technical means well known to those skilled in the art and will not be elaborated herein.
[0109] Step S103: obtaining a credibility parameter of the target window according to the first correction sub-parameter and the second correction sub-parameter of each comparison window; the first correction sub-parameter and the second correction sub-parameter of each comparison window are both negatively correlated with the credibility parameter.
[0110] Considering that the smaller the mean of the comparison standard deviation parameters of all comparison windows is, the more stable the fluctuation of the initial interference degree in the data window containing the target liquid level data is, and the higher the credibility of the comparison window is, the first correction sub-parameter is negatively correlated with the credibility parameter; the second correction sub-parameter obtained by step S102 can also reflect the credibility of the comparison window, and the second correction sub-parameter is negatively correlated with the credibility, so the credibility parameter of the target window is obtained according to the first correction sub-parameter and the second correction sub-parameter of each comparison window.
[0111] In one embodiment of the present invention, after negative correlation mapping is performed on the mean of the second correction sub-parameters of all comparison windows and the product of the first correction sub-parameters, the mapping result is used as the credibility parameter of the target window.
[0112] The calculation formula of the credibility parameter of the target window includes:
[0113]
[0114] Wherein, p represents the credibility parameter of the target window; n represents the preset neighborhood parameter; 2n represents the number of comparison windows; j is the sequence number of the comparison window of the target liquid level data; D1 represents the second correction sub-parameter of the jth comparison window of the target liquid level data; xzz Represents the first correction sub-parameter of the target window; c represents the zero division parameter, c>0, to prevent the denominator from being zero.
[0115] In the calculation formula of the credibility parameter of the target window, D1 xzz The smaller it is, the smaller the standard deviation of the initial interference degree of all comparison windows is as a whole, which means that the initial interference degree of all comparison windows is more concentrated, the temperature influence pattern is more stable, and the credibility of the target window is greater; The smaller it is, the smaller the initial interference degree of the liquid level data in the comparison window is, the higher the accuracy and reliability are. At the same time, the more similar the fluctuations of the initial interference degree in the target window and the comparison window are, the higher the credibility of the affected features of the target window is, and the larger the credibility parameter is.
[0116] It should be noted that in other embodiments of the present invention, other basic mathematical operations or function mappings may also be used to implement relevant mappings, which are technical means well known to those skilled in the art and will not be elaborated herein.
[0117] Step S104: obtaining the credibility parameters of each comparison window; the credibility parameters of the comparison window are obtained in the same manner as the credibility parameters of the target window.
[0118] The target liquid level data exists in multiple data windows, so it is also necessary to calculate the credibility parameters of the comparison yellow mouth, so as to correct the initial interference degree according to the credibility of all data windows containing the target liquid level data.
[0119] By taking the comparison window as a new target window and repeating the process of steps S101 to S103 , the credibility parameters of all comparison windows can be obtained.
[0120] Step S105: Obtain the correction weight of the target liquid level data according to the credibility parameters of all data windows containing the target liquid level data; obtain the corrected interference degree of the target liquid level data according to the correction weight and the initial interference degree of the target liquid level data; the credibility parameter is positively correlated with the correction weight; the correction weight is positively correlated with the corrected interference degree.
[0121] After obtaining the credibility parameters of all data windows containing target liquid level data, the overall credibility of all data windows can be analyzed to obtain correction weights and correct the initial interference degree.
[0122] Considering that the larger the credibility parameters of all data windows are, the higher the credibility of the initial interference degree of the target liquid level data is, in one embodiment of the present invention, the product of the mean of the credibility parameters of all data windows containing the target liquid level data and the initial interference degree is used as the corrected interference degree.
[0123] It should be noted that all data windows containing target liquid level data include target windows and comparison windows of target liquid level data. In other embodiments of the present invention, other basic mathematical operations or function mappings may also be used to implement relevant mappings. These are technical means well known to those skilled in the art and will not be elaborated herein.
[0124] Step S4: According to a preset weighted smoothing filter algorithm, combined with the corrected interference degree of each liquid level data, denoised liquid level data is obtained.
[0125] After analyzing the interference of each liquid level data in step S3, the filtering process of the weighted smoothing filtering algorithm can be adjusted using the corrected interference degree of each liquid level data to obtain denoised liquid level data with higher accuracy.
[0126] Preferably, in one embodiment of the present invention, considering that the weighted moving average (WMA) algorithm is a commonly used time series smoothing algorithm, which can smooth the data series and reduce the impact of noise by assigning larger weights to newer data points and more sensitively reflecting the latest data changes, the WMA algorithm is used for denoising.
[0127] Based on the WMA algorithm, the initial filter weight of the liquid level data is obtained; according to the corrected interference degree and the initial filter weight, the corrected filter weight of the liquid level data is obtained; the corrected interference degree is negatively correlated with the corrected filter weight; the initial filter weight is positively correlated with the corrected filter weight; the corrected filter weight is normalized, and the sum of the normalized results of all liquid level data is 1;
[0128] WMA filtering is performed according to the modified filter weights of all monitoring data to obtain denoised liquid level data.
[0129] The calculation formula for the modified filter weight includes:
[0130]
[0131] Where x represents the serial number of the liquid level data; w x represents the initial filter weight of the x-th liquid level data; W x A represents the modified filter weight of the x-th liquid level data; x Indicates the degree of interference in the correction of the x-th liquid level data; X represents the number of liquid level data.
[0132] It should be noted that the initial filtering weights are directly obtained by the WMA algorithm. The WMA algorithm is a technical means well known to those skilled in the art and will not be described in detail here. In other embodiments of the present invention, the implementer may also adopt other weighted smoothing filtering algorithms such as exponential weighted average filtering.
[0133] One embodiment of the present invention also provides a liquid level measurement system based on an intelligent liquid level sensor, see Figure 3 The system includes a memory 301, a processor 302 and a computer program 303, wherein the memory 301 is used to store the corresponding computer program 303, and the processor 302 is used to run the corresponding computer program 303. When the computer program 303 runs in the processor 302, it can implement a liquid level measurement method based on an intelligent liquid level sensor described in steps S1-S4.
[0134] In summary, the present invention aims at the technical problem that the traditional weighted smoothing filter algorithm sets the filter weight of the liquid level monitoring data unreasonably, resulting in inaccurate liquid level data, and provides a liquid level measurement method and system based on an intelligent liquid level sensor. The present invention first obtains the monitoring data of the intelligent liquid level sensor; selects any monitoring data as the target data and constructs a target window; further obtains the accuracy parameter of the target liquid level data; further obtains the local fitting straight line of the target liquid level data; further obtains the initial interference degree of the target liquid level data according to the fitting error and the accuracy parameter; further obtains the comparison window; further obtains the correction interference degree of the target data according to the similarity of the fluctuation characteristics of the initial interference degree corresponding to the liquid level data in the target window and each comparison window, combined with the initial interference degree of the target data; finally, according to the preset weighted smoothing filter algorithm, combined with the correction interference degree of each liquid level data, the denoised liquid level data is obtained. The present invention analyzes the fluctuation characteristics of the local temperature, combines the change relationship between the temperature and the liquid level to determine the interference of the liquid level data by the temperature, and then uses the comparison window to correct it, and finally adjusts the weighted smoothing filter algorithm based on the corrected interference degree to improve the accuracy of the denoised liquid level data after filtering.
[0135] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0136] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
Claims
1. A liquid level measurement method based on an intelligent liquid level sensor, characterized in that: The method comprises: Acquire monitoring data of the intelligent liquid level sensor; the monitoring data at least includes temperature data and liquid level data; select any of the monitoring data as target data, correspondingly including target temperature data and target liquid level data; take the target data as the center and construct a target window with preset neighborhood parameters; According to the fluctuation characteristics of the temperature data in the target window, combined with the distribution characteristics of the target temperature data, the accuracy parameter of the target liquid level data is obtained; according to the temperature data and the liquid level data in the target window, a straight line fitting is performed to obtain a local fitting straight line of the target liquid level data; according to the fitting error between the liquid level data in the target window and the local fitting straight line, combined with the accuracy parameter, the initial interference degree of the target liquid level data is obtained; Based on the preset neighborhood parameters, all data windows containing the target liquid level data and not centered on the target liquid level data are obtained as comparison windows; based on the similarity of the fluctuation characteristics of the initial interference degree corresponding to the liquid level data in the target window and each comparison window, combined with the initial interference degree of the target data, the corrected interference degree of the target data is obtained; According to a preset weighted smoothing filter algorithm, combined with the corrected interference degree of each liquid level data, denoised liquid level data is obtained; The method for obtaining the accuracy parameter includes: Obtaining an accuracy weight according to a distribution position of the target temperature data compared to a preset normal temperature range; Acquire a temperature stabilization parameter according to similar features between the target temperature data and each temperature data in the target window; Acquire the accuracy parameter of the target liquid level data according to the accuracy weight and the temperature stability parameter; the accuracy weight and the temperature stability parameter are both positively correlated with the accuracy parameter; The method for obtaining the accuracy weight includes: When the target temperature data belongs to the preset normal temperature range, the accuracy weight is set to 1; When the target temperature data is higher than the preset normal temperature range, a distribution high parameter is obtained according to the difference characteristics between the target temperature data and the maximum value of the preset normal temperature range, and the distribution high parameter is negatively correlated and normalized to obtain an accuracy weight; When the target temperature data is lower than the preset normal temperature range, a low distribution parameter is obtained according to the difference characteristics between the target temperature data and the minimum value of the preset normal temperature range, and the low distribution parameter is negatively correlated and normalized to obtain an accuracy weight; The method for obtaining the initial interference degree includes: According to the fitting error between the target liquid level data and the corresponding fitting value on the local fitting straight line, a first disturbed parameter of the target liquid level data is obtained after negative correlation mapping; According to the similarity characteristics of the fitting error of the target liquid level data and the fitting error of each liquid level data in the target window, in combination with the corresponding accuracy parameter, a second disturbed parameter of the target liquid level data is obtained; According to the first disturbed parameter and the second disturbed parameter of the target liquid level data, the initial disturbed degree of the target liquid level data is acquired; the first disturbed parameter and the second disturbed parameter are both positively correlated with the initial disturbed degree; The method for obtaining the corrected interference degree includes: Obtaining the mean of the initial interference degree corresponding to the liquid level data in each comparison window as a comparison mean parameter, and obtaining the standard deviation as a comparison standard deviation parameter; obtaining the standard deviation of the initial interference degree corresponding to the liquid level data in the target window as a target standard deviation parameter; The mean of the comparison standard deviation parameters of all the comparison windows is used as the first correction sub-parameter; according to the difference characteristics between the target standard deviation parameter and each of the comparison standard deviation parameters, combined with the corresponding comparison mean parameter, the second correction sub-parameter of each comparison window is obtained; Acquire a credibility parameter of the target window according to the first correction sub-parameter and the second correction sub-parameter of each comparison window; the first correction sub-parameter and the second correction sub-parameter of each comparison window are both negatively correlated with the credibility parameter; Acquire the credibility parameter of each comparison window; the credibility parameter of the comparison window is acquired in the same manner as the credibility parameter of the target window; According to the credibility parameters of all data windows containing the target liquid level data, a correction weight of the target liquid level data is obtained; according to the correction weight of the target liquid level data and the initial interference degree, a correction interference degree of the target liquid level data is obtained; the credibility parameter is positively correlated with the correction weight; the correction weight is positively correlated with the correction interference degree; The method for obtaining denoised liquid level data comprises: Based on the WMA algorithm, the initial filtering weight of the liquid level data is obtained; according to the corrected interference degree and the initial filtering weight, the corrected filtering weight of the liquid level data is obtained; the corrected interference degree is negatively correlated with the corrected filtering weight; the initial filtering weight is positively correlated with the corrected filtering weight; the corrected filtering weight is normalized, and the sum of the normalized results of all liquid level data is 1; WMA filtering is performed according to the modified filtering weights of all monitoring data to obtain denoised liquid level data.
2. The liquid level measurement method based on the intelligent liquid level sensor according to claim 1 is characterized in that: The method for obtaining the second interference parameter includes: In the target window, the sum of the accuracy parameter of the target liquid level data and the accuracy parameter of each liquid level data is used as the second interference weight of each liquid level data; the inverse of the absolute value of the difference between the fitting error of the target liquid level data and the fitting error of each liquid level data is used as the second interference sub-parameter of each liquid level data; the average of the products of the second interference weights of all liquid level data and the corresponding second interference sub-parameter is used as the second interfered parameter of the target liquid level data.
3. The liquid level measurement method based on the intelligent liquid level sensor according to claim 1 is characterized in that: The calculation method of the credibility parameter includes: After negative correlation mapping is performed on the mean of the second correction sub-parameter of all the comparison windows and the product of the first correction sub-parameter, the mapping result is used as the credibility parameter of the target window.
4. The liquid level measurement method based on the intelligent liquid level sensor according to claim 1 is characterized in that: The method for obtaining the local fitting straight line includes: The temperature data in the target window is used as the explanatory variable and the liquid level data is used as the explained variable, and a least squares fitting based on a straight line is performed to obtain a local fitting straight line.
5. A liquid level measurement system based on an intelligent liquid level sensor, the system comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the liquid level measurement method based on the intelligent liquid level sensor as claimed in any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
On-line intelligent detection method and system for road water accumulation
CN109990867A
Liquid level detection method and device, storage medium and electronic equipment
CN113947611A
