Dissolved oxygen sensor abnormity judgment method and computer program product
By collecting ocean dissolved oxygen sensor data at the same temperature, and using a quadratic fitting function and R-squared regression model to identify sensor anomalies, the problem of sensor measurement instability in the marine environment was solved. This enabled rapid and accurate self-testing and calibration, ensuring the reliability of seawater dissolved oxygen monitoring.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-18
- Publication Date
- 2026-03-10
AI Technical Summary
Existing marine dissolved oxygen sensors are unstable in complex marine environments, resulting in inaccurate detection data. Regular self-testing is required, but the process is uncertain, affecting the accuracy and reliability of seawater dissolved oxygen monitoring.
Under constant ambient temperature, multiple random sensor data were collected. Sensor anomalies were identified by fitting indices using a quadratic fitting function and an R-squared regression model. A reasonable threshold was set for self-testing based on the relationship between phase value and dissolved oxygen content.
It enables rapid and accurate sensor self-testing, reduces errors, improves the stability and measurement accuracy of the sensor in complex marine environments, and ensures the normal operation of seawater dissolved oxygen monitoring.
Smart Images

Figure CN121633419A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of water quality monitoring, and relates to a sensor for measuring the content of dissolved oxygen in seawater, in particular to a judgment method for judging whether a dissolved oxygen sensor is abnormal. BACKGROUND
[0002] In the process of measuring dissolved oxygen in the sea, the temperature value and phase value of seawater can be collected in real time by using a dissolved oxygen sensor, so that online monitoring of the content of dissolved oxygen in seawater can be realized, and the quality of seawater and the pollution degree of seawater can be measured according to the monitored content of dissolved oxygen.
[0003] However, the marine field monitoring environment in reality is complex and changeable, and there are many interference factors. In actual operation process, it is found that the change of marine environment seriously interferes with the measurement of the dissolved oxygen sensor, and the performance is that the detected dissolved oxygen data is unstable. In order to judge whether the data collected by the seawater dissolved oxygen sensor and the calculated result are abnormal, the seawater dissolved oxygen sensor needs to be self-checked regularly to judge whether the dissolved oxygen sensor is in normal working state. For the abnormal dissolved oxygen sensor, it can be found in time and replaced or recalibrated to ensure the normal development of seawater dissolved oxygen monitoring operation. SUMMARY
[0004] In order to solve the above at least one technical problem in the prior art, the present application provides a dissolved oxygen sensor abnormality judgment method, which can automatically diagnose whether the dissolved oxygen sensor is abnormal.
[0005] To solve the above technical problems, the present application adopts the following technical solutions:
[0006] In one aspect, the present application provides a dissolved oxygen sensor abnormality judgment method, comprising:
[0007] Under the condition that the environmental temperature is constant, n times of dissolved oxygen sensor data are randomly collected, including temperature value, phase value and dissolved oxygen content value;
[0008] The highest temperature value and the lowest temperature value are selected from the collected temperature data, if the two values are similar, the subsequent judgment process is executed, otherwise, it is judged that the dissolved oxygen sensor has temperature detection abnormality problem;
[0009] A quadratic fitting function is established by using the phase value and the dissolved oxygen content value:
[0010] y = k2x 2 + k1x + k0;
[0011] Wherein, x represents the phase value; y represents the dissolved oxygen content value; k0, k1 and k2 are fitting coefficients.
[0012] calculating an R-square regression model fitting index R of the quadratic fitting function 2 :
[0013] ;
[0014] wherein, x i is the i-th phase value collected; y i is the dissolved oxygen content value corresponding to the i-th phase value; is the average value of the n dissolved oxygen content values;
[0015] comparing R 2 with a set threshold value, and determining whether the dissolved oxygen sensor is abnormal according to the comparison result.
[0016] In some embodiments of the present application, if R 2 is greater than or equal to the set threshold value, it indicates that the dissolved oxygen sensor is normal; if R 2 is less than the set threshold value, it indicates that the dissolved oxygen sensor is abnormal and needs to be recalibrated.
[0017] In some embodiments of the present application, the set threshold value can be determined according to the error calibration coefficient R-square recorded in the calibration specification of the dissolved oxygen sensor, and the set threshold value should be less than the error calibration coefficient R-square of the dissolved oxygen sensor, and the difference between the two is preferably not greater than 0.0009, so as to ensure the detection accuracy of the dissolved oxygen content.
[0018] In some embodiments of the present application, the set threshold value can be set to 0.999.
[0019] In some embodiments of the present application, the dissolved oxygen content value can be calculated by using a dissolved oxygen sensor calibration formula from the temperature value and the phase value detected by the dissolved oxygen sensor, and the dissolved oxygen sensor calibration formula is:
[0020] ;
[0021] wherein, z represents the temperature value; x represents the phase value; y represents the dissolved oxygen content value; A, B, C, D, E, F, and G are known calibration parameters.
[0022] In some embodiments of the present application, when the environmental temperature is seawater temperature, i.e., when the dissolved oxygen content of seawater is measured by using the dissolved oxygen sensor, since the change speed of seawater temperature is relatively slow, the temperature will not change within 10 minutes, so the random collection of the n times of dissolved oxygen sensor data within 10 minutes can be considered as data sampling under the condition that the environmental temperature is constant.
[0023] In some embodiments of the present application, the n times of dissolved oxygen sensor data can be real-time data collected on site, or can be recent historical record data.
[0024] In some embodiments of the present application, in order to improve the fitting degree of the fitting function, the value of n is preferably greater than or equal to 10.
[0025] In some embodiments of the present application, due to the existence of measurement error, when the same environmental temperature is detected by the dissolved oxygen sensor, the detection result will inevitably have slight deviation, therefore, the difference between the highest temperature value and the lowest temperature value detected by the dissolved oxygen sensor is less than or equal to 0.2℃, which is considered as the similar values, and the process of determining whether the dissolved oxygen sensor is abnormal or not can be continued; if the difference between the two values is more than 0.2℃, that is, the detected temperature value has a large deviation, there may be a problem of abnormal temperature detection of the dissolved oxygen sensor, at this time, the subsequent determination process can be directly stopped, and the determination result that the dissolved oxygen sensor is abnormal is output.
[0026] In another aspect, the present application also provides a computer program product comprising computer programs / instructions, which, when executed by a processor, implement the following steps of determining the abnormality of a dissolved oxygen sensor:
[0027] Under the condition that the environmental temperature is constant, n times of dissolved oxygen sensor data are randomly collected, including temperature value, phase value and dissolved oxygen content value;
[0028] The highest temperature value and the lowest temperature value are selected from the collected temperature data, if the two values are similar, the subsequent determination process is performed, otherwise, it is determined that the dissolved oxygen sensor has a problem of abnormal temperature detection;
[0029] A quadratic fitting function is established by using the phase value and the dissolved oxygen content value:
[0030] y = k2x 2 + k1x + k0;
[0031] Wherein, x represents the phase value; y represents the dissolved oxygen content value; k0, k1 and k2 are fitting coefficients;
[0032] The R square regression model fitting index R 2 of the quadratic fitting function is calculated:
[0033] ;
[0034] Wherein, x i is the i-th phase value collected; y i is the dissolved oxygen content value corresponding to the i-th phase value; is the average value of n dissolved oxygen content values;
[0035] R 2 The comparison with the set threshold value judges whether the dissolved oxygen sensor is abnormal according to a comparison result.
[0036] Compared with the prior art, the advantages and positive effects of the present application mainly embody in:
[0037] 1. The dissolved oxygen sensor abnormality judging method calculates the dissolved oxygen content value according to the temperature value and the phase value detected by the dissolved oxygen sensor under the same environmental temperature, judges whether the dissolved oxygen sensor is abnormal by using the deviation of the phase value and the dissolved oxygen content value to the fitting function curve, the calculation process is simple and easy to implement, and the working state of the dissolved oxygen sensor is diagnosed online to guide the staff to find and calibrate or replace the abnormal dissolved oxygen sensor in time, so as to ensure the normal development of seawater dissolved oxygen monitoring operation.
[0038] 2. The dissolved oxygen sensor abnormality judging method collects sensor data under the same temperature condition, so that the fitting function only needs to use the quadratic function to accurately reflect whether the real relationship between the phase value and the dissolved oxygen content value deviates, the calculation speed is fast, the error range only needs to be adjusted slightly on the basis of the error calibration coefficient R-square recorded in the calibration instruction of the dissolved oxygen sensor to determine the reasonable set threshold value, and the judging result is accurate and reliable.
[0039] 3. The dissolved oxygen sensor temperature abnormality judging method is not limited by the position of the sensor and is not affected by the interference of the marine environment, and can improve the stability of the self-checking of the dissolved oxygen sensor and the accuracy of the measurement in the variable marine environment.
[0040] Other features and advantages of the present application will become more apparent after reading the detailed description of the embodiments of the present application in combination with the accompanying drawings. BRIEF DESCRIPTION OF DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of these drawings.
[0042] Figure 1 The flow chart of one embodiment of the dissolved oxygen sensor abnormality judging method proposed in the present application;
[0043] Figure 2 The quadratic fitting function curve diagram of one embodiment of the phase value and the dissolved oxygen content value;
[0044] Figure 3 A graph of a quadratic fitting function for another embodiment of phase values and dissolved oxygen content values. DETAILED DESCRIPTION
[0045] The technical solutions in the embodiments of the present application will be apparently and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all the other embodiments obtained by those skilled in the art without creative work belong to the protection scope of the present application.
[0046] In the description of the present application, the continuous numbering of the method steps is for the convenience of review and understanding. The adjustment of the implementation order between the steps will not affect the technical effects reached by the technical solutions of the present application, in combination with the overall technical solutions of the present application and the logical relationship between the steps.
[0047] The seawater dissolved oxygen sensor at the present stage calculates the dissolved oxygen content value of seawater by collecting the temperature value and the phase value of seawater. The dissolved oxygen content calculation formula is provided by the manufacturer of the dissolved oxygen sensor after calibration, and the specific calibration formula is as follows:
[0048] (1);
[0049] In formula (1), z represents the temperature value; x represents the phase value; y represents the dissolved oxygen content value; A, B, C, D, E, F, and G are seven known calibration parameters after calibration.
[0050] In the actual use process of the seawater dissolved oxygen sensor, the hardware is affected by the complex marine environment. After being used for a period of time, the detected temperature value and / or phase value may deviate, which in turn causes the dissolved oxygen content value calculated by using the existing calibration formula to be no longer accurate, that is, the existing calibration formula is no longer applicable. However, it is generally uncertain how long this process will take, so it is necessary to regularly detect the working condition of the dissolved oxygen sensor to ensure that the marine monitoring operation can be normally carried out.
[0051] In order to realize online real-time diagnosis of whether the seawater dissolved oxygen sensor is abnormal, the embodiment designs a seawater dissolved oxygen sensor abnormality judgment method, as shown in Figure 1 The method specifically includes the following processes:
[0052] S101, under the condition that the environmental temperature is unchanged, randomly collecting n times of dissolved oxygen sensor data, including the temperature value, the phase value, and the dissolved oxygen content value.
[0053] In the embodiment, in order to quickly and accurately obtain the judgment result, the embodiment collects the dissolved oxygen sensor data under the same temperature condition, that is, the temperature value and the phase value under the same temperature environment are collected by using the dissolved oxygen sensor, and then the dissolved oxygen content value is calculated by using the calibration formula (1).
[0054] For the sensor for monitoring the dissolved oxygen content of seawater, since the seawater temperature changes slowly, the seawater temperature basically remains constant in a short time, and therefore the seawater temperature and the phase can be collected multiple times in a short time, which is regarded as the dissolved oxygen sensor data collection under the condition that the environmental temperature is constant.
[0055] In some embodiments, the data collection work can be set to be completed within 10 minutes, the collection times n are greater than or equal to 10 times, and the collected data can be real-time data collected by the dissolved oxygen sensor on site, or historical record data collected by the dissolved oxygen sensor in the near future.
[0056] S102, the highest temperature value and the lowest temperature value are selected from the collected temperature data, if the two values are similar, the subsequent judgment process is performed, otherwise it is determined that the dissolved oxygen sensor has a temperature detection abnormality problem.
[0057] Due to the limitation of the hardware design of the dissolved oxygen sensor, under the same environmental temperature, the temperature values detected by the normal dissolved oxygen sensor cannot be completely the same, and there will be a little difference. In view of this actual situation, the embodiment first judges whether the temperature value detected by the dissolved oxygen sensor is abnormal, if the highest temperature value and the lowest temperature value detected under the same environmental temperature are similar, for example, the difference between the two is less than or equal to 0.2℃, it is considered that the temperature detection of the dissolved oxygen sensor is normal, and the subsequent judgment process of whether the dissolved oxygen sensor is abnormal can be continued. On the contrary, if the difference between the highest temperature value and the lowest temperature value detected under the same environmental temperature is greater than 0.2℃, that is, the detected temperature value has a large deviation, there may be a problem of abnormal temperature detection of the dissolved oxygen sensor, at this time the subsequent judgment process can be directly stopped, and the judgment result that the dissolved oxygen sensor has an abnormality is output.
[0058] S103, a quadratic fitting function of the phase value and the dissolved oxygen content value is established.
[0059] In the embodiment, the n phase values collected and the n dissolved oxygen content values calculated can be used to construct a quadratic fitting function:
[0060] y = k2x 2 + k1x + k0 (2).
[0061] Wherein, x represents the phase value; y represents the dissolved oxygen content value; k0, k1, k2 are fitting coefficients.
[0062] Since the phase values in the embodiment are collected under the same temperature condition, a quadratic fitting function can meet the error judgment requirement, that is, a quadratic curve function of the relationship between the phase value and the dissolved oxygen content value under a single temperature, and the error range of the relationship between the phase value and the dissolved oxygen content value can be used to judge whether the dissolved oxygen sensor is abnormal. Using the quadratic fitting function can speed up the calculation speed and quickly output the judgment result under the condition of ensuring the accuracy of the judgment result.
[0063] S104, calculate the R-square regression model fitting index R of the quadratic fitting function 2 .
[0064] R-square (R 2 ) is a commonly used index for measuring the goodness of fit of a regression model, representing the proportion of the model explaining the variation of the dependent variable, and the value range is 0%-100%, and the closer the value is to 100%, the better the model fits the data.
[0065] In the embodiment, the R-square regression model fitting index R 2 corresponding to the above-mentioned quadratic fitting function (2) is calculated.
[0066] ;
[0067] Where x i is the i-th phase value collected; y i is the dissolved oxygen content value corresponding to the i-th phase value; is the average of the n dissolved oxygen content values.
[0068] S105, compare the fitting index R 2 with the set threshold value, and judge whether the dissolved oxygen sensor is abnormal according to the comparison result.
[0069] In the embodiment, a value slightly lower than the sensor calibration coefficient R-square provided by the manufacturer in the calibration specification of the dissolved oxygen sensor when it is shipped can be set as the set threshold value for comparison with the calculated fitting index R 2 . For example, for the case where the calibration specification records the sensor calibration coefficient R-square=0.9993, the set threshold value can be set to 0.999.
[0070] In some embodiments, the difference between the error calibration coefficient R-square of the dissolved oxygen sensor and the set threshold value should not be greater than 0.0009, so as to reduce the measurement deviation.
[0071] Establish a judgment rule: if R 2greater than or equal to the set threshold value, it is indicated that the dissolved oxygen sensor is normal and can continue to be used. On the contrary, if the R 2 less than the set threshold value, it is indicated that the dissolved oxygen sensor is abnormal and needs to be recalibrated before use.
[0072] The dissolved oxygen sensor abnormality judgment method of the embodiment can be written into a computer program or instruction executed by a processor to form a computer program product for online diagnosis of whether the dissolved oxygen sensor is working normally, to provide a reference for the staff to make a final decision on whether to replace the dissolved oxygen sensor or whether to recalibrate the dissolved oxygen sensor.
[0073] Two specific embodiments are listed below.
[0074] Embodiment 1
[0075] Suppose the data detected by the dissolved oxygen sensor is shown in Table 1.
[0076] Table 1
[0077]
[0078] The maximum temperature value in Table 1 is 20.27675℃, and the minimum temperature value is 20.24975℃, with a temperature difference less than 0.2℃, indicating that the temperature detection of the dissolved oxygen sensor is not a problem, and the subsequent judgment process can be performed.
[0079] All phase values and dissolved oxygen content values are traversed to establish a quadratic fitting function y = k2x 2 +k1x+k0. Wherein, k2 = 0.6785, k1 = -53.599, k0 = 1155.1, and the quadratic fitting function curve is shown in Figure 2 .
[0080] The R square regression model fitting index R 2 = 0.9996 of the above quadratic fitting function is greater than the set threshold value 0.999, indicating that the correlation coefficient of the 10 groups of phase values and dissolved oxygen content values is very high, and it is judged as normal data, that is, the dissolved oxygen sensor is currently in a normal working state and can continue to be used.
[0081] Embodiment 2
[0082] Suppose the data detected by the dissolved oxygen sensor is shown in Table 2.
[0083] Table 2
[0084]
[0085] The highest temperature value in Table 2 is 20.2145℃, the lowest temperature value is 20.2045℃, and the temperature difference is less than 0.2℃, indicating that the temperature detection of the dissolved oxygen sensor is not a problem, and the subsequent judgment process can be performed.
[0086] All phase values and dissolved oxygen content values are traversed to establish a quadratic fitting function y = k2x 2 +k1x+k0. Wherein, k2 = -7.7828, k1 = 498.19, k0 = -7841.8, and the quadratic fitting function curve is as shown in Figure 3
[0087] The R square regression model fitting index R of the above quadratic fitting function is calculated 2 = 0.9988, which is less than the set threshold 0.999, indicating that the correlation coefficient of the 10 groups of phase values and dissolved oxygen content values is not high, which may be because the dissolved oxygen sensor is contaminated, resulting in inaccurate data collection. At this time, it can be determined that the dissolved oxygen sensor is abnormal and needs to be recalibrated.
[0088] Of course, the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, for those skilled in the art, the technical solutions recorded in the foregoing embodiments can still be modified, or some technical features can be replaced by equivalents; and these modifications or replacements do not make the corresponding technical solutions deviate from the spirit and scope of the technical solutions claimed by the present application.
Claims
1. A method for determining anomalies in a dissolved oxygen sensor, characterized in that, The method comprises the following steps: Randomly collecting n times of dissolved oxygen sensor data including temperature value, phase value and dissolved oxygen content value under the condition that the ambient temperature is constant; Selecting the highest temperature value and the lowest temperature value from the collected temperature data, and if the two values are similar, performing the subsequent judgment process, otherwise, determining that the dissolved oxygen sensor has a temperature detection abnormality problem; Using the phase value and the dissolved oxygen content value, a quadratic fitting function is established: y = k2x 2 + k1x + k0; Wherein, x represents the phase value; y represents the dissolved oxygen content value; k0, k1, k2 are fitting coefficients; calculating an R-square regression model fit indicator R of the quadratic fit function 2 : ; wherein x i is the i-th phase value; y i is the dissolved oxygen content value corresponding to the i-th phase value; is the average of the n dissolved oxygen content values; R 2 comparing the set threshold value, and determining whether the dissolved oxygen sensor is abnormal based on a result of the comparison.
2. The dissolved oxygen sensor abnormality judgment method according to claim 1, characterized in that: If R 2 greater than or equal to a set threshold value, it indicates that the dissolved oxygen sensor is normal; If R 2 is less than a set threshold, it indicates that the dissolved oxygen sensor is abnormal and needs to be recalibrated.
3. The method according to claim 2, wherein The set threshold is determined according to the error calibration coefficient R-square recorded in the calibration specification of the dissolved oxygen sensor, and the set threshold is less than the error calibration coefficient R-square of the dissolved oxygen sensor, and the difference between the two is not greater than 0.0009.
4. The method according to claim 3, characterized by, The set threshold is 0.
999.
5. The method according to any one of claims 1 to 4, characterized in that, The dissolved oxygen content value is calculated by using the temperature value and the phase value detected by the dissolved oxygen sensor, and the dissolved oxygen sensor calibration formula is: ; Wherein, z represents the temperature value; A, B, C, D, E, F, G are known calibration parameters.
6. The method according to any one of claims 1 to 4, characterized in that, The ambient temperature is the seawater temperature, and it is assumed that the seawater temperature is constant within 10 minutes, and the random collection of n times of dissolved oxygen sensor data is completed within 10 minutes.
7. The method according to claim 6, wherein The n times of dissolved oxygen sensor data are real-time data collected on site or recent historical record data.
8. The method according to claim 7, wherein The n is greater than or equal to 10.
9. The method according to any one of claims 1 to 4, characterized by, The difference between the highest temperature value and the lowest temperature value is less than or equal to 0.2℃, and it is considered that the two values are similar.
10. A computer program product comprising computer programs / instructions, characterized in that, The computer program / instruction is executed by the processor to realize the steps of the dissolved oxygen sensor abnormality judgment method according to any one of claims 1 to 9.