Disclosure of Invention
Aiming at the defects of the technical background, the invention aims to provide a rapid self-calibration method for on-site maintenance of a water quality sensor.
The aim of the invention can be achieved by the following technical scheme:
A water quality sensor field maintenance rapid self-calibration method comprises the following steps:
The method comprises the steps of S1, starting a water quality sensor, namely starting the water quality sensor and preheating the water quality sensor to check whether the water quality sensor is in a normal working state or not, wherein the water quality sensor is arranged on a buoy arranged in a measured water body, the buoy is connected with a shore treatment station through a water pipe to convey a water sample to the shore treatment station for water quality detection, the water quality sensor is electrically connected with a control component arranged in the shore treatment station to transmit water quality parameter data, and the control component calibrates the water quality sensor through a self-calibration device;
S2, recording initial data, namely stably placing the water quality sensor in a water body to be measured for waiting time t 1 so that the water quality sensor is suitable for the water body environment and achieves stable reading, and recording current displayed water quality parameter data and field environment data of the water quality sensor, wherein the field environment data comprise the water temperature and the flow rate of the water body to be measured as reference basis in the calibration process;
S3, acquiring actual measurement data, namely starting a data acquisition function of the water quality sensor, acquiring water quality parameter data at a specified time interval t 2, transmitting the water quality parameter data to the control assembly, continuously acquiring time t 3, and recording the data as an actual measurement data sequence x (N), wherein n=1, 2,3.
S4, calculating an autocorrelation function: the control component calculates its autocorrelation function Rxx (M) for the acquired measured data sequence x (N), where m=1, 2, 3..n-1, the control component analyzes its actual peak characteristics M from the autocorrelation function Rxx (M), the data value M 0 corresponding to the measured peak value represents the point where the repeatability of the measured data signal is strongest, and the autocorrelation function Rxx (M) satisfies the following relation:
wherein x (n+m) is a data sequence obtained by shifting the measured data sequence x (n) by m units in time;
S5, calibrating and adjusting, namely comparing the standard peak value characteristic K of the water quality sensor in a normal working state with the actually measured peak value M, and dynamically adjusting the calibrating parameters of the water quality sensor according to the deviation by the self-calibrating device when the deviation exceeds a threshold value, wherein the detecting precision of the water quality sensor is insufficient;
S6, verifying a calibration result, namely placing the water quality sensor in the measured water body again after completing adjustment of the calibration parameters, collecting the measured data again, calculating an autocorrelation function, and repeating the steps from S2 to S5 until the measured data of the water quality sensor meet the requirements;
s7, recording and reporting, namely recording a self-calibration process, wherein the self-calibration process comprises initial data, measured data, calibration parameters before and after adjustment and an autocorrelation analysis result, and generating a maintenance report according to the record for subsequent reference and audit.
As a preferable embodiment of the present invention, the measured peak characteristic includes a peak number and a peak size.
Further, the peak dimension includes a peak width and a peak relative height.
In step S5, based on the influence of the field environment data on the standard peak characteristic K, an adjustment factor a is introduced to dynamically adjust the standard peak characteristic K according to the field environment data, the adjusted standard peak characteristic is set to be K', and a relationship model is established between the adjustment factor a and the field environment data through multiple linear regression, so as to satisfy the following relationship expression:
Wherein T 'and V' are the water temperature and the flow rate corresponding to the standard peak characteristic K, T, V is the water temperature and the flow rate of the water body to be measured, and a 0、a1、a2 is the adjustment coefficient;
The self-calibration device dynamically adjusts the calibration parameters of the water quality sensor according to the deviation between the adjusted standard peak characteristic K' and the actually measured peak M.
As a preferable technical scheme of the invention, the control component constructs a fault pre-judging model based on machine learning, inputs the actually measured data sequence x (n) into the fault pre-judging model before each calibration adjustment, predicts whether the water quality sensor has potential fault risks, and if the risk exists, pertinently adjusts the calibration strategy in the calibration adjustment process, including increasing the calibration times and adjusting the adjustment amplitude of the calibration parameters.
As a preferable technical scheme of the invention, the control component adaptively adjusts the acquisition time interval t 2 and the acquisition time t 3 of the measured data according to a calibration adjustment strategy.
As a preferred technical solution of the present invention, the control component is specifically adapted to:
When the water quality sensor in a certain area is monitored to have the same kind of actual measurement peak characteristic deviation, the control component adaptively shortens the acquisition time interval t 2 of the actual measurement data to 0.5 times of the original acquisition time interval t 3 to 2 times of the original acquisition time interval t 2;
When the measured peak characteristic of the water quality sensor is monitored to be continuously stable, the control component adaptively increases the acquisition time interval t 2 of the measured data to 1.3 times of the original acquisition time interval t 3 to 0.8 times of the original acquisition time interval t 2.
As a preferable technical scheme of the invention, the control assembly self-calibration device is arranged in the water quality sensor or the shore treatment station.
In summary, the beneficial effects of the invention are as follows:
According to the invention, the deviation and drift of the water quality sensor are rapidly identified by analyzing the measured data through the autocorrelation function, and the calibration parameters are dynamically adjusted by combining with the on-site environment data, so that the invention can adapt to different water quality and environment conditions, and the machine learning is utilized to conduct fault pre-judgment, so that maintenance personnel can take measures in advance, the probability of fault occurrence is reduced, and the stability and reliability of the system are improved. The method realizes the rapid self-calibration without standard solution, has the advantages of simple operation, no standard solution, adaptation to field environment, real-time monitoring performance and self-adaptability, solves the problems of high cost and poor stability of the standard solution in the traditional water quality sensor calibration method, reduces complexity and uncertainty in the calibration process, and improves the calibration efficiency and accuracy.
Detailed Description
Specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be understood that the particular embodiments presented herein are illustrative and explanatory only and are not restrictive of the invention.
It should be noted that in the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention, but that other embodiments of the invention and variations thereof are possible, and therefore the scope of the invention is not limited by the specific examples disclosed below.
As shown in fig. 1 to 2, a method for rapidly self-calibrating on-site maintenance of a water quality sensor 1 comprises the following steps:
The method comprises the steps of S1, starting a water quality sensor 1, preheating the water quality sensor 1, checking whether the water quality sensor 1 is in a normal working state, wherein the water quality sensor 1 is arranged on a buoy 2 arranged in a tested water body, the buoy 2 is connected with a shore treatment station 4 through a water pipe 3 so as to convey a water sample to the shore treatment station 4 for water quality detection, the water quality sensor 1 is electrically connected with a control component arranged in the shore treatment station 4 so as to transmit water quality parameter data, and the control component calibrates the water quality sensor 1 through a self-calibration device;
S2, recording initial data, namely stably placing the water quality sensor 1 in a water body to be measured for waiting time t 1 so that the water quality sensor 1 is adapted to the water body environment and reaches stable reading, and recording current displayed water quality parameter data and field environment data of the water quality sensor 1, wherein the field environment data comprise the water temperature and the flow velocity of the water body to be measured as reference bases in a calibration process;
S3, acquiring actual measurement data, namely starting a data acquisition function of the water quality sensor 1, acquiring water quality parameter data at a specified time interval t 2, transmitting the water quality parameter data to the control assembly, continuously acquiring time t 3, and recording the data as an actual measurement data sequence x (N), wherein n=1, 2,3.
S4, calculating an autocorrelation function: the control component calculates its autocorrelation function Rxx (M) for the acquired measured data sequence x (N), where m=1, 2,3. The control component analyzes actual peak characteristics M according to the autocorrelation function Rxx (M), wherein the actual peak characteristics comprise the number of peaks and the size of the peaks, and the size of the peaks comprises the width of the peaks and the relative height of the peaks; the data value M 0 corresponding to the measured peak value represents the point where the repeatability of the measured data signal is strongest, and the autocorrelation function Rxx (M) satisfies the following relation:
wherein x (n+m) is a data sequence obtained by shifting the measured data sequence x (n) by m units in time;
The introduction of the actual measurement peak value features is to more accurately reflect the working state of the water quality sensor 1 in the actual environment, and the actual measurement peak value features comprise the number of wave peaks, the width of the wave peaks and the relative height of the wave peaks, so that the response characteristics of the water quality sensor 1 under different water quality conditions can be comprehensively reflected. Specifically, the number of peaks reflects the frequency of the water quality parameter change, the width of the peaks reflects the amplitude and the duration of the water quality parameter change, the relative heights of the peaks are used for comparing the relative change conditions among different peaks, and the comprehensive analysis of the characteristics is helpful for more accurately evaluating the working state of the water quality sensor 1, so that a more accurate adjustment basis is provided in the calibration process.
S5, calibrating and adjusting, namely comparing the standard peak characteristic K of the water quality sensor 1 in a normal working state with the actually measured peak M, and dynamically adjusting the calibrating parameters of the water quality sensor 1 according to the deviation by the self-calibrating device when the deviation exceeds a threshold value, wherein the detecting precision of the water quality sensor 1 is insufficient;
S6, verifying a calibration result, namely placing the water quality sensor 1 in the measured water body again after completing adjustment of the calibration parameters, collecting measured data again, calculating an autocorrelation function, and repeating the steps from S2 to S5 until the measured data of the water quality sensor 1 meet the requirements;
s7, recording and reporting, namely recording a self-calibration process, wherein the self-calibration process comprises initial data, measured data, calibration parameters before and after adjustment and an autocorrelation analysis result, and generating a maintenance report according to the record for subsequent reference and audit.
Further, in step S5, based on the influence of the field environment data on the standard peak feature K, an adjustment factor a is introduced to dynamically adjust the standard peak feature K according to the field environment data, the adjusted standard peak feature is set to K', and the adjustment factor a and the field environment data establish a relationship model through multiple linear regression, so as to satisfy the following relationship:
Wherein T 'and V' are the water temperature and the flow rate corresponding to the standard peak characteristic K, T, V is the water temperature and the flow rate of the water body to be measured, and a 0、a1、a2 is the adjustment coefficient;
The self-calibration device dynamically adjusts the calibration parameters of the water quality sensor 1 according to the deviation between the adjusted standard peak characteristic K' and the actually measured peak M.
In practice, the readings of the water quality sensor 1 are affected by on-site environmental data such as water temperature and flow rate. In order to improve the accuracy of calibration, the application introduces an adjustment factor A and dynamically adjusts the standard peak value characteristic K according to the field environment data. The adjustment factor A establishes a relation with on-site environment data through a multiple linear regression model, so that the adjusted standard peak characteristic K' is more in line with actual environment conditions, the problem of influence of environment conditions on the calibration accuracy in the calibration process of the water quality sensor 1 is solved, different environment conditions can be self-adapted in the calibration process, and the detection accuracy and reliability of the water quality sensor 1 are further improved. The water temperature change affects the reaction speed and sensitivity of the water quality sensor 1, the water temperature increase causes the sensitivity of the water quality sensor 1 to chemical reaction or biological reaction to increase, and the reading is larger, so the adjustment coefficient a 1 is a negative number, the flow rate change affects the sampling frequency and measurement accuracy of the water quality sensor 1, and the high flow rate causes the reading of the water quality sensor 1 to be smaller, so the adjustment coefficient a 2 is a positive number.
In this embodiment, the standard peak characteristic K of the water quality sensor 1 is measured when the water temperature T 'of the measured water body is 20 ℃ and the flow velocity V' is 1 m/s, the adjustment factor a is 1.0, and the field environment data is that the water temperature T of the measured water body is 25 ℃ and the flow velocity V is 1.5 m/s, and the adjustment coefficients a 0、a1、a2 are respectively 1, -0.04 and 0.2 through multiple linear regression, so that the adjustment factor a and the field environment data satisfy the following relation:
based on the on-site environment data, the water temperature T of the water body to be measured is 25 ℃ and the flow velocity V is 1.5 m/s, the adjustment factor A can be obtained to be 0.9, namely the following formula is adopted:
i.e. the standard peak feature K should be scaled down based on the field environment of the present embodiment.
As a preferred embodiment of the present invention, the control component constructs a failure prediction model based on machine learning, inputs the actually measured data sequence x (n) into the failure prediction model before each calibration adjustment, predicts whether the water quality sensor 1 has potential failure risk, and if so, pertinently adjusts the calibration strategy in the calibration adjustment process, including increasing the number of calibration times and adjusting the adjustment amplitude of the calibration parameters.
The fault pre-judging model based on machine learning can predict the fault risk of the water quality sensor 1 by analyzing the actually measured data sequence x (n), training is performed by utilizing historical data, the relation between actually measured data and the fault risk is established, the current actually measured data sequence is input into the fault pre-judging model before each calibration and adjustment, and the model can output the prediction result of the fault risk. If the prediction result shows that the fault risk exists, the control component dynamically adjusts the calibration strategy according to the size and type of the risk, including increasing the number of calibration times and adjusting the adjustment amplitude of the calibration parameters so as to ensure the effectiveness of the calibration.
The construction of the fault pre-judging model comprises the following steps:
1) Collecting a plurality of groups of field environment data, initial water quality actual measurement data and water quality sensor 1 fault data, integrating the field environment data, the initial water quality actual measurement data and the water quality sensor 1 fault data into a data set, performing noise and abnormal value removal processing on the data set, including deleting data points with obvious errors and data points with overlong communication link interruption time, and performing normalization processing on data with different magnitudes;
2) Model training, namely dividing the preprocessed data set into a training set and a verification set, wherein the training set is used for learning the parameters of the fault pre-judging model, and the verification set is used for evaluating the performance of the fault pre-judging model and optimizing the parameters of the model through a gradient descent method;
3) And (3) model evaluation and optimization, namely, evaluating the proportion of the fault predicted by the fault pre-judging model correctly by adopting an accuracy rate alpha, and evaluating the proportion of the fault predicted by the fault pre-judging model to the actual fault by adopting a recall rate beta, wherein the harmonic mean value of the accuracy rate and the recall rate is an F1 value, which is used for reflecting the comprehensive performance of the fault pre-judging model, and optimizing the fault pre-judging model according to the expected requirement and the evaluation result.
As a preferred embodiment of the present invention, the control component adaptively adjusts the acquisition time interval t 2 and the acquisition time t 3 of the measured data according to a calibration adjustment strategy.
During the calibration process, if the fluctuation of the measured data is found to be larger, the control component can shorten the acquisition time interval t 2 so as to increase the data sampling frequency, thereby capturing the change condition of the water quality parameter more finely. Meanwhile, the control component can also prolong the acquisition time t 3, through the self-adaptive adjustment mechanism, the control component can flexibly cope with different calibration requirements, the calibration efficiency and the accuracy of the water quality sensor 1 are improved, the trouble of manual intervention and reliance on standard solutions is reduced to acquire measured data in a longer time period, the accuracy and the reliability of a calibration result are ensured, and the acquired data can be ensured to reflect the real condition of the water quality more accurately under different environmental conditions and sensor states.
Further, the control component is specifically adapted to:
When the water quality sensor 1 in a certain area is monitored to have the same kind of actual measurement peak characteristic deviation, the control component adaptively shortens the acquisition time interval t 2 of the actual measurement data to 0.5 times of the original acquisition time interval t 3 to 2 times of the original acquisition time interval t 2;
When the measured peak characteristic of the water quality sensor 1 is monitored to be stable continuously, the control component adaptively increases the acquisition time interval t 2 of the measured data to 1.3 times of the original acquisition time interval t 3 to 0.8 times of the original acquisition time interval t 2.
If it is found that a certain peak characteristic deviation exists in the water quality sensor 1 in a certain area, the control component sends an instruction to adjust the collection time interval t 2 and the collection time t 3 of the water quality sensor 1 in the whole area, so that the peak characteristic of the water quality sensor 1 is captured more accurately, the calibration efficiency and accuracy are improved, if the collection frequency is increased in the time period when the peak appears, the peak data can be acquired more accurately, the calibration accuracy is further improved, the collection time interval is prolonged appropriately in the time period when the peak characteristic is stable, the unnecessary data collection frequency and the burden of a system can be reduced, and the workload and the data transmission quantity of the sensor are reduced.
As a preferred embodiment of the invention, the control assembly self-calibration means are installed in the water quality sensor 1 or in the shore treatment station 4.
The self-calibration device comprises a data acquisition module, a calculation module and an adjustment module, wherein the data acquisition module is used for acquiring actual measurement data of the water quality sensor 1 in real time and transmitting the data to the calculation module, the calculation module calculates an autocorrelation function according to the actual measurement data and analyzes actual measurement peak characteristics, and the adjustment module dynamically adjusts calibration parameters of the water quality sensor 1 according to a calculation result. When the water quality sensor 1 is installed on the buoy 2, the self-calibration device can be installed in the buoy 2 and integrated with the water quality sensor 1, so that real-time calibration of the water quality sensor 1 can be realized, delay of data transmission is reduced, and calibration accuracy is improved, the self-calibration device can be installed in the shore processing station 4 and connected with the water quality sensor 1 on the buoy 2 through the water pipe 3, data of the water quality sensor 1 are collected in real time, calibration adjustment is performed, and calculation resources of the shore processing station 4 can be utilized, so that calibration efficiency and calibration accuracy are improved.
It should be understood that the foregoing embodiments are merely illustrative of one or more embodiments of the present invention, and that many other embodiments and variations thereof may be made by those skilled in the art without departing from the scope of the invention.