Water quality detection instrument drift compensation method and system
By constructing behavioral energy values and drift coefficients based on the sensor response curve and combining them with a rule tree network, flexible compensation for sensor drift in water quality testing instruments is achieved, solving the measurement inaccuracy problem caused by sensor drift and improving the intelligent diagnosis and operation accuracy of the instrument.
Patent Information
- Application Number
- CN202511119731.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-11
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2045-08-11
AI Technical Summary
Existing water quality testing instruments suffer from reduced measurement accuracy and data reliability due to sensor drift during long-term operation. Existing drift compensation methods rely on obtaining external true values, have poor real-time performance, and are difficult to perform continuous online corrections.
The behavioral energy value is constructed based on the sensor response curve sequence. The drift degree coefficient and the function selection strategy network constructed by the rule tree are introduced to achieve flexible adaptive compensation for sensor drift. The compensation function selection is driven by the real-time response status.
It significantly improves the intelligent diagnostic capabilities and long-term operating accuracy of water quality testing instruments, enhances the sensitivity and recognition ability of sensor drift, and adapts to stable output under non-ideal operating conditions.
Smart Images

Figure CN120632491A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of instrument drift, and in particular to a method and system for compensating a water quality detection instrument drift. Background Art
[0002] Water quality testing instruments are widely used in various scenarios, including municipal water supply, sewage treatment, and environmental monitoring. They typically rely on electrochemical sensors (such as pH, conductivity, dissolved oxygen, ammonia nitrogen, and residual chlorine) to monitor key water indicators in real time. However, over the long term, these sensors are susceptible to factors such as electrode aging, membrane fouling, and temperature and humidity fluctuations, causing drift in the detection output, thereby affecting measurement accuracy and data reliability.
[0003] Common drift compensation methods in existing technologies often calculate the error between the measured value and the true value, deriving the compensation amount based on this error. These methods rely on periodic acquisition of external true values, such as through manual sampling and testing, standard solution backtesting, and other methods, to infer instrument errors and apply corrections. However, these methods have limitations: true values are typically not continuously available during daily online monitoring, resulting in high dependency and poor real-time performance. Summary of the Invention
[0004] Based on the sensor response curve sequence collected by the water quality detection instrument during actual operation, the present invention constructs a behavioral energy value for characterizing the dynamic behavioral characteristics of the sensor, and introduces the drift degree coefficient as a normalized quantitative indicator of the response capability degradation, so that the speed, strength and stability characteristics of the sensor in the response process are uniformly encoded and can be compared across cycles, thereby significantly enhancing the system's sensitivity and recognition ability to different types of sensor response drift (including point drift, gain drift and hysteresis response); at the same time, a function selection strategy network constructed based on a rule tree is introduced into the compensation path, so that the drift degree coefficient and the sensor type label jointly drive the selection process of the optimal compensation function, thereby making the drift compensation no longer rely on fixed rules or training models, but flexibly adapting according to the real-time response status, realizing the stable output correction of multiple electrochemical water quality parameters under non-ideal operating conditions, thereby significantly improving the intelligent diagnostic capability, long-term operation accuracy and field adaptability of the water quality detection instrument.
[0005] The present invention provides a method for compensating drift of a water quality detection instrument, comprising: Real-time acquisition of the detection response curve sequence of the corresponding sensor. The detection response curve sequence refers to the set of all sampling points in the process from the initial output to the stable output of the water quality index value output by the corresponding sensor after the water quality detection instrument contacts the water body to be tested. The sampling point format is (t, y), where t is the timestamp corresponding to the sampling point, and y is the water quality index value corresponding to the sampling point; determining a response T value based on a detection response curve sequence of the corresponding sensor, dividing the detection response curve sequence based on the response T value to obtain a front section of the detection response curve sequence, and calculating a behavioral energy value of the corresponding sensor based on the front section of the detection response curve sequence; The ratio of the behavior energy value of the corresponding sensor to the reference behavior energy value of the corresponding sensor is recorded as the drift degree coefficient; Then, the drift degree coefficient of the corresponding sensor and the sensor type label of the corresponding sensor are sent to the trained compensation function selection strategy network for processing, and the corresponding compensation function number is output. Then, the corresponding compensation function is selected based on the compensation function number, and the drift degree coefficient is sent to the corresponding compensation function for calculation to obtain the compensation amount. Finally, the water quality index value of the last sampling point in the detection response curve sequence of the corresponding sensor is corrected by the compensation amount to complete the drift compensation operation.
[0006] As a preferred aspect, the response T value is determined based on the detection response curve sequence of the corresponding sensor, and the detection response curve sequence is divided based on the response T value to obtain the front section of the detection response curve sequence, which specifically includes the following contents: The water quality index value corresponding to the first sampling point in the detection response curve sequence is used as the initial response value, and the response stable value is determined based on the end of the response curve sequence; Multiply the difference between the response stable value and the initial response value by the variation coefficient to obtain the variation amplitude, and then add the response stable value and the variation amplitude to obtain the response T value; Starting from the first sampling point in the detection response curve sequence, traverse the sampling points in the detection response curve sequence, find the first sampling point whose water quality index value is greater than the response T value, and record it as the division point. All sampling points from the first sampling point to the division point in the detection response curve sequence constitute the front section of the detection response curve sequence.
[0007] As a preferred aspect, the calculation of the behavioral energy value of the corresponding sensor and the reference behavioral energy value based on the first segment of the detection response curve sequence specifically includes the following steps: Map the time axis corresponding to all sampling points in the front section of the detection response curve sequence to [0, 1], update the timestamps corresponding to all sampling points to obtain the response sequence; traverse the response sequence, calculate the slope between any two adjacent sampling points, record it as the response change rate, then assign weights to all change time periods using a window function, and regard the time period between the timestamps corresponding to two adjacent sampling points as one time period. Finally, perform a weighted sum operation on all response change rates and the weight assigned by the window function to obtain the behavioral energy value of the corresponding sensor; The calculation method of the reference behavioral energy value is consistent with the calculation method of the behavioral energy value of the corresponding sensor. The difference is that the front part of the detection response curve sequence when calculating the reference behavioral energy value is obtained based on the corresponding sensor being immersed in a standard water sample with known parameter values.
[0008] As a preferred aspect, the compensation function is constructed as follows: Acquire several drift training samples, each of which includes a drift feature vector. The drift feature vector includes a drift degree coefficient of the corresponding sensor and a sensor type label of the corresponding sensor. Perform a cluster analysis on all drift feature vectors, and record each obtained cluster as a drift pattern. Each drift pattern corresponds to several drift training samples, and a corresponding compensation function number is set for each drift pattern. The following operations are performed for each drift pattern: a mapping relationship between the compensation amount and the drift degree coefficient is fitted for all drift training samples corresponding to the drift pattern.
[0009] As a preferred aspect, training the compensation function selection strategy network specifically includes the following steps: Obtain several drift training samples and label them with compensation function numbers. All labeled drift training samples form a drift training set. The compensation function selection strategy network is trained with the drift training set, and the labeled compensation function numbers are used as training targets.
[0010] As a preferred aspect, the compensation function includes a linear, piecewise linear or exponential function.
[0011] The present invention also provides a water quality detection instrument drift compensation system, comprising: The detection response curve sequence acquisition module is used to collect the detection response curve sequence of the corresponding sensor in real time. The detection response curve sequence refers to the set of all sampling points in the process of the water quality index value output by the corresponding sensor from the initial output to the stable output after the water quality detection instrument contacts the water body to be tested. The sampling point format is (t, y), where t is the timestamp corresponding to the sampling point, and y is the water quality index value corresponding to the sampling point; a behavioral energy value calculation module, configured to determine a response T value based on a detection response curve sequence of a corresponding sensor, divide the detection response curve sequence based on the response T value to obtain a front section of the detection response curve sequence, and calculate a behavioral energy value of the corresponding sensor based on the front section of the detection response curve sequence; a drift degree coefficient calculation module, configured to record a ratio of a behavior energy value of a corresponding sensor to a reference behavior energy value of the corresponding sensor as a drift degree coefficient; The drift compensation module is used to send the drift degree coefficient of the corresponding sensor and the sensor type label of the corresponding sensor into the trained compensation function selection strategy network for processing, output the corresponding compensation function number, and then select the corresponding compensation function based on the compensation function number, and send the drift degree coefficient into the corresponding compensation function for calculation to obtain the compensation amount. Finally, the water quality index value of the last sampling point in the detection response curve sequence of the corresponding sensor is corrected by the compensation amount to complete the drift compensation operation.
[0012] The present invention has the following advantages: Based on the sensor response curve sequence collected by the water quality detection instrument during actual operation, the present invention constructs a behavioral energy value for characterizing the dynamic behavioral characteristics of the sensor, and introduces the drift degree coefficient as a normalized quantitative indicator of the response capability degradation, so that the speed, strength and stability characteristics of the sensor in the response process are uniformly encoded and can be compared across cycles, thereby significantly enhancing the system's sensitivity and recognition ability to different types of sensor response drift (including point drift, gain drift and hysteresis response); at the same time, a function selection strategy network constructed based on a rule tree is introduced into the compensation path, so that the drift degree coefficient and the sensor type label jointly drive the selection process of the optimal compensation function, thereby making the drift compensation no longer rely on fixed rules or training models, but flexibly adapting according to the real-time response status, realizing the stable output correction of multiple electrochemical water quality parameters under non-ideal operating conditions, thereby significantly improving the intelligent diagnostic capability, long-term operation accuracy and field adaptability of the water quality detection instrument. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 This is a structural diagram of the drift compensation system of the water quality detection instrument used in an embodiment of the present invention. DETAILED DESCRIPTION
[0014] In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0015] Example 1, a method for compensating drift of a water quality detection instrument, comprising: During the use of the water quality testing instrument, the detection response curve sequence of the corresponding sensor is collected in real time. It should be noted that the water quality testing instrument here generally includes a variety of electrochemical water quality sensors such as pH, dissolved oxygen (DO), conductivity, ammonia nitrogen, residual chlorine, etc. The water quality testing function can be realized through these electrochemical water quality sensors. The detection response curve sequence here refers to the collection of all sampling points in the process from the initial output to the stable output of the water quality index value detected and output by the corresponding sensor after the water quality testing instrument contacts the water body to be tested. The sampling time corresponding to the detection response curve sequence is generally one minute, and the sampling frequency is generally 1s. The sampling point is in the form of (t, y), where t is the timestamp corresponding to the sampling point, and y is the water quality index value corresponding to the sampling point (such as pH value, dissolved oxygen value and ammonia nitrogen value, etc.); The response T value is determined based on the detection response curve sequence of the corresponding sensor, and the detection response curve sequence is divided based on the response T value to obtain the front end of the detection response curve sequence. The behavioral energy value of the corresponding sensor is calculated based on the front end of the detection response curve sequence. The response T value here is used to divide the detection response curve sequence. The front end of the detection response curve sequence obtained by division can characterize the main change stage of the corresponding sensor. It should be noted that during the operation of the water quality testing instrument, after the sensor contacts the new water sample, the water quality index value output by the sensor presents a non-instantaneous change response process over time. This is due to the presence of a series of physical and chemical mechanisms such as electrode polarization, charge migration, and diffusion stabilization inside the sensor. The present application utilizes the dynamic characteristics contained in the main change stage to construct a basis for judging the drift state of the sensor. The behavioral energy value can characterize the behavioral characteristics of the water quality index value in the response process, such as speed, intensity, and continuity; The ratio of the behavioral energy value of the corresponding sensor to the reference behavioral energy value of the corresponding sensor is recorded as the drift degree coefficient. The reference behavioral energy value here is determined based on the response state of the corresponding sensor during the measurement of the calibration water body when leaving the factory, and can reflect the standard response characteristics of the corresponding sensor. By calculating the ratio of the behavioral energy value of the corresponding sensor to the reference behavioral energy value of the corresponding sensor, the difference between the current response characteristics when measuring the water body to be measured and the standard response characteristics can be analyzed, thereby reflecting the drift of the corresponding sensor. When constructing the behavioral drift degree coefficient, the ratio of the current behavioral energy value to the reference behavioral energy value is used. This processing method can output the influence of the difference in amplitude and response time, making the drift degree coefficient a dimensionless, cross-cycle, and cross-device comparable performance retention indicator. Then, the drift degree coefficient of the corresponding sensor and the sensor type label of the corresponding sensor are sent to the trained compensation function selection strategy network for processing, and the corresponding compensation function number is output. Then, the corresponding compensation function is selected based on the compensation function number, and the drift degree coefficient is sent to the corresponding compensation function for calculation to obtain the compensation amount. Finally, the water quality index value of the last sampling point in the detection response curve sequence of the corresponding sensor is corrected by the compensation amount to complete the drift compensation operation. The compensation function here includes linear, piecewise linear or exponential functions, etc., which are fitted according to the mapping relationship between the compensation amount and the drift degree coefficient. The compensation function selection strategy network is constructed based on the decision tree model, which is essentially a rule tree, which can determine the drift mode of the corresponding sensor according to the drift degree coefficient and the sensor type label of the corresponding sensor, such as zero drift, gain drift and hysteresis response; the compensation function selection strategy network is established based on a multi-layer perceptron; Based on the sensor response curve sequence collected by the water quality detection instrument during actual operation, the present invention constructs a behavioral energy value for characterizing the dynamic behavioral characteristics of the sensor, and introduces the drift degree coefficient as a normalized quantitative indicator of the response capability degradation, so that the speed, strength and stability characteristics of the sensor in the response process are uniformly encoded and can be compared across cycles, thereby significantly enhancing the system's sensitivity and recognition ability to different types of sensor response drift (including point drift, gain drift and hysteresis response); at the same time, a function selection strategy network constructed based on a rule tree is introduced into the compensation path, so that the drift degree coefficient and the sensor type label jointly drive the selection process of the optimal compensation function, thereby making the drift compensation no longer rely on fixed rules or training models, but flexibly adapting according to the real-time response status, realizing the stable output correction of multiple electrochemical water quality parameters under non-ideal operating conditions, thereby significantly improving the intelligent diagnostic capability, long-term operation accuracy and field adaptability of the water quality detection instrument.
[0016] Compared with the method of directly compensating based on the difference between the measured value and the true value, it has many significant advantages: First, the measurement error only reflects the final result and cannot reveal the dynamic degradation of the sensor response process, while the behavioral energy is derived from the speed, intensity and persistence characteristics of the entire response process and can reflect the degradation mechanism itself; Second, the measurement error relies on the external true value reference and is difficult to obtain continuously in actual operation, while the behavioral energy can be independently evaluated by comparing with the reference response curve, which is suitable for online deployment; Third, the behavioral energy is more sensitive to the slightest decrease in response capability and can obtain a more accurate compensation amount; Fourth, the behavioral energy is a continuous dimensionless indicator and can be used as a unified input to drive the compensation function modeling and strategy matching, which is applicable to multiple types of sensors and drift patterns; Finally, compared with the problem that the error value cannot distinguish the drift type, the behavioral energy combined with dynamic characteristics such as the response rate can construct a complete drift state vector, which helps to accurately identify the drift pattern and match the precise compensation path; The response T value is determined based on the detection response curve sequence of the corresponding sensor, and the detection response curve sequence is divided based on the response T value to obtain the front section of the detection response curve sequence, which specifically includes the following contents: The water quality index value corresponding to the first sampling point in the detection response curve sequence is used as the starting response value, and the response stability value is determined based on the end of the response curve sequence. The response stability value here refers to the average value of the last five water quality index values in the last response curve sequence; Multiply the difference between the response stability value and the initial response value by the variation coefficient to obtain the variation amplitude. The confidence coefficient here is generally 90%, which represents the theoretical response process time proportion of the sensor. The variation amplitude represents the total variation amplitude experienced by the sensor this time. Then, the response stability value and the variation amplitude are added together to obtain the response T value. Starting from the first sampling point in the detection response curve sequence, traverse the sampling points in the detection response curve sequence, find the first sampling point whose water quality index value is greater than the response T value, and record it as the division point. All sampling points from the first sampling point to the division point in the detection response curve sequence constitute the front section of the detection response curve sequence.
[0017] The calculation of the behavioral energy value of the corresponding sensor and the reference behavioral energy value based on the first segment of the detection response curve sequence specifically includes the following steps: Map the time axes corresponding to all sampling points in the front section of the detection response curve sequence to [0, 1], update the timestamps corresponding to all sampling points, and obtain the response sequence, so that the time axis of the calculated behavioral energy value is unified. The specific mapping method is: divide the difference between the timestamp corresponding to the sampling point and the timestamp corresponding to the first sampling point in the detection response curve sequence by the total length of the time axis corresponding to the front section of the detection response curve sequence; traverse the response sequence, calculate the slope between any two adjacent sampling points, record it as the response change rate, and then assign weights to all change time periods through the window function. The window function here can be a Hamming window or an exponential weight window. The time period between two adjacent sampling points is regarded as a time period. Finally, all response change rates and the weight assigned by the window function are weighted and summed to obtain the behavioral energy value of the corresponding sensor; The calculation method of the reference behavioral energy value is consistent with the calculation method of the behavioral energy value of the corresponding sensor. The difference is that the front part of the detection response curve sequence when calculating the reference behavioral energy value is obtained based on the corresponding sensor being immersed in a standard water sample with known parameter values.
[0018] The compensation function is constructed as follows: Obtain several drift training samples, each of which includes a drift feature vector. The drift feature vector includes the drift degree coefficient of the corresponding sensor and the sensor type label of the corresponding sensor. The drift feature vector is obtained and constructed by the operator based on the actual water quality testing operation process. A cluster analysis operation is performed on all drift feature vectors. Each cluster obtained is recorded as a drift pattern, and each drift pattern corresponds to several drift training samples. The clustering algorithm adopts the K-means algorithm, and a corresponding compensation function number is set for each drift pattern. For each drift pattern, the following operations are performed: For all drift training samples corresponding to the drift pattern, a mapping relationship between the compensation amount and the drift degree coefficient is fitted. The fitting methods include linear, piecewise linear, or exponential functions. The fitting method with the highest accuracy is selected as the compensation function. The training of the compensation function selection strategy network includes the following steps: Obtain several drift training samples and label them with compensation function numbers. The compensation function numbers here correspond to the drift modes to which the drift training samples belong. All labeled drift training samples are combined into a drift training set. The compensation function selection strategy network is trained with the drift training set. The labeled compensation function numbers are used as training targets to determine whether the training conditions are met. The training conditions are generally that the accuracy of the compensation function selection strategy network meets expectations. If the training conditions are met, the trained compensation function selection strategy network is output. Otherwise, the compensation function selection strategy network is continued to be trained with the drift training set.
[0019] Example 2, a water quality detection instrument drift compensation system, see Figure 1 ,include: The detection response curve sequence acquisition module is used to collect the detection response curve sequence of the corresponding sensor in real time during the use of the water quality detection instrument. It should be noted that the water quality detection instrument here generally includes a variety of electrochemical water quality sensors such as pH, dissolved oxygen (DO), conductivity, ammonia nitrogen, residual chlorine, etc. The water quality detection function can be realized through these electrochemical water quality sensors. The detection response curve sequence here refers to the collection of all sampling points in the process from the initial output to the stable output of the water quality index value detected and output by the corresponding sensor after the water quality detection instrument contacts the water body to be tested. The sampling time corresponding to the detection response curve sequence is generally one minute, and the sampling frequency is generally 1s. The sampling point is in the form of (t, y), where t is the timestamp corresponding to the sampling point, and y is the water quality index value corresponding to the sampling point (such as pH value, dissolved oxygen value and ammonia nitrogen value, etc.); A behavioral energy value calculation module is used to determine the response T value based on the detection response curve sequence of the corresponding sensor, divide the detection response curve sequence based on the response T value, obtain the front segment of the detection response curve sequence, and calculate the behavioral energy value of the corresponding sensor based on the front segment of the detection response curve sequence. The response T value here is used to divide the detection response curve sequence, and the front segment of the detection response curve sequence obtained by division can characterize the main change stage of the corresponding sensor. It should be noted that during the operation of the water quality detection instrument, after the sensor contacts the new water sample, the water quality index value output by the sensor presents a non-instantaneous change response process over time. This is due to the presence of a series of physical and chemical mechanisms such as electrode polarization, charge migration, and diffusion stabilization inside the sensor. This application utilizes the dynamic characteristics contained in the main change stage to construct a basis for judging the drift state of the sensor. The behavioral energy value can characterize the behavioral characteristics of the water quality index value in the response process, such as speed, intensity, and continuity; The drift degree coefficient calculation module is used to record the ratio of the behavioral energy value of the corresponding sensor to the reference behavioral energy value of the corresponding sensor as the drift degree coefficient. The reference behavioral energy value here is determined based on the response state of the corresponding sensor during the measurement of the calibration water body when leaving the factory, and can reflect the standard response characteristics of the corresponding sensor. By calculating the ratio of the behavioral energy value of the corresponding sensor to the reference behavioral energy value of the corresponding sensor, the difference between the response characteristics when the water body is currently being measured and the standard response characteristics can be analyzed, thereby reflecting the drift of the corresponding sensor. When constructing the behavioral drift degree coefficient, the ratio of the current behavioral energy value to the reference behavioral energy value is used. This processing method can output the impact of the difference in amplitude and response time, making the drift degree coefficient a dimensionless, cross-cycle, and cross-device comparable performance retention indicator. The drift compensation module is used to send the drift degree coefficient of the corresponding sensor and the sensor type label of the corresponding sensor into the trained compensation function selection strategy network for processing, output the corresponding compensation function number, and then select the corresponding compensation function based on the compensation function number, and send the drift degree coefficient into the corresponding compensation function for calculation to obtain the compensation amount. Finally, the water quality index value of the last sampling point in the detection response curve sequence of the corresponding sensor is corrected by the compensation amount to complete the drift compensation operation. The compensation function here includes linear, piecewise linear or exponential functions, which are fitted according to the mapping relationship between the compensation amount and the drift degree coefficient. The compensation function selection strategy network is constructed based on the decision tree model, which is essentially a rule tree. It can determine the drift mode of the corresponding sensor according to the drift degree coefficient and the sensor type label of the corresponding sensor, such as zero drift, gain drift and hysteresis response; the compensation function selection strategy network is established based on a multi-layer perceptron.
[0020] It should be understood that those skilled in the art may make improvements or modifications based on the above description, and all such improvements and modifications shall fall within the scope of protection of the appended claims. Any portion of this specification not described in detail is prior art known to those skilled in the art.
Claims
1. A method for compensating drift of a water quality testing instrument, characterized in that: include: Real-time acquisition of the detection response curve sequence of the corresponding sensor. The detection response curve sequence refers to the set of all sampling points in the process from the initial output to the stable output of the water quality index value output by the corresponding sensor after the water quality detection instrument contacts the water body to be tested. The sampling point format is (t, y), where t is the timestamp corresponding to the sampling point, and y is the water quality index value corresponding to the sampling point; determining a response T value based on a detection response curve sequence of the corresponding sensor, dividing the detection response curve sequence based on the response T value to obtain a front section of the detection response curve sequence, and calculating a behavioral energy value of the corresponding sensor based on the front section of the detection response curve sequence; The ratio of the behavior energy value of the corresponding sensor to the reference behavior energy value of the corresponding sensor is recorded as the drift degree coefficient; Then, the drift degree coefficient of the corresponding sensor and the sensor type label of the corresponding sensor are sent to the trained compensation function selection strategy network for processing, and the corresponding compensation function number is output. Then, the corresponding compensation function is selected based on the compensation function number, and the drift degree coefficient is sent to the corresponding compensation function for calculation to obtain the compensation amount. Finally, the water quality index value of the last sampling point in the detection response curve sequence of the corresponding sensor is corrected by the compensation amount to complete the drift compensation operation.
2. A method for compensating drift of a water quality testing instrument according to claim 1, characterized in that: The response T value is determined based on the detection response curve sequence of the corresponding sensor, and the detection response curve sequence is divided based on the response T value to obtain the front section of the detection response curve sequence, which specifically includes the following contents: The water quality index value corresponding to the first sampling point in the detection response curve sequence is used as the initial response value, and the response stable value is determined based on the end of the response curve sequence; Multiply the difference between the response stable value and the initial response value by the variation coefficient to obtain the variation amplitude, and then add the response stable value and the variation amplitude to obtain the response T value; Starting from the first sampling point in the detection response curve sequence, traverse the sampling points in the detection response curve sequence, find the first sampling point whose water quality index value is greater than the response T value, and record it as the division point. All sampling points from the first sampling point to the division point in the detection response curve sequence constitute the front section of the detection response curve sequence.
3. A method for compensating drift of a water quality testing instrument according to claim 2, characterized in that: The calculation of the behavioral energy value of the corresponding sensor and the reference behavioral energy value based on the first segment of the detection response curve sequence specifically includes the following steps: Map the time axis corresponding to all sampling points in the front section of the detection response curve sequence to [0, 1], update the timestamps corresponding to all sampling points to obtain the response sequence; traverse the response sequence, calculate the slope between any two adjacent sampling points, record it as the response change rate, then assign weights to all change time periods using a window function, and regard the time period between the timestamps corresponding to two adjacent sampling points as one time period. Finally, perform a weighted sum operation on all response change rates and the weight assigned by the window function to obtain the behavioral energy value of the corresponding sensor; The calculation method of the reference behavioral energy value is consistent with the calculation method of the behavioral energy value of the corresponding sensor. The difference is that the front part of the detection response curve sequence when calculating the reference behavioral energy value is obtained based on the corresponding sensor being immersed in a standard water sample with known parameter values.
4. A method for compensating drift of a water quality testing instrument according to claim 3, characterized in that: The compensation function is constructed as follows: Acquire several drift training samples, each of which includes a drift feature vector. The drift feature vector includes a drift degree coefficient of the corresponding sensor and a sensor type label of the corresponding sensor. Perform a cluster analysis on all drift feature vectors, and record each obtained cluster as a drift pattern. Each drift pattern corresponds to several drift training samples, and a corresponding compensation function number is set for each drift pattern. The following operations are performed for each drift pattern: a mapping relationship between the compensation amount and the drift degree coefficient is fitted for all drift training samples corresponding to the drift pattern.
5. A method for compensating drift of a water quality testing instrument according to claim 4, characterized in that: The training of the compensation function selection strategy network includes the following steps: Obtain several drift training samples and label them with compensation function numbers. All labeled drift training samples form a drift training set. The compensation function selection strategy network is trained with the drift training set, and the labeled compensation function numbers are used as training targets.
6. A method for compensating drift of a water quality testing instrument according to claim 5, characterized in that: The compensation function can be in the form of linear, piecewise linear or exponential function.
7. A water quality testing instrument drift compensation system, characterized in that: The system applies a water quality detection instrument drift compensation method according to any one of claims 1 to 6, comprising: The detection response curve sequence acquisition module is used to collect the detection response curve sequence of the corresponding sensor in real time. The detection response curve sequence refers to the set of all sampling points in the process of the water quality index value output by the corresponding sensor from the initial output to the stable output after the water quality detection instrument contacts the water body to be tested. The sampling point format is (t, y), where t is the timestamp corresponding to the sampling point, and y is the water quality index value corresponding to the sampling point; a behavioral energy value calculation module, configured to determine a response T value based on a detection response curve sequence of a corresponding sensor, divide the detection response curve sequence based on the response T value to obtain a front section of the detection response curve sequence, and calculate a behavioral energy value of the corresponding sensor based on the front section of the detection response curve sequence; a drift degree coefficient calculation module, configured to record a ratio of a behavior energy value of a corresponding sensor to a reference behavior energy value of the corresponding sensor as a drift degree coefficient; The drift compensation module is used to send the drift degree coefficient of the corresponding sensor and the sensor type label of the corresponding sensor into the trained compensation function selection strategy network for processing, output the corresponding compensation function number, and then select the corresponding compensation function based on the compensation function number, and send the drift degree coefficient into the corresponding compensation function for calculation to obtain the compensation amount. Finally, the water quality index value of the last sampling point in the detection response curve sequence of the corresponding sensor is corrected by the compensation amount to complete the drift compensation operation.
Citation Information
Patent Citations
Long-term drift error compensation method for gravity sensor
CN109613618A
Gas concentration drift compensation method based on neural network
CN117763283A
Water quality detection system for hydraulic engineering and monitoring method
CN120214252A
Error correction system and method for marine environment observation data
CN120314529A
A water sampler and a measuring device of water quality with the function of water sampling and the measuring method
KR1020150102439A
Cited By
New energy automobile condenser operation data processing method and system
CN122087368A
A method and system for processing operating data of condensers in new energy vehicles
CN122087368B
Method and apparatus for compensation of intrinsic drift of electrochemical sensors
CN122361576A