A method for detecting and repairing outliers in water environment monitoring data

Through the short-term ring comparison method and sub-sequence similarity repair method, the problem of outlier detection and repair in water environment monitoring data is solved, and higher-quality data repair is achieved. Especially when it is greatly affected by the outside world, the repaired data is smooth. The degree and trend are obvious.

CN114020730BActive Publication Date: 2024-09-13HANG ZHOU AN HAO JIAN CE KE JI YOU XIAN GONG SI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111255406.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-27
Publication Date
2024-09-13
Estimated Expiration
2041-10-27

AI Technical Summary

Technical Problem

Outliers appear in water environment monitoring data due to sensor failures, data transmission errors, etc., resulting in a decline in data quality. It is difficult to effectively detect and repair with existing technology, especially when there is a large impact from the outside world.

Method used

The short-term chain comparison method is used to detect outliers, and the data is dynamically divided into subsequences, the similarity of the subsequences is calculated, and the changing trend of the most similar subsequences is selected to repair the outliers to avoid relying on the model for repair.

Benefits of technology

The quality of water environment monitoring data is improved. The repaired data is smoother and the short-term trend is obvious, which is better than the existing prediction and fitting repair methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114020730B
    Figure CN114020730B
Patent Text Reader

Abstract

The present invention relates to the field of water environment monitoring technology, and in particular to a method for detecting and repairing outliers in water environment monitoring data. The method comprises the following steps: (1) using a sliding window to perform a short-term comparison of water environment monitoring data to detect outliers; (2) dynamically dividing the water environment monitoring data into various subsequences; (3) for the subsequence where the outlier is located, respectively calculating the similarity with other subsequences and selecting the subsequence with the greatest similarity; (4) repairing the outlier according to the change trend of the corresponding position data in the most similar subsequence. The present invention repairs outliers in water environment monitoring data without relying on any model, uses a short-term comparison method to detect outliers, and repairs outliers based on subsequence similarity, so that the repaired data has better smoothness, the short-term trend of the data is more obvious, and the data quality is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of water environment monitoring, and in particular to a method for detecting and repairing abnormal values ​​in water environment monitoring data. Background Art

[0002] With the continuous deepening of big data applications, data quality issues have become a key issue affecting the development of big data applications. Water environment monitoring data is a time series of various water environment indicators (water temperature, pH value, dissolved oxygen, conductivity, turbidity, ammonia nitrogen, permanganate index, total phosphorus, total nitrogen, chlorophyll, blue-green algae, etc.) detected by sensors. They are typical big data. Due to factors such as sensor failure, data transmission, and reading errors, outliers appear in water environment monitoring data. The existence of outliers reduces the data quality of monitoring data. The timely detection and repair of outliers is of great significance to the subsequent knowledge acquisition, water environment indicator prediction modeling and other applications.

[0003] In order to improve the availability of data, researchers use fitting methods and prediction methods to repair outliers in big data. However, water environment monitoring data is greatly affected by external factors (such as pollution, weather, etc.), resulting in large errors in the model after fitting according to long-term trends. In addition, outliers in water environment monitoring generally include missing values, which leads to the failure of the prediction method. The early step of outlier repair is outlier detection. Traditional outlier detection technology is mainly based on classification, distance, clustering, statistics, information theory, etc., but for specific application scenarios, more targeted outlier detection methods are needed. Summary of the invention

[0004] To solve the above problems, the present invention provides a method for detecting and repairing outliers in water environment monitoring data. The method does not rely on any model to repair outliers in water environment monitoring data, adopts a short-term year-on-year method to detect outliers, and repairs outliers based on subsequence similarity, so that the repaired data has better smoothness, the short-term trend of the data is more obvious, and the data quality is effectively improved.

[0005] The present invention is achieved by adopting the following technical solutions:

[0006] A method for detecting and repairing outliers in water environment monitoring data comprises the following steps:

[0007] (1) Use sliding windows to perform short-term comparisons on water environment monitoring data to detect outliers;

[0008] (2) Dynamically segmenting the water environment monitoring data into subsequences;

[0009] (3) For the subsequence where the outlier is located, calculate the similarity with other subsequences and select the subsequence with the greatest similarity;

[0010] (4) Repairing the outliers according to the changing trend of the corresponding position data in the most similar subsequence.

[0011] In one embodiment, the method for detecting abnormal values ​​in step (1) is as follows: for each monitoring value v on the time series V i , calculate the difference with the k-nearest neighbor window size one by one, and record the number of points countnum whose difference exceeds the threshold ε. When all comparisons are completed, you can check whether the countnum value is greater than τ to check v i Is it an outlier? If v i If it is an abnormal value, its position is recorded; where V is the water environment monitoring data V = (v1, v2, ..., v n ), where point v i (1≤i≤n) is t i The monitoring value corresponding to the moment, Indicates point v i The k-nearest neighbor window, if Existence or Then determine v i is an outlier, where ε is the difference threshold and τ is the quantity threshold.

[0012] In one embodiment, the step (2) of dynamically dividing the water environment monitoring data into subsequences is specifically as follows: based on the maximum distance threshold To dynamically divide the sequence, first set a flag variable flag. The flag value 1 represents that the subsequence is in an ascending state, the value -1 represents that it is in a descending state, and the value 0 represents that it is in a stable state. The flag is assigned an initial value according to the initial trend of the data sequence. Then, for each monitoring data v i Do the following operations to calculate the difference value e from the previous data i =v i -v i-1 , and calculate the maximum distance of the subsequence so far, when the maximum distance does not exceed the threshold When e i If the sign is opposite to the flag, the flag is set to 0. When the flag and e i The value of is used to judge the overall trend and change of the subsequence curve, thereby dividing and saving the subsequence, and finally performing initialization operations for dividing the next subsequence.

[0013] In one embodiment, the shape distance calculation formula for calculating the similarity with other subsequences in step (3) is shown in formula (1):

[0014]

[0015] Among them, V1 and V2 are two time series, M 1x , M 2x are the modes of the x-th point of the time series V1 and V2, respectively, with a value range of {-3, -2, -1, 0, 1, 2, 3}, representing the six modes of {accelerated descent, horizontal descent, decelerated descent, unchanged, decelerated ascent, horizontal ascent, accelerated ascent}; A 1x , A 2x are the amplitude changes of the x-th point in the time series V1 and V2 (i.e. A x =v x+1- v x , );

[0016] From formula (1), we can see that the smaller the shape distance value, the greater the similarity between the two time series. Therefore, D(V i , V j ) is taken as the similarity of the subsequence, as shown in formula (2); in the case of inconsistent subsequence sizes, a rolling method can be used to calculate the similarity between the short sequence and each equal-length fragment in the long sequence, and the maximum similarity obtained is taken as the final similarity of the two subsequences;

[0017] sim(V i , V j )=1 / D(V i , V j ) (2).

[0018] In one embodiment, the method for repairing the outliers in step (4) is: according to the most similar subsequence V j The changing trend of the corresponding value in the i Repair, that is, v i =v i-1 +(v j -v j-1 ).

[0019] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention aims at the problem of repairing outliers in water environment monitoring data. First, a sliding window is used to perform short-term year-on-year comparison of water environment monitoring data to detect outliers. Then, a plurality of subsequences are obtained by dynamically segmenting the water environment monitoring data, and outliers are repaired based on the comparison of subsequence similarities. Experiments are carried out on water environment monitoring data of a water station. The experimental results show that the method of the present invention is superior to the currently commonly used prediction repair method and fitting repair method. The repaired data is smoother and the short-term trend is more obvious, which can effectively improve the data quality of the monitoring data. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 is the curve corresponding to the pH value data set;

[0021] Figure 2 is the curve corresponding to the dissolved oxygen data set;

[0022] Figure 3 is the execution result of the pH value abnormal value detection method;

[0023] Figure 4 is the execution result of the dissolved oxygen abnormal value detection method;

[0024] Figure 5 This is the repair result of outliers in the PH value dataset;

[0025] Figure 6 The repair results of outliers for dissolved oxygen dataset;

[0026] Figure 7 Comparison of the restoration results of various methods for the pH value dataset;

[0027] Figure 8 Comparison of the repair results of various methods for the dissolved oxygen dataset. DETAILED DESCRIPTION

[0028] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention, so the present invention is not limited by the specific embodiments disclosed below.

[0029] Since the monitoring indicators of water environment mainly include water temperature, pH value, dissolved oxygen, conductivity, turbidity, ammonia nitrogen, permanganate index, total phosphorus, total nitrogen, chlorophyll, blue-green algae, etc., the water environment is dynamically changing, and the monitoring values ​​of these indicators will also change with the development of time. During the online monitoring process, the sensor will return the monitoring value of the corresponding indicator at a fixed time interval, so the discrete time series data of each indicator will be obtained. According to the different monitored water environment indicators, the time series of each indicator can be obtained separately.

[0030] Definition 1 Water environment monitoring data is the time series of monitoring values ​​of a certain water environment indicator, denoted as V = (v1, v2, ..., v n ), where v i (1≤i≤n) represents t i The monitoring value corresponding to the moment.

[0031] The water environment is sensitive to external influences. Under normal circumstances, it is normal for the monitoring values ​​of various indicators to fluctuate. However, when the time interval is small, the adjacent monitoring values ​​should be close. Even if the water environment is affected by the outside world and the monitoring value at a certain moment rises or falls sharply relative to the previous value, the subsequent monitoring values ​​are also close. Therefore, the abnormal value cannot be determined by the amplitude of the rise or fall of the monitoring value. Anomalies are burrs. The characteristic of anomalies is that they deviate significantly from other adjacent monitoring values, that is, the anomaly is much larger (or smaller) than other adjacent values ​​within a certain time period. According to the above analysis, the anomaly in the water environment monitoring data is defined as: within the k-nearest neighbor time window of a certain monitoring value, if the difference between this value and other monitoring values ​​exceeds a certain threshold (or the difference is less than a negative threshold) The number exceeds a certain number, then the value is an abnormal value.

[0032] Definition 2: Outliers in water environment monitoring data Given water environment monitoring data V = (v1, v2, ..., v n ), where point v i (1≤i≤n) represents t i The monitoring value corresponding to the moment. Indicates point v i In the k-nearest neighbor window, if Existence or Then determine v i is an outlier, where ε is the difference threshold and τ is the quantity threshold.

[0033] In the above definition, k-nearest neighbors use a bidirectional time window, which can avoid misjudging the monitoring value when the water environment index is greatly affected by external factors as an abnormal value, because this monitoring value is far from the monitoring value of the predecessor time window, but is close to the monitoring value of the successor time window.i Whether it is an outlier, the setting of the nearest neighbor window size k, the difference threshold ε, and the quantity threshold τ is an important basis for judgment. Therefore, for different water environment monitoring indicators, different k, ε, and τ values ​​can be selected to meet the purpose of outlier detection of various water environment monitoring indicators.

[0034] The essence of outlier repair in water environment monitoring data is to use some method to find a value closest to the true value where the outlier is located, and use this value to replace the outlier in the original sequence, so as to obtain the repaired data sequence.

[0035] Definition 3 Repair sequence of water environment monitoring data Given water environment monitoring data V = (v1, v2, ..., v n ), where point v i (1≤i≤n) is t i The monitoring value corresponding to the moment. If v i is an abnormal value, according to a certain method i The repair value after repair is v i ′, then the sequence V=(v1,v2,…,v i ′,…,v n ) is the repair sequence of water environment monitoring data, where v i ′ should be as close to v as possible i The true value of .

[0036] According to the above idea of ​​solving the problem of repairing outliers in water environment monitoring data, the present invention provides a method for detecting and repairing outliers in water environment monitoring data, comprising the following steps:

[0037] (1) Use sliding windows to perform short-term comparisons on water environment monitoring data to detect outliers;

[0038] According to the definition of abnormal values ​​of water environment monitoring data given above, when the values ​​of k, ε, and τ are given, each monitoring value v on the time series V can be calculated by sliding the window. i , calculate the difference with the k-nearest neighbor window size one by one, and record the number of points countnum whose difference exceeds the threshold ε. When all comparisons are completed, you can check whether the countnum value is greater than τ to check v i Is it an outlier? If v i If it is an outlier, record its location.

[0039] (2) Dynamically segmenting the water environment monitoring data into subsequences;

[0040] According to the purpose of outlier repair, how to make the repaired value closer to the real value of the monitoring indicator at that time is a key issue. By observing the characteristics of water environment monitoring data, it is found that the data change curves of subsequences in different time periods have a high similarity. Therefore, if the subsequence with the greatest similarity to the subsequence where the outlier is located is found, the outlier can be repaired according to the change trend of the corresponding value in the most similar subsequence, so that the repaired value is as close to the real value as possible. Through the above analysis, repairing the outliers of water environment monitoring data requires the following three steps: first, divide the water environment monitoring data into various subsequences; then, for the subsequence where the outlier is located, calculate the similarity with other subsequences respectively and select the subsequence with the greatest similarity; finally, repair the outlier according to the change trend of the corresponding position data in the most similar subsequence.

[0041] In water environment monitoring data, data fragments with a shorter time range have obvious regularity, generally in an upward, downward or relatively stable state, but the size of these data fragments is not fixed. Therefore, when dividing the data sequence, a fixed-size division method cannot be used, but dynamic division is required based on the changing characteristics of the data. Dynamically divide the sequence, that is, consider that the maximum distance of the data segment is less than the threshold When the data is in a stable state, the data segments that continue to rise (fall) are not affected by the threshold Limit (maximum distance exceeds the threshold The dynamic partitioning method can not only reduce the number of subsequences, but also make the change trend of each subsequence more obvious.

[0042] In order to indicate the trend of the subsequence, a flag variable flag can be set. The flag value 1 represents that the subsequence is in an upward state, the value -1 represents that it is in a downward state, and the value 0 represents that it is in a stable state. i -v i-1 ) and the current flag value, we can know whether the trend of the data sequence has changed, combined with the maximum distance threshold Therefore, the steps of dynamic division of water environment monitoring data are as follows: first, assign an initial value to the flag according to the initial trend of the data sequence; then, for each monitoring data v i Do the following operations to calculate the difference value e from the previous data i =v i -v i-1 , and calculate the maximum distance of the subsequence so far, when the maximum distance does not exceed the threshold When e iIf the sign is opposite to the flag, the flag is set to 0. When the flag and e i The value of is used to judge the overall trend and change of the subsequence curve, thereby dividing and saving the subsequence, and finally performing initialization operations for dividing the next subsequence. In order to avoid the influence of outliers, outliers are ignored when dividing subsequences, so that outliers are included in a subsequence.

[0043] (3) For the subsequence where the outlier is located, calculate the similarity with other subsequences and select the subsequence with the greatest similarity;

[0044] Step (2) can divide the water environment monitoring data into multiple subsequence fragments. These divided subsequences can be compared for similarity, laying the foundation for repairing outliers. Since the similarity of subsequences is curve similarity, that is, the subsequences must not only be similar in shape (similar in change trend) but also have the shortest distance, the Euclidean distance cannot be simply used to measure the subsequence similarity. The Euclidean distance cannot distinguish the shape similarity and cannot reflect the similarity of the dynamic change amplitude of the trend. The present invention uses a shape distance algorithm to measure the subsequence similarity. The principle of the shape distance algorithm is to use the product of the pattern distance and the amplitude change distance of each point as the distance between the two subsequences. The shape distance calculation formula is shown in formula (1). Among them, V1, V2 are two time series, M 1x , M 2x are the modes of the x-th point of the time series V1 and V2, respectively, with a value range of {-3, -2, -1, 0, 1, 2, 3}, representing the six modes of {accelerated descent, horizontal descent, decelerated descent, unchanged, decelerated ascent, horizontal ascent, accelerated ascent}; A 1x , A 2x are the amplitude changes of the x-th point in the time series V1 and V2 (i.e. A x =v x+1- v x ,).

[0045]

[0046] From formula (1), we can see that the smaller the shape distance value, the greater the similarity between the two time series. Therefore, we take D(V i , V j ) is taken as the similarity of the subsequence, as shown in formula (2). For the case where the subsequence sizes are inconsistent, a rolling method can be used to calculate the similarity between the short sequence and each equal-length segment in the long sequence, and the maximum similarity obtained is taken as the final similarity of the two subsequences.

[0047] sim(V i , V j)=1 / D(V i , V j ) (2)

[0048] (4) Repairing the outliers according to the changing trend of the corresponding position data in the most similar subsequence.

[0049] The outlier repair of water environment monitoring data is performed based on the subsequence with the greatest similarity, so the outlier v i When repairing, you need to find v first i The subsequence V i Then, according to the subsequence similarity calculation method in step (3), the similarity with other subsequences is calculated respectively, and the subsequence V with the largest similarity is selected. j Since only subsequences with the same overall trend will have a high similarity, and the trend of the subsequences has been stored when the subsequences are divided in step (2), when calculating the similarity, only the trend of V i Subsequences with the same trend. Finally, according to subsequence V j The changing trend of the corresponding value in the i Repair, that is, v i =v i-1 +(v j -v j-1 ).

[0050] Example 1

[0051] In order to verify the effectiveness of the method for detecting and repairing outliers in water environment monitoring data proposed in the present invention, water environment monitoring data from a water station was selected for experiments, and the outlier repair results were analyzed and discussed.

[0052] 1. Data preparation

[0053] Two different water quality elements, pH value and dissolved oxygen (in mg / l), were selected for algorithm verification. The online monitoring data of the water station from 2018 to 2019 was used, with a data time interval of 1 day. Figure 1 , Figure 2 are the curves corresponding to the two sets of data. Figure 1 , Figure 2 It can be seen that the overall trend of the time series data set curves of pH value and dissolved oxygen is smooth, but there are also some obviously suspicious anomalies (missing values ​​and outliers, etc.). If these anomalies cannot be repaired in time, they will have a serious impact on the subsequent data analysis.

[0054] 2. Result evaluation

[0055] First, the outlier detection algorithm was evaluated for the two sets of data sets. Due to the different data characteristics of pH and dissolved oxygen, the nearest neighbor window size k, difference threshold ε, and quantity threshold τ set when executing the outlier detection algorithm were also different.

[0056] After multiple experiments and comparative analysis, the final k, ε, and τ values ​​of the outlier detection algorithm are set as follows: k = 3, ε = 0.5, τ = 4 in the pH data set, and k = 3, ε = 0.9, τ = 3 in the dissolved oxygen data set. Under the above parameter settings, 11 outliers were detected in the pH data set and 21 outliers were detected in the dissolved oxygen data set. This method did not have FP (False Positive, normal was mistakenly detected as abnormal) and FN (False Negative, abnormal was mistakenly detected as normal) data in the outlier detection process. Figure 3 , Figure 4 The execution results of the outlier detection algorithm are given. The data points represented by the dots are outliers. It can be seen from the figure that these points are obviously deviated from their neighboring nodes. The test results show that the outlier detection algorithm given by the present invention can successfully detect outliers that are obviously deviated from neighboring nodes (i.e., different from others) from the water environment monitoring data set, while retaining the data fluctuations caused by water environment changes to the greatest extent, which is convenient for later data analysis.

[0057] Then, the outlier repair algorithm is evaluated for the two data sets. In the subsequence division stage, the maximum distance threshold set for the PH value data set is Divided into 101 subsequences, the maximum distance threshold set for the dissolved oxygen dataset is It is divided into 104 subsequences, and the size of the subsequences is moderate, which shows that the given subsequence division method is effective. In the stage of repairing outliers by using subsequence similarity, the subsequence with the greatest similarity can be found in the subsequence where the outlier is located. The repair effect of the outlier is as follows: Figure 5 , Figure 6 As shown, from Figure 5 , Figure 6 It can be seen that the repaired curve becomes smoother, and there is no node that deviates significantly from the neighboring nodes, which indicates that the method of repairing data based on subsequence similarity is feasible, and the outlier repair method of the present invention has good effectiveness.

[0058] 3. Comparative experiment of outlier repair methods

[0059] In order to further verify the effectiveness of the outlier repair method in this paper, the method of the present invention is compared with the prediction-based and fitting-based outlier repair methods on the experimental data set. The repair results of the three methods are shown in Figure 2. Figure 7 , Figure 8 As shown. Figure 7 , Figure 8 It can be seen that: there is a certain deviation between the repaired data set obtained based on the prediction method and the original data set, especially the prediction result of the original missing value is far away from the original curve, indicating that the prediction method is significantly affected by the missing value; the repaired data obtained based on the fitting method has multiple protrusions relative to the original curve, the reason is that the fitting polynomial only reflects the long-term trend of the original data, and the specific fitting value is far from the original data; the repaired data set obtained by the method of the present invention overlaps with the original data set in most areas, the area where the outlier is located becomes smoother, and the short-term trend of the data is more obvious. Comparative experiments show that the outlier repair methods based on prediction and fitting are not applicable to water environment monitoring data. The repair method of the present invention can effectively improve the data quality of water environment monitoring data on the basis of retaining the original characteristics of water environment monitoring data.

[0060] 4. Conclusion

[0061] Aiming at the outliers existing in water environment monitoring data, the short-term month-on-month method is used to detect outliers, and the outliers are repaired according to the subsequence similarity. The experimental results show that the proposed outlier repair method is superior to the currently commonly used prediction repair method and fitting repair method.

[0062] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0063] The above-mentioned embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.

Claims

1. A method for detecting and repairing outliers in water environment monitoring data, characterized in that: The following steps are involved: (1) Use sliding windows to perform short-term comparisons on water environment monitoring data to detect outliers; (2) Dynamically segmenting the water environment monitoring data into subsequences; (3) For the subsequence where the outlier is located, calculate the similarity with other subsequences and select the subsequence with the greatest similarity; (4) repairing the outliers according to the change trend of the corresponding position data in the most similar subsequence; In step (2), the water environment monitoring data is dynamically divided into subsequences as follows: based on the maximum distance threshold To dynamically divide the sequence, first set a flag variable flag. The flag value 1 represents that the subsequence is in an ascending state, the value -1 represents that it is in a descending state, and the value 0 represents that it is in a stable state. The flag is assigned an initial value according to the initial trend of the data sequence. Then, for each monitoring data v i Do the following operations to calculate the difference value e from the previous data i =v i -v i-1 , and calculate the maximum distance of the subsequence so far, when the maximum distance does not exceed the threshold When e i If the sign is opposite to the flag, the flag is set to 0. When the flag and e i The value of determines the overall trend and change of the subsequence curve, thereby dividing and saving the subsequence, and finally performing initialization operations for dividing the next subsequence; The shape distance calculation formula for calculating the similarity with other subsequences in step (3) is shown in formula (1): Among them, V1 and V2 are two time series, M 1x , M 2x are the modes of the x-th point of the time series V1 and V2, respectively, with a value range of {-3, -2, -1, 0, 1, 2, 3}, representing the six modes of {accelerated descent, horizontal descent, decelerated descent, unchanged, decelerated ascent, horizontal ascent, accelerated ascent}; A 1x , A 2x are the amplitude changes of the x-th point in the time series V1 and V2, that is, A x =v x+1 -v x ; From formula (1), we can see that the smaller the shape distance value, the greater the similarity between the two time series. Therefore, D(V i ,V j ) is taken as the similarity of the subsequence, as shown in formula (2); in the case of inconsistent subsequence sizes, a rolling method can be used to calculate the similarity between the short sequence and each equal-length fragment in the long sequence, and the maximum similarity obtained is taken as the final similarity of the two subsequences; sim(V i ,V j )=1 / D(V i ,V j ) (2)。 2. The method for detecting and repairing outliers in water environment monitoring data according to claim 1, characterized in that: The method for detecting abnormal values ​​in step (1) is specifically as follows: for each monitoring value v on the time series V i , calculate the difference with the k-nearest neighbor window size one by one, and record the number of points countnum whose difference exceeds the threshold ε. After all comparisons are completed, check whether the countnum value is greater than τ to verify v i Is it an outlier? If v i If it is an abnormal value, its position is recorded; where V is the water environment monitoring data V = (v1, v2, ..., v n ), where point v i t i The monitoring value corresponding to the moment, 1≤i≤n, Indicates point v i The k-nearest neighbor window, if Existence or Then determine v i is an outlier, where ε is the difference threshold and τ is the quantity threshold.

3. The method for detecting and repairing outliers in water environment monitoring data according to claim 1, characterized in that: The method for repairing outliers in step (4) is as follows: j The changing trend of the corresponding value in the i Repair, that is, v i =v i-1 +(v j -v j-1 ).

Citation Information

Patent Citations

  • Watershed water quality monitoring abnormal value detection method based on spatial relationship

    CN110737874A

  • Real-time abnormal diagnosis and interpolation method for water regimen monitoring data

    WO2021197009A1